PDA

View Full Version : 24 hr timer



actionplus
- 18th May 2006, 19:00
it is pretty simple task.

All it needs to do is when I plug in power, a countdown of a certain time, say 12hr or 24hr should start. And when it reaches the time, a LED should light up for 1 minute then starts the countdown again. A never ending loop until I pull out the power.

any ideas how I should start.
I want to use a 12F??? pic with a 32khz xtal.
PicBasic Pro.

Travin77
- 18th May 2006, 20:41
there is a timer example on this site (look in the code examples). It uses tmr0 and interupts with a 4 mhz crystal if I am not mistaken. Then, just put an "if" statement for the hour and minute var when they reach a given multiple of 12 then make a port go high which connects to an led.

paul borgmeier
- 18th May 2006, 21:05
In the Code Example Section of this forum, look for

Easy and Accurate Clocks without RTC IC

The second attached program in this post does almost exactly what you want. Only simple changes are needed to make it match your goals.

Good Luck,


Paul Borgmeier
Salt Lake City, Utah
USA