2024-10-05 12:18 AM
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!
2024-10-05 5:45 AM - edited 2024-10-05 5:46 AM
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.
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.