GPIO PIN interrupt is not working in LPC 1837

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

GPIO PIN interrupt is not working in LPC 1837

1,351 次查看
ponalagappan
Contributor III

Hi,

 

I am trying to use GPIO PIN interrupt in  lpc1837. i need active low interrupt. initially i set the GPIO port and pin in PINTSEL0 register and verified its value.

 

 

then doing with configuration registers ISEL,IENR and IENF  as follows 

/* 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 );

when i set the values for SIENR, it immediately sets the IST register PSTAT0 and PSTAT1 flag. but it should not happen. my hardware pin state is HIGH in normal, upon interrupt it provides LOW. 

Is that my way is correct of doing , any suggestions?

标记 (3)
0 项奖励
回复
1 回复

900 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi pon alagappan,

I'd highly recommend you to refer to the pinint demo which illustrates configure a pin interrupt as a falling edge interrupt.

2016-09-27_14-34-40.jpg

And you can download the LPCOpen through the link below.

LPCOpen Software for LPC18XX|NXP 


Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复