lpcware

Analog comparator interrupt handler

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by CroesJeroen on Fri Feb 01 15:34:33 MST 2013
Hello guys,

I'm facing a difficulty with the analog comparator. I use 1.66V for the - input of the comparator (with the voltage ladder) and a analog input for the + input of the comp.

The output of the comparator0 works just fine, it go's high when V+>V-. I'm debugging it and checking the comparator register, CMP0STAT  give the status of the comparator.

I added the comparator interrupt to the NVIC but it just doesnt jump to the handler?!

LPC1227


void InitCMP(void){
set the inputs, comparator, voltage ladder....

NVIC_ClearPendingIRQ(CMP_IRQn);
NVIC_EnableIRQ(CMP_IRQn);

}




void COMP_IRQHandler(void){

LPC_ACOMP->CMP |= INTCOMPCLR; // reset the interrupt status
}


Hopefully someone used this before and maybe encountered the same problem!

kind regards

Outcomes