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 low-cost, high-performance MCU board designed by Waveshare. It is equipped with a 1.69inch capacitive LCD screen, a lithium battery charging chip, a six-axis sensor (three-axis accelerometer and a three-axis gyroscope), RTC and other peripherals, which are convenient for development and embedding into the product.

Features

  • Equipped with high-performance Xtensa® 32-bit LX7 dual-core processor, up to 240 MHz main frequency
  • Supports 2.4GHz Wi-Fi (802.11 b/g/n) and Bluetooth® 5 (BLE), with onboard antenna
  • Built in 512KB of SRAM and 384KB ROM, with onboard 8MB PSRAM and an external 16MB Flash memory
  • Built-in 1.69inch capacitive LCD screen with a resolution of 240×280, 262K colors for clear color pictures

Onboard Resources

  • Onboard patch antenna, as shown in the figure ⑩
  • Onboard PCF85063 RTC clock chip and RTC battery interface, facilitating timing and scheduling functions, as shown in ③ and ⑨
  • Onboard QMI8658C 6-axis inertial measurement unit (IMU) containing a 3-axis gyroscope and a 3-axis accelerometer, 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 flashing 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

When using the GPIO pins reserved on the ESP32-S3-LCD-1.69 board, it is important to pay attention to the wire colors and their corresponding functions to avoid damaging the development board due to wiring habits ESP32-S3-Touch-LCD-1.69-details-5.jpg

Dimensions

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

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. When 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

Version Options

The Wikis for the two versions are different. Please click on the corresponding product to view the usage instructions.
ESP32-S3-LCD-1.69 wiki ESP32-S3-Touch-LCD-1.69 wiki
ESP32-S3-LCD-1.69
without touch control
ESP32-S3-Touch-LCD-1.69
with touch control

Usage Instructions

ESP32-S3-Touch-LCD-1.69 currently provides two development tools and frameworks, Arduino IDE and ESP-IDF, providing flexible development options, you can choose the right development tool according to your project needs and personal habits.

Development tools

180px-Arduino-IDE-logo.jpg

Arduino IDE

Arduino IDE is an open source electronic prototyping platform, convenient and flexible, easy to get started. After a simple learning, you can start to develop quickly. At the same time, Arduino has a large global user community, providing an abundance of open source code, project examples and tutorials, as well as rich library resources, encapsulating complex functions, allowing developers to quickly implement various functions.

180px-ESP-IDF-logo.jpg

ESP-IDF

ESP-IDF, or full name Espressif IDE, is a professional development framework introduced by Espressif Technology for the ESP series chips. It is developed using the C language, including a compiler, debugger, and flashing tools, etc., and can be developed via the command lines or through an integrated development environment (such as Visual Studio Code with the Espressif IDF plugin). The plugin offers features such as code navigation, project management, and debugging.


Each of these two development approaches has its own advantages, and developers can choose according to their needs and skill levels. Arduino are suitable for beginners and non-professionals because they are easy to learn and quick to get started. ESP-IDF is a better choice for developers with a professional background or high performance requirements, as it provides more advanced development tools and greater control capabilities for the development of complex projects.

Components preparation

  • ESP32-S3-Touch-LCD-1.69 x1
  • USB cable (Type-A to Type-C) x 1

400px-ESP32-S3-Touch-LCD-1.69-usenotes-01.png

Before operating, it is recommended to browse the table of contents to quickly understand the document structure. For smooth operation, please read the FAQ carefully to understand possible problems in advance. All resources in the document are provided with hyperlinks for easy download.

Working with Arduino

This chapter introduces setting up the Arduino environment, including the Arduino IDE, management of ESP32 boards, installation of related libraries, program compilation and downloading, as well as testing demos. It aims to help users master the development board and facilitate secondary development.
Flow1.png

Environment setup

Download and install Arduino IDE

  • Click to visit the official website, select the corresponding system and system bit to download.
    ESP32-S3-AMOLED-1.91-Ar-software-01.png
  • Run the installer and install all by default.
The environment setup is carried out on the Windows 10 system, Linux and Mac users can access Arduino-esp32 environment setup for reference

