lpcware

Group GPIO input interrupt for Two pins (or more) cannot trigger well.

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by kitahei88 on Sun Jul 12 07:26:09 MST 2015
Hello.
I'm using LPCxpresso1549.
I have problem for Group GPIO interrupt setting.
I want to make timing logging for multiple buttons with GINT.

I tested GINT for only one button , get on/off condition, It worked well.
The button is pulled up and set GINT for edge trigger .GINT0 is falling edge and GINT1 is rising edge.

Next , I expand the code for multiple buttons ,like below.


extern "C" void GINT0_IRQHandler(void)
{
        LPC_GINT0->CTRL |= (1<<0);      // clear interrupt status
        //
        Code like LED1 toggle.
        //
}
   
extern "C" void GINT1_IRQHandler(void)
{
        LPC_GINT1->CTRL |= (1<<0);      // clear interrupt status
        //
        Code for LED2 toggle
        //
}


void gint_init(void)
{
    LPC_SYSCON->SYSAHBCLKCTRL0 |= (1 << 19);                // enable GINT

    LPC_GINT0->PORT_ENA[0] = 0x0000FFFF ; // port 0 16pins(expand)
    LPC_GINT0->PORT_POL[0] = 0xFFFF0000;  // falling edge
    LPC_GINT0->CTRL |= (1<<0) | (0<<2);      // interrupt active, OR condition , edge trigger
   

    LPC_GINT1->PORT_ENA[0] = 0x0000FFFF ; // port 0 16pin(expand)
    LPC_GINT1->PORT_POL[0] = 0xFFFFFFFF;  // rising edge
    LPC_GINT1->CTRL |= (1<<0) | (0<<2) ;      // interrupt active, OR condition , edge trigger
    NVIC_EnableIRQ(GINT0_IRQn);                             // enable GINT0 interrupt
    NVIC_EnableIRQ(GINT1_IRQn);                             // enable GINT1 interrupt
}


This code cannot work well.
I push one button , GINT0 interrupt was triggered, BUT press and hold the button , then press another button , interrupt was not triggered.

I found that same problem was occurred for LPC43xx
https://www.lpcware.com/content/forum/lpc43xx-gpio-group-interrupt

So LPC15xx or LPC43xx cannot do such things?
Should I use another MCU like LPC17xx?

Outcomes