ESP32-S3-Touch-LCD-1.69

From Waveshare Wiki
Jump to: navigation, search
ESP32-S3-Touch-LCD-1.69
ESP32-S3-Touch-LCD-1.69.jpg

1.69inch, 240 × 280
USB, UART, I2C
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

{{{name6}}}

Overview

Introduction

ESP32-S3-Touch-LCD-1.69 is a cost-effective, high-performance microcontroller development board designed by Waveshare. On the small plates, onboard a 1.69inch capacitive touch LCD screen, Lithium battery charging chip, 6-axis sensor (3-axis accelerator and 3-axis gyroscope), and peripheral interface such as RTC, easy to develop and embed into products.

Features

  • Equipped with high-performance Xtensa®32-bit LX7 dual-core processor, main frequency running up to 240MHz.
  • Support 2.4 GHz Wi-Fi (802.11 b/g/n) and Bluetooth® 5 (LE), and onboard antenna.
  • Built-in 512KB SRAM and 384KB ROM, 8MB PSRAM, and external 16MB Flash.
  • Onboard 1.69inch capacitive touch LCD screen, 240×280 resolution, 262K colors, can clearly display color pictures.

Screen display picture

ESP32-S3-Touch-LCD-1.69-240423 03.png ESP32-S3-Touch-LCD-1.69-240527-2.png ESP32-S3-Touch-LCD-1.69-240527-1.png

ESP32-S3-Touch-LCD-1.69 platformIO 05.png ESP32-S3-Touch-LCD-1.69 platformIO 06.png ESP32-S3-Touch-LCD-1.69 platformIO 07.png ESP32-S3-Touch-LCD-1.69 platformIO 08.png ESP32-S3-Touch-LCD-1.69 platformIO 09.png ESP32-S3-Touch-LCD-1.69 platformIO 10.png

Hardware Description

  • Onboard patch antenna, uses 0 ohm shorted optional external antennas, as shown in ⑩.
  • Onboard PCF85063 RTC chip with reserved SH1.0 RTC battery header (support charging), supports timing function, as shown in ③ and ⑨.
  • Onboard QMI8658C 6-axis Inertial Measurement Unit (IMU), including a 3-axis gyroscope and a 3-axis accelerator, as shown in ④.
  • Onboard ETA6098 high-performance Lithium battery charging chip, M1.25 Lithium battery interface, easy to install lithium batteries charge and discharge for long-term usage, as shown in ⑤ and ⑥.
  • Onboard buzzer can be utilized as an audio peripheral, as shown in ⑧.
  • Onboard Type-C interface, connect to ESP32-S3 USB for demo programming and log printing, as shown in ⑦.
  • Onboard BOOT and RST function buttons, easy to reset and enter the download mode, as shown in ⑫ and ⑬.
  • Onboard function circuit button, can be customized as the power-on button, and can identify single pressing, double pressing, and long pressing, as shown in ⑪.

ESP32-S3-Touch-LCD-1.69-Hard.jpg
17225613021962.png

Pinout Definition

ESP32-S3-Touch-LCD-1.69-details-5.jpg

Dimensions

ESP32-S3-Touch-LCD-1.69 Dim.jpg

LCD Description

LCD and its Controller

  • The built-in controller used in this LCD is ST7789V2, which is an LCD controller with 240 × RGB × 320 pixels, while the pixels of this LCD are 240(H) × RGB × 280(V). Hence, the LCD's internal RAM is not fully used.
  • This LCD supports 12-bit, 16-bit, and 18-bit per pixel input color formats, namely RGB444, RGB565, and RGB666 color formats, this demo uses RGB565 color format, which is also commonly used RGB Format.
  • This LCD uses a four-wire SPI communication interface, which can greatly save the GPIO port, and the communication speed will be faster.
  • The resolution of this module is 240(H) × RGB × 280(V), but sometimes it may not fully display your images as it is round in corners.

SPI Communication Protocol