Install Arduino-ESP32

  • Regarding ESP32-related motherboards used with the Arduino IDE, the esp32 by Espressif Systems library must be installed first.
  • It is generally recommended to use Install Online. If online installation fails, use Install Offline.
  • To install the Arduino-ESP32 tutorial, please refer to Arduino board manager tutorial
  • ESP32-S3-Touch-LCD-1.69 Development board installation instructions
Board name Board installation requirements Version number requirements
esp32 by Espressif Systems "Offline" installation/"Online" installation 3.0.5 and above

Install library

  • When installing Arduino libraries, there are usually two ways to choose from: Install online and Install offline. If the library installation requires offline installation, you must use the provided library file
    For most libraries, users can easily search and install them through the online library manager of the Arduino software. However, some open-source libraries or custom libraries are not synchronized to the Arduino Library Manager, so they cannot be acquired through online searches. In this case, users can only manually install these libraries offline.
  • For library installation tutorial, please refer to Arduino library manager tutorial
  • ESP32-S3-Touch-LCD-1.69 library file is stored in the sample program, click here to jump: ESP32-S3-Touch-LCD-1.69 Demo
  • ESP32-S3-Touch-LCD-1.69 Library file installation instructions
Library Name Description Version Library Installation Requirements
Arduino_DriveBus CST816 Touch chip driver library —— "Install Offline”
GFX_Library_for_Arduino GFX graphical library for ST7789 v1.4.9 “Install Online” or “Install Offline”
lvgl LVGL graphical library v8.4.0 "Install Online" requires copying the demos folder to src after installation. “Install Offline” is recommended
Mylibrary Development board pin macro definition —— “Install Offline”
SensorLib PCF85063, QMI8658 sensor driver library v0.2.1 “Install Online” or “Install Offline”
lv_conf.h LVGL configuration file —— “Install Offline”

Run the First Arduino Demo

If you are just getting started with ESP32 and Arduino, and you don't know how to create, compile, flash, and run Arduino ESP32 programs, then please expand and take a look. Hope it can help you!

New Project

  • Run the Arduino IDE and select File -> New Sketch
    ESP32-S3-AMOLED-1.91-Ar-study-01.png
  • Enter the code:
void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
}

void loop() {
  // put your main code here, to run repeatedly:
  Serial.println("Hello, World!");
  delay(2000);
}
  • Save the project and select File -> Save As.... In the pop-up menu, select the path to save the project, and enter a project name, such as Hello_World, click Save

ESP32-S3-AMOLED-1.91-Ar-study-02.png

Compile and Flash Demos

  • Select the corresponding development board, take the ESP32S3 motherboard as an example:

①. Click to select the dropdown menu option Select Other Board and Port;
②. Search for the required development board model esp32s3 dev module and select;
③. Select COM Port;
④. Save the selection.
ESP32-S3-AMOLED-1.91-Ar-study-03.png

  • Some development boards with specified version numbers support direct model selection, for example, "Waveshare ESP32-S3-LCD-1.69":

ESP32-S3-AMOLED-1.91-Ar-study-07.png

  • If the ESP32S3 mainboard only has a USB port, you need to enable USB CDC, as shown in the following diagram:

ESP32-S3-AMOLED-1.91-Ar-study-04.png

  • Compile and upload the program:

①. Compile the program; ②. Compile and download the program; ③. Download successful.
ESP32-S3-AMOLED-1.91-Ar-study-05.png

  • Open the Serial Monitor window, and the demo will print "Hello World!" every 2 seconds, and the operation is as follows:

ESP32-S3-AMOLED-1.91-Ar-study-06.png

Demos

Flow2.png

  • ESP32-S3-Touch-LCD-1.69 demos
