No matter which method of work, when the TL's low 5-bit overflow, it will carry to th, and when all 13-bit counters overflow, it will overflow to the counter's tf0 carry. We will discuss the function of the gate position GATA. The GATA bit status determines whether the timer operation control depends on one condition of tr0 or the two conditions of tr0 and int0 pins. When GATA = 1, The int0 signal of the pin is invalid because the GATA signal is blocked and the door. In this case, if tr0 = 1, the analog switch is enabled to enable the counter to perform addition counting, that is, timing/counting. If tr0 is set to 0, the analog switch is disconnected and the count is stopped. The timer/count cannot work. When GATA = 0, the output end of the gate is determined by the status of the tr0 and int0 levels. If tr0 = 1, int0 = 1, and the output of the door is 1, the timer/Counter count is allowed, in this case, the operation control is jointly controlled by the tr0 and int0 conditions. The tr0 is to determine the operation control bit of the timer/counter, and is set by the software or the "0 ". As described above, tf0 indicates the overflow status of the timer/counter. When the overflow occurs, it is set by the hardware. When tf0 overflow is interrupted by the CPU, the hardware is "0" when the switch is interrupted ", tf0 can also be queried and cleared by the program ". In working mode, the counter's counter value range is: 1 To 8192 (213) The formula for calculating the scheduled time is as follows: (213-initial counting value) ╳ 12 Or (213-initial count value) Renew the machine cycle The time unit is the same as the crystal cycle or machine cycle. If the single-chip crystal oscillator is set to 6.000 MHz, the minimum timing time is: [213-(213-1)] Listen 1/6 then 10-6 then 12 = 2 then 10-6 (S) = 2 (US) (213-0) Then 1/6 then 10-6 then 12 = 16384 then 10-6 (S) = 16384 (us ). Work Mode 1 When M1, M0 = 01, the timer/Counter is in the working mode 1. At this time, the equivalent circuit 3 of the timer/and counter shows that the timer 0 is still used as an example, the timer 1 is exactly the same as the timer 1. |