xWRL6432 MMWAVE-L-SDK  05.04.00.01
EPWM

The ePWM driver provides API to configure various sub-modules within the ePWM module. Below are the high level features supported by the driver.

Features Supported

  • Configuration of Time Base submodule to set time-base clock, counter mode,
  • Configuration of Counter Compare submodule to specify duty cycle
  • Configuration of Action Qualifier submodule to specify the type of action to take when time-base or counter-compare event occurs
  • Configuration of Dead Band submodule to set rising-edge and falling-edge delay or bypass the module
  • Configuration of Chopper submodule to generate a chopper frequency, set pulse width of the first pulse in the chopped pulse train or bypass the module
  • Configuration of Trip Zone submodule to specify the tripping action to take when a fault occurs
  • Configuration of event-trigger submodule to trigger an interrupt and rate at which these events occur

SysConfig Features

Note
It is strongly recommend to use SysConfig where it is available instead of using direct SW API calls. This will help simplify the SW application and also catch common mistakes early in the development cycle.
  • Selection of output channels.
  • Configuring pinmux based on selected pin.
  • Enabling TimeBase Clock based on selected ePWM instance.

Features NOT Supported

  • ePWM digital comparator modules
  • ePWM high-resolution modules

Example Usage

Include the below file to access the APIs

#include <drivers/epwm.h>

Check external Synchronization signal

uint16_t tbStatus = EPWM_tbGetStatus(ePWMBaseAddr, EPWM_TB_STS_SYNCI);
if(0 == tbStatus)
{
DebugP_log("External Synchronization event has occured\r\n");
}
else
{
DebugP_log("No external Synchronization event has occured\r\n");
}

Get Timebase Counter direction

uint16_t tbStatus = EPWM_tbGetStatus(ePWMBaseAddr, EPWM_TB_STS_CTR_DIR);
if(0 == tbStatus)
{
DebugP_log("Time base counter is currently counting down\r\n");
}
else
{
DebugP_log("Time base counter is currently counting up\r\n");
}

Configure Counter compare

uint32_t counterCmpVal = 0x100;
uint32_t status;
status = EPWM_counterComparatorCfg(ePWMBaseAddr, EPWM_CC_CMP_A, counterCmpVal, EPWM_SHADOW_REG_CTRL_ENABLE, EPWM_CC_CMP_LOAD_MODE_CNT_EQ_PRD, FALSE);
if(TRUE == status)
{
DebugP_log("Comparator value was written successfully\r\n");
}
else
{
DebugP_log("Comparator value write failed\r\n");
}

API

APIs for EPWM