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

Power off state of nRF51822 GPIOs

The nRF51 reference manual says that GPIO PIN_CNF registers are retained registers and that "a retained register is a register that will retain its value in system OFF mode, and through a reset depending on reset source."

I perhaps mistakenly took this to mean that if I set up a pin with a certain configuration, it would retain that configuration while power was removed from the chip. For instance, that if I set up a pin to have a pull up, that it would continue to be connected to the input power pin when all power was removed. Obviously, with no power connected to the chip, no voltage would be applied to the pin from the nRF side; but, it still be electrically connected (via resistor) to the positive supply line. Similarly for pull down (connected via a resistor to gnd), or for input disconnect (not connected to either -- floating).

I have an nRF51 GPIO pin that's connected to both an external device and a normally open push button, which is then connected to ground. This is intended to act as a momentary power switch. The external device provides a "weak internal pull-up forc[ing] a high state if [this pin] is left floating." This external device controls the power to the nRF chip. When the nRF51822 has power, and I set a pin as a pull up or pull down, or disconnect it, I observe the correct behavior. For instance, if I configure the pin as an input, I can read the state of the push button and I observe either 3.3V or 0 volts depending on the state of the push button. However, when the nRF51822 has all power removed, I read about 400mV on this pin when the button is open and 0V when closed.

I'm guessing that my understanding of "retained" is incorrect and that the power removed state of the GPIO pins is as a weak pulldown. I guess retained means that once power is reapplied to the chip and it resets, the pin goes back to having its pre-power off state (pull up, down, disconnect, etc). This makes sense now that I think about it since I guess the chip would need some power to retain the state of the transistors in the GPIO circuit.

Is this correct?

I've read this post, which helps, but, I'm still a little dense on what the IO circuit inside the nRF51 chip looks like, so I'm having trouble reasoning about it.

Thanks for helping my meager electronics understanding. :)

-c

Related