Hello everybody,
in my application the DPWM signal should by interrupted by a current limit. Therefore I have used ACOMP-F and the pin has a positive offset voltage, so I will be able to detect, when the current will become negative polarity. Will the input voltage go below ZCD_THRESHOLD, the current DPWM cycle should be interrupted.
// enable ACOMP-F pin and connect to current limit on DPWM-1 (ZCD - zero current detection)
FaultMuxRegs.DPWM1CLIM.bit.ACOMP_F_EN = 1;
FaultMuxRegs.ACOMPCTRL2.bit.ACOMP_F_SEL = 0;
FaultMuxRegs.ACOMPCTRL2.bit.ACOMP_F_POL = 0;
FaultMuxRegs.ACOMPCTRL2.bit.ACOMP_F_THRESH = ZCD_THRESHOLD;
In the DPWM module I have the following configurations:
// activate cycle by cycle current limit
Dpwm1Regs.DPWMCTRL0.bit.CBC_PWM_AB_EN = 1;
Dpwm1Regs.DPWMCTRL0.bit.CBC_ADV_CNT_EN = 1;
Dpwm1Regs.DPWMFLTCTRL.bit.CBC_MAX_COUNT = 0;
Dpwm1Regs.DPWMFLTCTRL.bit.CBC_FAULT_EN = 1;
Actually the ZCD does it's job as expected - but just a single time! Instead of re-activate DPWM at the next DPWM period, it keeps inactive! Just by disabling and enabling DPWM again, the DPWM module beginns to work - ...for a single time and the game beginns again!
In the technical reference manual, this behavior is described for a FAULT_AB detection, but not for the CLIM/CBC!
Has anyone an idea how to fix that?
Thanks for your assistance!
Kind regards,
Andy