Table of Contents
Introduction
Espressif’s ESP8266EX is a microcontroller most widely known as a Wi-Fi SoC solution to meet users’ continuous demands for efficient power usage, compact design, and reliable performance in the Internet of Things industry.
With the total and independent Wi-Fi organizing abilities, ESP8266EX can perform either as an independent application or as a captive to a host MCU. At the point when we say the captive to a host microcontroller, it implies it can use as a WiFi connector to any microcontroller utilizing SPI or UART interfaces. While utilized as an independent it can play out the abilities of microcontroller and WiFi organizing.
When ESP8266EX hosts the application, it immediately boots up from the flash. The coordinated high-speed cache expands the system execution and improves the system memory.
Other than the Wi-Fi functionalities, ESP8266EX additionally incorporates an upgraded adaptation of Tensilica\’s L106 Diamond series 32-bit processor and on-chip SRAM. It is very well communicated with outside sensors and different gadgets through the GPIOs.
This chip is widely used in various applications such as
- Home applications
- Home automation
- Smart plugs and lights
- Industrial wireless control
- Baby monitor
- IP cameras
- Sensor networks
- Wearable electronics
- Wi-FI location-aware devices
- Security ID tags
- Wi-Fi position system beacons
ESP8266 is the initial version. ESP8266EX is the updated version. Now ESP8266EX is the most commonly available.
Functional Description
CPU
The ESP8266EX integrates a Tensilica L106 32-bit RISC processor, which achieves extra-low power consumption and reaches a maximum clock speed of 160 MHz. The Real-Time Operating System (RTOS) and Wi-Fi stack allow 80% of the processing power to be available for user application programming and development. The CPU includes the interfaces as below:
- Programmable RAM/ROM interfaces (iBus), which can be connected with a memory controller, and can also be used to visit flash.
- Data RAM interface (dBus), which can be connected with the memory controller.
- AHB interface which can be used to visit the register.
Memory
ESP8266EX Wi-Fi SoC integrates a memory controller and memory units including SRAM and ROM. MCU can access the memory units through iBus, dBus, and AHB interfaces. All memory units can be accessed upon request, while a memory arbiter will decide the running sequence according to the time when these requests are received by the processor.
Clock
High-Frequency Clock
The high-frequency clock on ESP8266EX is used to drive both transmit and receive mixers. This clock is generated from an internal crystal oscillator and an external crystal. The crystal frequency ranges from 24 MHz to 52 MHz. The internal calibration inside the crystal oscillator ensures that a wide range of crystals can be used, nevertheless, the quality of the crystal is still a factor to consider to have reasonable phase noise and good Wi-Fi sensitivity.
External Clock
An externally generated clock is available with a frequency ranging from 24 MHz to 52 MHz.
Radio
ESP8266EX radio consists of the following blocks.
- 2.4 GHz receiver
- 2.4 GHz transmitter
- High-speed clock generators and a crystal oscillator
- Bias and regulators
- Power management
Wi-Fi
ESP8266EX implements TCP/IP and full 802.11 b/g/n WLAN MAC protocol. It supports basic Service Set (BSS) STA and SoftAP operations under the Distributed Control Function (DCF). Power management is handled with minimum host interaction to minimize the active duty period.
Power Management
ESP8266EX is designed with advanced power management technologies and intended for mobile devices, wearable electronics, and the Internet of Things applications.
The low-power architecture operates in the following modes:
- Active mode: The chip radio is powered on. The chip can receive, transmit, or listen.
- Modem-sleep mode: The CPU is operational. The Wi-Fi and radio are disabled.
- Light-sleep mode: The CPU and all peripherals are paused. Any wake-up events (MAC, host, RTC timer, or external interrupts) will wake up the chip.
- Deep-sleep mode: Only the RTC is operational and all other parts of the chip are powered off.
ESP8266 MCU
To start with this MCU first we must know about its specification. Here are some of the salient points:
- Operating Voltage: 3.3V
- Current consumption: 10uA – 170mA
- Flash memory attachable 16MB max (512K normal)
- Processor Tensilica: L106 32-bit
- Processor speed: 80-160MHz
- RAM: 32K + 80K
- GPIOs: 17 (multiplexed with other functions)
- Analog to Digital 1 input with 1024 step (10 bit)
- resolution
- Wi-Fi: 802.11 support b/g/n
- Maximum concurrent TCP connections 5
ESP8266 MCU Pin Diagram
Pin | Name | Type | Description |
1 | VDDA | Pin | Analog power range from 2.5V – 3.6V |
2 | LNA | Input / Output | RF Antenna Interface Chip output impedance = 39 + j6 Ω. It is suggested to retain the π-type matching network to match the antenna. |
3 | VDD3P3 | Pin | Amplifier Power 2.5 V – 3.6 V |
4 | VDD3P3 | Pin | Amplifier Power 2.5 V – 3.6 V |
5 | VDD_RTC | Pin | Power (Not Connected) 1.1V |
6 | TOUT | Input | ADC pin. It can be used to test the power-supply voltage of VDD3P3 (Pin3 and Pin4) and the input power voltage of TOUT (Pin 6). However, these two functions cannot be performed simultaneously. |
7 | CHIP_EN | Input | Chip Enable High: ON, the chip works properly Low: OFF, the small current consumed |
8 | XPD_DCDC | Input / Output | GPIO16; Deep-sleep wakeup (need to be connected to EXT_RSTB) |
9 | MTMS | Input / Output | GPIO 14; Used as SPI as Clock Pin: HSPI_CLK |
10 | MTDI | Input / Output | GPIO 12; Used in SPI as Master-In_Slave_Out Pin: HSPI_MISO |
11 | VDDPST | Pin | Digital / Input-Output Power Supply (1.8 V – 3.6 V) Similar to Pin 17 |
12 | MTCK | Input / Output | GPIO 13; Used as SPI Master-Out-Slave-In Pin: HSPI_MOSI; Used as UART Clear to Send Pin: UART0_CTS |
13 | MTDO | Input / Output | GPIO 15; Used as SPI Chip Select Pin: HSPI_CS; Used as UART Request to Send Pin: UART0_RTS |
14 | GPIO2 | Input / Output | GPIO2; UART TX during flash programming; |
15 | GPIO0 | Input / Output | GPIO0; Used as SPI Chip Select Pin 2: SPI_CS2 |
16 | GPIO4 | Input / Output | GPIO4 |
17 | VDDPST | Pin | Digital/IO Power Supply (1.8 V – 3.6 V). Similar to Pin 11 |
18 | SDIO_DATA_2 | Input / Output | GPIO9; SPIHD; HSPIHD; Used to connect with SD Card Data Pin 2: SDIO_DATA2 (Series R: 20 Ω) |
19 | SDIO_DATA_3 | Input / Output | GPIO10; SPIHD; HSPIHD; Used to connect with SD Card Data Pin 3: SDIO_DATA3 (Series R: 20 Ω) |
20 | SDIO_CMD | Input / Output | GPIO11; Used to connect SD Card Command Pin: SDIO_CMD (Series R: 200 Ω); Used as SPI as Chip Select Pin: SPI_CS0 |
21 | SDIO_CLK | Input / Output | GPIO6; Used to connect SD Card Clock Pin: SDIO_CLK (Series R: 200 Ω); Used as SPI as Clock Pin: SPI_CLK |
22 | SDIO_DATA_0 | Input / Output | GPIO7; Used to connect SD Card Data Pin: SDIO_D0 (Series R: 200 Ω); Used as SPI as Master-In-Slave_Out Pin: SPI_MISO |
23 | SDIO_DATA_1 | Input / Output | GPIO8; Used to connect SD Card Data Pin: SDIO_D1 (Series R: 200 Ω); Used as SPI as Master-Out-Slave-In Pin: SPI_MOSI |
24 | GPIO5 | Input / Output | GPIO5 |
25 | U0RXD | Input / Output | GPIO3; UART Rx during flash programming |
26 | U0TXD | Input / Output | GPIO1; UART TX during flash programming; Used as SPI Chip Select Pin 1: SPI_CS1 |
27 | XTAL_OUT | Input / Output | Connect to crystal oscillator output, can be used to provide BT clock input |
28 | XTAL_IN | Input / Output | Connect to the crystal oscillator input |
29 | VDDD | Pin | Analog Power 2.5 V – 3.6 V |
30 | VDDA | Pin | Analog Power 2.5 V – 3.6 V |
31 | RES12K | Input | Serial connection with a 12 kΩ resistor and connect to the ground |
32 | EXT_RSTB | Input | External reset signal (Low voltage level: active) |
33 | GND | Pin | Ground to the chip. |
ESP-12E Module
In August 2014 Espressif Systems launched their first raw module which is manufactured by a third part AI-Thinker and module referred to as ESP-01 module. Since then Ai-Thinker developed a series of modules based around ESP8266, this series referred to as ESP-xx modules range from 01 to 14.
The current most popular and hot topic is the ESP-12 which has a flexible configuration available today. The basic ESP-12 module needs its expander module to make it breadboard and 0.1” stripboard friendly. It has an internal 32-bit microcontroller that can perform multiple communications and output signals. The module is programmable with multiple languages and in most modern IoT devices ESP12E is available for creating and network hub and device. ESP12E has all popular network protocols and security encryption in a single chip with fast speed and low power consumption. The module ESP12E is popular due to its cheapness and it has less ping as compared to any other module.
ESP12E Applications
- The device is mostly available in IoT devices.
- The Laptops and Computers also come with ESP 12E.
- The wireless control system also has ESP 12E.
- In smart toys and applications, the module has the best use to control them wirelessly.
ESP-12E Module Pin Diagram
Pin | IC Pin | Name | Type | Description |
1 | 32 | EXT_RSTB | Input | Active low external reset signal |
2 | 6 | TOUT | Input | A/D Conversion result.Input voltage range 0-1V,,scope:0-1024 |
3 | 7 | CHIP_EN | Input | Active high enable pin (Low: small current |
4 | 8 | XPD_DCDC | Input / Output | GPIO16; Used to wake up the chipset from deep sleep mode. |
5 | 9 | MTMS | Input / Output | GPIO14; Used as HSPI Clock Pin: HSPI_CLK |
6 | 10 | MTDI | Input / Output | GPIO12; Used as HSPI Master-In-Salve-Out Pin: HSPI_MISO |
7 | 12 | MTCK | Input / Output | GPIO13; Used as SPI Master-Out-Slave-In Pin:HSPI_MOSI; Used as UART Clear to Send Pin: UART0_CTS |
8 | 3,4 | VDD3P3 | Pin | 3.3V power supply (VDD) |
9 | 20 | SDIO_CMD | Input / Output | GPIO11; Used to connect SD Card Command Pin:SDIO_CMD (Series R: 200 Ω) Used as SPI as Chip Select Pin: SPI_CS0 |
10 | 22 | SDIO_DATA_0 | Input / Output | GPIO7; Used to connect SD Card Data Pin: SDIO_D0 (Series R: 200 Ω); Used as SPI as Master-In-Slave_Out Pin: SPI_MISO; |
11 | 18 | SDIO_DATA_2 | Input / Output | GPIO9; SPIHD; HSPIHD; Used to connect with SD Card Data Pin 2: SDIO_DATA2 (Series R: 20 Ω) |
12 | 19 | SDIO_DATA_3 | Input / Output | GBIO10; SPIWP; HSPIWP; Used to connect with SD Card Data Pin 3: SDIO_DATA3 (Series R: 20 Ω) |
13 | 23 | SDIO_DATA_1 | Input / Output | GPIO8; Used to connect with SD Card Data Pin 1: SDIO_DATA1 (Series R: 20 Ω); Used as SPI as Master-Out-Slave-In Pin: SPI_MOSI |
14 | 21 | SDIO_CLK | Input / Outputt | GPIO6; Used to connect SD Card Clock Pin:SDIO_CLK (Series R: 200 Ω); Used as SPI as Clock Pin: SPI_CLK |
15 | 33 | GND | Pin | Ground Pin |
16 | 13 | MTDO | Input / Output | GPIO15; MTDO; Used as SPI Chip Select Pin: HSPI_CS; Used as UART Request to Send Pin: UART0_RTS |
17 | 14 | GPIO2 | Input / Output | GPIO2; Used as UART TX during flash programming: UART1_TXD |
18 | 15 | GPIO0 | Input / Output | GPIO0; Used as SPI Chip Select Pin 2: SPI_CS2 |
19 | 16 | GPIO4 | Input / Output | GPIO4 |
20 | 24 | GPIO5 | Input / Output | GPIO5 |
21 | 25 | U0RXD | Input / Output | GPIO3; Used as UART Rx during flash programming: UART0_RXD |
22 | 26 | U0TXD | Input / Output | GPIO1; Used as UART TX during flash programming: UART0_TXD; Used as SPI Chip Select Pin 1: SPI_CS1 |
NodeMCU Development Board
NodeMCU is a development board that uses the ESP-12E. NodeMCU is breadboard friendly and includes a USB to the serial interface. NodeMCU can be programmed using Lua scripting, Arduino, or ESP8266 SDK.
NodeMCU V1 is the first generation but is now outdated. NodeMCU V2and V3 is the second generation. V2 is made by Amica, while V3 is made by LoLin. V2 and V3 use a different USB to serial chip. V3\’s board size is significantly larger than the V2.
NodeMCU Pin Diagram
NodeMCU development board has a total of High-speed30 pins in which 14 pins are active, uses ESP-12 module, onboard reset and flash button, 3.3 voltage regulator, Micro USB, USB to UART Bridge, and some other components.
Peripheral Interface
Interfaces | Pin Name (Function Name) | Description |
GPIO (General Purpose Input Output Interface) | GPIO0, GPIO1, GPIO2, GPIO3, GPIO4, GPIO5, GPIO6, GPIO7, GPIO8, GPIO9, GPIO10, GPIO11, GPIO12, GPIO13, GPIO14, GPIO15, GPIO16 | General Purpose Input Output Interface is a flexible interface where pins can be used for both inputs as well as output purposes (not simultaneously). ESP8266EX has 17 GPIO pins which can be assigned to various functions by programming the appropriate registers. These pins, when working as GPIOs, can be multiplexed with other functions such as I2C, I2S, UART, PWM, and IR Remote Control, etc. For understanding more about GPIO click here |
UART (Universal Asynchronous Receiver Transmitter) | UART0 U0RXD, U0TXD, MTDO (U0RT), MTCK (U0CTS) UART1 GPIO2 (U1TXD), SD_D1 (U1RXD) | UART, or universal asynchronous receiver transmitter, is one of the most used device-to-device communication protocols. Data transfers to/from UART interfaces can be implemented via hardware. The data transmission speed via UART interfaces reaches 115200 x 40 (4.5 Mbps). UART0 can be used for communication. It supports flow control. Since UART1 features only data transmit signal (TX), it is usually used for printing logs. For understanding more about UART click here |
SDIO (Secure Digital Input Output Interface) | SDIO_CLK, SDIO_DATA0, SDIO_DATA1, SDIO_DATA2, SDIO_DATA3, SDIO_CMD | SDIO, a type of Secure Digital card interface. It can be used as an interface for input or output devices. ESP8266EX has one Slave SDIO, which supports 25 MHz SDIO v1.1 and 50 MHz SDIO v2.0, and 1 bit/4 bit SD mode and SPI mode. |
SPI (Serial Peripheral Interface | SPI SDIO_CLK (SPICLK), SDIO_DATA0 (SPIQ/MISO), SDIO_DATA1 (SPID/MOSI), SDIO_DATA2 (SPIHD), SDIO_DATA3 (SPIWP), U0TXD (SPICS1), GPIO0 (SPICS2), SDIO_CMD (SPICS0) HSPI MTMS (HSPICLK), MTDI (HSPIQ/MISO), MTCK (HSPID/MOSI), MTDO (HPSICS) | SPI is one of the most widely used interfaces between the microcontroller and peripheral ICs such as sensors, ADCs, DACs, shift registers, SRAM, and others. ESP8266EX has two SPIs. • One general Slave/Master SPI • One general Slave/Master HSPI Functions of all these pins can be implemented via hardware. For more understanding about SPI click here |
I2C Interface | MTMS (I2C_SCL), GPIO2 (I2C_SDA) | I2C is a synchronous, multi-controller/multi-target, packet-switched, single-ended, serial communication. It is used to connect external sensor products and display screens, etc. ESP8266EX has one I2C, which is realized via software programming, used to connect with other microcontrollers and other peripheral equipment such as sensors. For more understanding about I2C click here |
I2S Interface | MTDI (I2SI_DATA), MTCK (I2SI_BCK), MTMS (I2SI_WS), MTDO (I2SO_BCK), U0RXD (I2SO_DATA), GPIO2 (I2SO_WS) | I2S interfaces are mainly used in applications such as data collection, processing, and transmission of audio data, as well as the input and output of serial data. For example, LED lights (WS2812 series) are supported. ESP8266EX has one I2S data input interface and one I2S data output interface and supports the linked list DMA. |
PWM (Pulse Width Modulation) | MTDI (PWM0), MTDO (PWM1), MTMS (PWM2), GPIO4 (PWM3) | (PWM) is a square wave, a signal switched between HIGH and LOW, in which the HIGH duration can be varied. The HIGH duration is called pulse width and can be varied from zero (fully LOW) up to the period of the square wave (fully HIGH). The ratio of pulse width to the square wave period is called duty cycle The average voltage of PWM signal can simulate analog value between 0V to VDD (3.3V on ESP8266). PWM interface can be used to control LED lights, buzzers, relays, electronic machines, and so on. |
ADC (Analog to Digital Converter) | TOUT | The ESP8266\’s ADC has a 10-bit resolution, and the input voltage range is between 0{1V. The NodeMCU V3 board has a voltage divider circuit, so the input voltage range on pin A0 is between 0 – 3.3V. |
IR Remote Control. | MTMS (IR TX), GPIO5 (IR RX) | The functionality of the Infrared remote control interface can be implemented via software programming. NEC coding, modulation, and demodulation are supported by this interface. The frequency of modulated carrier signal is 38 kHz, while the duty ratio of the square wave is 1/3. The transmission range is around 1m which is determined by two factors: one is the maximum current drive output, the other is the internal current-limiting resistance value in the infrared receiver. ESP8266EX currently supports one infrared remote control interface. |
Conclusion
We have come to know so far about the basic block diagram and functional description of ESP8266 along with the pin description of ESP 8266 MCU, ESP-12EModule, and NodeMCU Development Board. Also, we understood various peripheral interfaces and their corresponding PINs.
For getting more detailed specifications refer to the datasheet of ESP8266 MCU.
References
- https://www.espressif.com/sites/default/files
- https://components101.com/sites/default/files/2021-09/ESP12E-Datasheet.pdf
- https://microcontrollerslab.com/esp8266-pinout-reference-gpio-pins/
- https://github.com/acrobotic/Ai_Docs
Saaransh Panjrath
Student at Bharati Vidyapeeth College of Engineering, pursuing B.Tech in ECE domain. Have some knowledge of programming languages like C, C++, python. Also, have some basic knowledge of ML and DL. Currently working on embedded systems.
Author: Kunal Gupta
Author