本人使用為28377S的MCU,使用PWM PHASE上的筆記。
CODE
1.設定選用PWM Master作為同步來源
EPwm4Regs.TBCTL.bit.SYNCOSEL = TB_CTR_ZERO; //PWM4 is SYNC Source
EPwm4Regs.TBCTL.bit.PHSEN = TB_DISABLE; //Phase Disable
2.將PWM4的同步訊號傳遞到PWM6
EPwm5Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN; //PWM5 SYNCO is PWM4 SYNCO
3.開啟PWM PHSEN,並設定Phase角度
EPwm6Regs.TBCTL.bit.PHSEN = TB_ENABLE; //PWM6 PHASE Enable(Scheme PWM6 SYNCI is PWM5 SYNCO)
EPwm6Regs.TBPHS.bit.TBPHS = 0; //PWM6 Phase is 0
圖片1
圖片2
Susan Yang:谢谢分享