Tool/software:
We config the EPWM1 module of DSP1 to output SYNC signal when CTR=0, which is further used to synchronize the EPWM1 module of another chip (DSP2).
The two DSP chips both use up and down counting mode, the TBPRD register are both 2500. The output of PWM is set to be low when CTR=CMP in the up-count mode, while the output is high when CTR=CMP in the down-count mode.
The TBPHS reload of DSP2 chip is enabled and the phase shift value is set to 10U, instead of zero.
It is found that when the duty cycle of DSP2 is very small, it outputs an abnormal normal high level suddenly. As follows.
As can be seen from the figure above, after the synchronization signal in the middle position arrives, the EPWM count register of DSP2 should be loaded as 10, and the corresponding TBCTR should be close to zero.
Theoretically, the output PWM duty cycle at this time should be approximately 0, but the result is the high level PWM with a duty cycle of approximately 1
There are a lot of similar problems with driver loss caused by phase shift on the forum, but they all occur when the phase shift is changed dynamically.
But in my application the value of TBPHS of EPWM1 module is fixed with the value of 10U in DSP2.
Why does this happen?
I analyze whether it is because as shown in the figure above, assuming that the TBCMPA register at this time may be 6, the data of the TBCTR register will be directly updated from 4 to 10 after the synchronization signal comes, and the comparison match of the rising edge will be missed.
As a result, the high level has not been pulled down until the comparison of the falling edge matches the PWM pull point, resulting in a PWM high level output of nearly one cycle
I wonder if that's the reason?
The test has seen the synchronization signal, which is very stable in every period, then each period will trigger the EPWM1 module of DSP2 to perform phase shift operation.
So the next time the phase shift signal comes, the count register should be very close to the set TBPHS register value? That way, it shouldn't miss this match.
After a PWM cycle, how much difference can the TBCTR make with the theoretical value? In theory, if the crystal clock is very stable, after a synchronous phase shift operation, the data of the count register and the data of the phase shift register are the same every time the phase shift signal comes.