0.96inch lcd module spi.png
Note: The difference from the traditional SPI protocol is that the data line sent from the slave to the host is hidden because it only needs to be displayed. Please refer to Datasheet Page 66 for the table.
RESX is reset, it is pulled low when the module is powered on, usually set to 1;
CSX is the slave chip selection, and the chip will be enabled only when CS is low.
D/CX is the data/command control pin of the chip, when DC = 0, write command, when DC = 1, write data.
SDA is the transmitted data, that is, RGB data;
SCL is the SPI communication clock.
For SPI communication, data is transmitted with timing, that is, the combination of clock phase (CPHA) and clock polarity (CPOL):
The level of CPHA determines whether the data is collected on the first clock transition edge or the second clock transition edge of the serial synchronization clock. When CPHA = 0, data acquisition is performed on the first transition edge;
The level of CPOL determines the idle state level of the serial synchronous clock. CPOL = 0, which is a low level.
As can be seen from the figure, at the first falling edge of SCLK it starts to transmit data, 8-bit data is transmitted in one clock cycle, using SPI0, bit-by-bit transmission, high bit first, and low bit last.

Touch and its Controller

  • This LCD is composed of surface toughened glass + thin film FILM material, which has high strength, strong hardness, and good light transmittance. The matching driver chip is CST816D self-capacitance touch chip, which supports the standard I2C communication protocol standard, which can realize a 10Khz~400Khz configurable communication rate.

I2C Communication Protocol

  • The 7-bit device address of the chip is 0x15, that is, the device writing address is 0x2A, and reading address is 0x2B.
  • Waveform introduction:
    • Write a single byte: (write 0x01 to 0x1F register)
    • 1.28inch Touch LCD02.jpg
    • Write multiple bytes consecutively (write 0x20, 0x01 to 0x1E and 0x1F respectively)
    • 1.28inch Touch LCD03.jpg
    • Read a single byte (read a single byte from 0x21)
    • 1.28inch Touch LCD04.jpg
    • Read multiple bytes consecutively (read 3 bytes from 0x21, 0x22, 0x23)
    • 1.28inch Touch LCD05.jpg

Sample Demo

Arduino IDE

Environment Setup

Install Arduino IDE

  1. Open the official website software download interface, select the corresponding system and system bits to download
    ESP32-S3-Pico-Ar-01.jpg
  2. You can choose to download directly, or you can choose to contribute and download
    ESP32-S3-Pico-Ar-02.jpg
  3. Run the installer and install all by default

Install arduino-esp32 online

  1. Open Preferences
    ESP32-S3-Pico-Ar-03.jpg
  2. Add the corresponding board management link and click this button
    ESP32-S3-Pico-Ar-04.jpg
  3. In the first blank space, add the following
    https://espressif.github.io/arduino-esp32/package_esp32_index.json

  4. Save the setup
  5. Open the board manager and search for ESP32, select version 3.0.5 or above
    ESP32-S3-Touch-AMOLED-1.8 241014 01.png
  6. Wait for the download. Note: The download time is long, please be patient
    ESP32-S3-Pico-Ar-07.jpg
  7. The arduino-esp32 download is complete
    ESP32-S3-Pico-Ar-08.jpg

Run library installation

When using the LVGL library, you need to modify the configuration of the corresponding screen. It is recommended to use the lib library in the demo directly. Copy the library folder to the C:\Users\xxxx\Documents\Arduino\libraries directory. xxxx represents the user name on your computer, so be careful. When copying a library, please note that if there are other libraries in the directory, please clean or migrate them first to avoid replacement or library conflicts ESP32-S3-Touch-LCD-1.69 241017 01.png


ESP32-S3-Touch-LCD-1.69 Library file description
File name Description Version Can it be downloaded directly?
Arduino_DriveBus CST816 touch chip driver library —— ——
GFX_Library_for_Arduino ST7789 GFX graphical library v1.4.9 Yes
lvgl LVGL graphical library v8.4.0 Yes. Demos folder needs to be copied to src after downloading, it is recommended to use existing library
Mylibrary development board pin macros definition —— ——
SensorLib PCF85063 and QMI8658 sensor driver library v0.2.1 Yes
lv_conf.h LVGLconfiguration file —— ——

Get started

  1. Use the TYPT-C to TYPE-A cable to connect the development board to the computer
  2. The Arduino IDE board searches for waveshare esp32-s3-touch-lcd-1.69 and specifies the COM port

ESP32-S3-Touch-LCD-1.69 241017 02.png

Hello World example

