Quantcast
Channel: MEL PICBASIC Forum
Viewing all articles
Browse latest Browse all 4787

60Hz timebase clock

$
0
0
Hello all, I am in the planning stages for a simple clock that uses numitron tubes for the display. That part is pretty much worked out. I decided against using a realtime clock chip as they do need an initial date setting and battery backup. My idea is to base it from the 60Hz power. For isolation and protection against spikes I plan to drive the LED side of an optic isolator using a small step down transformer. That should give nice clean 60Hz pulses on the output side. So far so good.

Now for the timekeeping part. How about preloading an 8 bit counter with 195 so it will overflow on the 60th pulse? Then the interrupt goes to the timekeeping code where each overflow is counted as a second. The time between these periods should be plenty for the necessary math and writing to the display.

Any comments appreciated.


Adam

Viewing all articles
Browse latest Browse all 4787

Trending Articles