English
Language : 

W78ERD2_07 Datasheet, PDF (36/76 Pages) Winbond – 8-BIT MICROCONTROLLER
W78ERD2/W78ERD2A
osc
T2 = P1.0
TR2 = T2CON.2
T2EX = P1.1
EXEN2 = T2CON.3
RCLK+TCLK=0, CP/RL2 =T2CON.0=1
T2M = CKCON.5
1/6
1
C/T2 = T2CON.1
1/12
0
0
1
TL2 TH2
T2CON.7
TF2
RCAP2L RCAP2H
EXF2
T2CON.6
Timer 2
Interrupt
Figure 9-4 16-Bit Capture Mode
Auto-reload Mode, Counting up
This mode is enabled by clearing the CP/RL2 bit in T2CON and the DCEN bit in T2MOD. In this
mode, Timer 2 is a 16-bit up-counter. When the counter rolls over from FFFFh to 0000h, the contents
of RCAP2L and RCAP2H are automatically reloaded into TL2 and TH2, and the timer overflow bit TF2
is set. If the EXEN2 bit is set, then a negative transition of T2EX pin also causes a reload, which also
sets the EXF2 bit in T2CON.
osc
T2 = P1.0
TR2 = T2CON.2
T2EX = P1.1
EXEN2 = T2CON.3
RCLK+TCLK=0, CP/RL2 =T2CON.0=0, DCEN=0
T2M = CKCON.5
1/6
1 C/T2 = T2CON.1
1/12
0
0
1
TL2 TH2
T2CON.7
TF2
RCAP2L RCAP2
H
EXF2
T2CON.6
Timer 2
Interrupt
Figure 9-5 16-Bit Auto-reload Mode, Counting Up
Auto-reload Mode, Counting Up/Down
This mode is enabled when the CP/RL2 bit in T2CON is clear and the DCEN bit in T2MOD is set. In
this mode, Timer 2 is an up/down-counter whose direction is controlled by the T2EX pin (1 = up, 0 =
down). When Timer 2 overflows while counting up, the counter is reloaded by RCAP2L and RCAP2H.
When Timer 2 is counting down, the counter is reloaded with FFFFh when Timer 2 is equal to
RCAP2L and RCAP2H. In either case, the timer overflow bit TF2 is set, and the EXF2 bit is toggled,
though EXF2 can not generate an interrupt in this mode.
- 36 -