Hi,
I'm working in a new design where I need to detect changes in pins from RC0 to RC5. I'm using an interrupt to detect when an pin have changed. The problem is that it doesn't work, it works with pins in PORTA but not PORTC. I configure them exactly the same way. I've checked that there is no other peripheral assigned to those particular pins. I've also check that the RC pins are working as inputs since I can read the real state by using if (PORTCbits.RC0==1) ...
//Interrupt
void __attribute__((interrupt, auto_psv)) _CNInterrupt(void) {
PORTBbits.RB0 = 1;
WriteUART1(0x35);
InputChange_Clear_Intr_Status_Bit;
}
//Configuration
TRISC = 0xFFFF;
TRISA = 0xFFFF;
AD1PCFG = 0xFFFF;
InputChange_Clear_Intr_Status_Bit;
ConfigIntCN(INT_ENABLE|INT_PRI_4);
EnableCN2;
EnableCN8;
// CNEN1bits.CN8IE = 1; I also tried this.
I would appreciate any help.
Thanks.