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 lpc2000@yahoogroups.com, 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 ProjetosMessage
Re: LPC2106 external interrupts
2005-03-17 by johnnorgaard2003
Attachments
- No local attachments were found for this message.