Page 1 of 1

How do I make a AM , PM clock

Posted: Thu Aug 10, 2006 9:02 pm
by VirusAlert
any ideas?

Posted: Fri Aug 11, 2006 11:59 am
by Steve
Use the TIMER0 interrupt with a suitable crystal clock frequency and prescaler. Update the timer info in the TIMER0 macro, and repeatedly display the time within your main routine.

Posted: Wed Aug 23, 2006 11:51 pm
by rrwoods1978
Can we get that in English please? If we don't even know how to make a clock, then I am thinking we are pretty new to this.

I need to make a standard 12 hour clock with am & pm functions and alam. Also need a way to set the time and alarm using the switch board.

Posted: Thu Aug 24, 2006 9:35 am
by Ian
The Timer macro is called at so many times a second e.g 75 times a second or 75Hz.
The prescaler and crystal clock frequency allow you to set the refresh rate to a useable time period such as 75hz that you use.

Count to 75 in the timer interrupt macro and a second has passed.
Update the seconds minutes hours etc. .

The main program can display the time and check for inputs.

12 or 24 hour clock is simply a way to display the 24 hours.