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

Achieving low power states for GPIO pins

On page 143 of the datasheet the following is written, "The input buffer of a GPIO pin can be disconnected from the pin to enable power savings when the pin is
not used as an input,"  . So if we configure a pin to be an output we haven't acheived the lowest power state unless we take this extra step? I'm confused about what are the lowest power settings for each GPIO (input or output). Our products are battery powered so I want to achieve the lowest power states for eah pin. Thank you.

Parents
  • Hi John.

    If you configure a GPIO pin as default, you should achieve the lowest power state if you used the function nrf_gpio_cfg_default(uint32_t pin_number);

    In SDK 15.2, this functions sets the following configuration:

    __STATIC_INLINE void nrf_gpio_cfg_default(uint32_t pin_number)
    {
        nrf_gpio_cfg(
            pin_number,
            NRF_GPIO_PIN_DIR_INPUT,
            NRF_GPIO_PIN_INPUT_DISCONNECT,
            NRF_GPIO_PIN_NOPULL,
            NRF_GPIO_PIN_S0S1,
            NRF_GPIO_PIN_NOSENSE);
    }

    Where the following configuration is needed for low power:

    NRF_GPIO_PIN_DIR_INPUT sets the pin as an input.
    NRF_GPIO_PIN_INPUT_DISCONNECT disconnects the input buffer.
    NRF_GPIO_PIN_NOPULL disables the pin pull-up resistor.

    If you havnt used the pin for anything, this is how its already configured, as this is the reset configuration.

    - Andreas

Reply
  • Hi John.

    If you configure a GPIO pin as default, you should achieve the lowest power state if you used the function nrf_gpio_cfg_default(uint32_t pin_number);

    In SDK 15.2, this functions sets the following configuration:

    __STATIC_INLINE void nrf_gpio_cfg_default(uint32_t pin_number)
    {
        nrf_gpio_cfg(
            pin_number,
            NRF_GPIO_PIN_DIR_INPUT,
            NRF_GPIO_PIN_INPUT_DISCONNECT,
            NRF_GPIO_PIN_NOPULL,
            NRF_GPIO_PIN_S0S1,
            NRF_GPIO_PIN_NOSENSE);
    }

    Where the following configuration is needed for low power:

    NRF_GPIO_PIN_DIR_INPUT sets the pin as an input.
    NRF_GPIO_PIN_INPUT_DISCONNECT disconnects the input buffer.
    NRF_GPIO_PIN_NOPULL disables the pin pull-up resistor.

    If you havnt used the pin for anything, this is how its already configured, as this is the reset configuration.

    - Andreas

Children
No Data
Related