AM263Px MCU+ SDK: EPWM HR Phase Shift SFO

| AM263Px MCU+ SDK 26.00.00 |

EPWM HR Phase Shift SFO

# Introduction

This example modifies the MEP control registers to show edge displacement for high-resolution phase shift with ePWM in Up count mode due to the HRPWM control extension of the respective ePWM module.

Block diagram

# External Connections

- EPWM0_A, EPWM1_A (EPWM1_A and EPWM2_A in case of AM261x-LP) 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 49 for epwm0_A
- Connect HSEC 53 for epwm1_A

## AM261X-LP

When using AM261x-LP

- Connect J5/J7 Pin 70 for epwm1_A
- Connect J2/J4 Pin 40 for epwm2_A

# Supported Combinations

Parameter | Value
--- | ---
CPU + OS | r5fss0-0 nortos
Toolchain | ti-arm-clang
Board | am263px-cc, am263px-lp
Example folder | examples/drivers/epwm/hrpwm_phase_shift_sfo/

# 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 High Resolution Phase Shift Test Started ...
Please observe pins HSEC 49 and HSEC 53
High Resolution Phase 14.39 degree. (shift = 20.000 nanoseconds)
EPWM1 PHS = 6, PHSHR = 0
Calibration... Running...
High Resolution Phase 14.54 degree. (shift = 20.208 nanoseconds)
EPWM1 PHS = 7, PHSHR = 246
Calibration... Running...
High Resolution Phase 14.69 degree. (shift = 20.416 nanoseconds)
EPWM1 PHS = 7, PHSHR = 235
Calibration... Running...
High Resolution Phase 14.84 degree. (shift = 20.624 nanoseconds)
EPWM1 PHS = 7, PHSHR = 225
Calibration... Running...
High Resolution Phase 14.99 degree. (shift = 20.833 nanoseconds)
EPWM1 PHS = 7, PHSHR = 214
Calibration... Complete
SFO status=1 , MEP_ScaleFactor=45
High Resolution Phase 15.14 degree. (shift = 21.041 nanoseconds)
EPWM1 PHS = 7, PHSHR = 203
Calibration... Running...
High Resolution Phase 15.29 degree. (shift = 21.249 nanoseconds)
EPWM1 PHS = 7, PHSHR = 193

Expected output