Sign in

Not a member? | Forgot your Password?


Search lpc2000

Search tips

Subscribe to lpc2000

Free PDF Downloads

An Engineer's Guide to the LPC2100 Series

Advanced Linux Programming

What Every Programmer Should Know About Memory

Introduction to Embedded Systems

C++ Tutorial

Embedded Systems - Theory and Design Methodology

Microcontroller Programming and Interfacing

Introduction to Microcontrollers


More Free PDF Downloads

Discussion Groups

See Also

ElectronicsDSPFPGA

Find us on Facebook





Discussion Groups | LPC2000 | how to disable/enable interrupts within ISR in IAR workbench

Discussion group dedicated to the Philips LPC2000 family of ARM MCUs

how to disable/enable interrupts within ISR in IAR workbench - Harish Hrr - Jul 16 8:10:33 2009

All,

I am working on LPC2468 using IAR workbench IDE.
I have configured GPIO2-port-28 as input. This port/channel is working in
polling mode, but i want to configure it in interrupt mode. the below
configuration i have used to configure it in interrupt mode. The problem i
am facing is the ISR is getting called, but control does not go back to the
main funciton after ISR execution.

- FIO2MASK |= (1<<28); // mask enabled
- FIO2DIR |= (1<<28); // conf as Input
- IO2_INT_EN_R = (1u << 28); // Enabling of rising edge interrupt on GPIO
side
- install_irq (EINT3_INT, (void *)GPIO_Handler, HIGHEST_PRIORITY); //
configuration of EINT3 for GPIO

My ISR/handler function is as follows:

__irq __nested __arm void WaterMeter_Handler_main (void)
{
WM_Counter++;
VICVectAddr = 0; /* Acknowledge Interrupt */
return;
}

I suspect the problem may be with enabling/disabling of interrupt within the
ISR. plese let me know how to do this in IAR workbench environment.

regards,
Harish.




Re: how to disable/enable interrupts within ISR in IAR workbench - rolf_meeser - Jul 16 15:03:59 2009

Hi Harish,
--- In l..., Harish Hrr wrote:
> The problem i
> am facing is the ISR is getting called, but control does not go back to the
> main funciton after ISR execution.
>
>
> My ISR/handler function is as follows:
>
> __irq __nested __arm void WaterMeter_Handler_main (void)
> {
> WM_Counter++;
> VICVectAddr = 0; /* Acknowledge Interrupt */
> return;
> }

You must also clear the pending interrupt request in the GPIO module itself. Otherwise it will keep on firing interrupts. Try adding this line to your interrupt handler:
IO2IntClr = (1 << 28);

Regards,
Rolf