Introduction
This example generates a signal for a specified time and duty cycle using ePWM module. The time and duty cycle can be configured by the user.
The example does the below
- Configures ePWM0 to generate a 1KHz signal with 25% duty cycle for 60 seconds.
- Output channel A is used in the example.
- The parameters frequency, duty cycle and application run time are configurable by the user.
- Deadband submodule and chopper submodule are entirely bypassed in this example.
- ISR is used to keep track of elapsed time.
- Show usage of ePWM APIs
Supported Combinations
Parameter | Value |
CPU + OS | m4fss0-0 freertos |
Toolchain | ti-arm-clang |
Boards | xWRL6432-evm |
Example folder | examples/drivers/epwm/epwm_duty_cycle |
Using SDK with SysConfig
A GUI tool SysConfig is used to configure different modules and peripherals of the example. Using this tool, users can select and customize different modules and peripherals. The SysConfig tool will generate the code for initializing and configuring these modules. This configuration is saved to a file called example.syscfg for every example. To know more about how to use SDK with SysConfig, Visit this page
Using SDK with SysConfig
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
- Use any kind of logic analyzers etc. to probe ePWM output on pin configured as per Syscfg
See Also
EPWM
Sample Output on CCS Console
Shown below is a sample output when the application is run,
EPWM Duty Cycle Test Started ...
App will wait for 60 seconds (using PWM period ISR) ...
EPWM Duty Cycle Test Passed!!
All tests have passed!!