Part Number: TMS320F28034
In my code at startup i do the following:
EALLOW;
Comp1Regs.COMPCTL.bit.COMPDACEN = 1; //Power up Comparator 1 locally
Comp1Regs.COMPCTL.bit.COMPSOURCE = 0; //Connect the inverting input to the internal DAC
Comp1Regs.DACCTL.bit.DACSOURCE = 0;
EDIS;
Then i have a CBIT in the main state machine evaluating the trip flag where i clear the trip condition 4 times then set a warning on the 5th time.
CBC_TripFlagStatus = EPwm1Regs.TZFLG.bit.CBC;
if (EPwm1Regs.TZFLG.bit.CBC == 1)
{
if(CBC_LimitCounter <=4){CBC_LimitCounter++;}
if(CBC_LimitCounter>=5){
Warning10_CBCLimit =1;
}else{
EPwm1Regs.TZCLR.bit.CBC=1; // Clear Trip condition
}
}else{
if(CBC_LimitCounter !=0){CBC_LimitCounter--;}
Warning10_CBCLimit = 0; // CBC Limit not tripped
}
However, what i notice is that the CBC is being tripped at startup before it even gets to the CBIT part of the code. Is there some other setting or register setting that i need to set to ensure it doesnt get tripped at startup every power cycle on the controller?
Thanks for any help u can provide.
Abe
