English
Language : 

W79E217A Datasheet, PDF (97/207 Pages) Winbond – 8-bit Microcontroller
Preliminary W79E217A Data Sheet
12.2.1 Capture Mode
Capture mode is enabled by setting CP/RL2 in T2CON to 1. In capture mode, Timer/Counter 2 is a
16-bit up-counter. When the counter rolls over from FFFFh to 0000h, the timer overflow flag TF2 is
set, and an interrupt is generated, if enabled.
If the EXEN2 bit is set, a negative transition on the T2EX pin captures the current value of TL2 and
TH2 in the RCAP2L and RCAP2H registers. It also sets the EXF2 bit in T2CON, which generates an
interrupt if enabled. In addition, if the T2CR bit in T2MOD is set, the W79E217 resets Timer 2
automatically after each capture. This is illustrated below.
(RCLK,TCLK, CP/RL2 )= (0,0,1)
Figure 12-4: Timer2 16-Bit Capture Mode
12.2.2 Auto-reload Mode, Counting up
This mode is enabled by clearing CP/RL2 in T2CON register and DCEN in T2MOD. In this mode,
Timer/Counter 2 is a 16-bit up-counter. When the counter rolls over from FFFFh to 0000h, the timer
overflow flag TF2 is set, and TL2 and TH2 capture the contents of RCAP2L and RCAP2H,
respectively. Alternatively, if EXEN2 is set, a negative transition on the T2EX pin causes a reload,
which also sets the EXF2 bit in T2CON.
- 97 -
Publication Release Date: December 14, 2007
Revision A3.0