Hi,
I have enabled external interrupts on the pin 6 of Port0 of LPC1313 using the following steps-
(I am using the LPCOpen library for this.)
Chip_GPIO_SetPinDIRInput(LPC_GPIO_PORT, 0, 6);
Chip_GPIO_SetPinModeEdge(LPC_GPIO_PORT, 0, 64);
Chip_GPIO_SetEdgeModeSingle(LPC_GPIO_PORT, 0, 64);
Chip_GPIO_SetupPinInt(LPC_GPIO_PORT, 0, 6, GPIO_INT_RISING_EDGE);
Chip_GPIO_EnableInt(LPC_GPIO_PORT, 0, 64);
NVIC_ClearPendingIRQ(EINT0_IRQn);
NVIC_EnableIRQ(EINT0_IRQn);
There is no activity on the specified GPIO pin during this time (also verified in the DATA register for that port). However, as soon as the NVIC_EnableIRQ(EINT0_IRQn); command is executed, an interrupt seems to have occurred and the program goes to the PIOINT0_IRQHandler.
Please tell me why an interrupt is getting registered on enabling and if there is a workaround to avoid this case.
Thanks and Regards,
Prachi