Google Chat:---
+86-0755-88291180
sales@spotpear.com
dragon_manager@163.com
tech-support@spotpear.com
zhoujie@spotpear.com
WhatsApp:13246739196
WhatsApp:13424403025

SPI Communication Protocol:

Note: Unlike the traditional SPI protocol, because only display functionality is needed, the data line from the slave to the master is omitted
RESX is the Reset pin; it is pulled low during module power-up and is normally set to 1.
CSX is the slave chip select pin; the chip is enabled only when CS is low
D/CX is the data/command control pin of the chip. When DC = 0, commands are written; when DC = 1, data is written.
SDA is the data transmission pin, specifically for RGB data.
SCL is the SPI communication clock pin.
For SPI communication, data transmission follows a specific timing sequence, which are determined by the combination of clock phase (CPHA) and clock polarity (CPOL):
The level of CPHA determines whether data is captured on the first or second clock transition edge of the serial synchronous clock. When CPHA = 0, data is captured on the first transition edge;
The level of CPOL determines the idle level of the serial synchronous clock. CPOL = 0 means the idle state is low level.
As shown in the diagram, data transmission begins on the first falling edge of SCLK, with 8 bits of data transferred per clock cycle using SPI mode 0, transmitting bits from MSB to LSB
When using the reserved GPIO terminals on the board, pay attention to the wiring colors and corresponding functions to avoid damaging the development board due to incorrect wiring habits.


To help users quickly understand the various functions of the product, we provide a series of test examples to familiarize customers with the use of each interface. Besides the ESP32-S3-Touch-LCD-1.54 host and its accompanying components, the following items are required to run the examples:
When installing the battery, assemble the PC insulating sheet. It provides insulation and flame retardancy to isolate the battery from the PCB board.

If the port is not recognized, please enter Boot mode:
After the download is complete, restart the board to run the program.
Firmware directory of the demo package.ESP32-S3 and USB based on the development board's MCU and interface.
ESP32-S3-LCD-1.54-Demo\Firmware or ESP32-S3-Touch-LCD-1.54-Demo\Firmware directory provided in the example package. Manually enter the download address "0x00", and check the box on the far left

If it remains in the "Waiting for power-on sync" state, hold the "Boot" button and power cycle the device to enter download mode; this will resolve the issue.
Features Wi-Fi scanning and network configuration. Click WIFI on the interface, then wifi config to scan a QR code for network configuration
Allows adjustment of display brightness and volume
Displays the battery ADC voltage
Product information screen where you can view the MAC address

Supports JPG image display. Support for more image formats is currently being adapted
Simulates the interface of a digital photo album. This APP requires a TF card to be inserted with JPG image files placed in the photo directory to run correctly

Simulates a music player interface. This app requires an inserted memory card with MP3 files placed in the music directory to function correctly

Simulates the interface of a video player. This APP requires a TF card to be inserted with MP4 files placed in the video directory to run correctly

Simulates the interface of an e-book reader. This APP requires a TF card to be inserted with TXT files placed in the fiction directory to run correctly
This demo allows testing dual-microphone recording. Click the start button to begin recording, click again to stop recording. The app will then automatically play back the recorded audio
The recorded audio file is saved in the root directory of the memory card

This example demonstrates an LVGL demo created with SquareLine Studio

This example demonstrates a Gravity Ball application based on the 6-axis inertial sensor. The ball moves in real-time on the screen as the device is tilted, following its orientation

Click the APP icon to enter the Xiaozhi AI application. It is consistent with the version adapted for the Xiaozhi official website, and the operation method is the same. Double-click the Boot button to return to the Brookesia interface

XiaozhiAI (XiaoZhi AI) is an open-source AI voice chatbot project based on the ESP32 development board, aiming to bring the general intelligence of large language models (LLMs) to edge devices. It provides a software-hardware integrated solution supporting full-duplex voice conversations and IoT device control, dedicated to assisting developers in building highly customized physical AI agents quickly and at low cost.
This article demonstrates how to flash firmware for Waveshare ESP32 development boards that support XiaoZhi AI, covering two methods: flashing without a development environment (directly flashing precompiled firmware) and flashing with a development environment (compiling from source and flashing).
This section uses the ESP32-S3-Touch-AMOLED-1.8 development board as an example. The steps are similar for other development boards.
Please first confirm that your hardware is listed in the XiaoZhi AI Supported Products List.

Visit the XiaoZhi GitHub to download the firmware file for your device. Click Assets to expand the full file list:

