User Manual
498
Rev. 1.1
2019-03-18
TLE984xQX
Microcontroller with LIN and Power Switches for Automotive Applications
Timer2 and Timer21
17.3.1.1 Up/Down Count Disabled
If DCEN = 0, the up-down count selection is disabled. The timer, therefore, functions as a pure up
counter/timer only. The operational block diagram is shown in
In this mode, if EXEN2 = 0, the timer starts to count up to a maximum of FFFF
H
, once TR2 is set. Upon overflow,
bit TF2 is set and the timer register is reloaded with the 16-bit reload value of the RC2 register. This reload
value is chosen by software, prior to the occurrence of an overflow condition. A fresh count sequence is started
and the timer counts up from this reload value as in the previous count sequence.
If EXEN2 = 1, the timer counts up to a maximum of FFFF
H
once TR2 is set. A 16-bit reload of the timer registers
from register RC2 is triggered either by an overflow condition or by a negative/positive edge (chosen by
T2MOD.EDGESEL) at input pin T2EX. If an overflow caused the reload, the overflow flag TF2 is set. If a
negative/positive transition at pin T2EX caused the reload, bit EXF2 is set. In either case, an interrupt is
generated to the core and the timer proceeds to its next count sequence. The EXF2 flag, similar to the TF2,
must be cleared by software.
If bit T2RHEN is set, Timer 2 is started by first falling edge/rising edge at pin T2EX, which is defined by bit
T2REGS. If bit EXEN2 is set, bit EXF2 is also set at the same point when Timer2 is started with the same falling
edge/rising edge at pin T2EX, which is defined by bit EDGESEL. The reload will happen with the following
negative/positive transitions at pin T2EX, which is defined by bit EDGESEL.
Note:
In counter mode, if the reload via T2EX and the count clock T2 are detected simultaneously, the
reload takes precedence over the count. The counter increments its value with the following T2
count clock.
Figure 115 Auto-Reload Mode (DCEN = 0)
TF2
EXF2
THL2
RC2
OR
OR
EXEN2
Overflow
Timer 2
Interrupt
T2EX
TR2
f
sys
PRE
N
T2PRE
/12
0
1
T2
C/T2=0
C/T2=1