-->
Page 1 of 3

How can floating GPIO2 pin damage the controller?

PostPosted: Mon Sep 07, 2020 1:51 am
by indrek84
According to the wiki:
wiki/doku.php?id=esp8266_gpio_pin_allocations#pin_functions
Notes :- GPIO2 It is considered safer to pull it high with a resistor on boot rather than leave it floating to avoid possible chip damage if pin is pulled high by your program


This sentence doesn't make sense to me. How can leaving the pin floating be damaging to the chip?

Shouldn't it say something like this:
"It is considered safer to pull it high with a resistor on boot OR leave it floating rather than CONNECTING IT DIRECTLY TO VCC to avoid possible chip damage if pin is pulled DOWN by your program"

This would make sense. If it is pulled directly to 3.3V and if you now set the GPIO02 as output and set it to LOW in your program code, then it will would short the 3.3V to GND through the GPIO02 pin.

Or do I misunderstand something fundamental here?

Re: How can floating GPIO2 pin damage the controller?

PostPosted: Fri Sep 11, 2020 2:57 am
by eriksl
Yes I agree.

Although floating pins are more susceptible to static energy discharge and noise.

Re: How can floating GPIO2 pin damage the controller?

PostPosted: Sat Sep 12, 2020 6:33 am
by btidey
Yes. No special danger due to shorts.

I do, however, set unused pins to INPUT_PULLUP (or PULLDOWN for GPIO16)so that they are in a defined state and this may help prevent any charge build up.

Re: How can floating GPIO2 pin damage the controller?

PostPosted: Sat Sep 12, 2020 7:02 am
by eriksl
There are people who do this actually: pull to Vcc or GND without using a resistor. And yes, that IS dangerous, because you can never rule out the pin will be in an "output" state for some time during booting or crash.

The GPIO's as input have a very large input impedance, so quite a large resistor can be used, I tend to use 10k or even 22k and that works. It will allow only < 1 mA to flow when the pin is setup as output and that's no problem.