SPRUJD3A July 2025 – October 2025 F28E120SB , F28E120SC
FILE: mcpwm_ex2_synchronization.c
This example configures myMCPWM0 and myMCPWM1 as follows myMCPWM0 Time Base Configurations In Up Count Mode for 10KHz Frequency PWM or 15999 TBCLKs for TBCLK of 160MHz Enabled Sync in for the InputXbar 5, with phase shift load enabled Sync Out is configured for every Counter equals Period event Action Qualifier is configurations Output A1 : Set High on Counter matches zero, set low on CMPA match Output B1 : Set High on Counter matches zero, set low on CMPB match Interrupt For Updating the Phase Shift Values runtime, Interrupt is configured in synchronous with the PWM Counter. ET2 is configured to fire at every 5 events of Counter = Period. ET2 is selected as source for the interrupt generation
myMCPWM1 Time Base Configurations In Up Down Count Mode for 10KHz Frequency PWM or 8000 TBCLKs for TBCLK of 160MHz Enabled Sync in from myMCPWM0, with phase shift load enabled. Default Counter Mode after sync is set to counting up. But can be changed. Action Qualifier is configurations Output A1 : Set High on Counter matches zero, set low on CMPA match Output B1 : Set High on Counter matches zero, set low on CMPB match
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 7 - GPIO12 - myMCPWM1 Output A1 Observe J2 19 - GPIO29 - myMCPWM1 Output B1
Watch Variables