On-Chip Peripheral Components
C513AO
User’s Manual
6-28
05.99
Figure 6-17
Timer 2 Auto-Reload Mode (DCEN = 1)
A logic “1” at T2EX makes Timer 2 count up. The timer will overflow at FFFFH and set the TF2 bit.
This overflow also causes the 16-bit value in RC2H and RC2L to be reloaded into the timer
registers, TH2 and TL2, respectively.
A logic “0” at T2EX makes Timer 2 count down. Now the timer underflows when TH2 and TL2 equal
the values stored in RC2H and RC2L. The underflow sets the TF2 bit and causes FFFFH to be
reloaded into the timer registers. The EXF2 bit toggles whenever Timer 2 overflows or underflows.
This bit can be used as a 17th bit of resolution if desired. In this operating mode, EXF2 does not
flag an interrupt.
Note: P1.1/T2EX is sampled during S5P2 of every machine cycle. The next increment/decrement
of Timer 2 will be done during S3P1 in the next cycle.
MCS02585
EXF2
TF2
RC2L
RC2H
TL2
TH2
Timer 2
Interrupt
Control
C/T2 = 0
OSC
TR2
Toggle
C/T2 = 1
FF
FF
Overflow
(down counting reload value)
(up counting reload value)
P1.0/T2
P1.1/T2EX
(1 = UP, 0 = DOWN)
÷ 12
H
H