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.

lpc2129 external interrupt 1 rising edge not working

Status
Not open for further replies.

pcsandhya82

Member level 3
Joined
Jul 31, 2010
Messages
58
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Bangalore
Activity points
1,732
Hi,

I am trying to interface a PIR sensor to LPC2129. below is how I have configured the interrupt:

//
void ext(void) __irq //P0.3 as external interrupt 1
{

CMDWRT(0x01);
LCD_DATA_WR("OBJECT DETECTED");
motor_stop();
EXTINT=0X02; //clear interrupt flag
VICVectAddr = 0x00000000;
VICIntEnable |= 0x00008000;
}
// in main program
PINSEL0|=0X000000C0; // PINSEL0<7:0> =11
EXTPOLAR=0x00; // falling edge sensitive
EXTMODE=0x02; //edge sensitive
VICIntEnable = 0x00008000;
VICVectCntl10 = 0x0000002F;
VICVectAddr10=(unsigned)ext;

This is working fine and executing ISR when falling edge occurs on P0.3

But since the sensor output is high, I would like it to execute ISR on rising edge. So I changed the setting of EXTPOLAR to =0x02; // rising edge sensitive

But its not working. I cant find out any configurations that i have missed out. Read the errata on VPBDIV and EINT1, and tried the below code:

unsigned char vpb;
vpb = VPBDIV ;
VPBDIV = 0x00;
EXTPOLAR=0x02; // falling edge sensitive
EXTMODE=0x02;
VPBDIV = vpb;

This also doesnt work.

Can someone please help?

Thanks.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top