Skip to main content
John W.
Associate
July 14, 2021
Solved

Do GPIO pins configured as digital inputs latch incoming data?

  • July 14, 2021
  • 3 replies
  • 1455 views

I've looked in many places and haven't found a definitive answer yet. The reference manual simply states that reading the GPIO port input register returns the value of the associated pins. Does that mean that an external device has to be driving the GPIO pin at that time? What if no external device is driving the GPIO pin at that time (i.e. all candidate drivers are in hi-z) but have previously driven a value onto the GPIO pin. For what it's worth I am planning to use the STM32H725 (CORDIC + FMAC + MDMA -- very cool!)

This topic has been closed for replies.
Best answer by waclawek.jan

> Does that mean that an external device has to be driving the GPIO pin at that time?

Yes.

> What if no external device is driving the GPIO pin at that time (i.e. all candidate drivers are in hi-z) but have previously driven a value onto the GPIO pin.

The input level is undefined.

JW

3 replies

waclawek.jan
waclawek.janBest answer
Super User
July 14, 2021

> Does that mean that an external device has to be driving the GPIO pin at that time?

Yes.

> What if no external device is driving the GPIO pin at that time (i.e. all candidate drivers are in hi-z) but have previously driven a value onto the GPIO pin.

The input level is undefined.

JW

TDK
July 14, 2021

Typically the way this is handled is to use an internal/external pulldown/pullup such that if nothing is driving it externally, the level goes to a known default state.

"If you feel a post has answered your question, please click ""Accept as Solution""."
John W.
John W.Author
Associate
July 14, 2021

Thank you for the clarification. Will design accordingly!

John W