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

please why nrf52832 gpio does not produce Interrupt

Here is my program:

#define EXIT_PIN       31

void EXIT_Init(void)
{

nrf_gpio_cfg_input(EXIT_PIN,GPIO_PIN_CNF_PULL_Pullup);


NVIC_EnableIRQ(GPIOTE_IRQn);

NRF_GPIOTE->CONFIG[0] = (GPIOTE_CONFIG_POLARITY_HiToLo << GPIOTE_CONFIG_POLARITY_Pos)
| (EXIT_PIN << GPIOTE_CONFIG_PSEL_Pos)
| (GPIOTE_CONFIG_MODE_Event << GPIOTE_CONFIG_MODE_Pos);

NRF_GPIOTE->INTENSET = GPIOTE_INTENSET_IN0_Set << GPIOTE_INTENSET_IN0_Pos;// ʹÄÜÖжÏÀàÐÍ:
}


void GPIOTE_IRQHandler(void)
{

    if ((NRF_GPIOTE->EVENTS_IN[0] == 1) && (NRF_GPIOTE->INTENSET & GPIOTE_INTENSET_IN0_Msk))
    {
         NRF_GPIOTE->EVENTS_IN[0] = 0;

    }

}

but  Program cannot enter interrupt,i Looking at it with an oscilloscope, there is no low level。but i use Query ,Looking at it with an oscilloscope, there is have low level. it works ok.

EXIT_PIN   is the pin which if data is ok ,Another device Pulls EXIT_PIN's level down.

Thanks very much.

Parents Reply Children
No Data
Related