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

Problem!!! GPIOTE callback issue in nRF51822...

Hello All,

Greetings!!!

I am working on nRF51822. I am used custom board. For reference i used nRF52 SDk 8.1.0 in IAR.

Right now i am use gpio pin as an interrupt pin and initialized as like below,

void gpiote_init()
{
uint32_t err_code;

if(!nrf_drv_gpiote_is_init())
{
err_code = nrf_drv_gpiote_init();
APP_ERROR_CHECK(err_code);
}

nrf_drv_gpiote_in_config_t config_in = GPIOTE_CONFIG_IN_SENSE_LOTOHI(true);
//nrf_drv_gpiote_in_config_t config_in1 = GPIOTE_CONFIG_IN_SENSE_HITOLO(true);

config_in.pull = NRF_GPIO_PIN_PULLUP;

err_code = nrf_drv_gpiote_in_init(rpm_pin, &config_in, gpiote_callback);
APP_ERROR_CHECK(err_code);

nrf_drv_gpiote_in_event_enable(rpm_pin, true);
}

My problem is gpiote callback function is not getting call.

So please give me solution as soon as possible.

Thanks & regards,

Urvisha Andani  

  • Hi,

     

     

    nrf_drv_gpiote_in_config_t config_in = GPIOTE_CONFIG_IN_SENSE_LOTOHI(true);
    //nrf_drv_gpiote_in_config_t config_in1 = GPIOTE_CONFIG_IN_SENSE_HITOLO(true);

    config_in.pull = NRF_GPIO_PIN_PULLUP;

    In this configuration, it assumes that your button is active low. Is that the case? If not, you should configure the .pull = NRF_GPIO_PIN_PULLDOWN;

      

    rpm_pin

    What GPIO is this? Have you ensured that no other module/driver in your system uses the same GPIO?

     

    Kind regards,

    Håkon 

Related