AnsweredAssumed Answered

Could anyone tell me the sequence of operation to be followed in GPIO PIN interrupt in LPC1837

Question asked by pon alagappan on Sep 22, 2016
Latest reply on Sep 27, 2016 by pon alagappan

I am using LPC1837, i need to enable active low interrupt in individual GPIO PIN.

 

 

 

/* enable GPIO port clock */

GPIO_PortClock(1);

 

/* Set GPIO6[0]  pin and GPIO6[2] as input */
GPIO_SetDir(6,0,GPIO_DIR_INPUT);
GPIO_SetDir(6,2,GPIO_DIR_INPUT);

 

/* enable pin as GPIO Mode pin in pin multiplexing*/
SCU_PinConfigure(0xC,1,( SCU_CFG_MODE_FUNC4 | SCU_SFS_EPUN | SCU_SFS_ZIF ));

SCU_PinConfigure(0xC,3,( SCU_CFG_MODE_FUNC4 | SCU_SFS_EPUN | SCU_SFS_ZIF ));

 

/* set values for PINTSEL0 to choose GPIO Port 6,pin no 0 on INTPIN0 */
SCU_PinInterruptSourceSelect(0x00, 0x06, 0x00);

/* set values for PINTSEL0 to choose GPIO Port 6,pin no 2 on INTPIN1 */
SCU_PinInterruptSourceSelect(0x01, 0x06, 0x02);

/* enable level interrupt */

LPC_GPIO_PIN_INT->ISEL = (GPIO_PIN_INT_ISEL_PMODE0_Msk |
GPIO_PIN_INT_ISEL_PMODE1_Msk);

/* enable level interrupt */

LPC_GPIO_PIN_INT->IENR = (GPIO_PIN_INT_IENR_ENRL0_Msk |
GPIO_PIN_INT_IENR_ENRL1_Msk );


LPC_GPIO_PIN_INT->SIENR = ( GPIO_PIN_INT_SIENR_SETENRL0_Msk |
GPIO_PIN_INT_SIENR_SETENRL1_Msk );


/* enable active LOW interrupt */


LPC_GPIO_PIN_INT->IENF = 0x00UL;

LPC_GPIO_PIN_INT->CIENF = (GPIO_PIN_INT_CIENF_CENAF0_Msk |
GPIO_PIN_INT_CIENF_CENAF1_Msk );




/* enable active HIGH level interrupt */

/*
LPC_GPIO_PIN_INT->IENF = ( GPIO_PIN_INT_IENF_ENAF0_Msk |
GPIO_PIN_INT_IENF_ENAF1_Msk );

LPC_GPIO_PIN_INT->SIENF = (GPIO_PIN_INT_SIENF_SETENAF0_Msk |
GPIO_PIN_INT_SIENF_SETENAF1_Msk );

*/


// NVIC->ICPR[(((uint32_t)(int32_t)33) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)33) & 0x1FUL));

NVIC->ISER[(((uint32_t)(int32_t)33) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)33) & 0x1FUL));

Outcomes