This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

MCB2300: GPIO Interrupt Problems

Hi everyone,

I'm new to programming with a MCB2300(LPC2378), and I'm having a little bit of trouble figuring out how to get the GPIO interrupts to work.

I'm trying to detect a rising edge on p2.6; if a rising edge is detected I turn on just p2.0, if it hasn't been detected i turn on just p2.1. I think that I am setting the gpio direction and enabling the interrupts correctly, but I can't get the desired behavior.

Here is my code:

int main(){

FIO2MASK0=0x00;
FIO2DIR0=0x03;
IO0_INT_EN_R=0x00000040;

while(1){
 if(IO_INT_STAT == 0x00000001)
        FIO2PIN0=1;
 else
        FIO2PIN0=2;
 }
}

thanks for any help that you can give me, sorry if i am making any really stupid/obvious errors.

0