This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

NRF_GPIO_PIN_PULLUP is not recognized as 1

I have the following two lines with pin 21 not connected to anything:

nrf_gpio_cfg_input(21, NRF_GPIO_PIN_PULLUP);
uint32_t value = nrf_gpio_pin_read(21);

I would expect the "value" to be "1" but it is "0". When I measure voltage, I get 1.75 volts. I use NRF51822 AC (Waveshare Core51822 + BLE400 development board). I power it from 3.3v external source (laptop -> ST-Link V2 -> BLE400 -> Core51822).

What do I do wrong?

When I do

nrf_gpio_cfg_output(21);
nrf_gpio_pin_set(21);

I get 3.08 volts.

Related