Part Number: LAUNCHXL-F28P65X
Other Parts Discussed in Thread: LAUNCHXL-F280049C
Tool/software:
Hello,
I am working with a LaunchXL-F28P65X, I have configured 2 EPWMs which I want to turn on and off from a C# interface with CAN messages.
I did a similar setup on a LaunchXL-F280049C, using One shot trip, forcing it as such :
ePWM->TZFRC.bit.OST = 1; // Trip PWM
ePWM->TZCLR.bit.OST = 1; //Clear Trip PWM
And it worked perfectly fine.
I tried the same on the 65x, and it doesn’t work reliably, sometimes it works as expected, sometimes it doesn’t turn the PWM off.
I read about the Diode Emulation, Minimum Dead-Band and Illegal Combo Logic submodules and I found another solution for my problem, using the Continuous Software Force registers from AQCSFRC.
ePWM->AQCSFRC.bit.CSFA = 1; // 01b = force low
ePWM->AQCSFRC.bit.CSFB = 1; // 01b = force low
and
ePWM->AQCSFRC.bit.CSFA = 0; //turn pwm back on
ePWM->AQCSFRC.bit.CSFB = 0;
but this doesn’t work with our current DB setup as I active high complementary ( EPWMxB is inverted ). And so when I force EPWMxA on low, EPWMxB goes on high.
PWM->pstEPwmAddr->DBCTL.bit.POLSEL = 0x2;
For this I have found another solution, which is to switch to active high mode before forcing the EPWM to low using CSF, and switching back to Active High Complementary before turning the EPWM back on.
ePWM->DBCTL.bit.POLSEL = 0x0;
ePWM->AQCSFRC.bit.CSFA = 1; // 01b = force low
ePWM->AQCSFRC.bit.CSFB = 1; // 01b = force low
//////////////////////
ePWM->DBCTL.bit.POLSEL = 0x2;
ePWM->AQCSFRC.bit.CSFA = 0; //turn pwm back on
ePWM->AQCSFRC.bit.CSFB = 0;
This solution seems to be working as we need it to, but I’m not sure it’s the best approach. Is there anything I missed? Or is there a better approach here?
Thank you!
