AM261x MCU+ SDK: EPWM valley switching

| AM261x MCU+ SDK 26.00.00 |

EPWM valley switching

# Introduction

EPWM Valley Switching

This example configures ePWMx as follows

- ePWMx with DCAEVT1 forcing the ePWM output LOW
- GPIO_A is used as the input to the INPUT XBAR INPUT1
- INPUT1 (from INPUT XBAR) is used as the source for DCAEVT1
- GPIO_B is set to output and toggled in the main loop to trip the PWM
- ePWMx with DCBEVT1 forcing the ePWM output LOW
- GPIO_A is used as the input to the INPUT XBAR INPUT1
- INPUT1 (from INPUT XBAR) is used as the source for DCBEVT1
- GPIO_B is set to output and toggled in the main loop to trip the PWM
- DCBEVT1 uses the filtered version of DCBEVT1
- The DCFILT signal uses the valley switching module to delay the
- DCFILT signal by a software defined DELAY value.

Block Diagram for EPWM Valley Switching example

# External Connections

- For AM263x-CC or AM263Px-CC or AM261x-SOM
  - GPIO48 is connected to GPIO122.
  - EPWM0_A and EPWM0_B pin can be connected to an oscilloscope to view the waveform.
- For AM263x-LP or AM263Px-LP
  - GPIO11 is connected to GPIO12.
  - EPWM1_A and EPWM1_B pin can be connected to an oscilloscope to view the waveform.
- For AM261x-LP
  - GPIO5 is connected to GPIO6.
  - EPWM1_A and EPWM1_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)

- Connect HSEC Pin 52 to HSEC Pin 72
- Capture waveform on HSEC Pin 49 for epwm0_A
- Capture waveform on HSEC Pin 51 for epwm0_B

## AM263X-LP or AM263PX-LP

- Connect boosterpack header J1/J3 pin 7 to J2/J4 pin 18
- Capture waveform on boosterpack header J2/J4 Pin 37 for epwm1_A
- Capture waveform on boosterpack header J2/J4 Pin 38 for epwm1_B

## AM261X-LP

- Connect boosterpack header J6/J8 pin 52 to J6/J8 53
- Capture waveform on boosterpack header J5/J7 Pin 69 for epwm1_A
- Capture waveform on boosterpack header J5/J7 Pin 63 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_valley_switching

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

EPWM Valley Switching waveform