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

GPIO irq not firring

Hi all

I have a strange problem with getting an input to generate an interrupt.
I probably have missed something, but I cant see what.

I'm trying to use P2.10 to generate GPIO interrupt on both falling and rising edges.

I set the P2.10 as an input
I install the EINT3 interrupt vectore (shared with GPIO interrupts
I set the rising and falling edge enable flag for the P2.10 input

But no interrupt is coming when I activate the input.

I have verified the settings with the 'Peripherals' in uVision4 and VIC, GPIO interrupt and GPIO seems to be setup ok.

Also, after I have set the P2.10 input, I can see the correct flag being set in the IO2_INT_STAT_R in the Peripherals->GPIO Interrupts and the IO2_INT_STAT_F when the input is released again.

When I use the P2.10 as an external interrupt (EINT0), I can get an interrupr with no proglem.

I just want to use both edge..

Im using a LPC2478 and KEIL uvision

any Ideas?

Code:

int main (void)
{
   // LED
   GPIOInit( 3, 27, FAST_PORT, DIR_OUT ); // Status LED
   // Input
   GPIOInit( 2, 10, FAST_PORT, DIR_IN ); // Reset
   // Clear it... just in case
   IO2_INT_CLR = (0x00000001<<10);
   // Install the EINt3
   install_irq(EINT3_INT,  (void (*)( void ))EINT3_Interrupt, HIGHEST_PRIORITY+1);
   // enable rising and falling edge
   IO2_INT_EN_R |= (0x00000001<<10);
   IO2_INT_EN_F |= (0x00000001<<10);
   // Forever
   while(1);
}

// EINt3 IRQ handler
void EINT3_Interrupt (void) __irq
{
        if(IO2_INT_STAT_R)
                FIO3CLR |= (0x0001 << 27);
        if(IO2_INT_STAT_F)
                FIO3SET |= (0x0001 << 27);

        IO2_INT_CLR = (0x00000001<<10);
        VICVectAddr = 0;
}


thomas