Skip to main content
Senior
April 28, 2020
Solved

The behavior of the​ gpio pin when powering on and powering off

  • April 28, 2020
  • 2 replies
  • 1789 views

This question may applied to the whole STM family and maybe pure hardware related, but I expect someone can give some clues.

  1. May I safely assume the gpio pins are ​high impedance when powering on?
  2. If I set pin to output, and output a high. Then, the power supply goes down. I expect the output will track the power supply till some point, that the pin can't retain output state anymore. Am I right? If so, when the point will occur, what's the supply voltage then?
  3. Similar to above, but this time set the pin low. What's the point I can't safely assume the pin is low?

Thanks.​

This topic has been closed for replies.
Best answer by TDK

> May I safely assume the gpio pins are ​high impedance when powering on?

Most pins are in input mode, which is floating. Some pins associated with JTAG/SWD are not floating.

> If I set pin to output, and output a high. Then, the power supply goes down. I expect the output will track the power supply till some point, that the pin can't retain output state anymore. Am I right? If so, when the point will occur, what's the supply voltage then?

Yep. The brown-out reset (BOR) is configurable and kicks in at various states, but generally around 1.8V. Once in reset, pins are in their reset state.

> Similar to above, but this time set the pin low. What's the point I can't safely assume the pin is low?

Same as above.

2 replies

TDK
TDKBest answer
April 29, 2020

> May I safely assume the gpio pins are ​high impedance when powering on?

Most pins are in input mode, which is floating. Some pins associated with JTAG/SWD are not floating.

> If I set pin to output, and output a high. Then, the power supply goes down. I expect the output will track the power supply till some point, that the pin can't retain output state anymore. Am I right? If so, when the point will occur, what's the supply voltage then?

Yep. The brown-out reset (BOR) is configurable and kicks in at various states, but generally around 1.8V. Once in reset, pins are in their reset state.

> Similar to above, but this time set the pin low. What's the point I can't safely assume the pin is low?

Same as above.

"If you feel a post has answered your question, please click ""Accept as Solution""."
berendi
Principal
April 29, 2020

Check the reset values of the GPIO registers in the reference manual to see which pins have pullup or pulldown enabled.