E32R32P & E32N32P 3.2-inch IPS ESP32-32E Display Module User Manual
CR2024-M13286
1. Resource Description
The resource directory contains the following files:
- 1-Demo: Sample program code, third-party software library, setup instructions, and program instruction document.
- 2-Specification: Display module product specification, LCD screen specification, and LCD display driver IC initialization code.
- 3-Structure_Diagram: Display module product dimensions and 3D drawings.
- 4-DataSheet: Data books for LCD driver ST7796, resistance touch screen driver XPT2046, ESP32 master, USB to Serial IC (CH340C), audio amplifier chip FM8002E, and battery charge management Chip TP4054.
- 5-Schematic: Product hardware schematic, ESP32-WROOM-32E module IO resource allocation table, schematic, and PCB component package.
- 6-User_Manual: Product user documentation.
- 7-Tool_software: WIFI and Bluetooth test APP, debugging tools, USB to serial port driver, ESP32 Flash download tool, character take-up software, image take-up software, JPG image processing software, and serial port debugging tools.
- 8-Quick_Start: Instructions for burning bin files, using the flash download tool, and general usage.
2. Software Instructions
The steps for display module software development are:
- Build the ESP32 platform software development environment.
- If necessary, import third-party software libraries for development.
- Open the software project to be debugged or create a new one.
- Power on the display module, compile and download the debugging program, and check the running effect.
- If the software effect is not as expected, modify the program code, recompile, and download until the desired effect is achieved.
Refer to the documentation in the 1-Demo directory for detailed steps.
3. Hardware Instructions
3.1. Overview of module hardware resources
The module hardware resources are shown in the following figures:
Figure 3.1 Module hardware resources 1: Depicts the LCD Screen and Resistive Touch Screen.
Figure 3.2 Module hardware resources 2: Provides a detailed view of the module's components, including:
- Resistive Touch Input Pin
- Backlight Control Circuit
- Speaker
- Audio power interface
- SPI Peripheral interface
- I2C Peripheral interface
- Reset Key
- 5V to 3.3V Voltage Regulator Circuit
- Type-C Interface
- BOOT Key
- Battery Charge and Discharge Management Circuit
- Battery Interface
- USB to Serial Port and One-Click Download Circuit
- MicroSD Card Slot
- RGB Three-Color LED
- ESP32-WROOM-32E Module
Description of Hardware Resources:
1) LCD
The LCD display is 3.2 inches with an ST7789 driver IC and a resolution of 240x320. It connects to the ESP32 via a 4-wire SPI interface.
A. Introduction to ST7789 controller
The ST7789 controller supports up to 240*320 resolution and 172800-byte GRAM. It supports 8-bit, 9-bit, 16-bit, and 18-bit parallel port data buses, as well as 3-wire and 4-wire SPI serial ports. It offers 65K, 262K RGB color display, rotation, scrolling, and video playback. The ST7789 uses 16-bit (RGB565) for pixel display, allowing up to 65K colors. Pixel addressing is done by rows and columns, with direction determined by the scanning mode.
B. Introduction to SPI communication protocol
Figure 3.3 Writing mode timing of 4-wire SPI bus: Illustrates the timing for 4-wire SPI communication. CSX is for slave chip selection, D/CX controls data/command, and SCL is the clock signal. SDA transmits data.
Figure 3.4 4 SPI transmission data format: Shows the 8-bit transmission byte format, transmitting the most significant bit (MSB) first.
SPI communication involves CPHA (Clock Phase) and CPOL (Clock Polarity). CPOL=0 indicates a low idle state for the clock. CPHA determines data collection timing relative to the clock edge. Common methods include CPHA=0 and CPOL=0.
2) Resistive Touch Screen
The 3.2-inch resistive touch screen connects to the XPT2046 control IC via four pins: XL, XR, YU, YD.
3) ESP32-WROOM-32E Module
This module features an ESP32-DOWD-V3 chip with a dual-core 32-bit LX6 microprocessor, operating up to 240MHz. It includes 448KB ROM, 520KB SRAM, 16KB RTC SRAM, and 4MB QSPI Flash. It supports 2.4GHz WIFI, Bluetooth V4.2, and Bluetooth Low Power. It offers 26 GPIOs and supports SD card, UART, SPI, SDIO, I2C, LED PWM, motor PWM, I2S, IR, pulse counter, GPIO, capacitive touch sensor, ADC, DAC, TWAI, and other peripherals.
4) MicroSD Card Slot
Supports MicroSD cards of various capacities using SPI communication mode.
5) RGB Three-Color LED
Red, green, and blue LEDs indicate program running status.
6) Serial Port
An external serial port module is used for serial communication.
7) USB to Serial Port and One-Click Download Circuit
Features a CH340C USB-to-serial IC for USB to TTL serial communication. Includes a one-click download circuit for automatic entry into download mode.
8) Battery Interface
A two-pin interface for connecting and charging the battery.
9) Battery Charge and Discharge Management Circuit
Utilizes the TP4054 IC to control battery charging current and discharge.
10) BOOT Key
Pressing the BOOT key during power-on or reset can enter download mode. It can also function as a regular button.
11) Type-C Interface
The primary interface for power supply, program download, and serial communication.
12) 5V to 3.3V Voltage Regulator Circuit
Uses the ME6217C33M5G LDO regulator to provide a stable 3.3V output from a 2V~6.5V input, with a maximum output current of 800mA.
13) RESET Key
Pressing the RESET key resets the ESP32.
14) Resistive Touch Screen Control Circuit
Employs the XPT2046 IC to communicate with the ESP32 via SPI, obtaining touch coordinates.
15) Expand the Input Pin
Two unused IO ports are brought out for peripheral use.
16) Backlight Control Circuit
Uses a BSS138 field-effect transistor to control the LCD backlight. The backlight is on when the LCD_BL pin is high and off when low.
17) Speaker Interface
Terminals for connecting mono speakers and loudspeakers.
18) Audio Power Amplifier Circuit
Features the FM8002E audio amplifier IC to drive a small speaker. Maximum drive power is 1.5W (8 ohms) or 2W (4 ohms) at 5V.
19) SPI Peripheral Interface
A 4-wire interface for external SPI devices, sharing pins with the MicroSD card.
20) I2C Peripheral Interface
A 4-wire interface for external IIC devices.
3.2. Detailed explanation of schematic diagram of display module
1) Type-C interface circuit
Figure 3.5 Type-C interface circuit: Shows the Type-C connection. D1 is a Schottky diode for reverse current protection. D2-D4 are surge protection diodes. R1 is a pull-down resistor. The module connects to power, downloads programs, and communicates via USB.
2) 5V to 3.3V voltage regulator circuit
Figure 3.6 Voltage regulator circuit: Illustrates the voltage regulator circuit using the ME6217C33M5G LDO. Bypass filter capacitors (C16-C19) maintain voltage stability.
3) Resistive touch screen control circuit
Figure 3.7 Resistive touch screen control circuit: Details the circuit for the resistive touch screen using the XPT2046 IC. Bypass filter capacitors (C25, C27) and pull-up resistors (R22, R32) are used. The XPT2046 obtains touch coordinates and sends them to the ESP32 via ADC conversion.
4) USB to serial port and one-click download circuit
Figure 3.8 USB to serial port and one-click download circuit: Shows the circuit with the CH340C USB-to-serial IC. C6 is a filter capacitor. Q1 and Q2 are NPN transistors. The circuit enables USB to serial port communication and one-click download. The principle involves controlling the RST and DTR pins of the CH340C to manage the ESP32's reset and IO0 states for download mode.
5) Audio power amplifier circuit
Figure 3.9 Audio power amplifier circuit: Depicts the audio amplifier circuit using the FM8002E IC. RC filter components (R23, C7-C9) and gain resistors (R10, R13) are present. C10 and C11 are coupling capacitors. R11 is a pull-up resistor. JP1 is the speaker port. The SHUTDOWN pin enables the amplifier at low level.
6) ESP32-WROOM-32E main control circuit
Figure 3.10 ESP32-WROOM-32E main control circuit: Shows the ESP32-WROOM-32E module. C4 and C5 are bypass filter capacitors.
7) Key reset circuit
Figure 3.11 Key reset circuit: Illustrates the reset circuit with KEY1, pull-up resistor R4, and delay capacitor C3. The reset principle involves C3 charging and discharging to control the RESET pin.
8) Interface circuit of serial module
Figure 3.12 Interface circuit of serial module: Shows the serial port interface with a 4P connector (P2). R29 and R30 are impedance balance resistors. Q5 controls the 5V power supply. R31 is a pull-down resistor. RXD0 and TXD0 connect to serial pins.
9) Expand IO and peripheral interface circuits
Figure 3.13 Extended IO and peripheral interface circuits: Displays expanded IO and peripheral interfaces using connectors P3, P4, and JP3. R33 and R34 are I2C pull-up resistors. SPI pins are shared with the MicroSD card. IO35 and IO39 are input-only pins. Removing R33/R34 is recommended when using I2C pins for ordinary IO.
10) Battery charge and discharge management circuit
Figure 3.13 Battery charge and discharge management circuit: Shows the battery management circuit with TP4054 IC (U6). Bypass filter capacitors (C20-C23) are used. JP2 connects to the battery. Q3 (P-channel FET) and R28 manage battery discharge. R27 regulates charging current.
11) 48P LCD panel wire welding interface
Figure 3.14 18P LCD panel wiring welding interface: Details the LCD panel interface with a 18P connector (QD1). C24 is a bypass filter capacitor. The interface supports touch screen signals, LCD voltage, SPI communication, control, and backlight functions.
3.3. Precautions for display module use
- When the display module is charging with the battery and the speaker is playing audio, the total current may exceed 500mA. Pay attention to the maximum current supported by the Type-C cable and power supply interface to avoid insufficient power supply.
- During use, avoid touching the LDO voltage regulator and battery charge management IC due to high temperatures.
- When connecting IO ports, ensure correct usage to avoid misconnections and program code definition mismatches.
- Use the product safely and reasonably.