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

Block diagram Block diagram (pins applicable for LaunchPad)

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

Output waveform

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

  • Connect: BoosterPack header J4 pin 31 (PA11) (MCPWM0_1A) to Scope/Logic analyzer

  • Connect: BoosterPack header J4 pin 32 (PA12) (MCPWM0_1B) to Scope/Logic analyzer

  • Connect: BoosterPack header J4 pin 40 (PB3) (MCPWM4_1A) to Scope/Logic analyzer

  • Connect: BoosterPack header J4 pin 39 (PA7) (MCPWM4_1B) to Scope/Logic analyzer

  • Connect: BoosterPack header J4 pin 38 (PB1) (MCPWM4_2A) to Scope/Logic analyzer

  • Connect: BoosterPack header J4 pin 37 (PA2) (MCPWM4_2B) to Scope/Logic analyzer

  • Connect: BoosterPack header J4 pin 36 (PB2) (MCPWM4_3A) to Scope/Logic analyzer

  • Connect: BoosterPack header J4 pin 35 (PA25) (MCPWM4_3B) to Scope/Logic analyzer