DS80C320-ECD DALLAS [Dallas Semiconductor], DS80C320-ECD Datasheet - Page 129

no-image

DS80C320-ECD

Manufacturer Part Number
DS80C320-ECD
Description
High-Speed Microcontroller User Guide
Manufacturer
DALLAS [Dallas Semiconductor]
Datasheet
TIMER/COUNTER 2 WITH OPTIONAL CAPTURE Figure 11-4
16-bit Auto-reload Timer/Counter
This mode is illustrated in Figure 11-5a. When Timer 2 reaches an overflow state, i.e., rolls over from
FFFFh to 0000, it will set the TF2 Flag. This flag can generate an interrupt if enabled. In addition, the
timer will restore its starting value and begin timing (or counting) again. The starting value is preloaded
by software into the capture registers RCAP2L and RCAP2H. These registers cannot be used for capture
functions while also performing auto-reload, so these modes are mutually exclusive. Auto-reload is
invoked by the CP/
CP/
(C/
as determined by T2M (CKCON.5). Otherwise, pulses on pin T2 (P1.0) are counted when C/
in other modes, Counting or timing is enabled or disabled with TR2 (T2CON.2).
When in auto-reload mode, Timer 2 can also be forced to reload with the T2EX (P1.1) pin. A 1 to 0
transition will force a reload if enabled by the EXEN2 (T2CON.3) bit. If EXEN2 is set to a logic 1, then
a 1 to 0 transition on T2EX will cause a reload. Otherwise, the T2EX pin will be ignored.
CLK MODE
DIVIDE BY 4 OSC/1
PMM1
PMM2
T2
OSC INPUT TO TIMER
RL2
TR2 = T2CON.2
EXEN2 = T2CON.3
= T2CON.1 = 0), the timer’s input may be selected to be oscillator cycles divided by either 12 or 4
T2EX = P1.1
is set to a logic 1, the timer is in capture mode described above. If the oscillator timebase is used
T2 = P1.0
TIMER INPUT
OSC/16
OSC/256
RL2
(T2CON.0) bit. When set to a logic 0, the timer is in auto-reload mode. When
DIVIDE
DIVIDE
BY 12
BY 4
T2M = CKCON.5
0
1
129 of 175
C/
CAPTURE
T2
0
1
= T2CON.1
CLK
0
0
RCAP2L
TL2
High-Speed Microcontroller User’s Guide
T2CON.6
EXF2 =
7
7
8
8
RCAP2H
TH2
15
15
INTERRUPT
T2
T2CON.7
TIMER 2
TF2 =
= 1. As

Related parts for DS80C320-ECD