Introduction
This example configures ePWM0, ePWM1 and ePWM2 (ePWM2, ePWM3 and ePWM4 in case of AM261x-LP) to produce an waveform with independent modulation on ePWMxA and ePWMxB. The TB counter is in up-down count mode for this example.
The compare values CMPA and CMPB are modified within the ePWM's ISR.
ISR Configuration
- INTXbar0, INTXbar1 and INTXbar2 are set for EPWM0INT, EPWM1INT and EPWM2INT (EPWM2INT, EPWM3INT and EPWM4INT in case of AM261x-LP)
- App_epwmIntrISR_x service this interrupts
- Updates the CMPA and CMPB compare values at every 10'th interrupt as follows:
- If CMPA/B is increasing, check if it reached max value. If not, increase CMPA/B else, change direction and decrease CMPA/B
- If CMPA/B is decreasing, check if it reached min value. If not, decrease CMPA/B else, change direction and increase CMPA/B
EPWM Asymetric Waveform with Independent Modulation using UP-DOWN-Count mode
External Connections
- EPWM0_A and EPWM0_B pin can be connected to an oscilloscope to view the waveform.
- EPWM1_A and EPWM1_B pin can be connected to an oscilloscope to view the waveform.
- EPWM2_A and EPWM2_B pin can be connected to an oscilloscope to view the waveform.
AM263X-CC or AM263PX-CC or AM261X-SOM
When using AM263x-CC, AM263Px-CC or AM261x-SOM with TMDSHSECDOCK (HSEC180 controlCARD Baseboard Docking Station)
- Capture waveform on HSEC Pin 49 for epwm0_A
- Capture waveform on HSEC Pin 51 for epwm0_B
- Capture waveform on HSEC Pin 53 for epwm1_A
- Capture waveform on HSEC Pin 55 for epwm1_B
- Capture waveform on HSEC Pin 50 for epwm2_A
- Capture waveform on HSEC Pin 52 for epwm2_B
AM263X-LP or AM263PX-LP
- Capture waveform on boosterpack header J6/J8 Pin 11 for epwm0_A
- Capture waveform on boosterpack header J6/J8 Pin 59 for epwm0_B
- Capture waveform on boosterpack header J2/J4 Pin 37 for epwm1_A
- Capture waveform on boosterpack header J2/J4 Pin 38 for epwm1_B
- Capture waveform on boosterpack header J2/J4 Pin 39 for epwm2_A
- Capture waveform on boosterpack header J2/J4 Pin 40 for epwm2_B
AM261X-LP
- Capture waveform on boosterpack header J2/J4 Pin 40 for epwm2_A
- Capture waveform on boosterpack header J2/J4 Pin 39 for epwm2_B
- Capture waveform on boosterpack header J2/J4 Pin 38 for epwm3_A
- Capture waveform on boosterpack header J2/J4 Pin 37 for epwm3_B
- Capture waveform on boosterpack header J2/J4 Pin 36 for epwm4_A
- Capture waveform on boosterpack header J2/J4 Pin 35 for epwm4_B
Supported Combinations
| Parameter | Value |
| CPU + OS | r5fss0-0 nortos |
| Toolchain | ti-arm-clang |
| Board | am263px-cc, am263px-lp |
| Example folder | examples/drivers/epwm/epwm_updown_aq |
Steps to Run the Example
- When using CCS projects to build, import the CCS project for the required combination and build it using the CCS project menu (see Using SDK with CCS Projects).
- When using makefiles to build, note the required combination and build using make command (see Using SDK with Makefiles)
- Establish connections as mentioned in External Connections section
- Launch a CCS debug session and run the executable, see CCS Launch, Load and Run
See Also
EPWM
Sample Output
Shown below is a sample output when the application is run,
EPWM Action Qualifier Module Test Started ...
EPWM Action Qualifier using UPDOWN-Count mode Example runs for 30 Secs
EPWM Action Qualifier Module Test Passed!!
All tests have passed!!