On my LPC1754 I'm trying to set up a falling edge pin interrupt on
P0.25.
This is my first time with a cortex-m3 part, I am more used to the
ARM7's.
I can't seem to get the interrupt to happen.
Using Crossworks v2.
I do this...
IO0IntEnF|=(1<<25); //enable interrupt on falling edge
NVIC_SetPriority(EINT3_IRQn,0x08);
NVIC_EnableIRQ(EINT3_IRQn);
And the int handler is defined like this...
static void EINT3_IRQHandler(void)
{
...
}
P0.25 is wiggling up and down but the int handler never gets called.
Have I made a stupid error?
--
Tim Mitchell
GPIO pin interrupts on LPC17xx
Started by ●September 15, 2010
Reply by ●September 15, 20102010-09-15
Hi:
1. Is the P0.25 selected as a GPIO (see PINSEL1)?
2. Are Interrupts enabled (globally)?
// Enable all interrupts
__enable_irq();
3. Do you clear the P0.25 interrupt flag? Maybe you get the first interrupt, but without clearing the flag, you won't get any more.
Regards,
Alex.
--- In l..., "Tim Mitchell" wrote:
>
> On my LPC1754 I'm trying to set up a falling edge pin interrupt on P0.25.
> This is my first time with a cortex-m3 part, I am more used to the ARM7's.
> I can't seem to get the interrupt to happen.
>
> Using Crossworks v2.
>
> I do this...
>
> IO0IntEnF|=(1<<25); //enable interrupt on falling edge
> NVIC_SetPriority(EINT3_IRQn,0x08);
> NVIC_EnableIRQ(EINT3_IRQn);
>
> And the int handler is defined like this...
>
> static void EINT3_IRQHandler(void)
> {
> ...
> }
>
> P0.25 is wiggling up and down but the int handler never gets called.
>
> Have I made a stupid error?
>
> --
> Tim Mitchell
>
1. Is the P0.25 selected as a GPIO (see PINSEL1)?
2. Are Interrupts enabled (globally)?
// Enable all interrupts
__enable_irq();
3. Do you clear the P0.25 interrupt flag? Maybe you get the first interrupt, but without clearing the flag, you won't get any more.
Regards,
Alex.
--- In l..., "Tim Mitchell" wrote:
>
> On my LPC1754 I'm trying to set up a falling edge pin interrupt on P0.25.
> This is my first time with a cortex-m3 part, I am more used to the ARM7's.
> I can't seem to get the interrupt to happen.
>
> Using Crossworks v2.
>
> I do this...
>
> IO0IntEnF|=(1<<25); //enable interrupt on falling edge
> NVIC_SetPriority(EINT3_IRQn,0x08);
> NVIC_EnableIRQ(EINT3_IRQn);
>
> And the int handler is defined like this...
>
> static void EINT3_IRQHandler(void)
> {
> ...
> }
>
> P0.25 is wiggling up and down but the int handler never gets called.
>
> Have I made a stupid error?
>
> --
> Tim Mitchell
>
Reply by ●September 15, 20102010-09-15
Hello Tim,
Wednesday, September 15, 2010, 4:15:08 PM, you wrote:
TM> And the int handler is defined like this...
TM> static void EINT3_IRQHandler(void)
TM> {
TM> ...
TM> }
TM> P0.25 is wiggling up and down but the int handler never gets called.
TM> Have I made a stupid error?
Is your source C or C++? If C++, you need to make sure to declare the
interrupt handler as C function:
extern "C" void EINT3_IRQHandler(void)
Also, if you use "static", it will be local to that source file and
linker won't link it to the startup. So don't.
--
WBR,
Igor mailto:s...@mail.ru
Wednesday, September 15, 2010, 4:15:08 PM, you wrote:
TM> And the int handler is defined like this...
TM> static void EINT3_IRQHandler(void)
TM> {
TM> ...
TM> }
TM> P0.25 is wiggling up and down but the int handler never gets called.
TM> Have I made a stupid error?
Is your source C or C++? If C++, you need to make sure to declare the
interrupt handler as C function:
extern "C" void EINT3_IRQHandler(void)
Also, if you use "static", it will be local to that source file and
linker won't link it to the startup. So don't.
--
WBR,
Igor mailto:s...@mail.ru
Reply by ●September 15, 20102010-09-15
Hi Tim
See also: http://tech.groups.yahoo.com/group/lpc2000/message/48671
Your port change config looks OK so I think that your problem must be outside of this setup somewhere.
Regards
Mark
--- In l..., "Tim Mitchell" wrote:
>
> On my LPC1754 I'm trying to set up a falling edge pin interrupt on P0.25.
> This is my first time with a cortex-m3 part, I am more used to the ARM7's.
> I can't seem to get the interrupt to happen.
>
> Using Crossworks v2.
>
> I do this...
>
> IO0IntEnF|=(1<<25); //enable interrupt on falling edge
> NVIC_SetPriority(EINT3_IRQn,0x08);
> NVIC_EnableIRQ(EINT3_IRQn);
>
> And the int handler is defined like this...
>
> static void EINT3_IRQHandler(void)
> {
> ...
> }
>
> P0.25 is wiggling up and down but the int handler never gets called.
>
> Have I made a stupid error?
>
> --
> Tim Mitchell
>
See also: http://tech.groups.yahoo.com/group/lpc2000/message/48671
Your port change config looks OK so I think that your problem must be outside of this setup somewhere.
Regards
Mark
--- In l..., "Tim Mitchell" wrote:
>
> On my LPC1754 I'm trying to set up a falling edge pin interrupt on P0.25.
> This is my first time with a cortex-m3 part, I am more used to the ARM7's.
> I can't seem to get the interrupt to happen.
>
> Using Crossworks v2.
>
> I do this...
>
> IO0IntEnF|=(1<<25); //enable interrupt on falling edge
> NVIC_SetPriority(EINT3_IRQn,0x08);
> NVIC_EnableIRQ(EINT3_IRQn);
>
> And the int handler is defined like this...
>
> static void EINT3_IRQHandler(void)
> {
> ...
> }
>
> P0.25 is wiggling up and down but the int handler never gets called.
>
> Have I made a stupid error?
>
> --
> Tim Mitchell
>
Reply by ●September 15, 20102010-09-15
Thanks everyone, it was the "static" declaration that was the problem.
The linker was not overriding the default "weak" definition of the handler with my routine so it was still jumping to the default handler.
Now working! Phew!!
--
Tim Mitchell
t...@sabretechnology.co.uk
t: 01482 800981 f: 01482 801078
-----Original Message-----
From: l... on behalf of Igor Skochinsky
Sent: Wed 15/09/2010 20:13
To: Tim Mitchell
Subject: Re: [lpc2000] GPIO pin interrupts on LPC17xx
Hello Tim,
Wednesday, September 15, 2010, 4:15:08 PM, you wrote:
TM> And the int handler is defined like this...
TM> static void EINT3_IRQHandler(void)
TM> {
TM> ...
TM> }
TM> P0.25 is wiggling up and down but the int handler never gets called.
TM> Have I made a stupid error?
Is your source C or C++? If C++, you need to make sure to declare the
interrupt handler as C function:
extern "C" void EINT3_IRQHandler(void)
Also, if you use "static", it will be local to that source file and
linker won't link it to the startup. So don't.
--
WBR,
Igor mailto:s...@mail.ru
The linker was not overriding the default "weak" definition of the handler with my routine so it was still jumping to the default handler.
Now working! Phew!!
--
Tim Mitchell
t...@sabretechnology.co.uk
t: 01482 800981 f: 01482 801078
-----Original Message-----
From: l... on behalf of Igor Skochinsky
Sent: Wed 15/09/2010 20:13
To: Tim Mitchell
Subject: Re: [lpc2000] GPIO pin interrupts on LPC17xx
Hello Tim,
Wednesday, September 15, 2010, 4:15:08 PM, you wrote:
TM> And the int handler is defined like this...
TM> static void EINT3_IRQHandler(void)
TM> {
TM> ...
TM> }
TM> P0.25 is wiggling up and down but the int handler never gets called.
TM> Have I made a stupid error?
Is your source C or C++? If C++, you need to make sure to declare the
interrupt handler as C function:
extern "C" void EINT3_IRQHandler(void)
Also, if you use "static", it will be local to that source file and
linker won't link it to the startup. So don't.
--
WBR,
Igor mailto:s...@mail.ru