English
Language : 

IS80LV52 Datasheet, PDF (17/48 Pages) Integrated Silicon Solution, Inc – CMOS SINGLE CHIP LOW VOLTAGE 8-BIT MICROCONTROLLER
IS80LV52
IS80LV32
ISSI ®
Timer 2
Timer 2 is a 16-bit Timer/Counter present only in the
IS80LV52/32. This is a powerful addition to the other two
just discussed. Five extra special function registers are
added to accommodate Timer 2 which are: the timer
registers, TL2 and TH2, the timer control register, T2CON,
and the capture registers, RCAP2L and RCAP2H. Like
Timers 0 and 1, it can operate either as a timer or as an
event counter, depending on the value of bit C/T2 in the
Special Function Register T2CON. Timer 2 has three
operating modes: capture, auto-reload, and baud rate
generator, which are selected by RCLK, TCLK, CP/RL2
and TR2.
In the Capture Mode, the EXEN2 bit in T2CON selects two
options. If EXEN2 = 0, then Timer 2 is a 16-bit timer or
counter whose overflow sets bit TF2, the Timer 2 overflow
bit, which can be used to generate an interrupt. If EXEN2
= 1, then Timer 2 performs the same way, but a 1-to-0
transition at external input T2EX also causes the current
value in the Timer 2 registers, TL2 and TH2, to be
captured into the RCAP2L and RCAP2H registers,
respectively. In addition, the transition at T2EX sets the
EXF2 bit in T2CON, and EXF2, like TF2, can generate an
interrupt.
The Capture Mode is illustrated in Figure 12.
In the auto-reload mode, the EXEN2 bit in T2CON also
selects two options. If EXEN2 = 0, then when Timer 2 rolls
over it sets TF2 and also reloads the Timer 2 registers with
the 16-bit value in the RCAP2L and RCAP2H registers,
which are preset by software. If EXEN2 = 1, then Timer 2
performs the same way, but a 1-to-0 transition at external
input T2EX also triggers the 16-bit reload and sets EXF2.
The auto-reload mode is illustrated in Figure 13.
The baud rate generator mode is selected by RCLK = 1
and/or TCLK = 1. This mode is described in conjunction
with the serial port (Figure 14).
OSC
DIVIDE 12
C/T2 = 0
T2 PIN
C/T2 = 1
TRANSITION
DETECTOR
TL2
(8 BITS)
CONTROL
TR2
CAPTURE
TH2
(8 BITS)
RCAP2L RCAP2H
T2EX PIN
CONTROL
EXEN2
TF2
EXF2
Figure 12. Timer 2 In Capture Mode
TIMER 2
INTERRUPT
Integrated Silicon Solution, Inc. — 1-800-379-4774
17
ADVANCE INFORMATION MC019-0A
10/01/98