JTAG & Interrupt Problem on LPC2138...

hi im new for programming with JTAG.

i want to learn how to use interrupt in my board LPC2138…

but it always can’t worked.

this is the code :

char pin;

void EXTINTVectoredIRQ(void) {

pin = 13;

EXTINT = 0x00000002;

VICVectAddr = 0x00000000; //clear interrupt

}

int main(void){

PINSEL0 =0x20000000; //set P0.14 as EINT1

VICIntSelect &= ~0x8000; // int 1 interrupt is an IRQ interrupt

VICIntEnable = 0x8000; // Enable int 1 interrupt

VICVectCntl1 = 0x2F; // Use slot 1 for int 1 interrupt

VICVectAddr1 = (unsigned)EXTINTVectoredIRQ;

pin=12;

while(1){

IO0DIR |= 1<<pin;

IO0CLR=1<<pin;

delay(500000);

IO0SET=1<<pin;

delay(500000);

}

}

i used LPC P2138.

this code is always blink the LED in pin 12. when an INT1 is active, the blinking LED is move to pin 13.

that’s any problem with JTAG, or my code?

i tried to give ‘1’ to INT1(P0.14) but nothing happens…

please help me to solve this problem…

thx u so muchh…

Your leds are blinking correctly, in accordance to what is written in your code.

The IO0CLR and IO0SET toggles pin reffered by the variable ‘pin’ with your statment 1<<pin. In the main code, pin=12, after the interrupt, pin becomes 13. The toggling pin nr is 12 before interrupt, and 13 after the interrupt. It remains 13 as there is no pin=12 anymore.

Angelo