Refer to the Flash Firmware Flashing and Erasing Tutorial to complete the firmware flashing.
This repository aggregates firmware for Waveshare ESP32 development boards that support XiaoZhi AI. All firmware has been tested and verified on the corresponding boards, making it convenient for users to find and download. Firmware versions may be updated slightly later than the official XiaoZhi repository.
Visit the Waveshare GitHub repository and download the appropriate firmware version for your needs:

Refer to the Flash Firmware Flashing and Erasing Tutorial to complete the firmware flashing.
Visit the XiaoZhi AI Chatbot repository to download the complete project code:

Refer to the ESP-IDF Environment Setup Tutorial to configure the development environment.
Click to select the target device. Choose the chip model corresponding to your development board (e.g.,
esp32s3):
When setting the target device, ESP-IDF will automatically configure the corresponding toolchain and libraries. This process may take some time, please be patient. For more details, please refer to the Official Documentation.
Click to open the ESP-IDF terminal, then execute the command
idf.py menuconfig to enter the configuration interface. Select Xiaozhi Assistant:

Select Board Type to choose the development board type:

Choose the product model corresponding to your development board:

Press the S key to save the configuration and exit. Then click the to automatically complete compilation, flashing, and serial monitoring.
Connect your phone or computer to the device's Wi-Fi hotspot: Xiaozhi-xxxxxx. After successful connection, the configuration page should automatically pop up. If not, manually open a browser and visit http://192.168.4.1.
On the network configuration page, select the Wi-Fi name you want to connect to (only 2.4G band is supported; to connect to an iPhone hotspot, enable Max Compatibility in your phone's system settings). The SSID will be auto-filled. Enter the password and click Connect to start connecting:

Ensure the device has successfully connected to the Internet. The device will then broadcast a 6-digit device verification code (you can wake the device again to replay the code).
Visit the XiaoZhi AI Console. If you haven't registered, complete the registration and log in:
Enter the 6-digit verification code. The device will automatically activate and appear on the Device Management page, ready for normal use.
Say the wake word "Hello XiaoZhi" to wake the device and start voice conversations.
ESP32-S3-Touch-AMOLED-1.8 Button Instructions:
This chapter contains the following sections. Please read as needed:
New to Arduino ESP32 development and looking for a quick start? We have prepared a comprehensive Getting Started Tutorial for you.
Note: This tutorial uses the ESP32-S3-Zero as a reference example, and all hardware code is based on its pinout. Before you start, we recommend checking the pinout of your development board to ensure the pin configuration is correct.
Please refer to the tutorial Installing and Configuring Arduino IDE to download and install the Arduino IDE and add ESP32 support.
To run the demo, you need to install the corresponding library. The example code uses the GFX Library for Arduino library to drive the ST7789 display and the SensorLib library to drive the CST816 touch controller.
You can click this link to download the demo package for the ESP32-S3-Touch-LCD-1.54 development board. The Arduino\libraries directory within this package contains all the necessary library files required for this tutorial.
| Library or File Name | Description | Version | Installation Method |
|---|---|---|---|
| lvgl | LVGL graphics library | v8.4.0 or v9.3.0 | Via Library Manager or manual install |
| GFX_Library_for_Arduino | GFX graphics library | v1.6.0 | Via Library Manager or manual install |
| U8g2 | Graphics display library | v2.35.30 | Via Library Manager or manual install |
| SensorLib | Sensor driver library | v0.3.1 | Via Library Manager or manual install |
| ESP32-audioI2S-master | Audio processing library | v3.4.0 | Via Library Manager or manual install |
| OneButton | Button library | v2.6.1 | Via Library Manager or manual install |
There are strong dependencies between versions of LVGL and its driver libraries. For example, a driver written for LVGL v8 may not be compatible with LVGL v9. To ensure that the examples can be reproduced reliably, it is recommended to use the specific versions listed in the table above. Mixing different versions of libraries may lead to compilation failures or runtime errors.
Installation Steps:
Unzip the downloaded demo package.
Copy all folders (ESP32-audioI2S-master, GFX_Library_for_Arduino, etc.) from its Arduino\libraries directory to the Arduino libraries folder.
The path to the Arduino libraries folder is typically: c:\Users\<username>\Documents\Arduino\libraries.
You can also locate it in the Arduino IDE by going to File > Preferences and checking the "Sketchbook location". The libraries folder is the libraries subfolder within this path.
For other installation methods, please refer to: Arduino Library Management Tutorial.
ESP32-S3-Touch-LCD-1.54 Board Installation Instructions
| Board Name | Installation Requirement | Version Requirement |
|---|---|---|
| ESP32 by Espressif Systems | "Install Offline" / "Install Online” | 3.2.0 |
You need to select and configure the development board for ESP32-S3-Touch-LCD-1.54.

The ESP32-S3-Touch-LCD-1.54 requires selecting ESP32S3 Dev Module
Select the USB port
The ESP32-S3-Touch-LCD-1.54 uses the ESP32-S3 native USB interface, not UART-to-USB. For serial communication:
The printf() function can be used directly;
To use the Serial.println() function, additional configuration is required: Enable the "USB CDC On Boot" option in the IDE's Tools menu, or declare an HWCDC object in your code to handle USB serial communication.
Select 16MB Flash
Select a Partition Table of the appropriate size
The Arduino demos are located in the Arduino/examples directory of the demo package.
| Demo | Basic Description | Dependency Library |
|---|---|---|
| 01_audio_out | Read audio files from TF card and play them | ESP32-audioI2S-master |
| 02_button_example | Button test | OneButton |
| 03_qmi8658_example | Prints data obtained from the IMU | SensorLib FastLED |
| 04_gfx_helloworld | Display HelloWorld on the screen | GFX_Library_for_Arduino |
| 05_esp_wifi_analyzer | Display WiFi signal strength on the screen | GFX_Library_for_Arduino |
| 06_gfx_u8g2_font | Display text in multiple languages by loading fonts | GFX_Library_for_Arduino, U8g2 |
| 07_sd_card_test | Test TF card read/write | --- |
| 08_lvgl_example_v8 | lvgl v8.4.0 demo | GFX_Library_for_Arduino, lvgl |
| 09_lvgl_example_v9 | lvgl v9.3.0 demo | GFX_Library_for_Arduino, lvgl |
| 10_esp_sr | Tests voice wake-up and recognition | --- |
This demo demonstrates the ESP32-S3-Touch-LCD-1.54 reading an audio file from the TF card and playing it through the speaker. The screen remains blank. It supports formats like MP3, AAC, and WAV.
Initialize the TF card:
if (!SD_MMC.setPins(clk, cmd, d0, d1, d2, d3)) {
Serial.println("Pin change failed!");
return;
}
if (!SD_MMC.begin()) {
Serial.println("Card Mount Failed");
return;
}
Set I2S pins and volume:
audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT,I2S_MCLK);
audio.setVolume(21); // 0...21
Set the audio file to play:
audio.connecttoFS(SD_MMC, "music/1.mp3");
Bind callback functions:
button1.attachClick(click1);
button1.attachDoubleClick(doubleclick1);
button1.attachLongPressStart(longPressStart1);
button1.attachLongPressStop(longPressStop1);
button1.attachDuringLongPress(longPress1);

