W77C32F-40 Nuvoton Technology Corporation of America, W77C32F-40 Datasheet - Page 55

no-image

W77C32F-40

Manufacturer Part Number
W77C32F-40
Description
Manufacturer
Nuvoton Technology Corporation of America
Datasheet

Specifications of W77C32F-40

Lead Free Status / Rohs Status
Supplier Unconfirmed
13.2 Timer/Counter 2
Timer/Counter 2 is a 16 bit up/down counter which is configured by the T2MOD register and controlled
by the T2CON register. Timer/Counter 2 is equipped with a capture/reload capability. As with the
Timer 0 and Timer 1 counters, there exists considerable flexibility in selecting and controlling the
clock, and in defining the operating mode. The clock source for Timer/Counter 2 may be selected for
either the external T2 pin (C/ T2 = 1) or the crystal oscillator, which is divided by 12 or 4 (C/ T2 = 0).
The clock is then enabled when TR2 is a 1, and disabled when TR2 is a 0.
13.2.1 Capture Mode
The capture mode is enabled by setting the CP/ RL2 bit in the T2CON register to a 1. In the capture
mode, Timer/Counter 2 serves as a 16 bit up counter. When the counter rolls over from FFFFh to
0000h, the TF2 bit is set, which will generate an interrupt request. If the EXEN2 bit is set, then a
negative transition of T2EX pin will cause the value in the TL2 and TH2 register to be captured by the
RCAP2L and RCAP2H registers. This action also causes the EXF2 bit in T2CON to be set, which will
also generate an interrupt. Setting the T2CR bit (T2MOD.3), the W77C32 allows hardware to reset
timer 2 automatically after the value of TL2 and TH2 have been captured.
13.2.2 Auto-reload Mode, Counting Up
The auto-reload mode as an up counter is enabled by clearing the CP/ RL2 bit in the T2CON register
and clearing the DCEN bit in T2MOD register. In this mode, Timer/Counter 2 is a 16 bit up counter.
When the counter rolls over from FFFFh, a reload is generated that causes the contents of the
RCAP2L and RCAP2H registers to be reloaded into the TL2 and TH2 registers. The reload action also
sets the TF2 bit. If the EXEN2 bit is set, then a negative transition of T2EX pin will also cause a
reload. This action also sets the EXF2 bit in T2CON.
div. by 4
div. by 64
div. by 1024 osc/256
Mode
EXEN2 = T2CON.3
Clock Source
TR2 = T2CON.2
T2EX = P1.1
T2 = P1.0
osc/1
osc/16
input
1/12
1/4
T2M = CKCON.5
1
0
C/T2 = T2CON.1
Figure 14. 16-Bit Capture Mode
0
1
- 55 -
RCAP2L
TL2
Publication Release Date: December 20, 2005
L
RCAP2H
TH2
H
H
W77C32/W77C032
T2CON.6
T2CON.7
EXF2
TF2
Revision A5
Interrupt
Timer 2

Related parts for W77C32F-40