Thanks Dave !


________________________________
From: Dave Camarillo <dave.camari...@gmail.com>
To: Nagasrinivas Pinjala <pinja...@yahoo.com>
Cc: psas-avionics <psas-avion...@psas.pdx.edu>
Sent: Friday, September 16, 2011 10:26 PM
Subject: Re: [psas-avionics] need help

Hi Naga,

A couple of notes and comments that should be helpful...

-On the LPC series of MCU's, you'll be looking for the pins that can
be configured as EINT# pins. These will allow for a state change on
the input pin to trigger an interrupt handler on the MCU.

-In the manual, there is a section on the vectored interrupt
controller. It will be critical that you read and understand this
chapter. The general process is to assign the address of the function
handler to the respective VIC register, configure the peripheral, and
enable the interrupt.

-When implementing the interrupt function, it's almost identical to a
normal function, however the function prolong and epilogue is modified
with compiler directives and/or assembler code. An example can be
found in the psas freertos-5.1.2 repo, under
LPCUSBIntegrationTesting/usb.c. There are two primary methods of
modifying the function. The first is using the compiler directive,
which may or may not be broken, depending on the version of gcc your
running. The second is to mark the function as naked and provide
assembler instructions at the beginning and end of the function to
save and restore context.


I think this should get you started in the right direction...


Regards,
-Dave


On Fri, Sep 16, 2011 at 7:52 PM, Nagasrinivas Pinjala
<pinja...@yahoo.com> wrote:
> Hi,
>
> I wish to write an interrupt based program for LPC2378 board. It involves
> one of the two user buttons and the LED. Following is the algorithm for the
> program:
> 1.Choose a button
> 2.Set the relevant pin as the input
> 3.Check if the button is pressed
>    if yes - send an interrupt to the micro-controller which then lights the
> LED
>    if no - do nothing
> I need guidance as to how to write an interrupt function in C, what are the
> compiler directives, and what are the registers I need to deal with.
> Any help would be greatly appreciated.
>
> Thanks,
> Naga.
>
> _______________________________________________
> psas-avionics mailing list
> psas-avionics@lists.psas.pdx.edu
> http://lists.psas.pdx.edu/mailman/listinfo/psas-avionics
>
>
_______________________________________________
psas-avionics mailing list
psas-avionics@lists.psas.pdx.edu
http://lists.psas.pdx.edu/mailman/listinfo/psas-avionics

Reply via email to