how to write for 5 minutes counter or delay using timer0

Status
Not open for further replies.

teknyc78

New Member
using pic18f452, please help, anyone have a sample code for minutes delay using timer0 or whatever....timer.
 
teknyc78 said:
using pic18f452, please help, anyone have a sample code for minutes delay using timer0 or whatever....timer.

If you're wanting just a simple 5 minute delay, it's easier to use a simple delay loop - and the PICList has a generator that will produce 16F type code for any delay you want. I'm not sure if you have to make any changes for the 18F series or not?.

If for some reason you want to use a timer?, timer2 is usually a better bet than timer0 (at least on the 16F series, again I can't comment on the 18F).

But regardless of which you might use, you can't get anywhere near 5 minutes from the timer alone. It's usual to use the timer to generate regular interrupts (every 1mS or 10mS perhaps?), then the interrupt routine keeps a count of the number of interrupts that have occurred.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…