Difference between revisions of "ESP32-S3-Touch-LCD-7"

From Waveshare Wiki
Jump to: navigation, search
Line 174: Line 174:
 
====Library Installation====
 
====Library Installation====
 
*TFT_SPI and lvgl libraries require configuration files after installation. It's recommended to directly copy the ESP32_Display_Panel, ESP32_IO_Expander, lvgl file, ESP_Panel_Conf.h, and lv_conf.h file of the [ ESP32-S3-Touch-LCD-4.3_libraries] to "C:\Users\xxxx\Documents\Arduino\libraries". Please note that "xxxx" represents your computer username.<br>
 
*TFT_SPI and lvgl libraries require configuration files after installation. It's recommended to directly copy the ESP32_Display_Panel, ESP32_IO_Expander, lvgl file, ESP_Panel_Conf.h, and lv_conf.h file of the [ ESP32-S3-Touch-LCD-4.3_libraries] to "C:\Users\xxxx\Documents\Arduino\libraries". Please note that "xxxx" represents your computer username.<br>
[[File: ESP32-S3-Touch-LCD-4.3-Lib.png]]
+
[[File: ESP32-S3-Touch-LCD-7-Lib.png]]
 
*After copying:
 
*After copying:
[[File: ESP32-S3-Touch-LCD-4.3-Lib02.png]]
+
[[File: ESP32-S3-Touch-LCD-7-Lib02.png]]
  
 
==Sample Demo==
 
==Sample Demo==

Revision as of 08:28, 23 April 2024

ESP32-S3-Touch-LCD-7
ESP32-S3-Touch-LCD-7.jpg

ESP32-S3-N8R8
Type C USB
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

Overview

Introduction

The ESP32-S3-Touch-LCD-7 is a low-cost, high-performance microcontroller development board designed by Waveshare. It features 2.4GHz WiFi and BLE 5, integrates large Flash storage and PSRAM, and a 7-inch capacitive touch LCD screen. Support running GUI interface demos such as LVGL. It also has multiple external peripheral interfaces (such as CAN, I2C, RS485, and Sensor) for developing applications such HMI on ESP32-S3. With various functions and interfaces, it is suitable for power requirements in IoT, mobile devices, wearable electronics, and smart home applications.

Features

  • Equipped with Xtensa® 32-bit LX7 dual-core processor, up to 240MHz main frequency.
  • Supports 2.4GHz Wi-Fi (802.11 b/g/n) and Bluetooth® 5 (LE), with onboard antenna.
  • Onboard 7-inch capacitive touch screen, 800x480 resolution, 65K colors.
  • Support capacitive touch control via I2C interface, 5-point touch control, and 65K colors.
  • Onboard CAN, RS485, I2C interface, SD card slot and so on, integrates full-speed USB serial port.
  • Support flexible clock, module power supply independent setting, and other controls to realize low power consumption in different scenarios.

Hardware Description

ESP32-S3-TOUCH-LCD-7-04.png

  • UART Interface : Use the CH343P chip for USB to UART connection to ESP32-S3's UART_TXD (GPIO43) and UART_RXD (GPIO44) for firmware burning and log printing.
  • USB Interface: GPIO19(DP) and GPIO20 (DN) are default USB pins for ESP32-S3, supporting interfaces such as UVC for cameras. Refer to UVC driver documentation for details.
  • Sensor Interface: This interface connects to GPIO6 for ADC usage, suitable for connecting sensor pack and so on.
  • CAN Interface: CAN interface pins are multiplexed with USB interface pins, using the FSUSB42UMX chip for switching. By default, USB interface is used when FSUSB42UMX's USB_SEL pin is LOW.
  • I2C Interface: ESP32-S3 provides multiple hardware I2C channels. Currently, GPIO8 (SDA) and GPIO9 (SCL) are used for I2C bus connection to IO expansion chips and touch interfaces.
  • RS485 Interface: The development board features onboard RS485 interface circuit, enabling direct communication with RS485 devices. RS485 circuit automatically switches between receive and transmit modes.
  • PH2.0 battery header: The development board employs the efficient charge and discharge management chip CS8501, capable of boosting single-cell lithium batteries to 5V. Currently, the charging current is set to 580mA, and users can modify the charging current by replacing the R45 resistor. Refer to the schematic for details.
Pinout
ESP32-S3-WROOM-x LCD USB SD UART CAN Sensor
GPIO0 G3
GPIO1 R3
GPIO2 R4
GPIO3 VSYNC
GPIO4 TP_IRQ
GPIO5 DE
GPIO6 AD
GPIO7 PCLK
GPIO8 TP_SDA
GPIO9 TP_SCL
GPIO10 B7
GPIO11 MOSI
GPIO12 SCK
GPIO13 MISO
GPIO14 B3
GPIO15 RS485_TX
GPIO16 RS485_RX
GPIO17 B6
GPIO18 B5
GPIO19 USB_DN CANRX
GPIO20 USB_DP CANTX
GPIO21 G7
GPIO38 B4
GPIO39 G2
GPIO40 R7
GPIO41 R6
GPIO42 R5
GPIO43 UART_TXD
GPIO44 UART_RXD
GPIO45 G4
GPIO46 HSYNC
GPIO47 G6
GPIO48 G5
CH422G - - - - - -
EXIO1 TP_RST
EXIO2 DISP
EXIO3 LCD_RST
EXIO4 SD_CS
EXIO5 USB_SEL(LOW) USB_SEL(HIGH)