Demo Basic Description Dependency Library
01_HelloWorld Demonstrates the basic graphics library functions and can also be used to test the basic performance of display screens and the display effect of random text GFX_Library_for_Arduino
02_Drawing_board Demonstrates the basic graphics library functions and can also be used to test the basic performance of display screens and the display effect of random text GFX_Library_for_Arduino, Arduino DriveBus
03_GFX_AsciiTable Prints ASCII characters in rows and columns on the display screen according to the screen size GFX_Library_for_Arduino
04_GFX_ESPWiFiAnalyzer Draws the WiFi band signal strength on the ST7789 display GFX_Library_for_Arduino
05_GFX_Clock A simple ST7789 clock example, implemented through basic pointer marking and time management GFX_Library_for_Arduino
06_GFX_PCF85063_simpleTime Displays the current time SensorLib, GFX_Library_for_Arduino
07_LVGL_Measuring_voltage The voltage is measured by a voltage divider on the board, and the analog value is read using GPIO1, then the battery voltage is calculated using the voltage divider formula LVGL
08_LVGL_PCF85063_simpleTime Use the PCF85063 RTC module to display the current time on the ST7789 display under LVGL LVGL, SensorLib
09_LVGL_Keys_Bee LVGL
10_LVGL_QMI8658_ui Display graphics using LVGL and communicate with the QMI8658 IMU to obtain accelerometer and gyroscope data LVGL, SensorLib
11_LVGL_Arduino LVGL demonstration LVGL,Arduino DriveBus
  • ESP32-S3-Touch-LCD-1.69 supports direct model selection
    • Take ESP32-S3-LCD-1.69 as an example

ESP32-S3-LCD-1.69-demo-02.png

01_HelloWorld

Hardware connection


  • Connect the board to the computer using a USB cable

300px-ESP32-S3-Touch-LCD-1.69-Ar-demo-01.jpg

Code analysis


  • Initialize the display:
if (!gfx->begin()) {
   USBSerial.println("gfx->begin() failed!");
 }
  • Clear the screen and display text:
 gfx->fillScreen(BLACK);
 gfx->setCursor(10, 10);
 gfx->setTextColor(RED);
 gfx->println("Hello World!");
  • GIF display:
 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!");

Result demonstration


  • 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 effect of displaying random text.

200px-ESP32-S3-Touch-LCD-1.69 241017 05.png

02_Drawing_board

Hardware connection


  • Connect the board to the computer using a USB cable

Code analysis


  • Screen 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);
 }

Result demonstration


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

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

03_GFX_AsciiTable

Hardware connection


  • Connect the board to the computer using a USB cable

Code analysis


  • Initialize the display:
if (!gfx->begin()) {
   USBSerial.println("gfx->begin() failed!");
 }
  • Calculate rows and columns and label them with numbers: Here the number of columns and rows that can be displayed is calculated according to the size of the display. Then use two loops separately, set different text colors, and print the numbers of rows and columns on the display so that the position of the characters can be easily determined when drawing the ASCII characters in the future.
int numCols = LCD_WIDTH / 8;
int numRows = LCD_HEIGHT / 10;

// Label the line number
gfx->setTextColor(GREEN);
for (int x = 0; x < numRows; x++) {
    gfx->setCursor(10 + x * 8, 2);
    gfx->print(x, 16);
}

// Label the column number
gfx->setTextColor(BLUE);
for (int y = 0; y < numCols; y++) {
    gfx->setCursor(2, 12 + y * 10);
    gfx->print(y, 16);
}
  • Draw the ASCII character table:
char c = 0;
for (int y = 0; y < numRows; y++) {
    for (int x = 0; x < numCols; x++) {
        gfx->drawChar(10 + x * 8, 12 + y * 10, c++, WHITE, BLACK);
    }
}

Result demonstration


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

04_GFX_ESPWiFiAnalyzer

Hardware connection


  • Connect the board to the computer using a USB cable

Code analysis


  • setup():

Initialize serial port communication;
Set WiFi to site mode and disconnect;
Initialize the display, obtain the screen size, and calculate various drawing parameters;
Set the screen background to black and draw the title bar.

  • loop() :

Scan WiFi networks and get network information, including channels, RSSI, BSSID, and SSID;
Count the number of networks, noise levels, and peak signal strength on each channel;
Clear old graphics and draw new ones based on the scan results, including signal strength ellipses and network information text;
Print the number of networks scanned and the channel with the least noise;
Draw graph baselines and channel numbering;
Enter the low-power mode according to the conditions.

Result demonstration


  • This example demonstrates how to draw a Wi-Fi band signal strength on the ST7789 display, implementing the function of a Wi-Fi analyzer.

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

