Electronics > Microcontrollers

PIC 24F Input Change Notification Works on PORTA but no PORTC?

(1/1)

Twistx77:
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) ...




--- Code: ---     

//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.
   
--- End code ---

I would appreciate any help.


Thanks.
--- Code: ---
--- End code ---

Navigation

[0] Message Index

There was an error while thanking
Thanking...
Go to full version