AM261x MCU+ SDK: EPWM DMA

| AM261x MCU+ SDK 26.00.00 |

EPWM DMA

# Introduction

This example configures an ePWM instance and DMA as follows:

- ePWMx is set up to generate PWM waveforms
- DMA channel 0 is set up to update the CMPAHR, CMPA, CMPBHR and CMPB every period with the next value in the configuration array. This allows the user to create a DMA enabled fifo for all the CMPx and CMPxHR registers to generate unconventional PWM waveforms.
- DMA channel 1 is set up to update the TBPHSHR, TBPHS, TBPRDHR and TBPRD every period with the next value in the configuration array.
- Other registers such as AQCTL can be controlled through the DMA as well by following the same procedure.

Block Diagram for EPWM DMA example

# External Connections

- For AM263x-CC or AM263Px-CC: EPWM0_A/B pin can be connected to an oscilloscope to view the waveform.
- For AM263x-LP or AM263Px-LP: EPWM1_A/B pin can be connected to an oscilloscope to view the waveform.

## AM263X-CC or AM263PX-CC or AM261X-SOM

When using AM263x-CC or AM263PX-CC 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

## AM263X-LP or AM263PX-LP or AM261X-LP

When using AM263x-LP or AM263PX-LP or AM261X-LP

- Capture waveform on boosterpack header J2/J4 Pin 37 for epwm1_A
- Capture waveform on boosterpack header J2/J4 Pin 38 for epwm1_B

# Supported Combinations

Parameter | Value
--- | ---
CPU + OS | r5fss0-0 nortos
Toolchain | ti-arm-clang
Board | am261x-som, am261x-lp
Example folder | examples/drivers/epwm/epwm_dma

# 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)
- 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 DMA Test Started ...
EPWM DMA Test Passed!!
All tests have passed!!

EPWM DMA waveform