This demo the ESP32-S3-LCD-1.54 to obtain data from the onboard QMI8658 and print it via the serial monitor.
Initialize QMI8658:
if (!qmi.begin(Wire, QMI8658_L_SLAVE_ADDRESS, SENSOR_SDA, SENSOR_SCL)) {
Serial.println("Failed to find QMI8658 - check your wiring!");
while (1) {
delay(1000);
}
}
This demo demonstratesthe ESP32-S3-Touch-LCD-1.54 using the GFX_Library_for_Arduino to drive the screen and display "HelloWorld".
Arduino_DataBus *bus = new Arduino_ESP32SPI(45 /* DC */, 21 /* CS */, 38 /* SCK */, 39 /* MOSI */, -1 /* MISO */);
Arduino_GFX *gfx = new Arduino_ST7789(
bus, 40 /* RST */, 0 /* rotation */, true, 240, 240);

This demo demonstrates the ESP32-S3-Touch-LCD-1.54 using the GFX_Library_for_Arduino to display WiFi channel signal strength.
This demo demonstrates the ESP32-S3-Touch-LCD-1.54 using the GFX_Library_for_Arduino to display text in various languages by loading fonts.
This demo uses the ESP32-S3-Touch-LCD-1.54 to test the TF card read/write functionality.
TF card initialization:
if (!SD_MMC.setPins(clk, cmd, d0, d1, d2, d3)) {
Serial.println("Pin change failed!");
return;
}
if (!SD_MMC.begin()) {
Serial.println("Card Mount Failed");
return;
}

