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.

28035 PWM

我在main初始化时,增计数,PWM1为基准,PWM2相移120,PWM3相移240能够实现,但是我在中断中只更新周期值时,出现如下情况。请问还有哪个地方处理不对吗?

在中断中只更新周期值时,pwm2计数器,为何计数到周期值时不清零,而是继续向上计数。我仿真时,pwm2计数器大部分是竟然大于周期值。不明白?
异常情况:在中断中,对TBPRD重新再次赋值一次,pwm1能够正常发板,pwm2不能发波,pwm3正常发波,移相240


interrupt void epwm1_isr(void)
{

EPwm1Regs.TBPRD = 299; 
EPwm2Regs.TBPRD = 299; 不发波
EPwm3Regs.TBPRD = 299; 
EPwm1TimerIntCount++;


EPwm1Regs.ETCLR.bit.INT = 1;

// Acknowledge this interrupt to receive more interrupts from group 3
PieCtrlRegs.PIEACK.all = PIEACK_GROUP3;

}