Hi BU,
Customer side has an issue regarding to EPWM2 PWM output. In their design, they use EPWM1 as sync source (EPWM1 CTR=ZRO), and EPWM2/EPWM3's PRD shadow load event is this sync signal and PRD is also linked to EPWM1's PRD. EPWM1/2/3 will have frequency/period suddenly change and slowly change (i.e. 40kHz suddenly change to 60kHz, and 60kHz slowly change to 40kHz). And the EPWM2's configuration codes are as follow. Notes the action qualifications are CMPB-Down pull-up and Zero pull-down.
During suddenly changing the frequency, i.e. 40kHz -> 60kHz, sometimes the PWM2' output will not change. A 25us background task read out the CTR and PRD value of EPWM2, and if the CTR is larger than PRD, one GPIO will be pull low. As shown in following figure (the purple signal is the GPIO), when the PWM output not change, detected that the CTR value is larger than the configured PRD value. And in the figure there is an measuring signal of the frequency for the PWM output (yellow signal is PWM2's B output, and the measuring frequency is over the yellow signal). As you can see, the issue is happened when suddenly changing the frequency from 40kHz to 60kHz, not each time but accidentally. The PWM output missing means that the CTR = CMPB-Down event missing from the AQ configuration.
We tried a lot things, such as disable the phase-shift, etc., but not work. Finally, we found that if during suddenly changing PRD of the PWM2, we give a larger CMPB value (>100, for example) firstly, and then step-by-step reducing the CMPB value to the expected small value, the above issue can be avoid:
I think the issue maybe caused by EPWM2 PRD shadow load action sometimes not work and CTR-CMPB down event missing and also CTR value will larger that the configured PRD value (we tried using CTR=CMPB-up event to pull up the output, and it works). The concept is shown in following figure:
So questions are why PRD shadow load not action, and why if we configure a larger CMPB value this issue can be avoided.
Regards,
Will