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

LPC23XX - Using External interrupt EINT0

Hi !

I am confused about using external interrupt. I have a MCB2300 board and wanted to write an application that use the push button wired to P2.10. In first step the interrupt handler just toggle led0.

In the user manual §10.2.2 we can read that P2 and P0 can both generate interrupts on each pin, on falling/rising edge.

So in order to use P2.10 as interrupt the register to use for me was those in table 133 & 134 "GPIO interrupt register map".
FIODIR Fast GPIO Port Direction control register.
IntEnR : GPIO Interrupt Enable for Rising edge.
IntClr GPIO Interrupt Clear.

Whith PINSEL4 we select the P2.10 pin mode : EINT0 or GPIO. I selected EINT0

But When I tested I see that the interrupt generated was not cleared by IntClr register.
Then I saw in forum that register to use for EINT are EXTINT, EXTMODE, EXTPOLAR, documented at §3.6.

So the question is : what is the difference beetween EINT0-3 and the GPIO interrupt handled by IntEnR/IntClr ? (Except that register to use are not the same :) )
Why is there "only" four external interrupt when the P0 & P2 can offer interrupt on each pin (that means 62).

  • You have two competing methods of implementing pin-change interrupts.

    You can use EINT0..EINT3 which are dedicated interrupt channels intended to control one pin each.

    Or you can use the GPIO pin-change interrupts, in which case you use GPIO configuration registers to mask which pins that may generate an interrupt, and then read out state information in the interrupt handler to decide what pin that caused the interrupt.

    So be very careful when reading the documentation, so you don't mix the two ways of handling interrupts.

    If you need few pins with interrupt, or some pins with very high priority, it's best to use the EINT method. If you need to supervise many pins, you need to use pin-change interrupts but can instead use random pins from P0 and P2 - each 32-bit ports.