Esp32 Datasheet en
Esp32 Datasheet en
Esp32 Datasheet en
Espressif Systems
October 8, 2016
About This Guide
This document provides introduction to the specifications of ESP32 hardware.
The document structure is as follows:
Chapter Title Subject
An overview of ESP32, including featured solutions, basic
Chapter 1 Overview and advanced features, applications and development sup-
port
Chapter 2 Pin Definitions Introduction to the pin layout and descriptions
Chapter 3 Functional Description Description of the major functional modules
Chapter 4 Peripheral Interface Description of the peripheral interfaces integrated on ESP32
Chapter 5 Electrical Characteristics The electrical characteristics and data of ESP32
Chapter 6 Package Information The package details of ESP32
Chapter 7 Supported Resources The related documents and community resources for ESP32
Appendix Touch Sensor The touch sensor design and layout guidelines
Release Notes
Date Version Release notes
2016.08 V1.0 First release
1 Overview 1
1.1 Featured Solutions 1
1.1.1 Ultra Low Power Solution 1
1.1.2 Complete Integration Solution 1
1.2 Basic Protocols 1
1.2.1 Wi-Fi 1
1.2.2 Bluetooth 2
1.3 MCU and Advanced Features 3
1.3.1 CPU and Memory 3
1.3.2 Clocks and Timers 3
1.3.3 Advanced Peripheral Interfaces 3
1.3.4 Security 4
1.3.5 Development Support 4
1.4 Application 4
1.5 Block Diagram 5
2 Pin Definitions 6
2.1 Pin Layout 6
2.2 Pin Description 6
2.3 Power Scheme 8
2.4 Strapping Pins 9
3 Functional Description 10
3.1 CPU and Memory 10
3.1.1 CPU 10
3.1.2 Internal Memory 10
3.1.3 External Flash and SRAM 10
3.1.4 Memory Map 11
3.2 Timers and Watchdogs 13
3.2.1 64-bit Timers 13
3.2.2 Watchdog Timers 13
3.3 System Clocks 13
3.3.1 CPU Clock 13
3.3.2 RTC Clock 14
3.3.3 Audio PLL Clock 14
3.4 Radio 14
3.4.1 2.4 GHz Receiver 14
3.4.2 2.4 GHz Transmitter 15
3.4.3 Clock Generator 15
3.5 Wi-Fi 15
3.5.1 Wi-Fi Radio and Baseband 15
3.5.2 Wi-Fi MAC 16
3.5.3 Wi-Fi Firmware 16
3.5.4 Packet Traffic Arbitration (PTA) 16
3.6 Bluetooth 17
3.6.1 Bluetooth Radio and Baseband 17
3.6.2 Bluetooth Interface 17
3.6.3 Bluetooth Stack 17
3.6.4 Bluetooth Link Controller 18
3.7 RTC and Low-Power Management 19
4 Peripheral Interface 21
4.1 General Purpose Input / Output Interface (GPIO) 21
4.2 Analog-to-Digital Converter (ADC) 21
4.3 Ultra Low Noise Analog Pre-Amplifier 21
4.4 Hall Sensor 21
4.5 Digital-to-Analog Converter (DAC) 21
4.6 Temperature Sensor 22
4.7 Touch Sensor 22
4.8 Ultra-Lower-Power Coprocessor 22
4.9 Ethernet MAC Interface 23
4.10 SD/SDIO/MMC Host Controller 23
4.11 Universal Asynchronous Receiver Transmitter (UART) 23
4.12 I2C Interface 24
4.13 I2S Interface 24
4.14 Infrared Remote Controller 24
4.15 Pulse Counter 24
4.16 Pulse Width Modulation (PWM) 24
4.17 LED PWM 25
4.18 Serial Peripheral Interface (SPI) 25
4.19 Accelerator 25
5 Electrical Characteristics 26
5.1 Absolute Maximum Ratings 26
5.2 Recommended Operating Conditions 26
5.3 RF Power Consumption Specifications 27
5.4 Wi-Fi Radio 27
5.5 Bluetooth Radio 28
5.5.1 Receiver - Basic Data Rate 28
5.5.2 Transmitter - Basic Data Rate 28
5.5.3 Receiver - Enhanced Data Rate 29
5.5.4 Transmitter - Enhanced Data Rate 29
5.6 Bluetooth LE Radio 30
5.6.1 Receiver 30
5.6.2 Transmitter 30
6 Package Information 32
7 Supported Resources 33
7.1 Related Documentation 33
7.2 Community Resources 33
Appendix A - Touch Sensor 34
1. Overview
ESP32 is a single chip 2.4 GHz Wi-Fi and Bluetooth combo chip designed with TSMC ultra low power 40 nm
technology. It is designed and optimized for the best power performance, RF performance, robustness, versatility,
features and reliability, for a wide variety of applications, and different power profiles.
For instance, in a low-power IoT sensor hub application scenario, ESP32 is woken up periodically and only when
a specified condition is detected; low duty cycle is used to minimize the amount of energy that the chip expends.
The output power of the power amplifier is also adjustable to achieve an optimal trade off between communication
range, data rate and power consumption.
Note:
For more information, refer to Section 3.7 RTC and Low-Power Management.
ESP32 uses CMOS for single-chip fully-integrated radio and baseband, and also integrates advanced calibration
circuitries that allow the solution to dynamically adjust itself to remove external circuit imperfections or adjust to
changes in external conditions.
As such, the mass production of ESP32 solutions does not require expensive and specialized Wi-Fi test equip-
ment.
• WMM-PS, UAPSD
• Block ACK
• Wi-Fi Direct (P2P), P2P Discovery, P2P Group Owner mode and P2P Power Management
Note:
For more information, refer to Section 3.5 Wi-Fi.
1.2.2 Bluetooth
• Compliant with Bluetooth v4.2 BR/EDR and BLE specification
• ATT/GATT
• HID
• BLE Beacon
• Two timer groups, including 2 x 64-bit timers and 1 x main watchdog in each group
• RTC watchdog
• 10 × touch sensors
• Temperature sensor
• 4 × SPI
• 2 × I2S
• 2 × I2C
• 3 × UART
• 1 host (SD/eMMC/SDIO)
• 1 slave (SDIO/SPI)
• Ethernet MAC interface with dedicated DMA and IEEE 1588 support
• CAN 2.0
• IR (TX/RX)
• Motor PWM
• Hall sensor
1.3.4 Security
• IEEE 802.11 standard security features all supported, including WFA, WPA/WPA2 and WAPI
• Secure boot
• Flash encryption
– AES
– RSA
– ECC
Note:
For more information, refer to Chapter 7 Supported Resources.
1.4 Application
• Generic low power IoT sensor hub
• Music players
– Loggers
• Audio headsets
• Home automation
• Mesh network
• Baby monitors
• Wearable electronics
• Security ID tags
• Healthcare
SPI Bluetooth
Bluetooth
link RF receive
I2C baseband
controller
Switch
Balun
I2S Clock
generator
SDIO Wi-Fi
Wi-Fi MAC RF
baseband
transmit
UART
2. Pin Definitions
VDD3P3_CPU
XTAL_N
GPIO22
XTAL_P
U0RXD
U0TXD
GPIO19
GPIO21
VDDA
VDDA
CAP2
CAP1
40
48
44
38
46
43
42
39
45
47
37
41
VDDA 1 36 GPIO23
LNA_IN 2 35 GPIO18
VDD3P3 3 34 GPIO5
VDD3P3 4 33 SD_DATA_1
SENSOR_VP 5 32 SD_DATA_0
SENSOR_CAPP 6 31 SD_CLK
ESP32
SENSOR_CAPN 7 30 SD_CMD
SENSOR_VN 8 29 SD_DATA_3
CHIP_PU 9 28 SD_DATA_2
VDET_1 10 27 GPIO17
VDET_2 11 26 VDD_SDIO
32K_XP 12 25 GPIO16
13
14
15
16
17
18
19
20
21
22
23
24
32K_XN
GPIO25
GPIO26
GPIO27
MTMS
MTDI
VDD3P3_RTC
MTCK
MTDO
GPIO2
GPIO0
GPIO4
• VDD3P3_RTC
• VDD3P3_CPU
• VDD_SDIO
VDD3P3_RTC is also the input power supply for RTC and CPU. VDD3P3_CPU is also the input power supply for
CPU.
VDD_SDIO connects to the output of an internal LDO, whose input is VDD3P3_RTC. When VDD_SDIO is con-
nected to the same PCB net together with VDD3P3_RTC; the internal LDO is disabled automatically.
The internal LDO can be configured as 1.8V, or the same voltage as VDD3P3_RTC. It can be powered off via
software to minimize the current of Flash/SRAM during the Deep-sleep mode.
Note:
It is required that the power supply of VDD3P3_RTC, VDD3P3_CPU and analog must be stable before the pin CHIP_PU
is set at high level.
Software can read the value of these 6 bits from the register ”GPIO_STRAPPING”.
During the chip power-on reset, the latches of the strapping pins sample the voltage level as strapping bits of ”0”
or ”1”, and hold these bits until the chip is powered down or shut down. The strapping bits configure the device
boot mode, the operating voltage of VDD_SDIO and other system initial settings.
Each strapping pin is connected with its internal pull-up/pull-down during the chip reset. Consequently, if a strap-
ping pin is unconnected or the connected external circuit is high-impendence, the internal weak pull-up/pull-down
will determine the default input level of the strapping pins.
To change the strapping bit values, users can apply the external pull-down/pull-up resistances, or apply the host
MCU’s GPIOs to control the voltage level of these pins when powering on ESP32.
After reset, the strapping pins work as the normal functions pins.
Note:
Firmware can configure register bits to change the setting of ”Voltage of Internal LDO (VDD_SDIO)” and ”Timing of SDIO
Slave” after booting.
3. Functional Description
This chapter describes the functions implemented in ESP32.
• Support DSP instructions, such as 32-bit Multiplier, 32-bit Divider, and 40-bit MAC
• 8 KBytes SRAM in RTC, which is called RTC SLOW Memory and can be used for co-processor accessing
during the Deep-sleep mode
• 8 KBytes SRAM in RTC, which is called RTC FAST Memory and can be used for data storage and main CPU
during RTC Boot from the Deep-sleep mode
• 1 Kbit of EFUSE, of which 256 bits are used for the system (MAC address and chip configuration) and the
remaining 768 bits are reserved for customer applications, including Flash-Encryption and Chip-ID
ESP32 accesses external QSPI Flash and SRAM by the high-speed caches�
• Up to 16 MBytes of external Flash are memory mapped into the CPU code space, supporting 8-bit, 16-bit
and 32-bit access. Code execution is supported.
• Up to 8 MBytes of external Flash/SRAM are memory mapped into the CPU data space, supporting 8-bit,
16-bit and 32-bit access. Data read is supported on the Flash and SRAM. Data write is supported on the
SRAM.
• Auto-reload at alarming
During Flash boot the RWDT and the first MWDT start automatically in order to detect and recover from booting
problems.
• One of 3 or 4 possible actions (interrupt, CPU reset, core reset, and system reset) on expiration of each stage
• Write protection, to prevent the RWDT and MWDT configuration from being inadvertently altered
In addition to this, ESP32 has an internal 8 MHz oscillator, of which the accuracy is guaranteed by design and
is stable over temperature (within 1% accuracy). Hence, the application can then select from the external crystal
clock source, the PLL clock or the internal 8 MHz oscillator. The selected clock source drives the CPU clock,
directly or after division, depending on the application.
• internal 31.25 kHz clock (derived from the internal 8 MHz oscillator divided by 256)
When the chip is in the normal power mode and needs faster CPU accessing, the application can choose the
external high speed crystal clock divided by 4 or the internal 8 MHz oscillator. When the chip operates in the low
power mode, the application chooses the external low speed (32 kHz) crystal clock, the internal RC clock or the
internal 31.25 kHz clock.
fxtal Ndiv
fout = K
Mdiv 2 div
where fout is the output frequency, fxtal is the frequency of the crystal oscillator, and Ndiv , Mdiv and Kdiv are all
integer values, configurable by registers.
3.4 Radio
The ESP32 radio consists of the following main blocks:
• clock generator
• Carrier leakage
• Baseband nonlinearities
• RF nonlinearities
• Antenna matching
These built-in calibration routines reduce the amount of time and required for product test and make test equipment
unnecessary.
3.5 Wi-Fi
ESP32 implements TCP/IP, full 802.11 b/g/n/e/i WLAN MAC protocol, and Wi-Fi Direct specification. It supports
Basic Service Set (BSS) STA and SoftAP operations under the Distributed Control Function (DCF) and P2P group
operation compliant with the latest Wi-Fi P2P protocol.
Passive or active scanning, as well as the P2P discovery procedure are performed autonomously when initiated
by appropriate commands. Power management is handled with minimum host interaction to minimize active duty
period.
• 802.11n MCS32
• WMM, U-APSD
• CCMP (CBC-MAC, counter mode), TKIP (MIC, RC4), WAPI (SMS4), WEP (RC4) and CRC
• P2P Discovery, P2P Group Owner, P2P Group Client and P2P Power Management
• Open interface for various upper layer authentication schemes over EAP such as TLS, PEAP, LEAP, SIM,
AKA or customer specific
• Clock/power gating combined with 802.11-compliant power management dynamically adapted to current
connection condition providing minimal power consumption
• Adaptive rate fallback algorithm sets the optimal transmission rate and transmit power based on actual Signal
Noise Ratio (SNR) and packet loss information
• Automatic retransmission and response on MAC to avoid packet discarding on slow host environment
• It is preferable that Wi-Fi works in the 20 MHz bandwidth mode to decrease its interference with BT.
• BT applies AFH (Adaptive Frequency Hopping) to avoid using the channels within Wi-Fi bandwidth.
• Wi-Fi MAC limits the time duration of Wi-Fi packets, and does not transmit the long Wi-Fi packets by the
lowest data-rates.
• Protect the critical Wi-Fi packets, including beacon transmission and receiving, ACK/BA transmission and
receiving.
• Protect the highest BT packets, including inquiry response, page response, LMP data and response, park
beacons, the last poll period, SCO/eSCO slots, and BLE event sequence.
• Wi-Fi MAC applies CTS-to-self packet to protect the time duration of BT transfer.
• In the P2P Group Own (GO) mode, Wi-Fi MAC applies a Notice of Absence (NoA) packet to disable Wi-Fi
transfer to reserve time for BT.
• In the STA mode, Wi-Fi MAC applies a NULL packet with the Power-Save bit to disable WiFi transfer to
reserve time for BT.
3.6 Bluetooth
ESP32 integrates Bluetooth link controller and Bluetooth baseband, which carry out the baseband protocols and
other low-level link routines, such as modulation/demodulation, packets processing, bit stream processing, fre-
quency hopping, etc.
• Class-1, class-2 and class-3 transmit output powers and over 30 dB dynamic control range
• Internal SRAM allows full speed data transfer, mixed voice and data, and full piconet operation
• Logic for forward error correction, header error control, access code correlation, CRC, demodulation, en-
cryption bit stream generation, whitening and transmit pulse shaping
• Classic Bluetooth
– Multi connections
– Master/Slave Switch
– Broadcast encryption
– Sniff mode
– Ping
– Advertising
– Scanning
– Multiple connections
– LE Ping
• Power mode
– Active mode: The chip radio is powered on. The chip can receive, transmit, or listen.
– Modem-sleep mode: The CPU is operational and the clock is configurable. The Wi-Fi/Bluetooth base-
band and radio are disabled.
– Light-sleep mode: The CPU is paused. The RTC and ULP-coprocessor are running. Any wake-up
events (MAC, host, RTC timer, or external interrupts) will wake up the chip.
– Deep-sleep mode: Only RTC is powered on. Wi-Fi and Bluetooth connection data are stored in RTC
memory. The ULP-coprocessor can work.
– Hibernation mode: The internal 8MHz oscillator and ULP-coprocessor are disabled. The RTC recovery
memory are power-down. Only one RTC timer on the slow clock and some RTC GPIOs are active. The
RTC timer or the RTC GPIOs can wake up the chip from the Hibernation mode.
• Sleep Pattern
– Association sleep pattern: The power mode switches between the active mode and Modem-sleep/Light-
sleep mode during this sleep pattern. The CPU, Wi-Fi, Bluetooth, and radio are woken up at predeter-
mined intervals to keep Wi-Fi/BT connections alive.
– ULP sensor-monitored pattern: The main CPU is in the Deep-sleep mode. The ULP co-processor does
sensor measurements and wakes up the main system, based on the measured data from sensors.
The power consumption varies with different power modes/sleep patterns and work status of functional modules
(see Table 5).
Note:
For more information about RF power consumption, refer to Section 5.3 RF Power Consumption Specifications.
4. Peripheral Interface
Each digital enabled GPIO can be configured to internal pull-up or pull-down, or set to high impedance. When
configured as an input, the input value can be read through the register. The input can also be set to edge-trigger
or level-trigger to generate CPU interrupts. In short, the digital IO pins are bi-directional, non-inverting and tristate,
including input and output buffer with tristate control. These pins can be multiplexed with other functions, such as
the SDIO interface, UART, SI, etc. For low power operations, the GPIOs can be set to hold their states.
With the appropriate setting, the ADCs and the amplifier can be configured to measure voltages for a maximum of
18 pins.
The temperature sensor has a range of -40°C to 125°C. As the offset of the temperature sensor varies from
chip to chip due to process variation, together with the heat generated by the Wi-Fi circuitry itself (which affects
measurements), the internal temperature sensor is only suitable for applications that detect temperature changes
instead of absolute temperatures and for calibration purposes as well.
However, if the user calibrates the temperature sensor and uses the device in a minimally powered-on application,
the results could be accurate enough.
Note:
For more information about the touch sensor design and layout, refer to Appendix A Touch Sensor.
• Dedicated DMA controller allowing high-speed transfer between the dedicated SRAM and Ethernet MAC
• Several address filtering modes for physical and multicast address (multicast and group addresses)
• Internal FIFOs to buffer transmit and receive frames. The transmit FIFO and the receive FIFO are both 512
words (32-bit)
• Hardware PTP (precision time protocol) in accordance with IEEE 1588 2008 (PTP V2)
• Secure Digital memory (SD mem Version 3.0 and Version 3.01)
• Multimedia Cards (MMC Version 4.41, eMMC Version 4.5 and Version 4.51)
The controller allows clock output at up to 80 MHz and in three different data-bus modes: 1-bit, 4-bit and 8-bit. It
supports two SD/SDIO/MMC4.41 cards in 4-bit data-bus mode. It also supports one SD card operating at 1.8 V
level.
Users can program command registers to control I2C interfaces to have more flexibility.
Both of the I2S interfaces have dedicated DMA controllers. PDM and BT PCM interfaces are supported.
The 16 channels of digital waveforms operate at 80 MHz APB clock, among which 8 channels have the option of
using the 8 MHz oscillator clock. Each channel can select a 20-bit timer with configurable counting range and its
accuracy of duty can be up to 16 bits with the 1 ms period.
The software can change the duty immediately. Moreover, each channel supports step-by-step duty increasing or
decreasing automatically. It is useful for the LED RGB color gradient generator.
• 4 timing modes of the SPI format transfer that depend on the polarity (POL) and the phase (PHA)
• up to 64-Byte FIFO
All SPIs can also be used to connect to the external Flash/SRAM and LCD. Each SPI can be served by DMA
controllers.
4.19 Accelerator
ESP32 is equipped with hardware accelerators of general algorithms, such as AES (FIPS PUB 197), SHA (FIPS
PUB 180-4), RSA, and ECC, which support independent arithmetic such as Big Integer Multiplication and Big
Integer Modular Multiplication. The maximum operation length for RSA, ECC, Big Integer Multiply and Big Integer
Modular Multiplication is 4096 bits.
The hardware accelerators greatly improve operation speed and reduce software complexity. They also support
code encryption and dynamic decryption�which ensures that codes in the Flash will not be stolen.
5. Electrical Characteristics
Note:
The specifications in this charpter are tested in general condition: VBAT = 3.3V, TA = 27°C, unless otherwise specified.
5.6.2 Transmitter
6. Package Information
7. Supported Resources
• ESP32 Documentation
All the available documentation and other resources of ESP32
• ESP32 Github
ESP32 development projects are freely distributed under Espressif’s MIT license on Github. It is established
to help developers get started with ESP32 and foster innovation and the growth of general knowledge about
the hardware and software surrounding these devices.
Protective cover
Substrate
ESP32
C
Electrode
In order to prevent capacitive coupling and other electrical interference to the sensitivity of the touch sensor system,
the following factors should be taken into account.
Note:
The examples illustrated in Figure 6 are not of actual scale. It is suggested that users take a human fingertip as reference.
• Close proximity between electrodes may lead to crosstalk between electrodes and false touch detections.
The distance between electrodes should be at least twice the thickness of the panel used.
• The width of a sensor track creates parasitic capacitance, which could vary with manufacturing processes.
The thinner the track is, the less capacitive coupling it generates. The track width should be kept as thin as
possible and the length should not exceed 10cm to accommodate.
• We should avoid coupling between lines of high frequency signals. The sensing tracks should be routed
parallel to each other on the same layer and the distance between the tracks should be at least twice the
width of the track.
• When designing a touch sensor device, there should be no components adjacent to or underneath the
electrodes.
• Do not ground the touch sensor device. It is preferable that no ground layer be placed under the device,
unless there is a need to isolate it. Parasitic capacitance generated between the touch sensor device and
the ground degrades sensitivity.
B.1. Input
>python esptool.py -p dev/tty8 -b 115200 write_Flash -c ESP32 -ff 40m -fm qio -fs 2MB
0x0 ~/Workspace/ESP32_BIN/boot.bin
0x04000 ~/Workspace/ESP32_BIN/drom0.bin
0x40000 ~/Workspace/ESP32_BIN/bin/irom0_Flash.bin
0xFC000 ~/Workspace/ESP32_BIN/blank.bin
0x1FC000 ~/Workspace/ESP32_BIN/esp_init_data_default.bin
B.2. Output
Connecting...
Erasing Flash...
Wrote 3072 bytes at 0x00000000 in 0.3 seconds (73.8 kbit/s)...
Erasing Flash...
Wrote 395264 bytes at 0x04000000 in 43.2 seconds (73.2 kbit/s)...
Erasing Flash...
Wrote 1024 bytes at 0x40000000 in 0.1 seconds (74.5 kbit/s)...
Erasing Flash...
Wrote 4096 bytes at 0xfc000000 in 0.4 seconds (73.5 kbit/s)...
Erasing Flash...
Wrote 4096 bytes at 0x1fc00000 in 0.5 seconds (73.8 kbit/s)...
Leaving...