electronicsman
Full Member level 5
I am very confused with configuring the interrupt for internal comparator of dspic33ev. As per the data sheet these are the statements
I am very confused with the statements. So my code will look like this. Please suggest if this code is Ok.
I am very confused with the statements. So my code will look like this. Please suggest if this code is Ok.
Code:
void __attribute__((__interrupt__,__no_auto_psv__)) _CMP1Interrupt(void)
{
static char testdata;
testdata = CM1CONbits.COUT /* Note 1: The comparison required for generating interrupts is based on the current comparator state and the last read
value of the comparator outputs. Reading the COUT bit in the CMxCON register will update the values used for the
interrupt generation */
/* Both the CMPIF and CEVT bits must be reset by clearing them in software. */
CM1CONbits.CEVT = 0;
IFS1bits.CMPIF = 0
}