Searching \ for 'Need help with a 30 min. timer.' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/timers.htm?key=time
Search entire site for: 'Need help with a 30 min. timer.'.

Truncated match.
PICList Thread
'Need help with a 30 min. timer.'
1998\03\30@141055 by Steven Kosmerchock

flavicon
face
Hello everybody,
I'm new to the world of PIC's.I was wondering if anybody have any suggestions to
help me out. Here's my problem: I need a timer that once activated will run 30
minutes, after the 30 minutes is up a relay will be triggered. Any code,
schematics, or advice would be greatly appreciated. I have the ability to use
and program these PIC's: 12C509, 12C672, 16F84, 16C63, 14000. Any and all
comments welcomed. Thanks in advance!!!!!!!!!!!!!!!!!!!!!!!!!!!

                       Steven Kosmerchock

EMAIL:  spam_OUTsteve.kosmerchockTakeThisOuTspamCELWAVE.com

1998\03\31@000758 by Mike Keitz

picon face
On Mon, 30 Mar 1998 11:45:43 -0800 Steven Kosmerchock
<.....Steve.KosmerchockKILLspamspam@spam@CELWAVE.COM> writes:
> Hello everybody,
>I'm new to the world of PIC's.I was wondering if anybody have any
>suggestions to
> help me out. Here's my problem: I need a timer that once activated
>will run 30
> minutes, after the 30 minutes is up a relay will be triggered. Any
>code,
> schematics, or advice would be greatly appreciated. I have the
>ability to use
> and program these PIC's: 12C509, 12C672, 16F84, 16C63, 14000.

Since the project only has one output and maybe one input, an 8-pin PIC
will be plenty.  The 12C509 will do.  If the time can doesn't have to be
*exactly* 30 minutes, the 12C509's internal RC oscillator can be used.
The maximum error inherent with it is about +- 5%, or +- 1.5 minutes over
30 minutes.  If precise timing is needed, use an external crystal.  Since
high MIPS is actually a disadvantage in this application, use a 32.768
KHz crystal.  Among the inexpensive standard crystals, they are more
precise for better timekeeping.  The PIC will also use very little supply
current at this slow speed.  The only reason not to use a 32 KHz crystal
is if the power to the PIC will be cut off and the time has to start as
soon as it is turned back on.  These crystals can take a second or so to
start running.

The relay will likely need a transistor to drive it.  A FET such as a
2N7000 can be connected directly to the PIC output with no resistor.

As for the software, use a simple delay loop that increments or
decrements RAM registers until the desired amount of time (number of
instruction cycles) has elapsed.  30 minutes is 14,745,600 PIC
instruction cycles at 32.768 KHz.  So about 3 bytes (24 bits) of counters
would be needed.


_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

1998\03\31@052911 by alex_holden

picon face
Steven Kosmerchock wrote:
>
Ever heard of a 555? ;)

>  Hello everybody,
> I'm new to the world of PIC's.I was wondering if anybody have any suggestions
to
>  help me out. Here's my problem: I need a timer that once activated will run
30
>  minutes, after the 30 minutes is up a relay will be triggered. Any code,
>  schematics, or advice would be greatly appreciated. I have the ability to use
>  and program these PIC's: 12C509, 12C672, 16F84, 16C63, 14000. Any and all
>  comments welcomed. Thanks in advance!!!!!!!!!!!!!!!!!!!!!!!!!!!

--
------------------- Linux- the choice of a GNU generation.
--------------------
: Alex Holden- Caver, Programmer, Land Rover nut, and Radio amateur (M1
CJD). :
-------------- www.geocities.com/CapeCanaveral/Lab/1532/
---------------

1998\03\31@121956 by Michael Hagberg

flavicon
face
ok, here is my 2" worth.

use a 12C508, it's cheaper than a 555 and all the caps and resisters that go
with it.

now for accuracy. with one resister to an ac power line, or the secondary of
the transformer you have a very stable 60 Hz time base, just count 60 cycles
/ second * 60 seconds / minute * 30 minutes = 108000 cycles. or make the
program easy and use registers for cycles, seconds and minutes.

