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
Important Usage Guidelines
NA
Example Usage
Include the below file to access the APIs
Check external Synchronization signal
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
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;
{
DebugP_log(
"Comparator value was written successfully\r\n");
}
else
{
}
API
APIs for EPWM