Hi I'm working with keil And I'm going to use a GPIO interrupt. And the pin PIO0_1 I wrote this program
#include <LPC13xx.h>
void PIOINT0_IRQHandler(void) { LPC_GPIO2->DATA=0xaaa; LPC_GPIO0->IC = (1<<1); }
int main(void){
LPC_GPIO0->DIR = 0x000; LPC_GPIO2->DIR = 0xfff;
LPC_GPIO0->IS = 0x0; LPC_GPIO0->IBE = 0x2; LPC_GPIO0->IEV = 0x0; LPC_GPIO0->IE = 0x2;
NVIC_SetPriority(EINT0_IRQn,0); NVIC_EnableIRQ(EINT0_IRQn);
while(1){ LPC_GPIO2->DATA=0xf0f; LPC_GPIO2->DATA=0x0f0; }
}
But it does not work in keil simulator. Anyone knows the problem? Thanks.
-> But it still does not work.
How do you know that, it does NOT work?
By a LED? By a Debugger/break-point?
Based on your picture, not only GPIO0RIS is set for P0.1. GPIO0MIS is also set for P0.1. Bits read HIGH in the GPIOMIS register reflect the status of the input lines triggering an interrupt.
Maybe, show me the picture of NVIC.