GPIO Interrupt - LPC1788

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GPIO Interrupt - LPC1788

620 Views
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

Labels (1)
0 Kudos
1 Reply

318 Views
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 Kudos