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.

28069的峰值电流控制模式



F28069的怎么用内部的比较器来配置成峰值电流控制模式呢?我这样配置有什么错误呢?

EALLOW;
EPwm1Regs.TZSEL.bit.DCAEVT2=1;
EPwm1Regs.TZCTL.bit.DCAEVT2=2;//force low
EPwm1Regs.TZDCSEL.bit.DCAEVT2=4;
EPwm1Regs.DCTRIPSEL.bit.DCAHCOMPSEL=0;
EPwm1Regs.DCTRIPSEL.bit.DCALCOMPSEL=8;
EPwm1Regs.DCACTL.bit.EVT2SRCSEL=1;
EPwm1Regs.DCACTL.bit.EVT2FRCSYNCSEL=1;
EPwm1Regs.DCFCTL.bit.PULSESEL=1;
EPwm1Regs.DCFCTL.bit.BLANKINV=0;
EPwm1Regs.DCFCTL.bit.BLANKE=1;
EPwm1Regs.DCFCTL.bit.SRCSEL=1;
EPwm1Regs.DCFWINDOW=10;
EDIS;

EALLOW;
Comp1Regs.COMPCTL.bit.COMPSOURCE=0;
Comp1Regs.COMPCTL.bit.COMPDACEN=1;
Comp1Regs.DACVAL.bit.DACVAL=310;
EDIS;

  • EPwm1Regs.TZCTL.bit.DCAEVT2=2;//force low

    这一句有问题,需要改成EPwm1Regs.TZCTL.bit.TZA 和EPwm1Regs.TZCTL.bit.TZB来实现,并且注意死区的控制。

    并且你没用用ramp generate,用固定的REF无法控制