SPRUJD3A July 2025 – October 2025 F28E120SB , F28E120SC
FILE: mcpwm_ex6_global_load_use_case.c
This example configures myMCPWM0 and myMCPWM1 with global load feature for synchronized parameter updates across multiple PWM channels as follows: myMCPWM0 (Primary Module) Time Base Configurations: - Up Count Mode - Period = 3999 (40 kHz @ TBCLK of 160MHz) - Free Run emulation mode Initial Compare Values: - PWM1A/B : 1800 (45% duty cycle) - PWM2A/B : 3133 (78% duty cycle) - PWM3A/B : 467 (12% duty cycle) Action Qualifier Configurations: All pairs (A/B outputs): - Set HIGH on Counter matches CMPA/CMPB counting up - Set LOW on Counter Period Deadband Configurations: - Initial: 32 counts (200ns @ 160MHz) - Both Rising and Falling edge delay enabled myMCPWM1 (Secondary Module) Time Base Configurations: - Up Count Mode synchronized to myMCPWM0 - Period = 3999 (40 kHz) Initial Compare Values: - PWM1A/B : 1000 (25% duty cycle) Action Qualifier Configurations: PWM1A/B outputs: - Set HIGH on Counter matches CMPA/CMPB counting up - Set LOW on Counter Period Global Load Feature Implementation: When perform_one_shot_load flag is set: 1. Compare Value Updates: myMCPWM0: - PWM1A: 2000 (50% duty) - PWM2A: 3333 (83% duty) - PWM3A: 667 (17% duty) myMCPWM1: - PWM1A: 2000 (50% duty) 2. Deadband Updates (both modules): - 48 counts (300ns @ 160MHz) - Applied to both rising and falling edges 3. Update Mechanism: - All changes written to shadow registers - Global load trigger synchronizes all updates - Changes take effect simultaneously
External Connections
Monitor the MCPWM pins for the waveforms: Observe J4 40 - GPIO0 - myMCPWM0 Output A1 Observe J4 39 - GPIO1 - myMCPWM0 Output B1 Observe J4 38 - GPIO2 - myMCPWM0 Output A2 Observe J4 37 - GPIO3 - myMCPWM0 Output B2 Observe J4 36 - GPIO4 - myMCPWM0 Output A3 Observe J4 35 - GPIO5 - myMCPWM0 Output B3 Observe J1 7 - GPIO12 - myMCPWM1 Output A1 Observe J2 19 - GPIO29 - myMCPWM1 Output B1