05_GFX_Clock

Hardware connection


  • Connect the board to the computer using a USB cable

Code analysis


  • Draw 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();
}

Result demonstration


  • This example demonstrates a simple ST7789 clock example, which implements a clock example with a simple marker pointer and time management

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

06_GFX_PCF85063_simpleTime

Hardware connection


  • Connect the board to the computer using a USB cable

Code analysis


  • loop() :
  • Get the current time first, and if this time is different from the last displayed time, perform the following operations:
    • Clear the area for the last displayed time, achieve this by filling a rectangle, so that there won't be overlapping when updating the time display.
    • Set the text color to black and the text size to 3.
    • Call the getCenteredX function to calculate the X coordinate of the current time string centered on the screen.
    • Set the cursor position and print the current time string to update the display of the time.
    • Copy the current time string to the previous Timestamp string to determine if the time has changed next time.

Result demonstration


  • This example demonstrates how to use the PCF85063 RTC module to display the current time on a ST7789 display, retrieving the time every second and updating the display only when the time changes

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

07_LVGL_Measuring_voltage

Hardware connection


  • Connect the board to the computer using a USB cable

Code analysis


  • my_print(): Used for LVGL log output, if LVGL log function is enabled, this function will print the log information to the serial port
  • my_disp_flush(): Responsible for refreshing the LVGL drawing buffer content to the display screen
  • example_increase_lvgl_tick(): A timer callback function that is used to notify LVGL about the passage of time
  • example_increase_reboot() : Another timer callback function that counts and may trigger a system reboot after a certain number of times

Result demonstration


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


08_LVGL_PCF85063_simpleTime

Hardware connection


  • Connect the board to the computer using a USB cable

Code analysis


  • setup():

Initialize serial communication, prepare possible serial debugging at baud rate of 115200;
Try to connect the PCF85063 real-time clock chip, if the connection fails, enter an infinite loop;
Set the initial time of the real-time clock to September 24, 2024, 11:09:41;
Initialize the display and set the screen brightness;
Initialize LVGL and register the logging output function (if logging is enabled);
Configure the LVGL display driver and drawing buffer, as well as initialize the input device driver (which is a virtual pointer input device driver);
Create a timer to periodically trigger the LVGL clock update
Create a label and set the initial text to “Initializing...”

  • loop():

Call lv_timer_handler to have LVGL handle graphical interface tasks;
Check the time for updates every second. If it has been updated, obtain the current time of the real-time clock, output it through the serial port, format the time into a specific format, update the text content of the label, and set the label's font to lv_font_montserrat_40.

Result demonstration


  • This example demonstrates how to use the PCF85063 RTC module under LVGL to display the current time on a ST7789 display screen, retrieving the time every second and only updating the display when the time changes, which is better than time refresh

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

09_LVGL_Keys_Bee

Comparison of old and new versions


  • The new version adds the development board model:

200px-ESP32-S3-Touch-LCD-1.69-pic--01.png

ESP32-S3-Touch-LCD-1.69 pin comparison between old and new versions
Peripheral Old version New version
Buzzer (Buzz) GPIO33 GPIO42
RTC interrupt (RTC_INT) GPIO41 GPIO39
Power control (SYS_EN) GPIO35 GPIO41
Power control (SYS_OUT) GPIO36 GPIO40

Hardware connection


  • Connect the board to the computer using a USB cable

Principle analysis


  • This function button is designed to solve the problem of few peripheral buttons, and its principle is as follows:

Pressing PWR allows battery power, initiating the system. At this point, the system should define SYS_EN to continuously output a high voltage level to maintain the powered-on effect. Releasing PWR will not cause a power cut. The function of PWR at this time is to lower SYS_OUT. The system detects actions such as pressing, double pressing, and long pressing on SYS_OUT, enabling customizable power-off control operations. For instance, in a long press mode, setting SYS_EN to a low level to disconnect the battery power completes the use of the multi-purpose buttons.

Code analysis


  • loop():

