Tool/software: Code Composer Studio
Hello;
I want to use UCD3138 PIN AD04 Analog Comparator Entry fast interrupt.I set ACOMP_D_POL=1 and input voltage always highter than the ACOMP_D_THRESH.
But the program can't stop in fast interrupt.lt just into fast interrupt once time,then it never occur.
I shuold make the input voltage lower than ACOMP_D_THRESH and higher again, entry the fast interrupt one time.
How make while the input voltage always higher than the ACOMP_D_THRESH always touch off the fast interrupt .
Here are some of my code:
void init_AD04_F(void)
{
FaultMuxRegs.ACOMPCTRL0.bit.ACOMP_EN=1;
FaultMuxRegs.ACOMPCTRL1.bit.ACOMP_D_SEL=0;
FaultMuxRegs.ACOMPCTRL1.bit.ACOMP_D_INT_EN=1;
FaultMuxRegs.ACOMPCTRL1.bit.ACOMP_D_POL=1;
FaultMuxRegs.ACOMPCTRL1.bit.ACOMP_D_THRESH=127;
write_firqpr(CIMINT_ALL_FAULT_MUX);
write_reqmask(CIMINT_ALL_FAULT_MUX);
enable_interrupt();
enable_fast_interrupt();
}
void fast_interrupt(void)
{
k = FaultMuxRegs.FAULTMUXINTSTAT.bit.ACOMP_D;
}