Language: EN

que-pines-puedo-usar-esp8266

Which pins can I use on an ESP8266

In the previous post, we saw the different pins of the ESP8266 and their functionalities. But we already commented that not all pins are safe to use in our projects.

This is because some pins have specific functions or play a crucial role in the device boot process. If not used correctly, this can generate a conflict and cause our project not to start, or even break something.

Of the 17 GPIO (0 to 16):

  • 6 GPIO (GPIO6 to GPIO11) are used to connect via SPI with the flash memory, so we cannot use them.
  • GPIO0, GPIO2, and GPIO15 are involved in the boot process, with the considerations we have seen in the previous section.
  • GPIO1 and GPIO3 are used for Serial communication (UART)

Summary of the pins

To avoid setbacks and ensure that we use the pins properly, we have the following reference table. It allows us to quickly check which pins are safe for use and which have specific functions that we must take into account.

Before starting any project with the ESP8266, it is highly recommended to consult this reference table and familiarize yourself with the characteristics of each pin. This will allow us to make informed decisions and avoid possible inconveniences in the development of our projects.

GPIOPinInputOutputComments
GPIO0D3⚠️Pulled Up✔️Boot fails if pulled LOW
Connected to FLASH button
GPIO1TX⚠️TX✔️HIGH during
Boot fails if pulled LOW
Debug output on boot
Not usable if UART is used
GPIO2D4⚠️Pulled Up✔️HIGH during boot
Boot fails if pulled LOW
Built-in LED
TX1
GPIO3RX✔️⚠️RXHIGH during boot
Not usable if UART is used
GPIO4D2✔️✔️SDA (I2c)
(frequently)
GPIO5D1✔️✔️SCL (I2C)
(frequently)
GPIO6-11-Used for flash memory
GPIO12D6✔️✔️MISO (SPI)
GPIO13D7✔️✔️MOSI (SPI)
GPIO14D5✔️✔️SLCK (SPI)
GPIO15D8⚠️Pulled to GND✔️CS (SPI)
LOW during boot
Boot fails if pulled HIGH
No Pull-Up
GPIO16D0⚠️No interruptions⚠️No PWM
⚠️No I2C
HIGH during boot
Pull-Down resistance
Connect to RST for Wake-Up
ADC0A0⚠️Analog Input

In the next posts, we will be looking at different development boards such as the NodeMCU that integrate the ESP8266 and start their programming.