This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

GPIO interrupt has no response

Hi,

there is a issue very strange, on a nrf52832 project, it use two gpio set to sense low level, one is p18, one is p29,  I found there is no response for low level of p29, and when disable sense of p18, it works well(p29 responses to low level), also I set p18 to high sense input, p29 is also no response,  actually there is another sense input(p07) on the board, and it seems no relations to p29 interrupt

can you give me a trip to trace the problem?

Brian

Parents
  • What have you configured GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS to?

    I assume you are using gpiote driver for all configuration of sense input?

    Best regards,
    Kenneth

  • I did't use gpiote driver, I just set pin for sense input and enable gpiote irq, then check pin status at interrupt.

    1. config sense input

    nrf_gpio_cfg_sense_input(29_PIN,NRF_GPIO_PIN_PULLUP,NRF_GPIO_PIN_SENSE_LOW);
    nrf_gpio_cfg_sense_input(18,NRF_GPIO_PIN_PULLUP,NRF_GPIO_PIN_SENSE_LOW);

    NRF_GPIOTE->INTENCLR = 0xFFFFFFFF;
    NVIC_ClearPendingIRQ(GPIOTE_IRQn);
    NVIC_SetPriority(GPIOTE_IRQn, APP_IRQ_PRIORITY_LOW);
    NRF_GPIOTE->INTENSET = GPIOTE_INTENSET_PORT_Msk;
    NVIC_EnableIRQ(GPIOTE_IRQn);
    NRF_GPIOTE->EVENTS_PORT = 0;

    2. check key status at interrupt

    void GPIOTE_IRQHandler(void)
    {
    uint32_t port_data = NRF_GPIO->IN;
    if ( NRF_GPIOTE->EVENTS_PORT ) {

    NRF_GPIOTE->EVENTS_PORT = 0;

    if(((~port_data) & (1<<18))== (1<<18))
    {
    //handle of p18 irq
    }

    if(((~port_data) & (1<<29))== (1<<29))
    {
    //handle of p29 irq
    }

    NRF_GPIOTE->EVENTS_PORT = 0;

    }
    }

Reply
  • I did't use gpiote driver, I just set pin for sense input and enable gpiote irq, then check pin status at interrupt.

    1. config sense input

    nrf_gpio_cfg_sense_input(29_PIN,NRF_GPIO_PIN_PULLUP,NRF_GPIO_PIN_SENSE_LOW);
    nrf_gpio_cfg_sense_input(18,NRF_GPIO_PIN_PULLUP,NRF_GPIO_PIN_SENSE_LOW);

    NRF_GPIOTE->INTENCLR = 0xFFFFFFFF;
    NVIC_ClearPendingIRQ(GPIOTE_IRQn);
    NVIC_SetPriority(GPIOTE_IRQn, APP_IRQ_PRIORITY_LOW);
    NRF_GPIOTE->INTENSET = GPIOTE_INTENSET_PORT_Msk;
    NVIC_EnableIRQ(GPIOTE_IRQn);
    NRF_GPIOTE->EVENTS_PORT = 0;

    2. check key status at interrupt

    void GPIOTE_IRQHandler(void)
    {
    uint32_t port_data = NRF_GPIO->IN;
    if ( NRF_GPIOTE->EVENTS_PORT ) {

    NRF_GPIOTE->EVENTS_PORT = 0;

    if(((~port_data) & (1<<18))== (1<<18))
    {
    //handle of p18 irq
    }

    if(((~port_data) & (1<<29))== (1<<29))
    {
    //handle of p29 irq
    }

    NRF_GPIOTE->EVENTS_PORT = 0;

    }
    }

Children
Related