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

ON/OFF Led with PULL_UP/NO_PULL resistance

Hi everyone,
I have a custom board using nRF52832 chip.

I want to turn ON and OFF a LED, which is directly connected to a GPIO pin.


Using this configuration I expect that passing the following instruction to set it as an output

#define LED   NRF_GPIO_PIN_MAP(0,10)
nrf_gpio_cfg_output(LED);

and the following instruction

nrf_gpio_pin_set(LED);

the LED will turn ON, but this doesn't happen.
Otherwise, I have discovered that it turns ON if I use the internal Pull Up resistor:

nrf_gpio_cfg(LED,
             NRF_GPIO_PIN_DIR_OUTPUT,
             NRF_GPIO_PIN_INPUT_DISCONNECT,
             NRF_GPIO_PIN_PULLUP,
             NRF_GPIO_PIN_S0S1,
             NRF_GPIO_PIN_NOSENSE);

and it turns OFF when I disconnect the Pull Up resistor:

nrf_gpio_cfg(LED,
             NRF_GPIO_PIN_DIR_OUTPUT,
             NRF_GPIO_PIN_INPUT_DISCONNECT,
             NRF_GPIO_PIN_NOPULL,
             NRF_GPIO_PIN_S0S1,
             NRF_GPIO_PIN_NOSENSE);

I'm not understanding this behavior..

The nRF52832 chip is supplied by 3.3V and I should get 3.3V at GPIO pin when the LED is ON, but I get just 2.7V.

Is there some reason that explain these strange behaviors?

Related