Part Number: AM263P4
Hello,
I am working with the LP-AM263P4 development board and am generating complementary PWM signals using PWM1 and PWM3.
My target configuration is:
- PWM Frequency: 20 kHz
- PWM Period: 50 µs
However, I am not getting the expected output. Initially, the PWM waveform matches the expected behavior, but after some time it changes unexpectedly. This pattern repeats at the same interval every time.
I have attached:
- Output waveform screenshots
ti_driver_open_close.csource file
My main application code is shown below:
void configAQ(uint32_t base)
{
EPWM_setActionQualifierAction(
base,
EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_HIGH,
EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA);
EPWM_setActionQualifierAction(
base,
EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_LOW,
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
}
void epwm_deadband_main(void *args)
{
/* Open drivers to open the UART driver for console */
Drivers_open();
Board_driversOpen();
DebugP_log("EPWM DeadBand Test Started ...\r\n");
DebugP_log("EPWM DeadBand Example runs for 5 Secs \r\n");
/* Start all the EPWM Timebase Counters */
SOC_setMultipleEpwmTbClk(gEpwmTbClkSyncDisableMask, TRUE);
configAQ(CONFIG_EPWM1_BASE_ADDR);
configAQ(CONFIG_EPWM3_BASE_ADDR);
uint16_t duty, duty2;
duty = 40;
duty2 = 40;
EPWM_setCounterCompareValue(
CONFIG_EPWM1_BASE_ADDR,
EPWM_COUNTER_COMPARE_A,
(5000 * duty) / 100);
EPWM_setCounterCompareValue(
CONFIG_EPWM3_BASE_ADDR,
EPWM_COUNTER_COMPARE_A,
(5000 * duty2) / 100);
while(1);
ClockP_sleep(5);
/* Stop all the EPWM Timebase Counters */
SOC_setMultipleEpwmTbClk(gEpwmTbClkSyncDisableMask, FALSE);
DebugP_log("EPWM DeadBand Test Passed!!\r\n");
DebugP_log("All tests have passed!!\r\n");
Board_driversClose();
Drivers_close();
}
I would appreciate your help in understanding the following:
- Why does the PWM waveform change periodically after initially producing the expected output?
- What could be causing this behavior?
- Is there any issue with my Action Qualifier configuration or the overall PWM setup?
- How can I fix this issue to obtain a stable 20 kHz complementary PWM output?
Additionally, I have another question:
- How can I independently control each PWM module (for example, PWM1 and PWM3) instead of operating them only as complementary outputs? I would appreciate any guidance or example demonstrating how to control each PWM separately.
Thank you for your support.
ANBURAJA A
Note:
0 is PWM1 A , 1 is PWM1 B
2 is PWM3 A, 3 is PWM3 B

