Abdullbasit
Newbie level 3
- Joined
- Jul 5, 2009
- Messages
- 4
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,293
- Location
- iraq
- Activity points
- 1,310
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