This example demonstrates how to control the ST7789 display using the Arduino GFX library and the Arduino DriveBus library, demonstrating basic graphics library functionality with dynamically changing text. This code can also be used to test the basic performance of the display and the display of random text.
Key code snippets

1. Display initialization:

if (!gfx->begin()) {
  USBSerial.println("gfx->begin() failed!");
}

2. Clear the screen and display text:

gfx->fillScreen(BLACK);
gfx->setCursor(10, 10);
gfx->setTextColor(RED);
gfx->println("Hello World!");

3. The animation shows:

gfx->setCursor(random(gfx->width()), random(gfx->height()));
gfx->setTextColor(random(0xffff), random(0xffff));
gfx->setTextSize(random(6), random(6), random(2));
gfx->println("Hello World!");

Effect demonstration

ESP32-S3-Touch-LCD-1.69 241017 04.png ESP32-S3-Touch-LCD-1.69 241017 05.png

Drawing board example

This example demonstrates how to use the ESP32 to control a CST816 touch controller and a TCA9554 GPIO expander via the I2C interface, while using the Arduino GFX library to drive an ST7789 display.
Key code snippets

1 Display initialization and brightness gradient animation:

gfx->begin();
gfx->fillScreen(WHITE);
for (int i = 0; i <= 255; i++) {
  gfx->Display_Brightness(i);
  gfx->setCursor(30, 150);
  gfx->setTextColor(BLUE);
  gfx->setTextSize(4);
  gfx->println("Loading board");
  delay(3);
}

Effect demonstration

ESP32-S3-Touch-LCD-1.69 241017 06.png

GFX AsciiTable example

This example shows how to display a basic ASCII character table on an ST7789 display on an ESP32 using the Arduino GFX library. The core function of the code is to initialize the display screen and print ASCII characters in rows and columns on the display screen according to the screen size.
Effect demonstration

ESP32-S3-Touch-LCD-1.69 241017 07.png

GFX ESPWiFiAnalyzer example

This example demonstrates an example of plotting WiFi band signal strength on the ST7789 display to implement the function of a WiFi analyzer.


Effect demonstration

ESP32-S3-Touch-LCD-1.69 241017 08.png

GFX Clock example

This example demonstrates a simple ST7789 clock example implemented with simple tag pointers and time management

Key code snippets

1 Drawing of hour, minute and second hands

void redraw_hands_cached_draw_and_erase() {
    gfx->startWrite();
    draw_and_erase_cached_line(center, center, nsx, nsy, SECOND_COLOR, cached_points, sHandLen + 1, false, false);
    draw_and_erase_cached_line(center, center, nhx, nhy, HOUR_COLOR, cached_points + ((sHandLen + 1) * 2), hHandLen + 1, true, false);
    draw_and_erase_cached_line(center, center, nmx, nmy, MINUTE_COLOR, cached_points + ((sHandLen + 1 + hHandLen + 1) * 2), mHandLen + 1, true, true);
    gfx->endWrite();
}

Effect demonstration

ESP32-S3-Touch-LCD-1.69 241017 09.png

GFX PCF85063 simpleTime example

This example demonstrates using the PCF85063 RTC module to display the current time on an ST7789 display, retrieving the time every second and updating the display only when the time changes

Effect demonstration

ESP32-S3-Touch-LCD-1.69 241017 10.png

LVGL Measuring voltage example

The board is reserved for voltage measurement by dividing the voltage. Use GPIO1 to read the analog value and obtain the battery voltage through the voltage dividing formula.

Effect demonstration

ESP32-S3-Touch-LCD-1.69 241017 11.png

LVGL PCF85063 simpleTime example

This example demonstrates using the PCF85063 RTC module to display the current time on the ST7789 display under LVGL, retrieving the time every second and updating the display only when the time changes. The comparison time refresh effect is better
Effect demonstration

ESP32-S3-Touch-LCD-1.69 241017 12.png

PWR_Key

This function button is designed to solve the problem that peripheral buttons have few functions. The working principle is as follows:

After pressing the PWR, the battery can be powered, and when the system starts, the system should define GPIO35 to continuously output a high level to maintain the power-up effect, and the PWR will not be powered off when the PWR is released. The function of PWR at this time can pull down GPIO36, the system detects GPIO36 press, continuous press and long press, and can customize the shutdown control operation, such as the system sets GPIO35 low level to disconnect the battery power supply in long press mode, and the multi-function button can be used.
Effect demonstration

