E32R40T-E32N40T 4.0inch Micro Python
“
Product Specifications
- Module: 4.0-inch ESP32-32E display module
- Resolution: 320×480 pixels
- Screen Driver IC: ST7796
- Main Controller: ESP32-WROOM-32E
- Main Frequency: 240MHz
- Wireless Connectivity: 2.4G WIFI, Bluetooth
- Thonny Version: 4.1.6
- MicroPython Firmware Version: 1.24.1
Pin Allocation Instructions
Rear view of 4.0-inch ESP32-32E display module:
ESP32-32E Pin Allocation Instructions:
Onboard Device | Device Pins | ESP32-32E Connection Pin | Description |
---|---|---|---|
TFT_CS | LCD | IO15 | LCD screen chip selection control signal, low level effective |
Example Program Usage Instructions
- Set up ESP32 MicroPython development
environment: Follow the steps provided in the
documentation to set up the development environment. - Upload files: Transfer the necessary files to
the ESP32 module as instructed. - Example Program Usage: Execute the example
program based on the provided guidelines.
Frequently Asked Questions (FAQ)
Q: How do I reset the ESP32-32E module?
A: Press the RESET_KEY button, which is shared
with the LCD screen reset, to perform a low-level reset.
Q: What is the power interface for the module?
A: The module features a Type-C power interface
that is connected to a 5V voltage source.
“`
LCDWIKI
E32R40T&E32N40T MicroPython Demo Instructions
CR2025-MI3570
E32R40T&E32N40T 4.0inch MicroPython
Demo Instructions
www.lcdwiki.com
1 / 10
LCDWIKI
E32R40T&E32N40T MicroPython Demo Instructions
CONTENTS
CR2025-MI3570
1. Software and hardware platform description …………………………… 3 2. Pin allocation instructions ……………………………………………………………………… 3 3. Instructions for the example program ……………………………………………..5
3.1. Set up ESP32 MicroPython development environment ………………………5 3.2. Upload files ……………………………………………………………………………………………… 5 3.3. Example Program Usage Instructions ………………………………………………….. 9
www.lcdwiki.com
2 / 10
LCDWIKI
E32R40T&E32N40T MicroPython Demo Instructions
CR2025-MI3570
1 Software and hardware platform description
Module: 4.0-inch ESP32-32E display module with 320×480 resolution and ST7796 screen driver IC.
Module master: ESP32-WROOM-32E module, the highest main frequency 240MHz, support 2.4G WIFI+ Bluetooth.
Thonny version: 4.1.6 ESP32 MicroPython firmware version: 1.24.1.
2 Pin allocation instructions
Figure 2.1 Rear view of 4.0-inch ESP32-32E display module
The main controller of the 4.0-inch ESP32 display module is ESP32-32E, and the GPIO allocation for its onboard peripherals is shown in the table below:
ESP32-32E pin allocation instructions
On board On board device device pins
TFT_CS
LCD TFT_RS
ESP32-32E connection pin
IO15
IO2
description
LCD screen chip selection control signal, low level effective
LCD screen command/data selection control signal.High level: data, low level: command
www.lcdwiki.com
3 / 10
LCDWIKI
E32R40T&E32N40T MicroPython Demo Instructions
CR2025-MI3570
TFT_SCK TFT_MOSI TFT_MISO TFT_RST
TFT_BL
TP_SCK
TP_DIN
RTP
TP_DOUT
TP_CS
TP_IRQ
LED_RED
LED
LED_GREEN
LED_BLUE
SD_CS
SDCARD
SD_MOSI SD_SCK SD_MISO
BATTERY BAT_ADC
Audio
Audio_ENABLE Audio_DAC
KEY
BOOT_KEY
IO14 IO13 IO12
EN
IO27
IO14 IO13 IO12 IO33
IO36
IO22 IO16 IO17 IO5 IO23 IO18 IO19 IO34 IO4 IO26 IO0
SPI bus clock signal (shared by LCD screen and touch screen) SPI bus writes data signals (shared by LCD screen and touch screen) SPI bus reading data signal (shared by LCD screen and touch screen) LCD screen reset control signal, low level reset (shared reset pin with ESP32-32E main control) LCD screen backlight control signal (high level lights up the backlight, low level turns off the backlight) SPI bus clock signal (shared by touch screen and LCD screen) SPI bus writes data signals (shared by touch screen and LCD screen) SPI bus reading data signal (shared by touch screen and LCD screen) Resistance touch screen chip selection control signal, low level effective Resistive touch screen touch interrupt signal, when a touch is generated, input a low level to the main control
Red LED light Green LED light Blue LED light
RGB tri color LED light, with a common anode, lit at low level and turned off at high level.
SD card signal selection, low level effective
SD card SPI bus write data signal
SD card SPI bus clock signal
SD card SPI bus read data signal
Battery voltage ADC value acquisition signal (input) Audio enable signal, low-level enable, high-level disable
Audio signal DAC output signal
Download mode selection button (press and hold the button to power on, then
www.lcdwiki.com
4 / 10
LCDWIKI
E32R40T&E32N40T MicroPython Demo Instructions
CR2025-MI3570
release it to enter download mode)
RESET_KEY
EN
ESP32-23E reset button, low level reset
(shared with LCD screen reset)
RX0 Serial Port
TX0
RXD0 TXD0
ESP32-32E serial port receiving signal ESP32-32E serial port sends signal
POWER TYPE-C_POWER
/
Type-C power interface, connected to 5V voltage.
Table 2.1 Pin allocation instructions for ESP32-32E onboard peripherals
3 Instructions for the example program
3.1. Set up ESP32 MicroPython development environment
For detailed instructions on setting up the “MicroPython_development_environment_construction_for_ESP32”, please refer to the document.
3.2. Upload files
After the development environment is set up, the relevant files need to be uploaded to the ESP32 device in order to run the testing program.
Before uploading the file, please familiarize yourself with the directory contents of the MicroPython sample program. Open the “1-_DemoMicroPython” directory in the package, as shown in the following figure:
www.lcdwiki.com
Figure 3.1 MicroPython Example Program Catalog
5 / 10
LCDWIKI
E32R40T&E32N40T MicroPython Demo Instructions
CR2025-MI3570
The contents of each folder are described as follows: BMP: Stores BMP format images that sample programs need to use. demos: Contains sample programs firmware: Stores MicroPython firmware (needs to be burned when setting up the development environment) Font: Stores the Chinese and English character modulo data that the sample program needs to use. libraries: Stores MicroPython library files that sample programs need to use
After understanding the directory contents of the MicroPython sample program, the next step is to upload the program file to the ESP32 device. The steps are as follows:
A. Connect the ESP32 display module to the computer and power it on using a USB cable.
B. Open the Thonny software and configure the MicroPython interpreter for ESP32, as shown in the following figure: (If already configured, this step can be omitted)
Figure 3.2 Selecting MicroPython interpreter
C. Click the toolbar
button to connect the ESP32 device. If the following
www.lcdwiki.com
6 / 10
LCDWIKI
E32R40T&E32N40T MicroPython Demo Instructions
CR2025-MI3570
prompt appears in the shell information bar, it indicates that the device connection is successful.
Figure 3.3 Connecting ESP32 devices D. Click the “View ->Files” button to open the file window (ignore this operation if
it is already open). Find the “1-_DemoMicroPython” directory in the package in the window, left click the mouse to select the target file in the directory, and right-click on the standalone mouse to select “Upload to /” to upload the target file. As shown in the following figure: Please note that when uploading files, ESP32 cannot run any programs, otherwise the upload will fail
www.lcdwiki.com
7 / 10
LCDWIKI
E32R40T&E32N40T MicroPython Demo Instructions
CR2025-MI3570
Figure 3.4 Uploading Files to ESP32 Devices E. Upload the files from the “BMP”, “Font”, and “libraries” directories to the
ESP32 device using the above method. The files in the ‘demos’ directory can be transferred or not. As shown in the following figure:
www.lcdwiki.com
Figure 3.5 Completed file upload
8 / 10
LCDWIKI
E32R40T&E32N40T MicroPython Demo Instructions
CR2025-MI3570
3.3. Example Program Usage Instructions
The sample program is located in the “1-_DemoMicroPythondemos” directory of the package, as shown in the following: figure:
Figure 3.6 Example Program The sample program can be uploaded to an ESP32 device to open and run, or it can be opened and run on a local computer. If you need to power on the ESP32 display module to run automatically, you need to change the sample program name to “main. py” and upload it to the ESP32 display module. In the Python software, open the target sample program, click the menu bar
button, and you can run it. If the operation fails, the ESP32 device needs to be reconnected.
The introduction of each example program is as follows: BMP_test.py
This example program relies on the ST7796.py library to display images in BMP format font_test.py
This example program relies on the ST7796.py library to display Chinese and English characters of various sizes. The font modeling data needs to be saved in the font file according to the relevant format. For instructions on character casting, please refer to the following website:
http://www.lcdwiki.com/Chinese_and_English_display_modulo_settings
www.lcdwiki.com
9 / 10
LCDWIKI
E32R40T&E32N40T MicroPython Demo Instructions
CR2025-MI3570
graphical_test.py This example program relies on the ST7796.py library to display graphics
such as points, lines, rectangles, rounded rectangles, triangles, circles, ellipses, etc. for drawing and filling, as well as setting display orientation. Read_ID_GRAM.py
This example program relies on the ST7796.py library to display LCD ID and RGAM color value readings. RGB_LED.py
This example hardware requires the use of RGB tri color lights to display the on/off and brightness adjustment of the RGB tri color lights. Simple_test.py
This example does not rely on any software libraries and displays simple screen scrolling content. Touch_Calibrate.py
This example relies on the ST7796.py library and the touch.exe library, displaying the calibration of a resistive touch screen. Follow the prompts displayed on the screen. After calibration is completed, the calibration parameters are output through the serial port and copied to the initialization of the sample program. Please note that the touch screen should be calibrated according to the display direction. The display direction in this program can be modified, as shown in the following figure:
Figure 3.7 Modifying the Touch Calibration Display Direction Touch_Pen.py
This example relies on the ST7796.py library and the touch.exe library,
displaying the operation of drawing dots and lines on the touch screen.
www.lcdwiki.com
10 / 10
Documents / Resources
![]() |
EBYTE E32R40T-E32N40T 4.0inch Micro Python [pdf] Instructions E32R40T, E32N40T, E32R40T-E32N40T 4.0inch Micro Python, E32R40T-E32N40T, 4.0inch Micro Python, Micro Python |