Call lv_timer_handler to have LVGL handle graphical interface tasks;
Read the status of the input pin, and perform debouncing processing;
Based on the state of the button (pressed or released) and the time interval, determine whether it is a single click, double click, or long press event, and update the label text on the display to show the corresponding event information;
At the same time, for the long press event, the buzzer will be triggered, and when released, the buzzer will be stopped and the specific output pin will be set to a low level.

Result demonstration


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

10_LVGL_QMI8658_ui

Hardware connection


  • Connect the board to the computer using a USB cable

Code analysis


  • my_disp_flush():

This function is the refresh function of the LVGL display driver. It is responsible for refreshing the LVGL drawing buffer content to the display screen;
Based on different color formats, call the corresponding functions of the gfx object to draw the bitmap to a specific area;
Finally, LVGL is notified that the refresh of the display has been completed.

  • loop():

Call lv_timer_handler to have LVGL handle graphical interface tasks;
Check if new data is ready for the QMI (QMI8658 sensor object). If available, attempt to acquire acceleration data and gyroscope data, and output through the serial port;
At the same time, the acceleration data is updated to the LVGL graph to show the change of acceleration on the three axes in real time;
Increase the frequency of data polling with delay(20) to ensure that sensor data is captured in a timely manner and the display is updated.

Result demonstration


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

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

11_LVGL_Arduino

Hardware connection


  • Connect the board to the computer using a USB cable

Result demonstration


This example demonstrates LVGL Widgets, achieving a frame rate of 20 to 30 frames in dynamic state
ESP32-S3-Touch-LCD-1.69 240802 03.png ESP32-S3-Touch-LCD-1.69 240802 11.png ESP32-S3-Touch-LCD-1.69 240529 02.png ESP32-S3-Touch-LCD-1.69 240529 03.png

Use of LVGL components


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

Below is a case study of LVGL actual components in the Arduino IDE

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

Working with ESP-IDF

This chapter introduces setting up the ESP-IDF environment setup, including the installation of Visual Studio and the Espressif IDF plugin, program compilation, downloading, and testing of example programs, to assist users in mastering the development board and facilitating secondary development. Flow3.png

Environment setup

Download and install Visual Studio

  • Open the download page of VScode official website, choose the corresponding system and system bit to download
    ESP32-S3-AMOLED-1.91-VScode-01.png
  • After running the installation package, the rest can be installed by default, but here for the subsequent experience, it is recommended to check boxes 1, 2, and 3
    ESP32-S3-AMOLED-1.91-VScode-02.png
    • After the first two items are enabled, you can open VSCode directly by right-clicking files or directories, which can improve the subsequent user experience.
    • After the third item is enabled, you can select VSCode directly when you choose how to open it.
The environment setup is carried out on the Windows 10 system, Linux and Mac users can access ESP-IDF environment setup for reference

Install Espressif IDF Plugin

  • It is generally recommended to use Install Online. If online installation fails due to network factor, use Install Offline.
  • For more information about how to install the Espressif IDF plug-in, see Install Espressif IDF Plug-in
  • Espressif IDF version ≥ v5.3.1

Run the First ESP-IDF Demo

If you are just getting started with ESP32 and ESP-IDF, and you don't know how to create, compile, flash, and run ESP-IDF ESP32 programs, then please expand and take a look. Hope it can help you!

New Project

ESP32-S3-AMOLED-1.91-study-01.png

ESP32-S3-AMOLED-1.91-study-02.png

Create Demo

  • Using the shortcut F1, enter esp-idf:show examples projects

ESP32-S3-AMOLED-1.91-study-03.png

  • Select your current IDF version

ESP32-S3-AMOLED-1.91-study-04.png

  • Take the Hello world demo as an example

①Select the corresponding demo
②Its readme will state what chip the demo applies to (how to use the demo and the file structure are described below, omitted here)
③Click to create the demo
ESP32-S3-AMOLED-1.91-study-05.png

  • Select the path to save the demo, and require that the demos cannot use folders with the same name

ESP32-S3-AMOLED-1.91-study-06.png

Modify COM Port

  • The corresponding COM ports are shown here, click to modify them
  • Please select the COM ports according to your device (You can view it from the device manager)
  • In case of a download failure, please press the Reset button for more than 1 second or enter download mode, and wait for the PC to recognize the device again before downloading once more