Hardware Connection

File:ESP32-S3-Touch-LCD-7-10.png

  • ESP32-S3-Touch-LCD-7 comes with an onboard automatic download circuit. The Type C port, marked UART1, is used for demo downloads and logging. Once the program is downloaded, run it by pressing the RESET button.
  • UART2 is adapted through the PH2.0 connector and shares the same serial port as UART1. It can be selected via a switch on the board. When using UART2 for programming, manual download is required.
  • When using, be cautious around the PCB antenna area to avoid interference from other metals or plastic components pressing against the PCB antenna.
  • The development board employs the PH2.0 connector to expose ADC, CAN, I2C, and RS485 peripheral pins. Sensors can be connected using PH2.0 to 2.54mm DuPont male header accessories.
  • Most GPIO pins are occupied by the 7-inch screen. The development board utilizes the CH422G chip to expand IO, used for functions such as reset, and backlight control.
  • For CAN and RS485 peripherals, 120-ohm termination resistors are connected by default via jumpers. They can be optionally disconnected by setting the jumpers to NC.
  • The SD card communicates via SPI, and it's important to note that the SD_CS pin needs to be driven by the EXIO4 of the CH422G.

Notes

  • Currently, running the LVGL benchmark example on ESP-IDF v5.3 with a single core has an average frame rate limit of 26, corresponding to an interface frame rate of 41 (PCLK 21 MHz). Before compiling, you need to configure ESP32 and LVGL through menuconfig.
CONFIG_FREERTOS_HZ=1000
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
CONFIG_ESPTOOLPY_FLASHFREQ_120M=y [should align with PSRAM]
CONFIG_SPIRAM_MODE_OCT=y
CONFIG_IDF_EXPERIMENTAL_FEATURES=y and CONFIG_SPIRAM_SPEED_120M=y [should align with FLASH]
CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y
CONFIG_SPIRAM_RODATA=y
CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y
CONFIG_COMPILER_OPTIMIZATION_PERF=y
#Configure the following LVGL items for improving frame rate (LVGL v8.3):
#define LV_MEM_CUSTOM 1 or CONFIG_LV_MEM_CUSTOM=y
#define LV_MEMCPY_MEMSET_STD 1 or CONFIG_LV_MEMCPY_MEMSET_STD=y
#define LV_ATTRIBUTE_FAST_MEM IRAM_ATTR or CONFIG_LV_ATTRIBUTE_FAST_MEM=y
  • For more details about LCD and LVGL performance, you can refer to this document.
  • The lithium battery socket only supports single-cell 3.7V lithium batteries. Do not use multiple battery packs for charging and discharging simultaneously. It is recommended to use a single-cell battery with a capacity of below 2000mAh.

Dimensions

[[File:

Environment Setting

The software framework for ESP32 series development boards is completed, and you can use MicroPython, and C/C++ (Arduino, ESP-IDF) for rapid prototyping of product development. Here's a brief introduction to these three development approaches:

  • Official C/C++ library installation:
    • ESP32 series Arduino development tutorial.
    • ESP32 series ESP-IDF development tutorial.
  • MicroPython is an efficient implementation of the Python 3 programming language that includes a small subset of the Python standard library and is optimized to run on microcontrollers and in restricted environments. (Development of this product is not currently supported.)
  • Environment setting is supported on Windows 10. Users can select Arduino/Visual Studio Codes (ESP-IDF) as IDE to develop. For Mac/Linux, users can refer to official introduction.

ESP-IDF

Arduino

ESP32-C6-DEV-KIT-N8-Arduino01.png

  • Install ESP32 on the Arduino IDE as shown below, and you can refer to this link.
  • File -> Preferences -> Additional Boards Managers URLs -> Add the following links:
https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json

ESP32-C6-DEV-KIT-N8-Arduino04.png
ESP32-C6-DEV-KIT-N8-Arduino05.png

  • Enter the development board manager, search for "esp32", select version 3.0.0-alpha3 under "esp32 by Espressif Systems" below, and reboot it after installation.

ESP32-C6-DEV-KIT-N8-Arduino07.png
3. Open the Arduino IDE and note that Tools in the menu bar selects the corresponding Flash (8MB) and enables PSRAM (8MB OPI), as shown in the following figure.
ESP32-S3-Touch-LCD-4.3-Ar02.jpg

Library Installation

  • TFT_SPI and lvgl libraries require configuration files after installation. It's recommended to directly copy the ESP32_Display_Panel, ESP32_IO_Expander, lvgl file, ESP_Panel_Conf.h, and lv_conf.h file of the [ ESP32-S3-Touch-LCD-4.3_libraries] to "C:\Users\xxxx\Documents\Arduino\libraries". Please note that "xxxx" represents your computer username.

File:ESP32-S3-Touch-LCD-7-Lib.png

  • After copying:

File:ESP32-S3-Touch-LCD-7-Lib02.png

Sample Demo