MCPWM GLOBAL LOAD USE CASE
Brief
Demonstrate the global load features usage for applications which has EPWMs with runtime updates to their CMP/TBPRD/Action Qualifier/ DeadBand Registers etc, that affect the EPWM Outputs. Care needs to be taken while updating these registers so that there wouldn’t be any incorrect/unexpected/corrupted waveforms while these updates happen. To tackle with such issues, the EPWMs have been equipped with a Global Load feature.
Details
The example configures MCPWM_0 and MCPWM_1 with global load feature for synchronized parameter updates across multiple PWM channels as follows:
MCPWM_0 : Global Load is configured
MCPWM_1 : Global Load is configured
Validation:
Add perform_one_shot_load flag in watch variable and set it to update compare value and deadband on the next global load event
Use an oscilloscope to observe synchronized updates
Watch deadband transitions on complementary pairs
Peripherals used
MCPWM
2 instances to show global load feature.Primary MCPWM_0 Config:
TBCLK : 250MHz
MODE : UpCount
PRD : 8000 cycles
FREQUENCY : 31.25KHz
SyncIn Source : MCPWM_1
Emulation : Free Run emulation mode
CMPA/B on 1A/B : 4000 (50% duty cycle)
Actions on 1A : High on Counter matches CMPA. Low on Period hit
Actions on 1B : High on Counter matches CMPB. Low on Period hit
Primary MCPWM_1 Config:
TBCLK : 250MHz
MODE : UpCount
PRD : 8000 cycles
FREQUENCY : 31.25KHz
CMPA/B on 1A/B : 7200 (10% duty cycle)
CMPA/B on 2A/B : 6400 (20% duty cycle)
CMPA/B on 3A/B : 6000 (25% duty cycle)
Actions on 1/2/3A : High on Counter matches CMPA. Low on Period hit
Actions on 1/2/3B : High on Counter matches CMPB. Low on Period hit
Deadband : Deadband Active High
RED : 40 (160ns)
FED : 40 (160ns)
After Global Load Feature Implementation:
MCPWM_0 Config Updates:
CMPA on 1A : 6000 (25% duty cycle)
Actions on 1A : High on Counter matches Period. Low on CMPA hit
Deadband : Deadband Active High
RED : 60 (240ns)
FED : 60 (240ns)
MCPWM_1 Config Updates:
CMPA on 1A : 1000 (12% duty cycle)
CMPA on 2A : 2000 (25% duty cycle)
CMPA on 3A : 4000 (50% duty cycle)
Actions on 1/2/3A : High on Counter matches Period. Low on CMPA hit
Deadband : Deadband Active High
RED : 60 (240ns)
FED : 60 (240ns)
External connections
Probe the following pins on boosterpack,
Connect: BoosterPack header J1 pin 6 (MCPWM_0_1A) to Scope/Logic analyzer
Connect: BoosterPack header J2 pin 19 (MCPWM_0_1B) to Scope/Logic analyzer
Connect: BoosterPack header J4 pin 40 (MCPWM_1_1A) to Scope/Logic analyzer
Connect: BoosterPack header J4 pin 39 (MCPWM_1_1B) to Scope/Logic analyzer
Connect: BoosterPack header J4 pin 38 (MCPWM_1_2A) to Scope/Logic analyzer
Connect: BoosterPack header J4 pin 37 (MCPWM_1_2B) to Scope/Logic analyzer
Connect: BoosterPack header J4 pin 36 (MCPWM_1_3A) to Scope/Logic analyzer
Connect: BoosterPack header J4 pin 35 (MCPWM_1_3B) to Scope/Logic analyzer