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.

为什么 SysCtrlRegs.PCLKCR1.bit.EPWM2ENCLK = 0; 不能关掉pwm呢?怎么关掉某些pmw输出?



EALLOW;
SysCtrlRegs.PCLKCR1.bit.EPWM2ENCLK = 0; // ePWM2
SysCtrlRegs.PCLKCR1.bit.EPWM1ENCLK = 0; // ePWM1
EDIS;

我这样做,把EPWM1和EPWM2的时钟给关了,但是为什么它不是输出为零,反而输出高电平(3.3v),是什么原因?

  • 时钟关了   这时候决定输出的就是硬件结构了     你要看看PWM波输出口在默认情况下是上拉还是下拉

    建议你把时钟别关   可以采用强制高或强制低的方式去控制输出