0

I'm a bit confused about the ESP8266 launching and GPIO behaviour. enter image description here

When I'm programming the ESP8266 I have to set GPIO2 high and GPIO0 low. But when I want to use the ESP8266 in my project I have to set GPIO2 and GPIO0 to HIGH, but if they are both high I can't use them as inputs or outputs. So my question is how can I use atleast of the GPIO as an output and starting the ESP8266 without reprogramming it.

  • but if they are both high I can't use them as inputs or outputs - the state of those pins are important at powerup/reset, not all the time - you can definitely use them as outputs withut any worry, and "carefully" as inputs (i.e. usually as simple as having a pullup resistor connected to each of those pins) - note: GPIO15 also has to be LOW on boot/reset - but I guess you have an ESP01 if you failed to worry about that – Jaromanda X Apr 16 '18 at 0:25
  • they only need the special state for about 50ms at power-on, then it doesn't matter. – dandavis Apr 17 '18 at 5:55
  • Do you know a way how to set it high at the beginning, and then use it as output, without a complicated circuit around it? – Ribisl Apr 17 '18 at 7:45
  • you can use pin 2 as output, only don't connect it direct or indirect to ground at startup. it is good for output that is normally HIGH – Juraj Apr 19 '18 at 8:40
1

ESP8266 was developed for 'Serial over WiFi' as system-on-chip based on the Tensilica processor. The GPIO pins of Tensilica where used for different purposes of the system, like antena, flash memory connection, boot setup etc.

The more general use of the ep8266 as micro-controller with WiFi has evolved, but needs to accept the legacy of the original concept. Smart people even found a way how to share SPI with the flash memory of the system.

If you want to use the IO pins of the esp8266 (they are not called GPIO in datasheet), you must accept the required boot state and use only circuit, sensor or actuator that doesn't disturb it and can handle it.

io0 LOW tels the esp8266 to boot into bootloader flashing mode. It is evaluated by ROM software in the boot process. Pull-up circuit is required to achieve normal boot. So if you want to attach something to this pin, it must accept this conditions. For button it is ideal.

If you want to use io 0 or io 2 as output, use logic that is normally HIGH and make sure it is not connected direct or indirect to ground at startup.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.