Tool/software:
I have a function which is supposed to turn off the PWM outputs via a continuous software force using the AQCSFRC registers.
#define PWM_AB_OUTPUTS_OFF 0b0000000000000101
void Disable_PWM(void)
{
//**********************************************
// Force all PWM outputs off via continuous
// software force. This takes effect on the next
// rising edge of TBCLK (15MHZ) since we are
// immediate mode.
//**********************************************
DINT;
EPwm1Regs.AQCSFRC.all = PWM_AB_OUTPUTS_OFF; // force all ePWM1 outputs off
EPwm2Regs.AQCSFRC.all = PWM_AB_OUTPUTS_OFF; // force all ePWM2 outputs off
EPwm3Regs.AQCSFRC.all = PWM_AB_OUTPUTS_OFF; // force all ePWM3 outputs off
EINT;
}
I would expect that writing 0x0005 to this register would shut off both A and B outputs (force low) from the selected PWM channel(s), 1,2 and 3 in the code example. I would also expect this to work no matter what else is going on at the time with PWM. That is, even if I were to write to the normal action qualifier registers, changing PWM duty cycle, etc.
I am not writing the the AQSCFRC registers anywhere else in the code.
However, sometimes it works as expected, other times it does not.
Looking into the AQSCFRC registers after I call the Disable_PWM() function, I can see 0x0005 in EPWM1 ,2, and 3.AQSCFRC registers. This should force both A and B outputs low for these PWM channels. But occasionally, after the function is called, I can see high currents with my power supply in current limit, so I know that PWM switches are on. Whether or not there is actually PWM occurring, I don't know. But I do know there are switches on that should not be on.
FYI - I am running the PWMs with IMMEDIATE reload. So the new settings should take effect on the rising edge of the next TBCLK cycle.
Here are my questions.
1. Are there any special conditions for using the continuous force register (AQSCFRC) ?
2. Does the requested force condition in this register override any other requested output action from the PWM module ? Software forced events have the highest priority.
3. And finally, why doesn't this work (all the time) ?
Thanks.