This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to enable GPIO PIN interrupt in LPC1837

Hi,

I am trying to enable GPIO PIN interrupts using following procedure, But not getting why flags in IST itself not setting.

Please anyone point what went wrong here

my code:

NVIC_DisableIRQ(PIN_INT0_IRQn); NVIC_DisableIRQ(PIN_INT1_IRQn);

/* enbale tx interrupt, rx interrupt for module 0 */ SCU_PinInterruptSourceSelect(0x00, 0x06, 0x00); SCU_PinInterruptSourceSelect(0x01, 0x06, 0x02);

/* enable edge interrupt */

LPC_GPIO_PIN_INT->ISEL = 0x00UL;

/* enable rising edge 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 falling edge interrupt */

LPC_GPIO_PIN_INT->IENF = (GPIO_PIN_INT_IENF_ENAF0_Msk | GPIO_PIN_INT_IENF_ENAF0_Msk);

LPC_GPIO_PIN_INT->SIENF = (GPIO_PIN_INT_SIENF_SETENAF0_Msk | GPIO_PIN_INT_SIENF_SETENAF1_Msk );

/* Clear pending interrupt of pin interrupt 1*/ NVIC->ICPR[(((uint32_t)(int32_t)(0x21)) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)(0x21)) & 0x1FUL)); /* set priority for pin interrupt 1 */ NVIC_SetPriority(0x21, 1); /* enable pin interrupt - 0x21 */ NVIC->ISER[(((0x21)) >> 5UL)] = (uint32_t)(1UL << (((0x21)) & 0x1FUL));

Parents
  • Pon alagappan,

    If you were to be presented with a piece of paper showing something like you've given, would you be prepared to look at it?

    I have neither the time nor inclination to spend time reading such an awfully formatted post.

Reply
  • Pon alagappan,

    If you were to be presented with a piece of paper showing something like you've given, would you be prepared to look at it?

    I have neither the time nor inclination to spend time reading such an awfully formatted post.

Children
No data