User Manual
481
Rev. 1.1
2019-03-18
TLE984xQX
Microcontroller with LIN and Power Switches for Automotive Applications
General Purpose Timer Units (GPT12)
16.4.6
GPT2 Clock Signal Control
All actions within the timer block GPT2 are triggered by transitions of its basic clock. This basic clock is derived
from the module clock
f
GPT
by a basic block prescaler, controlled by bitfield BPS2 in register T6CON (see
). The count clock can be generated in two different ways:
•
Internal count clock
, derived from GPT2’s basic clock via a programmable prescaler, is used for (gated)
Timer Mode.
•
External count clock
, derived from the timer’s input pin(s), is used for Counter Mode.
For both ways, the basic clock determines the maximum count frequency and the timer’s resolution:
Note:
When initializing the GPT2 block, and the block prescaler BPS2 in T6CON needs to be set to a value
different from its reset value (00
B
), it must be initialized first before any mode involving external
trigger signals is configured. These modes include counter, capture, and reload mode. Otherwise,
unintended count/capture/reload events may occur.
In this case (e.g. when changing BPS2 during operation of the GPT2 block), disable related interrupts
before modification of BPS2, and afterwards clear the corresponding service request flags and re-
initialize those registers (T5, T6, CAPREL) that might be affected by a count/capture/reload event.
Internal Count Clock Generation
In Timer Mode and Gated Timer Mode, the count clock for each GPT2 timer is derived from the GPT2 basic
clock by a programmable prescaler, controlled by bitfield TxI in the respective timer’s control register TxCON.
The count frequency
f
Tx
for a timer Tx and its resolution
r
Tx
are scaled linearly with lower clock frequencies, as
can be seen from the following formula:
(16.2)
The effective count frequency depends on the common module clock prescaler factor F(BPS2) as well as on
the individual input prescaler factor 2
<TxI>
.
summarizes the resulting overall divider factors for a
GPT2 timer that result from these cascaded prescalers.
lists GPT2 timer’s parameters (such as count frequency, resolution, and period) resulting from the
selected overall prescaler factor and the module clock
f
GPT
. Note that some numbers may be rounded.
Table 256 Basic Clock Selection for Block GPT2
Block Prescaler
1)
1) Please note the non-linear encoding of bitfield BPS2.
BPS2 = 01
B
BPS2 = 00
B
2)
2) Default after reset.
BPS2 = 11
B
BPS2 = 10
B
Prescaling Factor for
GPT2: F(BPS2)
F(BPS2)
= 2
F(BPS2)
= 4
F(BPS2)
= 8
F(BPS2)
= 16
Maximum External
Count Frequency
f
GPT
/4
f
GPT
/8
f
GPT
/16
f
GPT
/32
Input Signal Stable
Time
2 ×
t
GPT
4 ×
t
GPT
8 ×
t
GPT
16 ×
t
GPT
f
Tx
=
f
GPT
F BPS2
(
)
•
<Txl>
2
r
Tx
[
μ
s]
=
f
GPT
[MHz]
F BPS2
(
)
•
<Txl>
2