3.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) and counter-compare B (CMPB) 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 and CMPB 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)
• Controls the PWM duty cycle if the action-qualifier submodule is configured appropriately
• Shadows new compare values to prevent corruption or glitches during the active PWM cycle
3.2.3.2 Controlling and Monitoring the Counter-Compare Submodule
The counter-compare submodule operation is controlled and monitored by the registers shown in
Table 3-5. Counter-Compare Submodule Registers
Register
Address
Offset
Shadowed
Description
Bit Description
CMPCTL
0x0007
No
Counter-Compare Control Register.
CMPAHR
0x0008
Yes
HRPWM Counter-Compare A Extension Register
CMPA
0x0009
Yes
Counter-Compare A Register
CMPB
0x000A
Yes
Counter-Compare B Register
CMPAHRM
0x002C
Writes
HRPWM counter-compare A Extension Mirror Register
CMPAM
0x002D
Writes
Counter-compare A mirror Register
(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 also described in
. Refer to your device-specific data sheet to
determine which ePWM instances include this feature.
The key signals associated with the counter-compare submodule are described in
Table 3-6. Counter-Compare Submodule Key Signals
Signal
Description of Event
Registers Compared
CTR = CMPA
Time-base counter equal to the active counter-compare A value
TBCTR = CMPA
CTR = CMPB
Time-base counter equal to the active counter-compare B value
TBCTR = CMPB
CTR = PRD
Time-base counter equal to the active period.
Used to load active counter-compare A and B registers from the shadow register
TBCTR = TBPRD
CTR = ZERO
Time-base counter equal to zero.
Used to load active counter-compare A and B registers from the shadow register
TBCTR = 0x0000
Enhanced Pulse Width Modulator (ePWM) Module
SPRUH18I – JANUARY 2011 – REVISED JUNE 2022
TMS320x2806x Microcontrollers
261
Copyright © 2022 Texas Instruments Incorporated
Содержание TMS320 2806 Series
Страница 2: ......