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

Proper method to disconnect (and connect) an NRF52 input (configured via GPIOTE)

The NRF52 product spec suggests: "The input buffer of a GPIO pin can be disconnected from the pin to enable power savings"

I've found that gpio.h provides the function: nrf_gpio_input_disconnect(pin)

However this function doesn't appear to change the power consumption state of my button (which continually draws 250uA when connected to GND).

If I instead use: nrf_gpio_cfg_output(pin)

I get the desired power savings.

Q1. Not sure what "else" is required (or set) to properly disconnect this input when not needed. Could you advise of the proper way to "disconnect" an input that is configured for GPIOTE?

Q2. What is the proper way then, to connect the input and resume GPIOTE sense functionality?

I am using the S132 5.0 softdevice, and SDK 14.

  • 250uA is not caused by the input buffer. 250uA sounds more like you have configured a pull-up resistor on the GPIO pin and that the button is constantly pulling the pin to GND.

    Can you please describe how you configured the GPIO, and also describe how the button is connected to the chip/pcb?

  • Correct -- I didn't mean to imply 250uA caused by input buffer.

    You are right, we have a pull-up which will sink to ground through the button/switch and draw 250uA when made. This input is configured via a call to : nrf_drv_gpiote_in_init() with input config set to PULLUP and GPIOTE_CONFIG_IN_SENSE_TOGGLE(false).

    If I call nrf_gpio_input_disconnect(pin), it doesn't seem to disconnect this input. If I call nrf_gpio_cfg_output(pin), it does, and I get no current flow.

    While it seems like a valid work around, I'm just not sure what "else" is happening and if by configuring as an OUTPUT, perhaps some other state is not ideal.

    Moreover, I'd like to understand the proper method to turn this input back on (reconfigure as input) and enable GPIOTE sense & interrupt capabilities properly.

Related