Author Topic: PIC 24F Input Change Notification Works on PORTA but no PORTC?  (Read 4840 times)

0 Members and 1 Guest are viewing this topic.

Offline Twistx77Topic starter

  • Regular Contributor
  • *
  • Posts: 147
  • Country: 00
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: [Select]
     

//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.
Code: [Select]
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf