GPIO Interrupt - LPC1788

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

GPIO Interrupt - LPC1788

748 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mahdiafpr on Sat May 04 05:23:07 MST 2013
<p style="font-size: 13px; padding: 0px; margin: 16px 0px; font-family: verdana, sans-serif; line-height: normal;">InThe Name Of Allah
<p style="font-size: 13px; padding: 0px; margin: 16px 0px; font-family: verdana, sans-serif; line-height: normal;">Hi
<p style="font-size: 13px; padding: 0px; margin: 16px 0px; font-family: verdana, sans-serif; line-height: normal;">I was Downloaded LPC1788 CMSIS and use GPIO Interrupt Project and run keil Debugger.
<p style="font-size: 13px; padding: 0px; margin: 16px 0px; font-family: verdana, sans-serif; line-height: normal;">Problem is that GPIO Handler Never Call.
<p style="font-size: 13px; padding: 0px; margin: 16px 0px; font-family: verdana, sans-serif; line-height: normal;">NVIC_SetPriority(GPIO_IRQn, 1);
NVIC_EnableIRQ(GPIO_IRQn);
GPIO_IntCmd(2, 1&lt;&lt;9, 1);
<p style="font-size: 13px; padding: 0px; margin: 16px 0px; font-family: verdana, sans-serif; line-height: normal;">but with Software Trriger, GPIO Handler called :
<p style="font-size: 13px; padding: 0px; margin: 16px 0px; font-family: verdana, sans-serif; line-height: normal;">NVIC-&gt;STIR = GPIO_IRQn;

Original Attachment has been moved to: GPIO%20Interrupt.rar

标签 (1)
0 项奖励
回复
1 回复

446 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wmues on Mon May 06 02:01:50 MST 2013

I have used GPIO interrupt with the following code:


LPC_IOCON-&gt;P2_9 = 0x30;   // Setup P2.9 as Input with Hysterese


// Interrupts for Rising AND falling edge


LPC_GPIOINT-&gt;IO2IntEnR = (1 &lt;&lt; 9);


LPC_GPIOINT-&gt;IO2IntEnF = (1 &lt;&lt; 9);


// Enable Interrupt
NVIC_EnableIRQ(GPIO_IRQn);


 


void __attribute__ ((interrupt)) GPIO_IRQHandler(void)
{
     // do something


     // Reset all Interrupt Flags


    LPC_GPIOINT-&gt;IO0IntClr = 0xFFFFFFFF;
    LPC_GPIOINT-&gt;IO2IntClr = 0xFFFFFFFF;
}




0 项奖励
回复