this is a great first project to learn the pic assembly.

michael

p.s. when you are testing the project, you might want to try setting the
timer to 2 minutes. it will cut down on the debug time.

{Original Message removed}

1998\03\31@130640 by alex_holden
picon face
Michael Hagberg wrote:
>
> ok, here is my 2" worth.
>
> use a 12C508, it's cheaper than a 555 and all the caps and resisters that go
> with it.

Really? I never thought of it like that. I would tend not to consider
the cost of cheap commonly used items such as resistors, 555s, BC547s,
ZTX300s, 1N4148s and suchlike, but think of a microcontroller as being
an 'expensive' item. I'll have to remember in future not to rule out a
PIC as 'overkill' without comparing the actual costs involved.

> now for accuracy. with one resister to an ac power line, or the secondary of
> the transformer you have a very stable 60 Hz time base, just count 60 cycles
> / second * 60 seconds / minute * 30 minutes = 108000 cycles. or make the
> program easy and use registers for cycles, seconds and minutes.

Again, I don't think I would have even considered hooking the thing up
to the mains for timing purposes. How accurate is the mains supply
anyway? If the frequency tolerances are anything like the voltage
tolerances, I can't see it being really any more accurate than a 12C508s
internal oscillator (I'm in the UK, BTW).

> this is a great first project to learn the pic assembly.
>
> michael
>
> p.s. when you are testing the project, you might want to try setting the
> timer to 2 minutes. it will cut down on the debug time.

> {Original Message removed}

1998\03\31@183907 by William Chops Westfield

face picon face
   > use a 12C508, it's cheaper than a 555 and all the caps
   > and resisters that go with it.

   Really? I never thought of it like that.

Well, no, not really.  In unit quantitites a 555 is about $0.50, resistors
(2 required) are about $0.02, and caps are maybe $0.10, for a total cost of
less than $1.  While a 12c508 might be less than $1 in quantity, it's more
than that if you only buy one, and you probably should still have at least
a bypass cap.

However, when you start talking about a 555 connected to a divider chip,
and count in circuit complexity and PC board space and such, I think the
12c508 starts to pull ahead pretty quickly.  A lot of the "neat things"
people have done with 12c508s are replacements for 555-like timers - see
microchip's web page...

BillW

1998\03\31@200918 by Reginald Neale

flavicon
face
>    > use a 12C508, it's cheaper than a 555 and all the caps
>    > and resisters that go with it.
>
>    Really? I never thought of it like that.
>
>Well, no, not really.  In unit quantitites a 555 is about $0.50, resistors
>(2 required) are about $0.02, and caps are maybe $0.10, for a total cost of
>less than $1.  While a 12c508 might be less than $1 in quantity, it's more
>than that if you only buy one, and you probably should still have at least
>a bypass cap.
>
>However, when you start talking about a 555 connected to a divider chip,
>and count in circuit complexity and PC board space and such, I think the
>12c508 starts to pull ahead pretty quickly.  A lot of the "neat things"
>people have done with 12c508s are replacements for 555-like timers - see
>microchip's web page...
>
>BillW

It's one thing if you're building it for yourself, and quite another if you
have to manufacture thousands or millions. In a real-world design, we
figure it costs us somewhere between 10 cents and 25 cents just to handle a
part, i.e., buy it,  stock it, track it, insert it in the board etc. So if
you're manufacturing a product, it doesn't take many parts to exceed the
real cost of a controller, even if the parts were FREE.

That's what makes PICs so powerful.

Reg Neale


'Need help with a 30 min. timer.'
1998\04\01@113053 by Martin R. Green
flavicon
face
On Tue, 31 Mar 1998 19:04:18 -0800, Alex Holden
<alex_holdenspamKILLspamgeocities.com> wrote:

>Again, I don't think I would have even considered hooking the thing up
>to the mains for timing purposes. How accurate is the mains supply
>anyway? If the frequency tolerances are anything like the voltage
>tolerances, I can't see it being really any more accurate than a 12C508s
>internal oscillator (I'm in the UK, BTW).

I don't know for sure about the UK, but here in N.A. all generating
stations connected to the power grid synchronize the AC frequency with
a single very accurate timebase.  Periodically they check for
deviation from the nominal frequency, and intruduce a correction to
bring the phase back in synch with the master reference.  I'm not a
power engineer, but I believe this is to simplify combining the output
>from all the feeder generators into the main power grid.

So for at least as long as I have known about the technique of
deriving an accurate timebase from the mains frequency (since the
early 70's) the answer to your question is, and was - in the short
term (seconds to hours?) the mains frequency is not particularly
accurate, in the long term (days to years) it is VERY accurate - much
more so than even a good crystal oscillator.

CIAO - Martin.

Martin R. Green
.....mrgreenKILLspamspam.....NOSPAMbigfoot.com

To reply, remove the NOSPAM from the return address
Stamp out SPAM everywhere!!!

1998\04\01@140646 by Hardy e/ou Rafael Pinto

flavicon
face
   The AC power line MUST be synchronized between 59.95 and 60.05 Hz for
stability issues. If you don't do such a thing, the "sum" of the sinusoids
will add a modulating component bigger than 1Hz and this will be VERY
perceptible by our systems (Microwaves, TVs, etc...). Anyway, if this
modulated component, known as Voltage Swing, grows bigger than 1%, one power
generator will start influencing the other and the result is a BIG explosion
of both! This because this "slower" or "faster" component will create Torque
against the torque of the turbine... The axis of this generator will break
with the effort. To compensate, all generators nowadays have servo control
systems on the turbine slots to make them run correctly for the 60Hz
generation.



   Rafael Pinto


{Original Message removed}

1998\04\02@010034 by Nigel Goodwin

flavicon
picon face
In message <EraseME3521AEB2.B48spam_OUTspamTakeThisOuTgeocities.com>, Alex Holden
<alex_holdenspamspam_OUTGEOCITIES.COM> writes
>Again, I don't think I would have even considered hooking the thing up
>to the mains for timing purposes. How accurate is the mains supply
>anyway? If the frequency tolerances are anything like the voltage
>tolerances, I can't see it being really any more accurate than a 12C508s
>internal oscillator (I'm in the UK, BTW).

The long term accuracy of the UK mains supply is very high, ideal for
use with clocks and timers. Hence the use of the mains supply to feed
the clock/timer on old VCR's - far more accurate than a crystal. For
some reason they seem to have changed to crystal control in VCR's these
days, so they tend to need adjusting periodically.

Years ago the story was that the mains frequency was corrected at
midnight every day, they had two clocks in the power station, one fed
from the generated power, the other from the Rugby standards
tranmissions. If they didn't match at midnight the mains frequency was
changed until they did!
--

Nigel.

       /--------------------------------------------------------------\
       | Nigel Goodwin   | Internet : @spam@nigelgKILLspamspamlpilsley.demon.co.uk     |
       | Lower Pilsley   | Web Page : http://www.lpilsley.demon.co.uk |
       | Chesterfield    |                                            |
       | England         |                                            |
       \--------------------------------------------------------------/

1998\04\02@032105 by wwl

picon face
>
>So for at least as long as I have known about the technique of
>deriving an accurate timebase from the mains frequency (since the
>early 70's) the answer to your question is, and was - in the short
>term (seconds to hours?) the mains frequency is not particularly
>accurate, in the long term (days to years) it is VERY accurate - much
>more so than even a good crystal oscillator.
>
Except for those pesky transients & other glitches that can be counted
by mistake - some sort of software PLL or gating system (e.g. ignore
anything for 19ms after a detected cycle for 50Hz) would be needed for
best accuracy, although a simple RC filter & schmitt inout helps a
lot.
    ____                                                           ____
  _/ L_/  Mike Harrison / White Wing Logic / KILLspamwwlKILLspamspamnetcomuk.co.uk  _/ L_/
_/ W_/  Hardware & Software design / PCB Design / Consultancy  _/ W_/
/_W_/  Industrial / Computer Peripherals / Hazardous Area      /_W_/

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...