Skip to main content
Visitor II
October 5, 2024
Question

Voltage on uninitialised pins?

  • October 5, 2024
  • 1 reply
  • 532 views

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!

    This topic has been closed for replies.

    1 reply

    Super User
    October 5, 2024

    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.