Prescaler; Counter - NXP Semiconductors MKL27Z128VFM4 Reference Manual

Table of Contents

Advertisement

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.
timer module counting is up.
PS[2:0] = 001
CNTIN = 0x0000
selected input clock
prescaler counter
timer module 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 counting (see
• 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.
Freescale Semiconductor, Inc.
1
0
1
0
1
0
2
1
Figure 29-2. Example of the Prescaler Counter
Up
counting)
Up-down
counting)
KL27 Sub-Family Reference Manual , Rev. 5, 01/2016
Chapter 29 Timer/PWM Module (TPM)
0
1
0
1
0
1
0
1
3
2
0
1
0
1
0
1
0
3
0
1
475

Advertisement

Table of Contents
loading

Table of Contents