Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Thread

Simpliest working FIQ example - please help.

Simpliest working FIQ example - please help.

2004-03-08 by hansklos2003

Hi!

My problem is: how to make an application with EINT0 assigned to FIQ.
I try with someting like below - but it does not work.
The source of interrupt is a pushbutton.
I use IAR EWARM Kickstart compiler.

A fragment of code with init procedure:

  ...
  VICIntSelect = 0x4000;   // Select EINT0 as FIQ.
  VICIntEnable = 0x4000;   // Enable EINT0 interrupt.
  PINSEL1 = 0x00000001;    // configure P0.16 pin as EINT0.
  ...

A code with FIQ handler:

  ...
  EXTINT = 0x01;       // Try to reset external interrupt flag.
  if (!(EXTINT & 0x01))// Check if flag was reset (button not pressed.
  {
    AND I CAN NOT REACH THIS POINT
  }
  ...

What I may say - something is working - after pushing interrupt
button program hangs.

Robert

Re: Simpliest working FIQ example - please help.

2004-03-08 by moostieuk

Have you read the user manual on the LPC part?  

There's a number of things you have to do before getting the VIC to 
work, one is that if you are running from RAM you have to map the 
exception vectors to where flash would be, and the interrupt vector 
needs to specific jump instruction.  

If you don't do those steps then the normal interrupt vector gets 
called, i'm guessing your program is jumping off to that.  You might 
want to set a breakpoint on the interrupt vector entry in the vector 
table.

It's possible that this might not be the problem, I've not seen your 
compiler so I don't know what it does on your behalf, however, I did 
have the same problem as you and I eventually read the manual 
properly and found the cause of the problem.



--- In lpc2000@yahoogroups.com, "hansklos2003" <hansklos2003@y...> 
wrote:
> Hi!
> 
> My problem is: how to make an application with EINT0 assigned to 
FIQ.
> I try with someting like below - but it does not work.
> The source of interrupt is a pushbutton.
> I use IAR EWARM Kickstart compiler.
> 
> A fragment of code with init procedure:
> 
>   ...
>   VICIntSelect = 0x4000;   // Select EINT0 as FIQ.
>   VICIntEnable = 0x4000;   // Enable EINT0 interrupt.
>   PINSEL1 = 0x00000001;    // configure P0.16 pin as EINT0.
>   ...
> 
> A code with FIQ handler:
> 
>   ...
>   EXTINT = 0x01;       // Try to reset external interrupt flag.
>   if (!(EXTINT & 0x01))// Check if flag was reset (button not 
pressed.
Show quoted textHide quoted text
>   {
>     AND I CAN NOT REACH THIS POINT
>   }
>   ...
> 
> What I may say - something is working - after pushing interrupt
> button program hangs.
> 
> Robert

Re: Simpliest working FIQ example - please help.

2004-03-08 by haack0815

Hi Robert,

take a look at the Usermanual at page 40 table 8.

You must wait until your signal is '1' to reset the flag.

Unfortunately the external interrupts at the 210x is level-sensitive.


Andreas


--- In lpc2000@yahoogroups.com, "hansklos2003" <hansklos2003@y...> wrote:
Show quoted textHide quoted text
> Hi!
> 
> My problem is: how to make an application with EINT0 assigned to FIQ.
> I try with someting like below - but it does not work.
> The source of interrupt is a pushbutton.
> I use IAR EWARM Kickstart compiler.
> 
> A fragment of code with init procedure:
> 
>   ...
>   VICIntSelect = 0x4000;   // Select EINT0 as FIQ.
>   VICIntEnable = 0x4000;   // Enable EINT0 interrupt.
>   PINSEL1 = 0x00000001;    // configure P0.16 pin as EINT0.
>   ...
> 
> A code with FIQ handler:
> 
>   ...
>   EXTINT = 0x01;       // Try to reset external interrupt flag.
>   if (!(EXTINT & 0x01))// Check if flag was reset (button not pressed.
>   {
>     AND I CAN NOT REACH THIS POINT
>   }
>   ...
> 
> What I may say - something is working - after pushing interrupt
> button program hangs.
> 
> Robert

Re: Simpliest working FIQ example - problem solved

2004-03-09 by hansklos2003

Hi !

Everything is working fine now.
The problem was not in VIC configuration, interrupt vectors mapping 
etc...
It was a mistake in linker configuration file (IAR's linker files are 
little crazy) for FIQ stack.

Robert


--- In lpc2000@yahoogroups.com, "moostieuk" <moostieuk@y...> wrote:
> Have you read the user manual on the LPC part?  
> 
> There's a number of things you have to do before getting the VIC to 
> work, one is that if you are running from RAM you have to map the 
> exception vectors to where flash would be, and the interrupt vector 
> needs to specific jump instruction.  
> 
> If you don't do those steps then the normal interrupt vector gets 
> called, i'm guessing your program is jumping off to that.  You 
might 
> want to set a breakpoint on the interrupt vector entry in the 
vector 
> table.
> 
> It's possible that this might not be the problem, I've not seen 
your 
> compiler so I don't know what it does on your behalf, however, I 
did 
Show quoted textHide quoted text
> have the same problem as you and I eventually read the manual 
> properly and found the cause of the problem.
> 
> 
> 
> --- In lpc2000@yahoogroups.com, "hansklos2003" <hansklos2003@y...> 
> wrote:
> > Hi!
> > 
> > My problem is: how to make an application with EINT0 assigned to 
> FIQ.
> > I try with someting like below - but it does not work.
> > The source of interrupt is a pushbutton.
> > I use IAR EWARM Kickstart compiler.
> > 
> > A fragment of code with init procedure:
> > 
> >   ...
> >   VICIntSelect = 0x4000;   // Select EINT0 as FIQ.
> >   VICIntEnable = 0x4000;   // Enable EINT0 interrupt.
> >   PINSEL1 = 0x00000001;    // configure P0.16 pin as EINT0.
> >   ...
> > 
> > A code with FIQ handler:
> > 
> >   ...
> >   EXTINT = 0x01;       // Try to reset external interrupt flag.
> >   if (!(EXTINT & 0x01))// Check if flag was reset (button not 
> pressed.
> >   {
> >     AND I CAN NOT REACH THIS POINT
> >   }
> >   ...
> > 
> > What I may say - something is working - after pushing interrupt
> > button program hangs.
> > 
> > Robert

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.