![NXP Semiconductors MKL27Z128VFM4 Reference Manual Download Page 483](http://html1.mh-extra.com/html/nxp-semiconductors/mkl27z128vfm4/mkl27z128vfm4_reference-manual_1721847483.webp)
pulse width
counter overflow
timer module counter =
MOD
period
(2 x CnV)
(2 x MOD)
timer module counter = 0
channel (n) match
(timer module counting
is down)
channel (n) match
(timer module counting
is up)
counter overflow
timer module counter =
MOD
channel (n) output
Figure 29-12. CPWM period and pulse width with ELSnB:ELSnA = 1:0
If (ELSnB:ELSnA = 0:0) when the TPM counter reaches the value in the CnV register,
the CHnF bit is set and the channel (n) interrupt is generated (if CHnIE = 1), however the
channel (n) output is not controlled by TPM.
If (ELSnB:ELSnA = 1:0), then the channel (n) output is forced high at the channel (n)
match (TPM counter = CnV) when counting down, and it is forced low at the channel (n)
match when counting up (see the following figure).
TOF bit
...
7
8
8
7
7
7
6
6
6
5
5
5
4
4
3
3
2
2
1
0
1
...
previous value
CNT
channel (n) output
counter
overflow
channel (n) match in
down counting
channel (n) match in
up counting
channel (n) match in
down counting
counter
overflow
CHnF bit
MOD = 0x0008
CnV = 0x0005
Figure 29-13. CPWM signal with ELSnB:ELSnA = 1:0
If (ELSnB:ELSnA = X:1), then the channel (n) output is forced low at the channel (n)
match (TPM counter = CnV) when counting down, and it is forced high at the channel (n)
match when counting up (see the following figure).
TOF bit
...
7
8
8
7
7
7
6
6
6
5
5
5
4
4
3
3
2
2
1
0
1
...
previous value
CNT
channel (n) output
counter
overflow
channel (n) match in
down counting
channel (n) match in
up counting
channel (n) match in
down counting
counter
overflow
CHnF bit
MOD = 0x0008
CnV = 0x0005
Figure 29-14. CPWM signal with ELSnB:ELSnA = X:1
Chapter 29 Timer/PWM Module (TPM)
KL27 Sub-Family Reference Manual , Rev. 5, 01/2016
Freescale Semiconductor, Inc.
483