SPRUJD3A July 2025 – October 2025 F28E120SB , F28E120SC
FILE: mcpwm_ex1_basic_pwm.c
This example configures myMCPWM0 and myMCPWM1 as follows myMCPWM0 Time Base Configurations In Up Count Mode for 10KHz Frequency PWM 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 Output A2 : Set High on Counter matches CMPA, set low on Period match Output B2 : Set High on Counter matches CMPB, set low on Period match Output A3 : Set High on Counter matches CMPA, set low on CMPB match Output B3 : Set Low on Counter matches CMPA, set high on CMPB match Interrupt For Updating the CMPx Values runtime, Interrupt is configured in synchronous with the PWM Counter. ET1 is configured to fire at every 5 events of Counter = Period. ET1 is selected as source for the interrupt generation
myMCPWM1 Time Base Configurations In Up Down Count Mode for 10KHz Frequency PWM Action Qualifier is configurations Output A1 : Set High on Counter matches CMPA while counting up, Set low on CMPA match while Counting down Output B1 : Set High on Counter matches CMPB while counting up, Set low on CMPB match while Counting down Interrupt For Updating the CMPx Values runtime, Interrupt is configured in synchronous with the PWM Counter. ET1 is configured to fire at every 5 events of Counter = Period. ET1 is selected as source for the interrupt generation
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 J4 7 - GPIO12 - myMCPWM1 Output A1 Observe J2 19 - GPIO29 - myMCPWM1 Output B1