-->
Page 1 of 1

Connecting gpio2 to 3.3v power rail and gpio 15 to ground

PostPosted: Fri May 25, 2018 5:23 pm
by Charles Cunningham
I now understand that it is recommended that gpio2 be left floating and gpio15 be pulled down thru a resistor to ground during normal use of the ESP8266 but I made a circuit board a while ago that connects gpio2 to 3.3v and gpio15 to ground permanently/directly (not thru resistors). Will this damage the ESP/cause shorts in any way?

ESP8266 BOOT MODE SELECT WARNING

PostPosted: Sat Aug 04, 2018 1:14 am
by Charles Cunningham
To answer my own question, yes. Apparently it is recommended that you use pullup resistors rather than connecting the boot mode select pins directly to certain voltages.

I believe the reason for this recommendation is that GPIO15 has other purposes other than boot mode select (specifically it is TXD2, the debugging UART output -- since UART output drives the line high periodically, connecting this pin directly to ground without disabling UART on this pin (not sure if this is possible) will cause a short).

I'm pretty sure connecting GPIO 2 directly to logic level high won't cause any problems as long as you don't drive this pin low somewhere in your code. Also, GPIO2 can definetely be shorted directly to a logic level -- that's what a reset button does, again though, don't drive it high as an output in your code and then press the reset button. If you don't trust yourself to not use these pins in your program though, I would just stick to pullup/pulldown resistors.

Also, always make sure that you only use these pins as outputs -- if they are used as an input and driven to an incorrect logic on startup, the esp won't boot correctly. If you are going to use them as outputs, I would also use diodes (with the anode connected to the esp pin and connect a pulldown resistor between ground and the cathode of the diode (10k ohms should most applications, use ohms law if you want to know the voltage drop across the resistor for your application)). That way whatever you are using the pin for can't affect the logic of the pin on startup.

So to summarize:

Here is a boot mode selection table for the ESP -- the 1s and 0s are high and low:

| GPIO 0 (reset) | GPIO 2 | GPIO 15
Flash Startup (Normal) | 1 | 1 | 0
UART Download Mode (Programming) | 0 | 1 | 0
SD-Card Boot | 0 | 0 | 1

For GPIO 15, use a pulldown resistor (10k is fine) or figure out how to disable UART on this pin (don't ask me). The others should be fine to short directly to a certain logic level as long as you don't try to use the pins as outputs, causing a short. If you want to use the pins as outputs, definitely use pullup/down resistors on these pins and make the diode circuit I describe below to prevent accidental boot mode mis-selects.