Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

External Interrupt (ENT1) not working properly in LPC2294

Status
Not open for further replies.

radhe_nerist

Newbie level 2
Joined
Apr 29, 2011
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,300
Dear Freinds,
I have designed a board using LPC2294 microcontroller in that I have written a program to test the external interrupt(ENT1) functionality. while during debugging, I am seeing that even after giving external interrupt in interrupt PIN P0.14(ENT1), my program is not jumping to ISR. It remains in main loop only. I am seeing that in debbugging mode the interrupt register shows that ENT1 flag is set means interrupt has occured but it is not jumping to ISR.
My code written is as follows:

#include<LPC22XX.h>
#include<stdio.h>

void external(void) __irq; // Interrupt subroutine declaration

unsigned int x = 0x00400000;

int main(void)
{


IOSET1 = 0xffffffff;
PINSEL0 = PINSEL0 | 0x20000000; ///////////ENT1 = Pin P0.14////////
EXTMODE = 0x00000000;
EXTPOLAR = 0x00000000;


VICVectAddr0 = (unsigned long) external ;
VICVectCntl0 = 0x0000002f ;
VICIntEnable = VICIntEnable | 0x00008000;

IO0DIR = x; // GPIO toggling
IO0CLR = x; // GPIO toggling


while(1)
{
IOSET1 = 0xffffffff; // GPIO toggling
IOCLR1 = 0xffffffff; // GPIO toggling

}



}

void external(void) __irq // External Interrupt subroutine
{
IO0SET = x; // GPIO toggling
IO0CLR = x; // GPIO toggling

EXTINT = 0x00000002;
VICVectAddr = 0x00000000;
}


can anybody help me????? Please............
 

radhe_nerist

Newbie level 2
Joined
Apr 29, 2011
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,300
Hi freinds ,
I have got the solution... Actually I am using Keil for debugging .. I was using single step debugging mode in that it show interrupt occurence but it does not jump to subroutine... So I am using RUN in which program will be running continuosly.. There it is going to subroutine..
 

alexan_e

Administrator
Joined
Mar 16, 2008
Messages
11,895
Helped
2,021
Reputation
4,158
Reaction score
2,031
Trophy points
1,393
Location
Greece
Activity points
64,377
The code works the same in single step and in the run mode, if you change the pin state to give an interrupt then you will see that in the next few steps the execution will enter the interrupt.
The other way is to use the run as you say and put a breakpoint in the first line of the interrupt so that execution stops when the execution enters the interrupt and you can proceed with step execution to check your code.

Alex
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top