Interrupt falling edges LPC1114

cancel
Showing results for 
Search instead for 
Did you mean: 

Interrupt falling edges LPC1114

211 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drvrh on Wed Jul 22 01:38:19 MST 2015
Hello I must moving my project from LPC1769 to LPC1114 and I don't know how to set interrupt.

in LPC1769 I have:

//interrupt initialization
void IOIntInit(){
LPC_GPIOINT -> IO0IntEnF = (1 << UPbutton_PIN) | (1 << MENUTIPKA_PIN) | (1 << HOLDTIPKA_PIN) | (1 << EXITTIPKA_PIN) | (1 << LEFTTIPKA_PIN);
NVIC_EnableIRQ(EINT3_IRQn);
}


void EINT3_IRQHandler(void){
counter1++;
if((LPC_GPIOINT -> IO0IntStatF) & (1 << UPTbutton_PIN)){
if(counter1 == 1){
__disable_irq();
_delay_ms(150);
LPC_GPIOINT -> IO0IntClr |= (1 << UPbutton_PIN);
flagIO1 = 1;
......
.....
....


And now I don't know how I set interrupt with falling edge detect for LPC1114.

     void IOIntInit(){
//interrupt initialization
     LPC_GPIO0 -> IE = (1 << UPbutton_PIN);
         NVIC_EnableIRQ(EINT0_IRQn); 
     }


But I have no Idea how detect falling edg with register IEV.

Labels (1)
0 Kudos
1 Reply

121 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Badman on Thu Aug 20 04:46:37 MST 2015
TRY whit this code, written with the head:

#include "LPC11xx.h"

void PIOINT0_IRQHandler(void)
{
if (LPC_GPIO0->MIS & (1<<UPbutton_PIN) )
{
LPC_GPIO0->IC |= (1<<UPbutton_PIN);  // clear interrupt for pin
}
}

int main(void) {
    volatile static int i = 0 ;

   /* INIT INT GPIO */
    LPC_GPIO0->IS = (1<<UPbutton_PIN);  // interrupt edge
    LPC_GPIO0->IEV &=  ~(1<<UPbutton_PIN);  // falling edge generate interrupt
    LPC_GPIO0->IE = (1<<UPbutton_PIN);   // permission to interrupt
    NVIC_EnableIRQ(EINT0_IRQn);

    while(1) {
        i++ ;
    }
    return 0 ;
}


0 Kudos