This demo demonstrates running an lvgl (v8.4.0) example program on the ESP32-S3-Touch-LCD-1.54.
It is required to install lvgl v8.4.0 version. If you have installed other version, please reinstall.

This demo demonstrates running an lvgl (v9.3.0) example program on the ESP32-S3-Touch-LCD-1.54.
It is required to install lvgl v9.3.0 version. If you have installed other version, please reinstall.


This demo demonstrates running the ESP_SR example program on the ESP32-S3-LCD-1.54.

Wire.begin(I2C_PIN_SDA, I2C_PIN_SCL);
es7210_init();
i2s.setPins(I2S_PIN_BCK, I2S_PIN_WS, I2S_PIN_DOUT, I2S_PIN_DIN, I2S_PIN_MCK);
i2s.setTimeout(1000);
i2s.begin(I2S_MODE_STD, 16000, I2S_DATA_BIT_WIDTH_16BIT, I2S_SLOT_MODE_STEREO);
ESP_SR.onEvent(onSrEvent);
ESP_SR.begin(i2s, sr_commands, sizeof(sr_commands) / sizeof(sr_cmd_t), SR_CHANNELS_STEREO, SR_MODE_WAKEWORD);
static const sr_cmd_t sr_commands[] = {
{ 0, "Turn on the light", "TkN nN jc LiT" },
{ 0, "Switch on the light", "SWgp nN jc LiT" },
{ 1, "Turn off the light", "TkN eF jc LiT" },
{ 1, "Switch off the light", "SWgp eF jc LiT" },
{ 1, "Go dark", "Gb DnRK" },
{ 2, "Start fan", "STnRT FaN" },
{ 3, "Stop fan", "STnP FaN" },
};
This chapter contains the following sections. Please read as needed:
New to ESP32 ESP-IDF development and looking to get started quickly? We have prepared a general Getting Started Tutorial for you.
Please Note: This tutorial uses the ESP32-S3-Zero as a teaching example, and all hardware code is based on its pinout. Before you start, it is recommended that you check the pinout of your development board to ensure the pin configuration is correct.
For the ESP32-S3-Touch-LCD-1.54 development board, ESP-IDF V5.5.0 or above is required.
The following guide uses Windows as an example, demonstrating development using VS Code + the ESP-IDF extension. macOS and Linux users should refer to the official documentation.
Download the installation manager from the ESP-IDF Installation Manager page. This is Espressif's latest cross-platform installer. The following steps demonstrate how to use its offline installation feature.
Click the Offline Installer tab on the page, then select Windows as the operating system and choose your desired version from the filter bar.

After confirming your selection, click the download button. The browser will automatically download two files: the ESP-IDF Offline Package (.zst) and the ESP-IDF Installer (.exe).

Please wait for both files to finish downloading.
Once the download is complete, double-click to run the ESP-IDF Installer (eim-gui-windows-x64.exe).
The installer will automatically detect if the offline package exists in the same directory. Click Install from archive.

Next, select the installation path. We recommend using the default path. If you need to customize it, ensure the path does not contain Chinese characters or spaces. Click Start installation to proceed.

When you see the following screen, the ESP-IDF installation is successful.

We recommend installing the drivers as well. Click Finish installation, then select Install driver.

Download and install Visual Studio Code.
During installation, it is recommended to check Add "Open with Code" action to Windows Explorer file context menu to facilitate opening project folders quickly.
In VS Code, click the Extensions icon in the Activity Bar on the side (or use the shortcut Ctrl + Shift + X) to open the Extensions view.
Enter ESP-IDF in the search box, locate the ESP-IDF extension, and click Install.