ESP32-S3-AMOLED-1.91-study-07.png

Modify Driver Object

  • Select the object we need to drive, which is our main chip ESP32S3

ESP32-S3-AMOLED-1.91-study-08.png

  • Choose the path to openocd, it doesn't affect us here, so let's just choose one

ESP32-S3-AMOLED-1.91-study-09.png

Other Status Bar Functions

①.ESP-IDF Development Environment Version Manager, when our project requires differentiation of development environment versions, it can be managed by installing different versions of ESP-IDF. When the project uses a specific version, it can be switched to by utilizing it
②.Device flashing COM port, select to flash the compiled program into the chip
③.Select set-target chip model, select the corresponding chip model, for example, ESP32-P4-NANO needs to choose esp32p4 as the target chip
④.menuconfig, click it to Modify sdkconfig configuration file Project configuration details
⑤.fullclean button, when the project compilation error or other operations pollute the compiled content, you can clean up all the compiled content by clicking it
⑥.Build project, when a project satisfies the build, click this button to compile
⑦.Current download mode, the default is UART
⑧.flash button, when a project build is completed, select the COM port of the corresponding development board, and click this button to flash the compiled firmware to the chip
⑨.monitor enable flashing port monitoring, when a project passes through Build --> Flash, click this button to view the log of output from flashing port and debugging port, so as to observe whether the application works normally
⑩.Debug
⑪.Build Flash Monitor one-click button, which is used to continuously execute Build --> Flash --> Monitor, often referred to as "little flame"

ESP32-S3-AMOLED-1.91-study-10.png

Compile, Flash and Serial Port Monitor

  • Click on the all-in-one button we described before to compile, flash and open the serial port monitor

ESP32-S3-AMOLED-1.91-study-11.png

  • It may take a long time to compile especially for the first time

ESP32-S3-AMOLED-1.91-study-12.png

  • During this process, the ESP-IDF may take up a lot of CPU resources, so it may cause the system to lag
  • If it is the first time to flash the program for a new project, you will need to select the download method, and select UART

ESP32-S3-AMOLED-1.91-study-13.png

  • This can also be changed later in the Download methods section (click on it to pop up the options)

ESP32-S3-AMOLED-1.91-study-14.png

  • As it comes with the onboard automatic download circuit, it can be downloaded automatically without manual operation
  • After successful download, it will automatically enter the serial monitor, you can see the chip output the corresponding information and be prompted to restart after 10S

ESP32-S3-AMOLED-1.91-study-15.png

Use the IDF Demos

The following takes ESP32-S3-LCD-1.47-Demo as an example to introduce the two opening methods of the project and the general steps of use, and the detailed explanation of the ESP-IDF project. If you use other projects, the operation steps can be applied similarly.

Open In the Software

  • Open VScode software and select the folder to open the demo

ESP32-S3-AMOLED-1.91-study-16.png

  • Select the provided ESP-IDF example and click to select the file (located in the /Demo/ESP-IDF path under demo)

ESP32-S3-AMOLED-1.91-study-17.png

Open from Outside the Software

  • Select the project directory correctly and open the project, otherwise it will affect the compilation and flashing of subsequent programs

ESP32-S3-AMOLED-1.91-study-18.png

  • After connecting the device, select the COM port and model, click below to compile and flash to achieve program control

ESP32-S3-AMOLED-1.91-study-19.png

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 base or library, which 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: The import of libraries in the Python development environment only requires to "import library name or path", while ESP-IDF is based on the C language, and the importing of libraries is configured and defined through CMakeLists.txt.
    • The purpose of CmakeLists.txt: When compiling ESP-IDF, the build tool CMake first reads the content of the top-level CMakeLists.txt in the project directory to read the build rules and identify the content to be compiled. When the required components and demos are imported into the CMakeLists.txt, the compilation tool CMake will import each content that needs to be compiled according to the index. The compilation process is as follows:

ESP32-P4 VSCode ESP-IDF GettingStart 240906 02.png

Demos

Flow2.png

  • ESP32-S3-Touch-LCD-1.69 Demo
