Hey all!
I'm trying to improve myself on a STM32F407 Discoveryboard and I noticed something strange (for a newbie like me). I was simply blinking a LED on Port A pin 3. But I noticed some of other pins had some voltage on them too. Though I didn't configure them, by default they're configured as inputs.
While debugging I put a breakpoint after I set the pin 3 and checked GPIOA_IDR(Input Data Register) was 0x0000 86C8 and GPIOA_ODR(Output Data Register) was 0x0000 0008 as expected because I turned on the pin 3.
Pull-up/Pull-down register for GPIOA is 0x6400 0000 by default. Which means there should be no pull-up/pull-down on pin 9 for example.
The question is why I measured 4,68V(which is equal to 5v output on my mcu) on PA9,PA14,PA13 etc. Are they being used for something else in the background? Because I know these ports are not only used for GPIO. And if not is there something wrong with my mcu?
General rule for analog as well as digital circuits:
Don´t leave any (unused) input floating.
(This has been discussed many times here in this forum as well as in the internet)
In your case I recommend to:
* use internal pullup or pulldown feature. (with this you can´t short circuit anything even if you externally connect VCC or GND)
* Other users recommend to switch them to "output LOW"
*******
Floating means "undefined" this is what you see. You see "a voltage" but you can´t predict what voltage it will be.
Floating inputs may oscillate, they may be more prone to ESD faults, they usually increase power supply current due to internal crowbar currents. (all this is explained many times, just do a search for more detailed informations)
Measuring 4.68V with multimeter means the pins are not floating. I see that according to the schematic some of the pins have secondary function, e.g. PA13 and P14 is used for SW debug interface.
I´m not sure about this.
A high input resistance voltmeter and a lot of flux residuals ...
But I agree it´s more likely that an internal pullup and the input resistance of the multimeter causes such voltage.
Like: 200k pullup and a 3MOhm multimeter input..