![NXP Semiconductors MKL27Z128VFM4 Reference Manual Download Page 475](http://html1.mh-extra.com/html/nxp-semiconductors/mkl27z128vfm4/mkl27z128vfm4_reference-manual_1721847475.webp)
The external clock input passes through a synchronizer clocked by the TPM counter
clock to assure that counter transitions are properly aligned to counter clock transitions.
Therefore, to meet Nyquist criteria considering also jitter, the frequency of the external
clock source must be less than half of the counter clock frequency.
29.5.2 Prescaler
The selected counter clock source passes through a prescaler that is a 7-bit counter.
The value of the prescaler is selected by the PS[2:0] bits. The following figure shows an
example of the prescaler counter and TPM counter.
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
2
2
3
3
1
1
1
1
1
1
1
1
1
selected input clock
prescaler counter
timer module counting is up.
PS[2:0] = 001
CNTIN = 0x0000
timer module counter
Figure 29-2. Example of the Prescaler Counter
29.5.3 Counter
The TPM has a 16-bit counter that is used by the channels either for input or output
modes.
The counter updates from the selected clock divided by the prescaler.
The TPM counter has these modes of operation:
)
• up-down counting (see
29.5.3.1 Up counting
Up counting is selected when SC[CPWMS] = 0.
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.
Chapter 29 Timer/PWM Module (TPM)
KL27 Sub-Family Reference Manual , Rev. 5, 01/2016
Freescale Semiconductor, Inc.
475