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

GPIO 24 voltage high low status

Hello,

I am using sdk 12.2.2 and nrf52 customised board. Now my challenge is as follows.

When I am adding this in my code.

nrf_gpio_cfg_output(26);
nrf_gpio_pin_write(26, 1);

pinread1 = nrf_gpio_pin_out_read(26);
NRF_LOG_INFO("pinread status 26 %d \r\n", pinread1);

I am getting pinread1 status as 1 in logs but when I am manually checking the status of this pin with  multimeter I am getting 1.2V. My battery is providing 2.8V.

What can be the issue in this?

Thanks,

Parents Reply Children
  • You are using standard drive if using the defaults, like this:

    __STATIC_INLINE void nrf_gpio_cfg_output(uint32_t pin_number)
    {
        nrf_gpio_cfg(
            pin_number,
            NRF_GPIO_PIN_DIR_OUTPUT,
            NRF_GPIO_PIN_INPUT_DISCONNECT,
            NRF_GPIO_PIN_NOPULL,
            NRF_GPIO_PIN_S0S1,
            NRF_GPIO_PIN_NOSENSE);
    }
    

    As a test, give it some wellie; if the voltage doesn't increase something is clamping it perhaps

        nrf_gpio_cfg(LED_GREEN_PIN,           // 24 eg. LED_GREEN
                     NRF_GPIO_PIN_DIR_OUTPUT,
                     NRF_GPIO_PIN_INPUT_DISCONNECT,
                     NRF_GPIO_PIN_NOPULL,
                     NRF_GPIO_PIN_H1S0,       // Require High Drive high level
                     NRF_GPIO_PIN_NOSENSE);
    

    You could also add NRF_GPIO_PIN_PULLUP; if that increases the voltage you may have lost the FET to 2.8V on that pin. As an aside, I use that pin on the same package without issue. Also nrf_gpio_pin_out_read() does not of course read the status of the actual hardware pin, just the output register bit which is supposed to drive the pin.

Related