ePWM Submodules
654
SPRUH22I – April 2012 – Revised November 2019
Copyright © 2012–2019, Texas Instruments Incorporated
C28 Enhanced Pulse Width Modulator (ePWM) Module
7.2.3.1
Purpose of the Counter-Compare Submodule
The counter-compare submodule takes as input the time-base counter value. This value is continuously
compared to the counter-compare A (CMPA) counter-compare B (CMPB) counter-compare C (CMPC) and
counter-compare D (CMPD)registers. When the time-base counter is equal to one of the compare
registers, the counter-compare unit generates an appropriate event.
The counter-compare:
•
Generates events based on programmable time stamps using the CMPA, CMPB, CMPC and CMPD
registers
–
CTR = CMPA: Time-base counter equals counter-compare A register (TBCTR = CMPA).
–
CTR = CMPB: Time-base counter equals counter-compare B register (TBCTR = CMPB)
–
CTR = CMPC: Time-base counter equals counter-compare C register (TBCTR = CMPC).
–
CTR = CMPD: Time-base counter equals counter-compare D register (TBCTR = CMPD)
•
Controls the PWM duty cycle if the action-qualifier submodule is configured appropriately using
counter-compare A (CMPA) & counter-compare B (CMPB)
•
Shadows new compare values to prevent corruption or glitches during the active PWM cycle
7.2.3.2
Controlling and Monitoring the Counter-Compare Submodule
The counter-compare submodule operation is controlled and monitored by the registers shown in
:
(1)
This register is available only on ePWM modules with the high-resolution extension (HRPWM). On ePWM modules that do not
include the HRPWM this location is reserved. This register is described in the device-specific
High-Resolution Pulse Width
Modulator (HRPWM)
section of this manual. Refer to the device-specific data manual to determine which ePWM instances
include this feature.
Table 7-6. Counter-Compare Submodule Registers
Register Name
Address Offset
Shadowed
Description
CMPCTL
0x07
No
Counter-Compare Control Register
CMPCTL2
0x41
No
Counter Compare Control Register 2
CMPAHR
0x08
Yes
HRPWM Counter-Compare A Extension Register
(1)
CMPA
0x09
Yes
Counter-Compare A Register
CMPAHRM
0x2C
Writes
HRPWM Counter-Compare A Extension Mirror Register
(1)
CMPAM
0x2D
Writes
Counter-Compare A Mirror Register
CMPAHRM2
0x64
Yes
Counter Compare A High-Resolution Mirror 2 Register
(1)
CMPAM2
0x65
Yes
Counter Compare A Mirror 2 Register
(1)
CMPB
0x0A
Yes
Counter-Compare B Register
CMPBHR
0x4A
Yes
Compare B High-Resolution Register
CMPBHRM
0x66
Writes
Counter Compare B High-Resolution Mirror Register
(1)
CMPBM
0x67
Writes
Counter Compare B Mirror Register
CMPC
0x69
Yes
Counter Compare C Register
CMPD
0x6B
Yes
Counter Compare D Register