Part Number: TMS320F280023
Hello, experts,
I am facing an issue when using the CMPSS module. My settings are as under-
void CompInit()
{
EALLOW;
CmpssRegs4.COMPCTL.bit.COMPDACE = 1; // Power up comparator
CmpssRegs4.COMPCTL.bit.COMPHSOURCE = 0; // Internal DAC to be used for inverting input
EDIS;
}
.
.
.
.
.
.
void EpwmUpdate ()
{
EALLOW;
EPwm2Regs.TZCTL.bit.TZA = 2;
EPwm2Regs.TZDCSEL.bit.DCAEVT2 = 2;
EPwm2Regs.DCAHTRIPSEL.bit.TRIPINPUT4 = 1;
EPwm2Regs.DCTRIPSEL.bit.DCAHCOMPSEL = 3;
EPwm2Regs.TZSEL.bit.DCAEVT2 = 2;
EPwm2Regs.TZEINT.bit.DCAEVT2 = 1;
EPwmXbarRegs.TRIP4MUX0TO15CFG.bit.MUX6 = 0;
EPwmXbarRegs.TRIP4MUXENABLE.bit.MUX6 = 1;
EDIS;
}
My application is to implement a Peak Current Mode Control. Our observations are as under-
Whenever we increase the DAC value or give the reference DAC value the first time, there is a major overshoot of current.
I tried adding the following line in the CompInit() function -
AnalogSubsysRegs.CMPHPMUXSEL.bit.CMP4HPMUXSEL = 1;
However, then a current would flow even with DAC value set as 0.
I suspect that I have done some errors in setting up the tripping actions.
Requesting the forum's help to resolve this issue!