Yahoo Groups archive

Lpc2000

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

Thread

External interrupt in LPC2214--varify if my code is OK?

External interrupt in LPC2214--varify if my code is OK?

2005-11-26 by Sanjiwani

I want sample code in crossworks for external interrupt LPC2214 using FIQ or
IRQ

As my code is not working, I need help.My code is given below ,Please rell
me where I am wrong

 

 

My code is as follows:

 

#include <targets/LPC22xx.h>

//#include<__armlib.h>

 

static void interrupt0ISR(void) __attribute__ ((interrupt ("FIQ")));

static void interrupt0ISR(void){

  IO0CLR = 0x000000F0;                        //Set the LED pins on P0.5

  EXTINT = 0x01;                        //Clear the peripheral interrupt
flag

 

}

void delay(unsigned int d)

{

for(;d;d--);

}

 

void initFiq(void);

 

int main (void)

{

  initFiq();                                                //Initilise the
Fast interrupt 

  IO0SET = 0x000000F0;                        //clear the LED pins

  

 // __ARMLIB_enableIRQ();

while(1)

{

; forever

//Loop here }

return 0;

}

 

void initFiq(void) 

{

  IO0DIR = 0x000000F0;                                     //Set the LED
pins P0.5 as outputs

  PINSEL1 = 0x00000001;                                  //select EINT0

  VICIntSelect    = 0x00004000;                           //Enable a Vic
Channel as FIQ

  VICIntEnable   = 0x00004000;                           //Enable the
EXTINT1 interrupt

 

}                                                           

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 



[Non-text portions of this message have been removed]

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.