Demo Basic Description
01_ESP_IDF_ST7789 Drive the st7789 screen through SPI to display text, pictures, drawings and other functions
02_ESP_IDF_ST7789_LVGL Display LVGLdemo, use LVGL to display picture data
03_PCF85063 Use a simple method to drive the PCF85063 for time storage and reading functionality
04_QMI8658 Use ESP-IDF to port SensorLib, then use the ported SensorLib to drive qmi8658 to obtain gyroscope-related data

01_ESP_IDF_ST7789

Hardware connection


  • Connect the board to the computer using a USB cable

300px-ESP32-S3-Touch-LCD-1.69-Ar-demo-01.jpg

Code analysis


  • ST7789() :

Initialize various font objects, ready for displaying text on the screen;
Initialize TFT_t objects associated with the ST7789 display, including setting SPI pins and display parameters via spi_master_init and lcdInit functions;
Enter an infinite loop and call various graphics test functions (such as FillTest, ColorBarTest, etc.) and font display test functions in turn to display different graphics and font display effects on the display. There is a period of time between each test to observe the results.

Result demonstration


  • Drive the st7789 screen through SPI to display text, pictures, drawings and other functions

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

02_ESP_IDF_ST7789_LVGL

Hardware connection


  • Connect the board to the computer using a USB cable

Code analysis


  • app_lcd_init() :

Configure and initialize the backlight pin for the LCD;
Initialize the SPI bus for communication with the LCD;
Create a panel IO object for the LCD and configure SPI-related parameters;
Install the LCD driver, create the LCD panel object, and perform some initialization operations, such as reset, turn on the display, set the mirror, etc.;
Turn on the LCD backlight.

  • app_lcd_init() :

Initialize LVGL and set parameters such as task priority, stack size, and timer period;
Configure the parameters of the LCD display and add it to the LVGL as a display device. In this way, LVGL can draw a graphical interface on this display.

Result demonstration


  • LVGL displays picture data

ESP32-S3-Touch-LCD-1.69 240802 03.png ESP32-S3-Touch-LCD-1.69 240802 11.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 241017 14.png ESP32-S3-Touch-LCD-1.69 241017 15.png

03_PCF85063

Hardware connection


  • Connect the board to the computer using a USB cable

Code analysis


  • rtc_get_time() :

This function is used to read the current time from the RTC (real-time clock chip, here it is assumed to be PCF85063). It reads 7 bytes of data from a specific register address by calling the rtc_read_reg function, representing seconds, minutes, hours, days, days of the week, months, and years.
It converts the read BCD format data to decimal format and prints out the current time. If the read operation fails, an error message is printed and an error code is returned.

  • rtc_set_time() :

This function is used to set the time of the RTC. It accepts hours, minutes, seconds, days, months, and years as parameters, converts these decimal data into BCD format, and forms an array.
It sets the time of the RTC by calling the rtc_write_reg function to write this array to the beginning of the specific register address of the RTC. If the write is successful, ESP_OK is returned; otherwise, the corresponding error code is returned.

Result demonstration


  • It drives PCF85063 to perform time storage reading

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

04_QMI8658

Hardware connection


  • Connect the board to the computer using a USB cable

Code analysis


  • read_sensor_data() :

Use the qmi.getAccelerometer function to read the accelerometer data, and if the reading is successful, print the data for the three axes of the accelerometer. If the read fails, an error message is printed;
Use the qmi.getGyroscope function to read the gyroscope data, and if the read is successful, print the data for the three axes of the gyroscope. If the read fails, an error message is printed;
Use the functions qmi.getTimestamp and qmi.getTemperature_C to respectively obtain the timestamp and temperature from the sensor, and print them out.
If the data is not ready, print a warning message. Then wait for a period of time and cycle again to check whether the data is ready.

Result demonstration


  • Get gyroscope-related data

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

ESP32-S3-Touch-LCD-1.69 Watch Project

Demo Link

ESP32-Watch
ESP32-S3-Touch-LCD-1.69-watch-01.png

Environment Setup

Install the platformIO Environment on Vscode

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


Open Folder

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

Compile & Upload Demo

Modify platformio.ini

