MOD = 0x0004
TOF bit
3
4
0
0
1
1
2
2
3
3
4
4
0
1
2
timer module counter
set TOF bit
period of timer module counter clock
period of counting = (MOD + 0x0001) x period of timer module counter clock
set TOF bit
set TOF bit
Figure 27-36. Example of TPM Up Counting
Note
• MOD = 0000 is a redundant condition. In this case, the
TPM counter is always equal to MOD and the TOF bit is
set in each rising edge of the TPM counter clock.
27.4.3.2 Up-Down Counting
Up-down counting is selected when (CPWMS = 1). When configured for up-down
counting, configuring MOD to less than 2 is not supported.
The value of zero is loaded into the TPM counter, and the counter increments until the
value of MOD is reached, at which point the counter is decremented until it returns to
zero and the up-down counting restarts.
The TPM period when using up-down counting is 2 × MOD × period of the TPM counter
clock.
The TOF bit is set when the TPM counter changes from MOD to (MOD – 1).
Functional Description
KL02 Sub-Family Reference Manual, Rev. 2.1, July 2013
424
Freescale Semiconductor, Inc.