
Chapter 14. Timers/Counters and Serial Interface Page 14-5
14.2.2.3 Mode 2, 8-Bit Counter with Auto-Reload — Timer 0 and Timer 1
In mode 2, the timer is configured as an 8-bit counter, with automatic reload of the start value on
overflow. TL0 (or TL1) is the counter, and TH0 (or TH1) stores the reload value.
As illustrated in Figure 14-2, mode 2 counter control is the same as for mode 0 and mode 1. When
TL0/1 increments from 0xFF, the value stored in TH0/1 is reloaded into TL0/1.
Table 14-3. TCON Register — SRF 0x88
Bit Function
TCON.7 TF1 - Timer 1 overflow flag. Set to 1 when the Timer 1 count overflows; automatically
cleared when the FX2 vectors to the interrupt service routine.
TCON.6 TR1 - Timer 1 run control. 1 = Enable counting on Timer 1.
TCON.5 TF0 - Timer 0 overflow flag. Set to 1 when the Timer 0 count overflows; automatically
cleared when the FX2 vectors to the interrupt service routine.
TCON.4 TR0 - Timer 0 run control. 1 = Enable counting on Timer 0.
TCON.3 IE1 - Interrupt 1 edge detect. If external interrupt 1 is configured to be edge-sensitive
(IT1 = 1), IE1 is set when a negative edge is detected on the INT1
pin and is automat-
ically cleared when the FX2 vectors to the corresponding interrupt service routine. In
this case, IE1 can also be cleared by software. If external interrupt 1 is configured to
be level-sensitive (IT1 = 0), IE1 is set when the INT1
pin is 0 and automatically
cleared when the INT1
pin is 1. In level-sensitive mode, software cannot write to IE1.
TCON.2 IT1 - Interrupt 1 type select. INT1
is detected on falling edge when IT1 = 1; INT1 is
detected as a low level when IT1 = 0.
TCON.1 IE0 - Interrupt 0 edge detect. If external interrupt 0 is configured to be edge-sensitive
(IT0 = 1), IE0 is set when a negative edge is detected on the INT0
pin and is automat-
ically cleared when the FX2 vectors to the corresponding interrupt service routine. In
this case, IE0 can also be cleared by software. If external interrupt 0 is configured to
be level-sensitive (IT0 = 0), IE0 is set when the INT0
pin is 0 and automatically
cleared when the INT0
pin is 1. In level-sensitive mode, software cannot write to IE0.
TCON.0 IT0 - Interrupt 0 type select. INT0 is detected on falling edge when IT0 = 1; INT0 is
detected as a low level when IT0 = 0.
Comentários a estes Manuais