Modify the default display as lolin_s3_mini_1_69

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

Flash Demo

Connect to the development board and select the corresponding COM port to compile and upload

ESP32-S3-Touch-LCD-1.69-watch-05.png

Download App

Android-applicable app, iOS users can search for Chronos in the app store Chronos

Effect demonstration

ESP32-S3-Touch-LCD-1.69 platformIO 09.png ESP32-S3-Touch-LCD-1.69 platformIO 08.png ESP32-S3-Touch-LCD-1.69 platformIO 10.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

Flash Firmware Flashing and Erasing


  • The current demo provides test firmware, which can be used to test whether the onboard device functions properly by directly flashing the test firmware
  • bin file path:
    ..\ESP32-S3-Touch-LCD-1.69\Firmware

Resources

Schematic diagrams

Project diagram

Demo

Datasheets

ESP32-S3

Other components

Software tools

Arduino

VScode

Other resource link

FAQ

 Answer:

You can subscribe to the repository, just open an issue, explain your requirements clearly, engineers will be the first time to evaluate the requirements, if there is any progress and update the repository, and you can also joke about the product, share your experience, and put forward your ideas. ESP32-display-support


 Answer:

After receiving the goods, if the development board model is printed on the board, it is the new version; otherwise, it is the old version. There are slight differences in the pin definitions between the new and old versions
300px-ESP32-S3-Touch-LCD-1.69-pic--01.png


 Answer:

1. When you find that the board is hot, please make sure to pull down the buzzer enable pin, otherwise the passive buzzer will keep consuming power, resulting in high LDO current and hot
2. If you are also using WiFi/Bluetooth features, overheating cannot be avoided. Enabling the wireless function of ESP32-S3 will increase the power consumption, leading to overheating
3. In the Arduino IDE environment, enabling PSRAM, using external Flash, and not pulling down the buzzer enable pin still results in significant heat generation. It is recommended to play with low-power solutions


 Answer:

1. When the serial port is occupied, the flashing will fail. Close the serial port monitor and try to flash again
2. When the ESP32 program crashes, the flashing will fail, and the development module needs to be completely powered off, hold down BOOT and power it on again to enter the strong download mode and then flash it. It will not automatically exit the download mode after flashing, so you need to power off and restart again


 Answer:

Windows system:
①View through Device Manager: Press the Windows + R keys to open the "Run" dialog box; Input devmgmt.msc and press Enter to open Device Manager; Expand the "Port (COM and LPT)" section, here it will list all the COM ports and their current status.
②Use the command prompt to view: Open the Command Prompt (CMD); enter the mode command, which will display status information for all COM ports.
③Check hardware connections: If you have already connected external devices to the COM port, the device usually occupies a port number, which can be determined by checking the connected hardware.
Linux system:
①Use the dmesg command to view: Open the terminal.
①Use the ls command to view: Enter ls /dev/ttyS* or ls /dev/ttyUSB* to list all serial port devices.
③Use the setserial command to view: Enter setserial -g /dev/ttyS* to view the configuration information of all serial port devices.


 Answer:

The LCD screen display chip used in this product is ST7789V2, and the touch chip is CST816T (only for the version with touch). There are two chip drivers in the lib we provide. For display drivers, please refer to GFX enable. For touch drivers, please refer to Arduino_LVGL demo


 Answer:

This product is positioned as a development board and is not a finished product. Regarding the product ecosystem, ESP32 is a core product with a mature ecosystem and a friendly development environment. We do not assist in modifying the code. As creators and geeks, please use your DIY abilities. If you have any questions, please feel free to ask our engineers for answers.
If you think our products are good, and you want to customize hardware, shells, software, etc. in batches, please contact sales
2024-07-19 172737.png

{{{5}}}



 Answer:
  • Check the schematic diagram for different development boards with Type-C interfaces, and handle the output accordingly:
    • For development boards with direct USB output, printf function is supported for printing output. If you want to support output via the Serial function, you will need to enable the USB CDC On Boot feature or declare HWCDC.
    • For development boards with UART to USB conversion, both printf and Serial functions are supported for printing output, and there is no need to enable USB CDC On Boot.



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)