Part Number: TMS320F28374S
Hi Team,
There's an issue from the customer need your help:
I would like to ask about the increase and decrease counting problem after phase shift synchronization between EPWM modules.
Regarding this problem, the chip manual is very clear: for the increase and decrease counting mode of PWM, whether the synchronized counter increases or decreases the count is determined by TBCTL->PHSDIR, 0 means subtract count, and vice versa.
The problem now is that I want to use the EPWM7's counter zero crossing to generate a synchronization signal to trigger the phase shift operation of EPWM8, so I configure EPWM8 as follows:
EPWM_setTimeBasePeriod(EPWM8_BASE, 500);
EPWM_setTimeBaseCounter(EPWM8_BASE, 0);
EPWM_setTimeBaseCounterMode(EPWM8_BASE, EPWM_COUNTER_MODE_UP_DOWN);
EPWM_enablePhaseShiftLoad(EPWM8_BASE);
EPWM_setPhaseShift(EPWM8_BASE, 300);
EPWM_setCountModeAfterSync(EPWM8_BASE,EPWM_COUNT_MODE_UP_AFTER_SYNC);
EPWM_setSyncOutPulseMode(EPWM8_BASE, EPWM_SYNC_OUT_PULSE_ON_EPWMxSYNCIN);
The above configuration should be relatively simple and clear. However, when testing, read the data of EPWM8's cycle register and count register, as follows:

As you can see, the period register data is 500, as configured
But the data in the counting register reaches 870, which exceeds the data in the periodic register, why? And in this case, the output of EPWM8 is always low
However, if the setting of increasing or decreasing the count is removed, or modified to decrement count EPWM_setCountModeAfterSync(EPWM8_BASE, EPWM_COUNT_MODE_DOWN_AFTER_SYNC), the counter data is normal again, and the PWM output is also normal
I would like to ask what causes this?
Thanks & Regards,
Ben