For ESP-IDF extension versions ≥ 2.0, the extension will automatically detect and recognize the ESP-IDF environment installed in the previous steps, requiring no manual configuration.
The ESP-IDF demos are located in the ESP-IDF directory of the demo package.
This demo is a comprehensive demo of ESP32-Touch-LCD-1.54, which is also the default demo flashed at factory
![]() | ![]() | ![]() | ![]() |
|---|
This example demonstrates how to use the espressif/button library to read button states such as single click, double click, and long press, and print them via serial port.
Bind callback functions:
ret = iot_button_register_cb(boot_btn, BUTTON_PRESS_DOWN, NULL, button_event_cb, NULL);
ret |= iot_button_register_cb(boot_btn, BUTTON_PRESS_UP, NULL, button_event_cb, NULL);
ret |= iot_button_register_cb(boot_btn, BUTTON_PRESS_REPEAT, NULL, button_event_cb, NULL);
ret |= iot_button_register_cb(boot_btn, BUTTON_PRESS_REPEAT_DONE, NULL, button_event_cb, NULL);
ret |= iot_button_register_cb(boot_btn, BUTTON_SINGLE_CLICK, NULL, button_event_cb, NULL);
ret |= iot_button_register_cb(boot_btn, BUTTON_DOUBLE_CLICK, NULL, button_event_cb, NULL);
ret |= iot_button_register_cb(boot_btn, BUTTON_LONG_PRESS_START, NULL, button_event_cb, NULL);
ret |= iot_button_register_cb(boot_btn, BUTTON_LONG_PRESS_HOLD, NULL, button_event_cb, NULL);
ret |= iot_button_register_cb(boot_btn, BUTTON_LONG_PRESS_UP, NULL, button_event_cb, NULL);
ret |= iot_button_register_cb(boot_btn, BUTTON_PRESS_END, NULL, button_event_cb, NULL);

This demo demonstrates how to use the sensorlib library to read data from the qmi8658 and print it.
Code Analysis
Read Accelerometer, Gyroscope, and Timestamp data from the qmi8658
if (qmi.getDataReady())
{
if (qmi.getAccelerometer(acc.x, acc.y, acc.z))
{
printf("ACCEL--x:%5.2f y:%5.2f z:%5.2f ", acc.x, acc.y, acc.z);
}
if (qmi.getGyroscope(gyr.x, gyr.y, gyr.z))
{
printf("GYRO--x:%5.2f y:%5.2f z:%5.2f ", gyr.x, gyr.y, gyr.z);
}
printf("Temperature:%5.2f degrees C", qmi.getTemperature_C());
}
printf("Timestamp:%ld \r\n", qmi.getTimestamp());

This demo uses the ESP32-S3-Touch-LCD-1.54 to test the TF card read/write functionality.
Initialize and mount the TF card:
sdmmc_slot_config_t slot_config = SDMMC_SLOT_CONFIG_DEFAULT();
#if EXAMPLE_IS_UHS1
slot_config.flags |= SDMMC_SLOT_FLAG_UHS1;
#endif
// Set bus width to use:
#ifdef CONFIG_EXAMPLE_SDMMC_BUS_WIDTH_4
slot_config.width = 4;
#else
slot_config.width = 1;
#endif
// On chips where the GPIOs used for the TF card can be configured, set them in
// the slot_config structure:
#ifdef CONFIG_SOC_SDMMC_USE_GPIO_MATRIX
slot_config.clk = CONFIG_EXAMPLE_PIN_CLK;
slot_config.cmd = CONFIG_EXAMPLE_PIN_CMD;
slot_config.d0 = CONFIG_EXAMPLE_PIN_D0;
#ifdef CONFIG_EXAMPLE_SDMMC_BUS_WIDTH_4
slot_config.d1 = CONFIG_EXAMPLE_PIN_D1;
slot_config.d2 = CONFIG_EXAMPLE_PIN_D2;
slot_config.d3 = CONFIG_EXAMPLE_PIN_D3;
#endif // CONFIG_EXAMPLE_SDMMC_BUS_WIDTH_4
#endif // CONFIG_SOC_SDMMC_USE_GPIO_MATRIX
// Enable internal pullups on enabled pins. The internal pullups
// are insufficient however, please make sure 10k external pullups are
// connected on the bus. This is for debug / example purpose only.
slot_config.flags |= SDMMC_SLOT_FLAG_INTERNAL_PULLUP;
ESP_LOGI(TAG, "Mounting filesystem");
ret = esp_vfs_fat_sdmmc_mount(mount_point, &host, &slot_config, &mount_config, &card);

This demo demonstrates running an lvgl example program on the ESP32-S3-Touch-LCD-1.54 (supports lvgl v8 and lvgl v9).
main/idf_component.yml file, for example, change it to lvgl/lvgl:^8.4.0.Initialize:
/* LCD HW initialization */
ESP_ERROR_CHECK(app_lcd_init());
/* Touch initialization */
app_touch_init();
/* LVGL initialization */
ESP_ERROR_CHECK(app_lvgl_init());
Development Board Design Files
Official ESP32-S3 Chip Manuals
Onboard Component Datasheets
Monday-Friday (9:30-6:30) Saturday (9:30-5:30)
Email: services01@spotpear.com