VRS51C1000
If EXEN2=1, Timer 2 still performs the above
operation, however, additionally, a 1 to 0 transition at
the external T2EX input will also trigger an anticipated
reload of Timer 2 with the value stored in RCAP2L,
RCAP2H and set EXF2.
Timer 2 Capture Mode
In Capture Mode, the EXEN2 bit of the T2CON register
controls whether an external transition on the T2EX pin
will trigger capture of the timer value.
FIGURE 14: TIMER 2 IN AUTO-RELOAD MODE
When EXEN2 = 0, Timer 2 acts as a 16-bit timer or
counter, which, upon overflowing, will set the TF2 bit
(Timer 2 overflow bit). This overflow can be used to
generate an interrupt.
FOSC
÷12
0
1
TIMER
TL2
TH2
0
0
7
7
0
0
7
7
C/T2
COUNTER
T2 pin
FIGURE 13: TIMER 2 IN CAPTURE MODE
RCAP2L
RCAP2H
TR2
TF2
T2EX pin
EXF2
FOSC
÷12
EXEN2
0
1
TIMER
TL2
TH2
0
0
7
7
0
0
7
7
C/T2
Timer 2
Interrupt
COUNTER
T2 pin
RCAP2L
RCAP2H
TR2
TF2
T2EX pin
EXF2
EXEN2
Timer 2
Interrupt
When EXEN2 = 1, the above still applies, however, in
addition, it is possible to allow a 1 to 0 transition at the
T2EX input to cause the current value stored in the
Timer 2 registers (TL2 and TH2) to be captured into
the RCAP2L and RCAP2H registers. Furthermore, the
transition at T2EX causes bit EXF2 in T2CON to be
set, and EXF2, like TF2, can generate an interrupt.
Note that both EXF2 and TF2 share the same interrupt
vector.
Timer 2 Auto-Reload Mode
In this mode, there are also two options controlled by
the EXEN2 bit in the T2CON register.
If EXEN2 = 0, when Timer 2 rolls over, it not only sets
TF2, but also causes the Timer 2 registers to be
reloaded with the 16-bit value in the RCAP2L and
RCAP2H registers previously initialised. In this mode,
Timer 2 can be used as a baud rate generator source
for the serial port.
______________________________________________________________________________________________
www.ramtron.com page 20 of 48