Enhanced PWM (ePWM) Module
It is possible to set the compare value greater than the period. In this case the action will take place as
shown in
.
Table 15-20. Behavior if CMPA/CMPB is Greater than the Period
Counter Mode
Compare on Up-Count Event CAU/CBU
Compare on Down-Count Event CAU/CBU
Up-Count Mode
If CMPA/CMPB
≤
TBPRD period, then the event
Never occurs.
occurs on a compare match (TBCNT = CMPA or
CMPB).
If CMPA/CMPB > TBPRD, then the event will not
occur.
Down-Count Mode
Never occurs.
If CMPA/CMPB < TBPRD, the event will occur on a
compare match (TBCNT = CMPA or CMPB).
If CMPA/CMPB
≥
TBPRD, the event will occur on a
period match (TBCNT = TBPRD).
Up-Down-Count
If CMPA/CMPB < TBPRD and the counter is
If CMPA/CMPB < TBPRD and the counter is
Mode
incrementing, the event occurs on a compare match
decrementing, the event occurs on a compare match
(TBCNT = CMPA or CMPB).
(TBCNT = CMPA or CMPB).
If CMPA/CMPB is
≥
TBPRD, the event will occur on a If CMPA/CMPB
≥
TBPRD, the event occurs on a
period match (TBCNT = TBPRD).
period match (TBCNT = TBPRD).
15.2.2.5.4 Waveforms for Common Configurations
NOTE:
The waveforms in this chapter show the ePWMs behavior for a static compare register
value. In a running system, the active compare registers (CMPA and CMPB) are typically
updated from their respective shadow registers once every period. The user specifies when
the update will take place; either when the time-base counter reaches zero or when the time-
base counter reaches period. There are some cases when the action based on the new
value can be delayed by one period or the action based on the old value can take effect for
an extra period. Some PWM configurations avoid this situation. These include, but are not
limited to, the following:
Use up-down-count mode to generate a symmetric PWM:
•
If you load CMPA/CMPB on zero, then use CMPA/CMPB values greater than or equal to
1.
•
If you load CMPA/CMPB on period, then use CMPA/CMPB values less than or equal to
TBPRD - 1.
This means there will always be a pulse of at least one TBCLK cycle in a PWM
period which, when very short, tend to be ignored by the system.
Use up-down-count mode to generate an asymmetric PWM:
•
To achieve 50%-0% asymmetric PWM use the following configuration: Load
CMPA/CMPB on period and use the period action to clear the PWM and a compare-up
action to set the PWM. Modulate the compare value from 0 to TBPRD to achieve 50%-
0% PWM duty.
When using up-count mode to generate an asymmetric PWM:
•
To achieve 0-100% asymmetric PWM use the following configuration: Load CMPA/CMPB
on TBPRD. Use the Zero action to set the PWM and a compare-up action to clear the
PWM. Modulate the compare value from 0 to TBPRD+1 to achieve 0-100% PWM duty.
1520
Pulse-Width Modulation Subsystem (PWMSS)
SPRUH73H – October 2011 – Revised April 2013
Copyright © 2011–2013, Texas Instruments Incorporated