Other Parts Discussed in Thread: C2000WARE
异常描述如下:当芯片处于开发波状态时,按“配置成强制动作立即生效” + “关发波” + “还原强制动作过零生效”的顺序执行后发波无法按预期的关闭。

异常描述如下:当芯片处于开发波状态时,按“配置成强制动作立即生效” + “关发波” + “还原强制动作过零生效”的顺序执行后发波无法按预期的关闭。

我用路径 \ti\c2000\C2000Ware_5_02_00_00\device_support\f2803x\examples\c28\epwm_updown_aq 下的例程加入了测试代码,试了是可以复现的。我没看到有插入压缩附件的地方,测试的代码也很少,你可以自己在例程文件里添加测试代码来进行测试。
for(;;)
{
__asm(" NOP");
if (s_testVar == 1)
{
s_testVar = 0;
EPwm1Regs.AQSFRC.bit.RLDCSF = 0x3; // 配置成强制动作立即生效
EPwm1Regs.AQCSFRC.all = 0x05; // 关发波
EPwm1Regs.AQSFRC.bit.RLDCSF = 0x0; // 还原强制动作过零生效
}
}


您好
您好
I see the issue you're referring to now.
This is due to the switching from shadow to immediate then back to shadow.
When going from immediate back to shadow, the shadow registers have value of 0x0 and will reload this.
To work around this, you will have to write again to the shadow registers after switching from immediate mode.
Try the following sequence. Also please ensure the FREE_SOFT is set to 0x3 so the TBCTR does not stop counting even while CPU is halted.
EPwm1Regs.AQSFRC.bit.RLDCSF = 0x3; //Configure to force actions to take effect immediately
EPwm1Regs.AQCSFRC.all = 0x05; //Guan Fabo
EPwm1Regs.AQSFRC.bit.RLDCSF = 0x0; //Restore the forced action to zero crossing and take effect
EPwm1Regs.AQCSFRC.all = 0x05; //Guan Fabo