EasyManua.ls Logo

NXP Semiconductors KL25 Series - Freescale Semiconductor, Inc

NXP Semiconductors KL25 Series
807 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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 reloaded with zero.
The TPM period when using up counting is (MOD + 0x0001) × period of the TPM
counter clock.
The TOF bit is set when the TPM counter changes from MOD to zero.
MOD = 0x0004
TOF bit
3
4
0
0
1 12
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 31-79. 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.
31.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).
Chapter 31 Timer/PWM Module (TPM)
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Freescale Semiconductor, Inc. 563

Table of Contents

Related product manuals