Data Sheet
4 PERIPHERAL INTERFACE
4. Peripheral Interface
4.1 General Purpose Input / Output Interface (GPIO)
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.
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.
4.2 Analog-to-Digital Converter (ADC)
ESP32 integrates 12-bit SAR ADCs and supports measurements on 18 channels (analog enabled pins). Some
of these pins can be used to build a programmable gain amplifier which is used for the measurement of small
analog signals. The ULP-coprocessor in ESP32 is also designed to measure the voltages while operating in the
sleep mode, to enable low power consumption; the CPU can be woken up by a threshold setting and/or via other
triggers.
With the appropriate setting, the ADCs and the amplifier can be configured to measure voltages for a maximum of
18 pins.
4.3 Ultra Low Noise Analog Pre-Amplifier
ESP32 integrates an ultra low noise analog pre-amplifier that outputs to the ADC. The amplification ratio is given by
the size of a pair of sampling capacitors that are placed off-chip. By using a larger capacitor, the sampling noise is
reduced, but the settling time will be increased. The amplification ratio is also limited by the amplifier which peaks
at about 60 dB gain.
4.4 Hall Sensor
ESP32 integrates a Hall sensor based on an N-carrier resistor. When the chip is in the magnetic field, the Hall
sensor develops a small voltage laterally on the resistor, which can be directly measured by the ADC, or amplified
by the ultra low noise analog pre-amplifier and then measured by the ADC.
4.5 Digital-to-Analog Converter (DAC)
Two 8-bit DAC channels can be used to convert two digital signals into two analog voltage signal outputs. The
design structure is composed of integrated resistor strings and a buffer. This dual DAC supports power supply as
input voltage reference and can drive other circuits. The dual channels support independent conversions.
Espressif Systems 21 http://www.espressif.com