cancel
Showing results for 
Search instead for 
Did you mean: 

Voltage on uninitialised pins?

Aqib
Associate

Hello,I'm developing a project using STM32G491RC MCU. It currently sits on a custom-made PCB supplied by a two stage buck power supply on-board.
When the MCU was powered up using on-board power supply, I see voltages appearing on pins that are not even initialised. Is this normal?
For e.g., I try a simple blinky code on pin PC7 without initializing any other pin (other than SWD). While PC7 toggles as expected, I also see voltages on other pins. What's going wrong? What should be the status of un-initialized pins?Thanks!

1 REPLY 1
TDK
Super User

Uninitialized pins are in analog mode. Their output is floating and the voltage on them should be considered undefined and subject to noise in the system from EMI, cross-talk, board leakage and whatever other sources of noise are present. Don't assign any significance to their voltage level.

TDK_0-1728132332384.png

 

If you need a pin to be at a particular level always, even under reset, you should use an external pullup or pulldown to do so.

If the pin should be at a particular level when the program is running, initialize it as an input with pulldown or anything else that will set the voltage to the desired level.

 

If you feel a post has answered your question, please click "Accept as Solution".