EmbeddedRelated.com
Forums
Memfault Beyond the Launch

LPC2364 GPIO Interrupt Problem

Started by grady_sean April 22, 2008
Hello all, I am trying to use a falling edge GPIO interrupt on P0.11.

I setup the pin as an input and have tested it as such and it seems to
work fine.

PINSEL0 &= 0xFF3FFFFF;
PINMODE0 &= 0xFFBFFFFF;

// Set the pins to be GPIO inputs.
FIO0DIR1 &= 0xF7; // 11110111

I also setup the IO0_INT_EN_F to enable the falling edge interrupt.

IO0_INT_EN_F &= 0x800;

Also then load and enable the VIC channel. I see in the docs that
EINT3 - channel 17 - is shared with GPIO interrupts.

VICVectAddr17 = (uint32)eint3_int;
VICIntEnable = (1 << 17);

Inside eint3_int I toggle an LED, clear the interrupt flag, and clear
the VIC address register.

When I put a signal on P0.11 I never get any interrupt out of it.
Signal looks good, 100us square pulse.

I threw a test bit of code to set the soft int in another timer
routine - when I have a breakpoint in my ISR I repeatedly hit it as
expected, but never with just the signal.

I am wondering if anyone else has used a GPIO interrupt in this
fashion and had success? I can't find anything relating to this
problem with the LPC23xx - but there are some issues for the other
LPC21/22xx series having to do with order, etc. Could one of these
things be an issue here as well?

Thanks in advance for any advice on this issue.

Sean

An Engineer's Guide to the LPC2100 Series

Without having carefully looked at all your 'numbers': one quick
observation:

Make sure to enable fast GPIO:

SCS |= 1; // Enable FAST GPIO

~ Paul

From: l... [mailto:l...] On Behalf Of
grady_sean
Sent: Tuesday, April 22, 2008 9:06 AM
To: l...
Subject: [lpc2000] LPC2364 GPIO Interrupt Problem

Hello all, I am trying to use a falling edge GPIO interrupt on P0.11.

I setup the pin as an input and have tested it as such and it seems to
work fine.

PINSEL0 &= 0xFF3FFFFF;
PINMODE0 &= 0xFFBFFFFF;

// Set the pins to be GPIO inputs.
FIO0DIR1 &= 0xF7; // 11110111

I also setup the IO0_INT_EN_F to enable the falling edge interrupt.

IO0_INT_EN_F &= 0x800;

Also then load and enable the VIC channel. I see in the docs that
EINT3 - channel 17 - is shared with GPIO interrupts.

VICVectAddr17 = (uint32)eint3_int;
VICIntEnable = (1 << 17);

Inside eint3_int I toggle an LED, clear the interrupt flag, and clear
the VIC address register.

When I put a signal on P0.11 I never get any interrupt out of it.
Signal looks good, 100us square pulse.

I threw a test bit of code to set the soft int in another timer
routine - when I have a breakpoint in my ISR I repeatedly hit it as
expected, but never with just the signal.

I am wondering if anyone else has used a GPIO interrupt in this
fashion and had success? I can't find anything relating to this
problem with the LPC23xx - but there are some issues for the other
LPC21/22xx series having to do with order, etc. Could one of these
things be an issue here as well?

Thanks in advance for any advice on this issue.

Sean


--- In l..., "Paul Claessen" wrote:
>
> Without having carefully looked at all your 'numbers': one quick
> observation:
>
>
>
> Make sure to enable fast GPIO:
>
>
>
> SCS |= 1; // Enable FAST GPIO
>
>
>
> ~ Paul

Hello, thank you for your suggestion. We are indeed setting the
'GPIOM' but for Fast I/O. I verified this after reading your post by
looking at the System Control & Status reg settings through the debugger.

Also, if I just try to use that pin as a GPIO Input it does seem to
work fine.

Thanks again for your time, it is much appreciated.
If you enable falling-edge, you should
IO0_INT_EN_F |= 0x800;
below line doesn't do any good.

> IO0_INT_EN_F &= 0x800;

Tom
--- In l..., "grady_sean" wrote:
>
> Hello all, I am trying to use a falling edge GPIO interrupt on P0.11.
>
> I setup the pin as an input and have tested it as such and it seems to
> work fine.
>
> PINSEL0 &= 0xFF3FFFFF;
> PINMODE0 &= 0xFFBFFFFF;
>
> // Set the pins to be GPIO inputs.
> FIO0DIR1 &= 0xF7; // 11110111
>
> I also setup the IO0_INT_EN_F to enable the falling edge interrupt.
>
> IO0_INT_EN_F &= 0x800;
>
> Also then load and enable the VIC channel. I see in the docs that
> EINT3 - channel 17 - is shared with GPIO interrupts.
>
> VICVectAddr17 = (uint32)eint3_int;
> VICIntEnable = (1 << 17);
>
> Inside eint3_int I toggle an LED, clear the interrupt flag, and clear
> the VIC address register.
>
> When I put a signal on P0.11 I never get any interrupt out of it.
> Signal looks good, 100us square pulse.
>
> I threw a test bit of code to set the soft int in another timer
> routine - when I have a breakpoint in my ISR I repeatedly hit it as
> expected, but never with just the signal.
>
> I am wondering if anyone else has used a GPIO interrupt in this
> fashion and had success? I can't find anything relating to this
> problem with the LPC23xx - but there are some issues for the other
> LPC21/22xx series having to do with order, etc. Could one of these
> things be an issue here as well?
>
> Thanks in advance for any advice on this issue.
>
> Sean
>


Memfault Beyond the Launch