This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PWM中断何时触发?

您好:

我用28027做了个案子。在timer0中断使能了epwm2中断,中断时机是count=0,但是通过示波器观察发现,第一次进入中断不是发生在count=0时,而是中断使能后就立即进入epwm2中断了。

测试方法是,在EPWM2中断设置一个引脚配置为高电平,同步观察该引脚和epwmA和epwmB的输出,首次进入中断不是发生在count=0,后续的中断时机就是对的。

我的ewpm2中断设置初始化代码是:

 EPwm2Regs.ETSEL.bit.INTSEL = ET_CTR_ZERO;    //
 EPwm2Regs.ETPS.bit.INTPRD = ET_2ND;      //
 PieCtrlRegs.PIEIER3.bit.INTx2 = 1; 
 IER |= M_INT3;

在timer0使能中断的方法是:
 EPwm2Regs.ETSEL.bit.INTEN = 1;

请指教,谢谢。