Download C868 8 - SELF8051
Transcript
C868 On-Chip Peripheral Components fSYS ÷ 12 C/T2 = 0 T2L/H C/T2 = 1 TR2 Overflow Pin T2 OR RC2L/H TF2 Timer 2 OR Interrupt EXF2 EXEN2 Pin T2EX Figure 4-6 4.6.5.2 Auto-Reload Mode (DCEN = 0) Up/Down Count Enabled If DCEN=1, the up-down count selection is enabled. The direction of count is determined by the level at input pin T2EX. The operational block diagram is shown in Figure 4-7. A logic 1 at pin T2EX sets the timer/counter 2 to up counting mode. The timer/counter, therefore, counts up to a maximum of FFFFH. Upon overflow, bit TF2 is set and the timer/ counter registers are reloaded with a 16-bit reload of the RC2L/H registers. A fresh count sequence is started and the timer counts up from this reload value as in the previous count sequence. This reload value is chosen by software, prior to the occurrence of an overflow condition. A logic 0 at pin T2EX sets the timer/counter 2 to down counting mode. The timer/counter counts down and underflows when the T2L/H value reaches the value stored at registers User’s Manual 4-26 V 1.0, 2003-01