ESP32-S3-Touch-LCD-1.69 240802 09.png

LVGL QMI8658 ui example

This example demonstrates the use of LVGL for graphics display, communicating with the QMI8658 IMU to obtain accelerometer and gyroscope data

Effect demonstration

ESP32-S3-Touch-LCD-1.69-240423 01.png

ESP32-S3-Touch-LCD-1.69 240802 06.png

LVGL Arduino example

This example demonstrates the LVGL Widgets example. The frame rate can reach 20~30 frames in dynamic state


Effect demonstration

ESP32-S3-Touch-LCD-1.69 240529 01.png ESP32-S3-Touch-LCD-1.69 240529 02.png ESP32-S3-Touch-LCD-1.69 240529 03.png

ESP32-S3-Touch-LCD-1.69 240802 03.png ESP32-S3-Touch-LCD-1.69 240802 02.png ESP32-S3-Touch-LCD-1.69 240802 11.png

Usage of LVGL Components When developing using the LVGL framework, you can call the components according to the component instructions provided by the LVGL official documentation LVGL8.3 Documents

Below is a practical component investigation case for the LVGL library in the Arduino IDE

ESP32-S3-Touch-LCD-1.69 240802 05.png ESP32-S3-Touch-LCD-1.69 240802 10.png

ESP-IDF

Introduction to ESP-IDF and Environment Setup (VSCode)

ESP-IDF(Espressif IoT Development Framework) is an open source IoT development framework launched by Espressif, specifically used for the development of its ESP32 series chips. ESP-IDF provides the necessary tools and libraries to build IoT applications, including Wi-Fi, Bluetooth, peripheral drivers, file systems, network protocol stacks, encryption, security and real-time operating system (FreeRTOS), etc.

The following description only applies to building using VSCode + ESP-IDF environment

  • PS:
    • If you want to use the Eclipse editor as the main development environment, please click the link to download Espressif-IDE to install and replace the ESP-IDF version ≥ v5.3.1
    • If errors and exceptions such as TSL Error and Network Error occur during the installation of ESP-IDF as described below, please clean the directory folders again, ensure that the network environment is stable and free of agent contamination, etc., and reinstall. It takes a long time, please be patient.

Prerequisites

  1. If you are using Mac or Linux, please install the following -install-prerequisites ESP-IDF prerequisites. If you are using Windows, ignore this step.

Install VSCode

  1. Open the download page on the VSCode official website, select the corresponding system and system bits to download
    Esp32-vscod-01.jpg
  2. After running the installation package, the rest can be installed by default. However, for the sake of subsequent experience, it is recommended to check items 1, 2, and 3 in the box here.
    Esp32-vscod-02.jpg
    • When the first and second items are turned on, you can open VSCode directly by right-clicking the file or directory, which can improve the subsequent use experience.
    • When the third item is turned on, and when selecting the opening method, you can directly select VSCode

Install ESP-IDF plug-in

  1. Open VSCode, click on the plug-in manager, and search for ESP-IDF to download and install, as shown in the figure:
    ESP32-P4 VSCode ESP-IDF env 240905 01.png
  2. After installation, the Espressif logo on the left toolbar is the plug-in. Click to enter the plug-in (there will be a short period of time to load the program), select EXPRESS Perform quick installation, as shown in the figure:
    ESP32-P4 VSCode ESP-IDF env 240905 02.png

Install the ESP-IDF development environment

  1. Enter the EXPRESS installation interface, confirm that the ESP-IDF version ≥ v5.3.1 release version, the ESP-IDF directory and the ESP-IDF tool directory, click Install and wait patiently for the installation steps. Completed, as shown in the figure:
    ESP32-P4 VSCode ESP-IDF env 240905 03.png
  2. If you are a user in China, you can choose the download server as Espressif. The installation process is relatively slow. Make sure the network is in good condition and wait patiently for the installation to complete. ESP32-P4 VSCode ESP-IDF env 240905 04.png
  3. Installation process display:
    ESP32-P4 VSCode ESP-IDF env 240905 05.png
  4. Installation complete flag:
    ESP32-P4 VSCode ESP-IDF env 240905 06.png

