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

Can't configure 2 gpio pins with opposite pull state

Hi,

I try configure 2 gpio pins with opposite pull state, one NRF_GPIO_PIN_PULLUP, other NRF_GPIO_PIN_PULLDOWN:

nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_LOTOHI(false);
in_config.pull = NRF_GPIO_PIN_PULLUP; 
err_code = nrf_drv_gpiote_in_init(PIN_BUTTON, &in_config, button_handler);
APP_ERROR_CHECK(err_code);
nrf_drv_gpiote_in_event_enable(PIN_BUTTON, true);

nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_LOTOHI(false);
in_config.pull = NRF_GPIO_PIN_PULLDOWN;
err_code = nrf_drv_gpiote_in_init(PIN_IMPULSE, &in_config, impulse_handler);
APP_ERROR_CHECK(err_code);
nrf_drv_gpiote_in_event_enable(PIN_IMPULSE, true);

But, callback don`t called.

If I configure with same pull state, then callback is called.

Why is this occurs? How to set up pins with diffrent pull state?

Thank you!

Parents
  • Hello,

    That sounds strange.
    Could you detail your issue some more: 

    But, callback don`t called.

    How are you testing this, and how does it behave differently than expected? I just want to make sure that I have understood you correctly.
    Could you also share the callback code, which is / is not being called?

    Why is this occurs? How to set up pins with diffrent pull state?

    Which pins on the nRF52832 are you using, and what are they connected to?
    Are you working with a nRF52 DK, or a custom board?

    Looking forward to resolving this issue together!

    Best regards,
    Karl 

  • Hello, Karl!

    Callback code, for example:

    void button_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
    {
       NRF_LOG_INFO("button_handler %d %d", pin, action);
       nrf_gpio_pin_toggle(PIN_LED);
    }
    
    void impulse_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
    {
       NRF_LOG_INFO("impulse_handler %d %d", pin, action);
    }

    If I configure 1(any) gpio pin then corresponding callback called(log is displayed). 

    PIN_BUTTON - 25

    PIN_IMPULSE - 9 (I use CONFIG_NFCT_PINS_AS_GPIOS define)

    I use custom board:

     

     

Reply
  • Hello, Karl!

    Callback code, for example:

    void button_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
    {
       NRF_LOG_INFO("button_handler %d %d", pin, action);
       nrf_gpio_pin_toggle(PIN_LED);
    }
    
    void impulse_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
    {
       NRF_LOG_INFO("impulse_handler %d %d", pin, action);
    }

    If I configure 1(any) gpio pin then corresponding callback called(log is displayed). 

    PIN_BUTTON - 25

    PIN_IMPULSE - 9 (I use CONFIG_NFCT_PINS_AS_GPIOS define)

    I use custom board:

     

     

Children
No Data
Related