If you are running from AC, You can get good accuracy by timing the 50 or 60Hz from the power transformer. If the AC goes away, you can turn on your
timer interrupt.
Just like the little alarm clocks with battery backup.
If you are running from AC, You can get good accuracy by timing the 50 or 60Hz from the power transformer. If the AC goes away, you can turn on your
timer interrupt.
Just like the little alarm clocks with battery backup.
Charles Linquist
The comment about using the AC line frequency is pretty sharp - The Hammond Clock company used to sell AC powered clocks with synchronous motors, and they would make gifts of these clocks to operators of the power utilities. The power plant operators would then have an incentive to regulate the AC line frequency.
I think in your case, you should look into a real-time clock IC. There are many of these to choose from, and you can interface to them using a variety of techniques. As has been stated in this thread, trying to use the counter in a PIC to keep accurate time in the long term is a waste of, um, time.
Darrel Taylor's
A better Search tool for the Forum
http://www.picbasic.co.uk/forum/showthread.php?t=4751
Finds:
Paul Borgmeier's
Easy and Accurate Clocks without RTC IC
http://www.picbasic.co.uk/forum/showthread.php?t=2129
Ohm it's not just a good idea... it's the LAW !
Bookmarks