(8) Timer counter
1. Interrupt enable register IE
2. Interrupt priority register IP
3. Interrupt control special register TCON
4. Working mode register TMOD
5. The principle of timer counter
Working method 0
From the above analysis, it can be seen that it takes 500 pulses to generate a periodic signal of t=2ms, and the initial value of 2^13-500 is given to count the pulses to reach 500 when the counter overflows, automatically interrupts, and outputs the waveform
Working method 2
6.100ms timing
The query method needs to determine whether TF1 is 1, and if it is 1, an overflow has occurred and the count is full. The
interrupt method does not need to determine TF1
7. 1s timing
8. Analysis of the initial value of the timer counter
9. Timing 400us
10. Duty cycle 70
11. 60s countdown