Introduction to basic structure of ESP-IDF project

  • Open the ESP-IDF plug-in, click New project, select the ESP-IDF sample-->sample_project-->Click Create
    ESP32-P4 VSCode ESP-IDF GettingStart 240905 01.png
  • Create a new one and open it in the window. You can see the structure of VSCode as follows:
├── CMakeLists.txt
├── main
│   ├── CMakeLists.txt
│   └── main.c
└── README.md                  

ESP-IDF Project details

  • Component: The components in ESP-IDF are the basic modules for building applications. Each component is usually a relatively independent code library or library that can implement specific functions or services and can be reused by applications or other components. Similar to the definition of libraries in Python development.
    • Component reference: In the Python development environment, the importing a library only needs to "import library name or path", while ESP-IDF is based on C language, and the importing a library is configured and defined through the CMakeLists.txt.
    • The role of CmakeLists.txt: When compiling ESP-IDF, the compilation tool CMake will first read the build rules by reading the contents of the top-level CMakeLists.txt of the project directory and identify the content that needs to be compiled. After the required components and programs are imported in CMakeLists.txt, the compilation tool CMake will import each item that needs to be compiled according to the index. The compilation process is as follows:
      ESP32-P4 VSCode ESP-IDF GettingStart 240906 02.png

Description of toolbar at the bottom of VSCode UI

When we open an ESP-IDF project, the environment will be automatically loaded at the bottom. For the development of ESP32-P4-Nano, the bottom toolbar is also very important, as shown in the figure:
ESP32-P4 VSCode ESP-IDF GettingStart 240905 03.png

  1. ESP-IDF development environment version manager, when our project needs to distinguish between development environment versions, we can manage them separately by installing different versions of ESP-IDF. When the project uses a specific version, we can use it to switch
  2. Device flashing COM port, select to flash the compiled program into the chip
  3. set-target chip model selection, select the corresponding chip model, for example: ESP32-P4-Nano needs to select esp32p4 as the target chip
  4. menuconfig, click to modify the content of the sdkconfig configuration file
  5. fullclean clean button, when the project compilation error or other operations pollute the compiled content, click to clean all the compiled content
  6. Build project, when a project satisfies the build, compile through this button
  7. flash flashing button, when a project Build is passed, select the corresponding development board COM port, click this button to flash the compiled firmware to the chip
  8. monitor turns on the flashing port monitoring. When a project Build-->Flash, you can click this button to view the log output by the flashing and debugging ports to observe whether the application is working normally
  9. Build Flash Monitor one-click button, used to continuously execute Build-->Flash-->Monitor, often called "little flame"

Example description

esp-idf-st7789 example

In this example, the ST7789 is driven by SPI to display functions such as text, images, and drawing

ESP32-S3-Touch-LCD-1.69 240802 12.png ESP32-S3-Touch-LCD-1.69 240802 13.png ESP32-S3-Touch-LCD-1.69 240802 14.png ESP32-S3-Touch-LCD-1.69 240802 15.png ESP32-S3-Touch-LCD-1.69 240802 04.png

LVGL_Image example

This example shows the LVGLdemo and uses LVGL to display image data

Effect demonstration

ESP32-S3-Touch-LCD-1.69 240529 01.png ESP32-S3-Touch-LCD-1.69 240529 02.png ESP32-S3-Touch-LCD-1.69 240529 03.png

ESP32-S3-Touch-LCD-1.69 240802 03.png ESP32-S3-Touch-LCD-1.69 240802 02.png ESP32-S3-Touch-LCD-1.69 240802 11.png

ESP32-S3-Touch-LCD-1.69 241017 13.png ESP32-S3-Touch-LCD-1.69 241017 14.png ESP32-S3-Touch-LCD-1.69 241017 15.png ESP32-S3-Touch-LCD-1.69 241017 16.png

pcf85063 example

In this example, the PCF85063 is driven in a simple way to perform the time storage and read function

Effect demonstration

ESP32-S3-Touch-AMOLED-1.8 241015 08.png

qmi8658 example

This example demonstrates how to use ESP-IDF to migrate a SensorLib and obtain gyroscope data from the qmi8658 driver of the migrated SensorLib

Effect demonstration

ESP32-S3-Touch-AMOLED-1.8 241015 09.png


