Center-Aligned Pwm (Cpwm) Mode - NXP Semiconductors MKL27Z128VFM4 Reference Manual

Table of Contents

Advertisement

Functional description
MOD = 0x0008
CnV = 0x0005
channel (n) output
Figure 29-11. EPWM signal with ELSnB:ELSnA = X:1
If (CnV = 0x0000), then the channel (n) output is a 0% duty cycle EPWM signal. If (CnV
> MOD), then the channel (n) output is a 100% duty cycle EPWM signal and CHnF bit is
not set since there is never a channel (n) match. Therefore, MOD must be less than
0xFFFF in order to get a 100% duty cycle EPWM signal.

29.5.7 Center-Aligned PWM (CPWM) Mode

The center-aligned mode is selected when (CPWMS = 1) and (MSnB:MSnA = 1:0).
The CPWM pulse width (duty cycle) is determined by 2 × CnV and the period is
determined by 2 × MOD (see the following figure). MOD must be kept in the range of
0x0001 to 0x7FFF because values outside this range can produce ambiguous results.
In the CPWM mode, the TPM counter counts up until it reaches MOD and then counts
down until it reaches zero.
The CHnF bit is set and channel (n) interrupt is generated (if CHnIE = 1) at the channel
(n) match (TPM counter = CnV) when the TPM counting is down (at the begin of the
pulse width) and when the TPM counting is up (at the end of the pulse width).
This type of PWM signal is called center-aligned because the pulse width centers for all
channels are when the TPM counter is zero.
The other channel modes are not designed to be used with the up-down counter (CPWMS
= 1). Therefore, all TPM channels should be used in CPWM mode when (CPWMS = 1).
482
counter
overflow
CNT
0
1
2
...
previous value
CHnF bit
TOF bit
KL27 Sub-Family Reference Manual , Rev. 5, 01/2016
channel (n)
counter
match
overflow
3
4
5
6
7
8
0
1
2
...
Freescale Semiconductor, Inc.

Advertisement

Table of Contents
loading

Table of Contents