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

nRF51822: How to set pin as Floating?

How can I set a gpio pin as floating? I am not sure what the correct pin configuration should be in order to leave it floating.

  • I'm not quite sure I understand what you mean by floating, but if you have it as an input pin, the nRF51822 wil not drive it to any level. If it's also not driven externally, I'd then call it "floating".

    I would however strongly recommend you to not leave any pins floating in a final design. If you're not using the GPIO for anything, you leave it at "Input buffer disconnected", which is the default setting, i.e.

    
    NRF_GPIO->PIN_CNF[pin_number] = GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos;
    
    
Related