ESP32 Datasheet Espressif Systems October 8, 2016
About This Guide This document provides introduction to the specifications of ESP32 hardware.
Contents 1 Overview 1 1.1 1 1.2 1.3 Featured Solutions 1.1.1 Ultra Low Power Solution 1 1.1.2 Complete Integration Solution 1 Basic Protocols 1 1.2.1 Wi-Fi 1 1.2.2 Bluetooth 2 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.
3.6 3.7 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 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.
Appendix A - Touch Sensor 34 Appendix B - Code Examples 36
List of Tables 1 Pin Description 6 2 Strapping Pins 9 3 Memory and Peripheral Mapping 11 4 Functionalities Depending on the Power Modes 19 5 Power Consumption by Power Modes 20 6 Capacitive Sensing GPIOs Available on ESP32 22 7 Absolute Maximum Ratings 26 8 Recommended Operating Conditions 26 9 RF Power Consumption Specifications 27 10 Wi-Fi Radio Characteristics 27 11 Receiver Characteristics-Basic Data Rate 28 12 Transmitter Characteristics - Basic Data Rate 28 13 Rece
List of Figures 1 Function Block Diagram 5 2 ESP32 Pin Layout 6 3 Address Mapping Structure 11 4 QFN48 (6x6 mm) Package 32 5 A Typical Touch Sensor Application 34 6 Electrode Pattern Requirements 34 7 Sensor Track Routing Requirements 35
1 OVERVIEW 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. 1.1 1.1.1 Featured Solutions Ultra Low Power Solution ESP32 is designed for mobile, wearable electronics, and Internet of Things (IoT) applications.
1.2 Basic Protocols 1 OVERVIEW • Fragmentation and defragmentation • Automatic Beacon monitoring/scanning • 802.11 i security features: pre-authentication and TSN • Wi-Fi Protected Access (WPA)/WPA2/WPA2-Enterprise/Wi-Fi Protected Setup (WPS) • Infrastructure BSS Station mode/SoftAP mode • Wi-Fi Direct (P2P), P2P Discovery, P2P Group Owner mode and P2P Power Management • UMA compliant and certified • Antenna diversity and selection Note: For more information, refer to Section 3.5 Wi-Fi. 1.2.
1.3 MCU and Advanced Features 1.3 1.3.1 1 OVERVIEW MCU and Advanced Features CPU and Memory • Xtensa® Dual-Core 32-bit LX6 microprocessors, up to 600 DMIPS • 448 KByte ROM • 520 KByte SRAM • 16 KByte SRAM in RTC • QSPI Flash/SRAM, up to 4 x 16 MBytes • Power supply: 2.2 V to 3.6 V 1.3.
1.4 Application 1.3.4 1 OVERVIEW Security • IEEE 802.11 standard security features all supported, including WFA, WPA/WPA2 and WAPI • Secure boot • Flash encryption • 1024-bit OTP, up to 768-bit for customers • Cryptographic hardware acceleration: – AES – HASH (SHA-2) library – RSA – ECC – Random Number Generator (RNG) 1.3.5 Development Support • SDK Firmware for fast on-line programming • Open source toolchains based on GCC Note: For more information, refer to Chapter 7 Supported Resources. 1.
1.
VDDA XTAL_P XTAL_N VDDA GPIO21 U0TXD U0RXD GPIO22 GPIO19 VDD3P3_CPU 46 45 44 43 42 41 40 39 38 37 Pin Layout CAP2 2.1 47 Pin Definitions CAP1 2.
2.2 Pin Description Name 2 No. Type PIN DEFINITIONS Function GPIO37, ADC_PRE_AMP, ADC1_CH1, RTC_GPIO1 SENSOR_CAPP 6 I Note: Connects 270 pF capacitor from SENSOR_VP to SENSOR_CAPP when used as ADC_PRE_AMP. GPIO38, ADC1_CH2, ADC_PRE_AMP, RTC_GPIO2 SENSOR_CAPN 7 I Note: Connects 270 pF capacitor from SENSOR_VN to SENSOR_CAPN when used as ADC_PRE_AMP. GPIO39, ADC1_CH3, ADC_PRE_AMP, RTC_GPIO3 SENSOR_VN 8 I Note: Connects 270 pF capacitor from SENSOR_VN to SENSOR_CAPN when used as ADC_PRE_AMP.
2.3 Power Scheme 2 Name No. Type Function SD_DATA_0 32 I/O GPIO7, SD_DATA0, SPIQ, HS1_DATA0, U2RTS SD_DATA_1 33 I/O GPIO8, SD_DATA1, SPID, HS1_DATA1, U2CTS PIN DEFINITIONS VDD3P3_CPU GPIO5 34 I/O GPIO5, VSPICS0, HS1_DATA6, EMAC_RX_CLK GPIO18 35 I/O GPIO18, VSPICLK, HS1_DATA7 GPIO23 36 I/O GPIO23, VSPID, HS1_STROBE VDD3P3_CPU 37 P CPU IO power supply input (1.8V - 3.
2.4 Strapping Pins 2.4 2 PIN DEFINITIONS Strapping Pins ESP32 has 6 strapping pins: • MTDI/GPIO12: internal pull-down • GPIO0: internal pull-up • GPIO2: internal pull-down • GPIO4: internal pull-down • MTDO/GPIO15: internal pull-up • GPIO5: internal pull-up Software can read the value of these 6 bits from the register ”GPIO_STRAPPING”.
3 FUNCTIONAL DESCRIPTION 3. Functional Description This chapter describes the functions implemented in ESP32. 3.1 CPU and Memory 3.1.1 CPU ESP32 contains two low-power Xtensa® 32-bit LX6 microprocessors with the following features.
3.1 CPU and Memory 3 FUNCTIONAL DESCRIPTION • 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. 3.1.4 Memory Map The structure of address mapping is shown in Figure 3. The memory and peripherals mapping of ESP32 is shown in Table 3.
3.
3.2 Timers and Watchdogs 3.2 3 FUNCTIONAL DESCRIPTION Timers and Watchdogs 3.2.1 64-bit Timers There are four general-purpose timers embedded in the ESP32. They are all 64-bit generic timers which are based on 16-bit prescalers and 64-bit auto-reload-capable up/downcounters.
3.4 Radio 3 FUNCTIONAL DESCRIPTION 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. 3.3.
3.5 Wi-Fi 3.4.2 3 FUNCTIONAL DESCRIPTION 2.4 GHz Transmitter The 2.4 GHz transmitter up-converts the quadrature baseband signals to the 2.4 GHz RF signal, and drives the antenna with a high powered Complementary Metal Oxide Semiconductor (CMOS) power amplifier. The use of digital calibration further improves the linearity of the power amplifier, enabling state-of-the-art performance of delivering +20.5 dBm of average power for 802.11b transmission and +17 dBm for 802.11n transmission.
3.5 Wi-Fi 3 FUNCTIONAL DESCRIPTION • Antenna diversity and selection (software-managed hardware) 3.5.2 Wi-Fi MAC The ESP32 Wi-Fi MAC applies low level protocol functions automatically as follows: • Request To Send (RTS), Clear To Send (CTS) and Acknowledgement (ACK/BA) • Fragmentation and defragmentation • Aggregation AMPDU and AMSDU • WMM, U-APSD • 802.
3.6 Bluetooth 3 FUNCTIONAL DESCRIPTION • 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.
3.6 Bluetooth 3.6.4 3 FUNCTIONAL DESCRIPTION Bluetooth Link Controller The link controller operates in three major states: standby, connection and sniff. It enables multi connection and other operations like inquiry, page, and secure simple pairing, and therefore enables Piconet and Scatternet.
3.7 RTC and Low-Power Management 3.7 3 FUNCTIONAL DESCRIPTION RTC and Low-Power Management With the advanced power management technologies, ESP32 can switch between different power modes (see Table 4). • 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 baseband and radio are disabled. – Light-sleep mode: The CPU is paused.
3.7 RTC and Low-Power Management 3 FUNCTIONAL DESCRIPTION Table 5: Power Consumption by Power Modes Power mode Active (RF working) Description Power consumption Wi-Fi Tx packet 13 dBm ~ 21 dBm 160 ~ 260 mA Wi-Fi / BT Tx packet 0 dBm 120 mA Wi-Fi / BT Rx and listening 80 ~ 90 mA Association sleep pattern (by Light- 0.9 mA@DTIM3, 1.2 mA@DTIM1 sleep) Max speed: 20 mA Modem-sleep The CPU is powered on. Normal speed: 5 ~ 10 mA Slow speed: 3 mA Light-sleep Deep-sleep Hibernation - 0.
4 4. Peripheral Interface 4.1 General Purpose Input / Output Interface (GPIO) PERIPHERAL INTERFACE ESP32 has 48 GPIO pins which can be assigned to various functions by programming the appropriate registers. There are several kinds of GPIOs: digital only GPIOs, analog enabled GPIOs, capacitive touch enabled GPIOs, etc. Analog enabled GPIOs can be configured as digital GPIOs. Capacitive touch enabled GPIOs can be configured as digital GPIOs.
4.8 Ultra-Lower-Power Coprocessor 4.6 4 PERIPHERAL INTERFACE Temperature Sensor The temperature sensor generates a voltage that varies with temperature. The voltage is internally converted via an analog-to-digital converter into a digital code. The temperature sensor has a range of -40°C to 125°C.
4.9 Ethernet MAC Interface 4.9 4 PERIPHERAL INTERFACE Ethernet MAC Interface An IEEE-802.3-2008-compliant Media Access Controller (MAC) is provided for Ethernet LAN communications. ESP32 requires an external physical interface device (PHY) to connect to the physical LAN bus (twisted-pair, fiber, etc.). The PHY is connected to ESP32 through 17 signals of MII or 9 signals of RMII.
4.12 4.12 I2C Interface 4 PERIPHERAL INTERFACE I2C Interface ESP32 has two I2C bus interfaces which can serve as I2C master or slave depending on the user’s configuration. The I2C interfaces support: • Standard mode (100 kbit/s) • Fast mode (400 kbit/s) • Up to 5 MHz, but constrained by SDA pull up strength • 7-bit/10-bit addressing mode • Dual addressing mode Users can program command registers to control I2C interfaces to have more flexibility. 4.
4.17 4.17 LED PWM 4 PERIPHERAL INTERFACE LED PWM The LED PWM controller can generate 16 independent channels of digital waveforms with the configurable periods and configurable duties. 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.
5.2 Recommended Operating Conditions 5. 5 ELECTRICAL CHARACTERISTICS Electrical Characteristics Note: The specifications in this charpter are tested in general condition: VBAT = 3.3V, TA = 27°C, unless otherwise specified. 5.1 Absolute Maximum Ratings Table 7: Absolute Maximum Ratings Parameter Symbol Min Max Unit Input low voltage VIL -0.3 0.25×VIO V Input high voltage VIH 0.75×VIO 3.3 V Input leakage current IIL - 50 nA Output low voltage VOL - 0.
5.4 Wi-Fi Radio 5.3 5 ELECTRICAL CHARACTERISTICS RF Power Consumption Specifications The current consumption measurements are conducted with 3.0 V supply and 25°C ambient, at antenna port. All the transmitters’ measurements are based on 90% duty cycle and continuous transmit mode. Table 9: RF Power Consumption Specifications Mode Min Typ Max Unit Transmit 802.11b, DSSS 1 Mbps, POUT = +19.5 dBm - 225 - mA Transmit 802.11b, CCK 11 Mbps, POUT = +18.5 dBm - 205 - mA Transmit 802.
5.5 Bluetooth Radio 5.5 5.5.1 5 ELECTRICAL CHARACTERISTICS Bluetooth Radio Receiver - Basic Data Rate Table 11: Receiver Characteristics-Basic Data Rate Parameter Conditions Min Typ Max Unit Sensitivity @0.1% BER - - -98 - dBm Maximum received signal @0.
5.5 Bluetooth Radio 5.5.3 5 ELECTRICAL CHARACTERISTICS Receiver - Enhanced Data Rate Table 13: Receiver Characteristics - Enhanced Data Rate Parameter Conditions Min Typ Max Unit π/4 DQPSK Sensitivity @0.01% BER - - -98 - dBm Maximum received signal @0.
5.6 Bluetooth LE Radio 5 Parameter In-band spurious emissions EDR differential phase coding 5.6 ELECTRICAL CHARACTERISTICS Conditions Min Typ Max Unit F = F0 + 1 MHz - -34 - dBm F = F0 - 1 MHz - -40.2 - dBm F = F0 + 2 MHz - -34 - dBm F = F0 - 2 MHz - -36 - dBm F = F0 + 3 MHz - -38 - dBm F = F0 - 3 MHz - -40.3 - dBm F = F0 +/- > 3 MHz - - -41.5 dBm - - 100 - % Bluetooth LE Radio 5.6.
5.6 Bluetooth LE Radio Parameter 5 ELECTRICAL CHARACTERISTICS Conditions Min Typ Max Unit F = F0 - > 3 MHz - -50 - dBm ∆ f1avg - - - 265 kHz ∆ f2max - 247 - - kHz ∆ f2avg /∆ f1avg - - -0.92 - - ICFT - - -10 - kHz Drift rate - - 0.7 - kHz/50 µs Drift Espressif Systems - - 31 2 - kHz http://www.espressif.
6 6. PACKAGE INFORMATION Package Information Figure 4: QFN48 (6x6 mm) Package Espressif Systems 32 http://www.espressif.
7 SUPPORTED RESOURCES 7. Supported Resources 7.1 Related Documentation The following link provides related documents of ESP32. • ESP32 Documentation All the available documentation and other resources of ESP32 7.2 Community Resources The following links connect to ESP32 community resources. • ESP32 Online Community An Engineer-to-Engineer (E2E) Community for ESP32 where you can ask questions, share knowledge, explore ideas and help solve problems with fellow engineers.
7.2 Community Resources 7 SUPPORTED RESOURCES Appendix A - Touch Sensor A touch sensor system is built on a substrate which carries electrodes and relevant connections with a flat protective surface. When a user touches the surface, the capacitance variation is triggered, and a binary signal is generated to indicate whether the touch is valid.
7.2 Community Resources 7 SUPPORTED RESOURCES Note: The examples illustrated in Figure 6 are not of actual scale. It is suggested that users take a human fingertip as reference. A.2. PCB Layout The recommendations for correctly routing sensing tracks of electrodes are as follows: • 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.
7.2 Community Resources 7 SUPPORTED RESOURCES Appendix B - Code Examples 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)...