EmbeddedRelated.com
Forums

LPC2106 external interrupts

Started by Leonardo Santos March 15, 2005
Hello All!
I'm trying to write a simple interrupt routine for a external interrupt
source (EINT0) for a LPC2106. As there's no selection between level or
edge-triggered interrupts, I want to to wait until there's a logic 1 on the
EINTx pin to clear the intrrupt on the VIC to not count a long strobe as
several different interrupts. This goes along with the LPC2106 user's manual,
as on page 40 it says that to clear a pending intrerrupt on EINTx I have to
wait until there's a high level on the pin, so I REALLY want to wait until a
logic 1 is present. But how do I do that?
I already tried a code like this in my interrupt handler:

(defines based on freeRTOS)

while( (GPIO0_IOPIN & (0x01<<16)) == 0 );
SCB_EXTINT |= 0x01;
VICVectAddr = serCLEAR_VIC_INTERRUPT;

If I remove the while() loop; I get several interrupts, as expected. But if I
leave the loop, after the first strobe on the pin, the processor gets stuck.
Can I use the IOPIN register to read the current logic level on the pin? I
think so, by reading the register description on page 81 of the UM.

Thanks a lot

--

Leonardo Pereira Santos
Engenheiro de Projetos



An Engineer's Guide to the LPC2100 Series

Easy -

Use a LPC23xx series chip!

I don't know why they did level interrupts on the LPC21xx series (easier to impliment?). I have never used a level interrupt in a micro controller.

You could use a D flipflop (Q Bar output) and a port line to reset it. The line will be high again before you reenable the intterupt. Thats what I was planning in a previous project. Fortunalty it has been delayed until now and I am planning on using a LPC 23xx solution and an edge triggered interrupt.

Owen Mooney

Hello All!
I'm trying to write a simple interrupt routine for a external interrupt
source (EINT0) for a LPC2106. As there's no selection between level or
edge-triggered interrupts, I want to to wait until there's a logic 1 on the
EINTx pin to clear the intrrupt on the VIC to not count a long strobe as
several different interrupts. This goes along with the LPC2106 user's manual,
as on page 40 it says that to clear a pending intrerrupt on EINTx I have to
wait until there's a high level on the pin, so I REALLY want to wait until a
logic 1 is present. But how do I do that?
I already tried a code like this in my interrupt handler:




Hi You can not read the port via GPIO when the port is defined as
External Int. You hav to try clearing the bit until it is accepted.

I do this
while( SCB_EXTINT & 0x01 )
{
SCB_EXTINT = 0x01;
}
VICVectAddr = serCLEAR_VIC_INTERRUPT; best regards

John Noergaard
--- In , Leonardo Santos <lsantos@p...> wrote:
> Hello All!
> I'm trying to write a simple interrupt routine for a external
interrupt
> source (EINT0) for a LPC2106. As there's no selection between level or
> edge-triggered interrupts, I want to to wait until there's a logic 1
on the
> EINTx pin to clear the intrrupt on the VIC to not count a long
strobe as
> several different interrupts. This goes along with the LPC2106
user's manual,
> as on page 40 it says that to clear a pending intrerrupt on EINTx I
have to
> wait until there's a high level on the pin, so I REALLY want to wait
until a
> logic 1 is present. But how do I do that?
> I already tried a code like this in my interrupt handler:
>
> (defines based on freeRTOS)
>
> while( (GPIO0_IOPIN & (0x01<<16)) == 0 );
> SCB_EXTINT |= 0x01;
> VICVectAddr = serCLEAR_VIC_INTERRUPT;
>
> If I remove the while() loop; I get several interrupts, as
expected. But if I
> leave the loop, after the first strobe on the pin, the processor
gets stuck.
> Can I use the IOPIN register to read the current logic level on the
pin? I
> think so, by reading the register description on page 81 of the UM.
>
> Thanks a lot
>
> --
>
> Leonardo Pereira Santos
> Engenheiro de Projetos