Abdullbasit
Newbie level 3
7 segment clock
Hi , i have make a digital clock by using avr microcontroller , but the idea is the same.
you need to be familiar with interrupts because it simplify software design and lessen the load to the cpu , you need 2 interrupts in your program:
1-timer 2 interrupt , TR2 should be overflow each 50 ms(50000 us if using 12 MHz crystal) ,thus ,in your isr you need to increment seconds each 20 overflows ( 20 * 50 = 1sec) , and if seconds reached 60 you should clear it and increment minutes and so on.
2- TR0 interrupt for refreshing the display
Hi , i have make a digital clock by using avr microcontroller , but the idea is the same.
you need to be familiar with interrupts because it simplify software design and lessen the load to the cpu , you need 2 interrupts in your program:
1-timer 2 interrupt , TR2 should be overflow each 50 ms(50000 us if using 12 MHz crystal) ,thus ,in your isr you need to increment seconds each 20 overflows ( 20 * 50 = 1sec) , and if seconds reached 60 you should clear it and increment minutes and so on.
2- TR0 interrupt for refreshing the display