Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Interrupt in LPC2148

Status
Not open for further replies.

Omkar_Trivedi

Newbie level 1
Newbie level 1
Joined
Feb 25, 2018
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
6
hey can anyone please help me ASAP in finding what is wrong with this interrupt program.
Im trying to turn a led on by using External interrupt.
Here is the code:






Code:
#include <lpc214x.h>
#include <string.h>
#define CR 0x0D#include <stdio.h> 




void ExtInt_Serve2(void)__irq;

/*----------------------------------<   INT Initialization  >------------------------------*/
void ExtInt_Init2(void)
{PINSEL0  |= 0x80000000;
VICIntSelect = 0x00;	
	EXTMODE  |= 4;										//Edge sensitive mode on EINT2
	EXTPOLAR = 0;										//Falling Edge Sensitive
																			//Enable EINT2 on P0.15
	VICVectCntl1 = 0x20 | 16;							//Use VIC0 for EINT2 ; 16 is index of EINT2
	VICVectAddr1 = (unsigned long) ExtInt_Serve2;					//Set Interrupt Vec Addr in VIC0
	VICIntEnable |= 1<<16;								//Enable EINT2
}

 void DelayMs(unsigned int count) 	
{  
						
									
    unsigned int i,j;		       	
    for(i=0;i<count;i++)
	{
		for(j=0;j<1000;j++);
	}

}

void main()
{
	PINSEL0  |= 0x80000000;	
	IO0DIR = 0X000000ff;
	
	ExtInt_Init2();							//Initialize Interrupt 2
	
	
	
}

void ExtInt_Serve2()__irq
{
	
	IOSET0=0X000000ff;
	
	
	EXTINT |= 4;
	VICVectAddr = 0;
}
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top