ePWM Submodules
694
SPRUHE8E – October 2012 – Revised November 2019
Copyright © 2012–2019, Texas Instruments Incorporated
C28 Enhanced Pulse Width Modulator (ePWM) Module
The counter-compare registers CMPC and CMPD each have an associated shadow register. By default
this register is shadowed. The memory address of the active register and the shadow register is
identical.The value in the active CMPC & CMPD register is compared to the time-base counter (TBCTR).
When the values are equal, the counter compare module generates a “time-base counter equal to counter
compare C or counter compare D ” event respectively. Shadowing of this register is enabled and disabled
by the CMPCTL2[SHDWCMODE] and CMPCTL2[SHDWDMODE] bit. These bits enable and disable the
CMPA shadow register and CMPB shadow register respectively. The behavior of the two load modes is
described below:
Shadow Mode:
The shadow mode for the CMPC is enabled by clearing the CMPCTL2[SHDWCMODE] bit and the
shadow register for CMPD is enabled by clearing the CMPCTL2[SHDWDMODE] bit. Shadow mode is
enabled by default for both CMPC and CMPD.
If the shadow register is enabled then the content of the shadow register is transferred to the active
register on one of the following events as specified by the CMPCTL2[LOADCMODE]
CMPCTL2[LOADDMODE] CMPCTL2[LOADCSYNC] & CMPCTL2[LOADDSYNC] register bits:
•
CTR = PRD: Time-base counter equal to the period (TBCTR = TBPRD).
•
CTR = Zero: Time-base counter equal to zero (TBCTR = 0x00)
•
Both CTR = PRD and CTR = Zero
•
SYNC event caused by DCAEVT1 or DCBEVT1 or EPWMxSYNCI or TBCTL[SWFSYNC]
•
Both SYNC event or a selection made by LOADCMODE/LOADDMODE
Only the active register contents are used by the counter-compare submodule to generate events to be
sent to the action-qualifier.
Immediate Load Mode:
If immediate load mode is selected (i.e., CMPCTL2[SHDWCMODE] = 1 or CMPCTL2[SHDWDMODE] =
1), then a read from or a write to the register will go directly to the active register.
7.2.3.4
Count Mode Timing Waveforms
The counter-compare module can generate compare events in all three count modes:
•
Up-count mode: used to generate an asymmetrical PWM waveform.
•
Down-count mode: used to generate an asymmetrical PWM waveform.
•
Up-down-count mode: used to generate a symmetrical PWM waveform.
To best illustrate the operation of the first three modes, the timing diagrams in
through
show when events are generated and how the EPWMxSYNCI signal interacts.