We continue with the ESP8266 SoC to discuss some of the ESP8266 and ESP12E hardware details (in the previous entry we saw their pinout and that they are essentially equivalent), and their differences compared to an Arduino board.
The first thing to highlight is that the ESP8266 lacks many hardware functions included in Atmel processors. Combined with WiFi management, the SoC has to divide its resources among all these functions. Although it is faster than an Arduino, it is a workload overhead, which in some applications can be a problem.
The next thing to highlight is that, as we saw in the introduction entry, the ESP8266 lacks internal Flash memory. The memory where we store the program is included in the module, but outside the SoC, and they communicate with each other via SPI. This means there are modules with different amounts of memory, and we will not be able to use the GPIO pins that communicate with the memory (we’ll see this next).
Power Supply
The ESP8266 power supply is 3.3V, supplying a voltage higher than 3.6V will destroy the SoC. Although many development boards include voltage regulators to power the board at 5V, or from USB.
Regarding whether the other ESP8266 pins are 5V tolerant, there has been much debate. According to the Datasheet (which changed between versions) it wasn’t very clear, but it was understood that they were not. However, currently, statements from Espressif and user experiments allow us to say that the ESP8266 GPIO pins are 5V tolerant when functioning as digital inputs.
The maximum current that the digital pins can provide or sink is 12mA. In comparison, most Arduino models can supply 20-40mA.
Regarding the analog-to-digital converter (ADC), the maximum voltage it can register is 0-1V. Supplying more than 1V to the ADC will damage it. However, some development boards include dividers to extend the range to 0-3.3V. You will have to check the ADC measurement range on each board.
The CHIP_EN pin controls the SoC’s power on/off, being on when it is HIGH. The EXT_RSTB pin controls the ESP8266 Reset, activating when it is LOW.
Boot
The ESP8266 has 3 boot modes:
- UART Bootloader, to upload a program via UART to the flash memory.
- Boot Sketch, executes the last program uploaded to the flash memory.
- SDIO, which is not used when programming with Arduino.
To boot in one mode or another, the pins GPIO15, GPIO0 and GPIO2 must be configured appropriately according to the following table:
| Mode | GPIO15 | GPIO0 | GPIO2 |
|---|---|---|---|
| Uart Bootloader | 0V | 0V | 3.3V |
| Normal Boot | 0V | 3.3V | 3.3V |
| SDIO | 3.3V | x | x |
Most development boards will have systems that manage the state of these pins for us. However, whether we want to use the ESP8266 (or ESP12E) independently, or in the case of a development board, we must consider the following:
- GPIO15 is always pulled down, so we cannot use its Pull-Up resistor.
- GPIO0 is set to
HIGHduring operation. - GPIO2 cannot be set to
LOWduring boot.
Connectivity
Digital Inputs and Outputs (GPIO)
The ESP8266 has 17 I/O pins (GPIO, General Purpose Input/Output pins). These can act as outputs providing 0V or 3.3V voltage (LOW and HIGH). Acting as inputs they can recognize a 0V or 3.3V voltage supplied to the GPIO.
When acting as outputs, the maximum current each GPIO can provide (or sink) is 12mA.
As inputs, as we said earlier, we can now say they are 5V tolerant (although I am not responsible if you blow up your board), so using an input to measure a voltage up to 5.8V should not damage it.
Regarding internal Pull resistors, like Arduino, pins GPIO0 to GPIO15 have Pull-Up resistors. While GPIO16 has a Pull-Down resistor.
Furthermore, of the 17 GPIOs we cannot use them all. In fact, we can use quite few, which is another important limitation compared to Arduino.
Analog Outputs (PWM)
Unlike Arduino, the ESP8266 does not have hardware PWM, instead it has to emulate it via software. This has the advantage that we can use PWM on all GPIOs, but also that it represents a calculation load for the ESP8266. The default frequency is 1kHz, but it can be changed.
Analog Inputs (ADC)
The ESP8266 has a 10-bit resolution ADC. The ADC has its own pin, independent of the GPIOs. The ADC input range is 0-1V, attempting to measure a voltage higher than 1V will damage the ADC. However, we have already seen that many boards have dividers that extend the range to measure 0-3.3V.
Communication
Serial (UART)
The ESP8266 has 2 hardware UARTs:
- UART0 on pins 1 and 3 (TX0 and RX0).
- UART1 on pins 2 and 8 (TX1 and RX1).
However, pin 8 is used to connect to the flash memory, so in practice, the UART1 port can only use the TX1 pin (it can only send, not receive).
On the other hand, UART0 also has access from pins 15 and 13 (RTS0 and CTS0).
I2C Bus
The ESP8266 does not have hardware for I2C, so it has to emulate it via software. This means we can use I2C with almost any GPIO pin, but again it represents a load for the processor.
By default, the library uses GPIO4 and GPIO5 (SDA and SCL). The maximum speed is 450kHz.
SPI Bus
The ESP8266 has 2 hardware SPIs, but one is used to connect to the flash memory. Therefore, the ESP8266 has 1 available SPI (HSPI) which can act as both Master and Follower.
The pins used are GPIO14 (CLK), GPIO12 (MISO), GPIO13 (MOSI) and GPIO15 (SS).