ESP32-S3-Touch-LCD-1.69 Watch Project

Demo Link

Environment Setting

Install platformIO Environment on Vscode

ESP32-S3-Touch-LCD-1.69 platformIO 01.png

Open Folder

ESP32-S3-Touch-LCD-1.69 platformIO 02.png

Compile & Upload Demo

Modify platformio.ini

Modify the default display as lolin_s3_mini_1_69.

ESP32-S3-Touch-LCD-1.69 platformIO 03.png

Flash Demo

Connect to the development board, and select the corresponding COM port to compile and download:

ESP32-S3-Touch-LCD-1.69 platformIO 04.png

Download App

Chronos app is applicable for Android systems; for IOS system, you can search Chronos in APP store.

Effects

ESP32-S3-Touch-LCD-1.69 platformIO 05.png ESP32-S3-Touch-LCD-1.69 platformIO 06.png ESP32-S3-Touch-LCD-1.69 platformIO 07.png ESP32-S3-Touch-LCD-1.69 platformIO 08.png ESP32-S3-Touch-LCD-1.69 platformIO 09.png ESP32-S3-Touch-LCD-1.69 platformIO 10.png

Resource

Document

Datasheet

Demo

Software

FAQ

 Answer:

1. When you find the board is hot, please make sure to pull down the GPIO33 first, and pull down the buzzer pin, otherwise the passive buzzer is like a resistor that consumes power all the time, which leads to the LDO current pressure to be high and it will be hot.
2. If you also use WiFi/Bluetooth function, overheating cannot be avoided. ESP32-S3 opens wireless function and the related power consumption will increase, leading to heat generation.
3. It is not recommended to enable the PSRAM function, if it is enabled, it may not pull down GPIO33 normally or affect the display in ESP-IDF and other scenarios, at this time, we recommend removing the buzzer resistor to disconnect its function.
4. In the Arduino IDE environment, turning on the PSRAM, using external Flash and pulling down the GPIO33 to enable pins will still cause a lot of heat, it is recommended to use a low-power program to play!

{{{5}}}


 Answer:

1. When the serial port is occupied, programming will fail. Close the serial port monitor and re-program. 2. When the ESP32 program crashes, the flashing will fail. At this time, the development module needs to be completely powered off, hold down BOOT and then power on to enter the strong download mode before flashing. After flashing, it will not automatically exit the download mode, so you need to power off and restart again.

{{{5}}}


 Answer:

Windows: (1) View through Device Manager: Press the Windows + R keys to open the Run dialog box; type devmgmt.msc and press enter to open Device Manager; expand the Ports (COM and LPT) section, which will list all COM ports and their current status. (2) Use Command Prompt to view: Open Command Prompt (CMD); Enter the mode command, which will display status information for all COM ports. (3) Check the hardware connection: If you have connected an external device to the COM port, usually the device will occupy a port number, and you can determine which port is used by looking at the connected hardware. Linux: (1) Use the dmesg command to view: Open the terminal. (2) Use the ls command to view: Enter ls /dev/ttyS* or ls /dev/ttyUSB* to list all serial devices. (3) Use setserial command to view: Enter setserial -g /dev/ttyS* to view the configuration information of all serial devices.

{{{5}}}


 Answer:

The LCD screen display chip used in this product is ST7789V2, and the touch chip is CST816T, there are drivers for the two chips in the libs we provided, for the display driver, please refer to TFT_eSPI enable, and for the touch driver, please refer to the Arduino_LVGL sample demo.

{{{5}}}


 Answer:

This product is a development board and is not an end product. The product ecology is ESP32 core, and the ecology is very mature, the development environment is also very friendly, we do not assist in modifying the code, so creators, and geeks can play with their own DIY ability, if you have any questions you can ask the development engineers to answer for you.
If you think our products are good, and hope to batch customized hardware, customized shell, customized software, etc., welcome to contact the development engineers!
2024-07-19 172737.png

{{{5}}}


Support



Technical Support

If you need technical support or have any feedback/review, please click the Submit Now button to submit a ticket, Our support team will check and reply to you within 1 to 2 working days. Please be patient as we make every effort to help you to resolve the issue.
Working Time: 9 AM - 6 PM GMT+8 (Monday to Friday)