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 keep track of elapsed time.
- Show usage of ePWM APIs
AM62LX-EVM
- This example uses the user expansion connector (J2) in the board for testing on AM62LX-SK.
- All pin numbers are on the expansion connector in the board.
- The pins configured for the example is enabled on user expansion connector based on the FET selection switch(FET_SEL0).
- The SOC_VOUT0_DATAn are the input to FET switches. The pins that are configured for the example are pinmuxed with the FET switches.
- The S0 select pin decides if the configured pins (which is pinmuxed with SOC_VOUT0_DATAn) map to HDMI or USER EXP connector.
- The S0 pin is triggered to a high value in the software. When the S0 is high, the pin that is configured for the example (which is pinmuxed with SOC_VOUT0_DATAn) will be available on the user expansion connector.
The below diagram depicts the selection:
S2 | S1 | S0 | IP(nA)/OP(nB1 (Or) nB2) |
H | H | L | nA=nB1 -> SOC - HDMI |
H | H | H | nA=nB2 -> SOC - GPIO EXP CONN |
Below is the connection details.
- Signal can be probed on Pin 18 of User Expansion Connector (J2) on the board.
- EPWM Signal: G22/V0UT0_DATA13 (Pin_18)
Supported Combinations
Parameter | Value |
CPU + OS | a53ss0-0 nortos |
a53ss0-0 freertos |
Toolchain | arm.gnu.aarch64-none |
Board | am62lx-evm |
Example folder | examples/drivers/epwm/epwm_duty_cycle/ |
Steps to Run the Example
See Also
EPWM
Sample Output
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!!