• sales

    +86-0755-88291180

ESP32-C6-Touch-LCD-1.47 User Guide

Overview

Introduction

This product a microcontroller development board that adopts ESP32-C6FH8 and supports 2.4GHz Wi-Fi 6 and Bluetooth BLE 5. It integrates 8MB Flash and has onboard 1.47inch capacitive touch LCD screen, can smoothly run GUI programs such as LVGL. Combined with various peripheral interfaces, it is suitable for the quick development of the HMI and other ESP32-C6 applications.

Features

  • Equipped with a high-performance 32-bit RISC-V processor with clock speed up to 160 MHz, and a low-power 32-bit RISC-V processor with clock speed as low as 20MHz
  • Supports 2.4 GHz Wi-Fi 6 (802.11 ax/b/g/n) and Bluetooth 5 (BLE) wireless communication protocols, with onboard antenna
  • Built-in 320KB ROM, 512KB HP SRAM, 16KB LP SRAM, and 8MB Flash
  • Onboard 1.47inch capacitive touch LCD display, 172×320 resolution, 262K color
  • Brings out most GPIO pins, and supports USB full-speed standard
  • Onboard TF card slot, supporting external TF card storage for pictures or files
  • Supports accurate control such as flexible clock and multiple power modes to realize low power consumption in different scenarios

Specifications

Parameter nameParameter
InterfaceUSB Type-C
Controller chipESP32-C6
LCD typeISP
Screen resolution172 × 320
Display chipJD9853
Touch chipAXS5106L

Interfaces


Dimensions


Usage Instructions

ESP32-C6-Touch-LCD-1.47 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


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.


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 tool, 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, etc.

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-C6-Touch-LCD-1.47 x1
  • TF card x 1 (32GB and below)
  • Card reader x1
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.

Environment Setup

Download and Install Arduino IDE

  • Click to visit the Arduino official website, select the corresponding system and system bit to download

  • Run the installer and install all by default

Install ESP32 Development Board

  • Before using ESP32-related motherboards with the Arduino IDE, you must first install the software package for the esp32 by Espressif Systems development board
  • According to board installation requirement, it is generally recommended to use Install Online. If online installation fails, use Install Offline.
  • For the installation tutorial, please refer to Arduino board manager tutorial
  • ESP32-C6-Touch-LCD-1.47 required development board installation description
Board nameBoard installation requirementVersion number requirement
esp32 by Espressif Systems"Install Offline" / "Install Online"≥3.0.0

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-C6-Touch-LCD-1.47 library file path:
    ..\ESP32-C6-Touch-LCD-1.47-Demo\Arduino\libraries
  • ESP32-C6-Touch-LCD-1.47 Library file installation instructions
Library NameDescriptionVersionLibrary Installation Requirement
lvglGraphical libraryv8.4.0"Install Online" (requires copying the demos folder to src)
GFX_Library_for_ArduinoLCD driver libraryv1.5.9"Install Online"
FastIMUIUM driver libraryv1.2.8"Install Online"
esp_lcd_touch_axs5106lTouch driver library--"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

  • 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

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.

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


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


  • Compile and upload the program:

①. Compile the program; ②. Compile and download the program; ③. Download successful.

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


Demo

  • ESP32-C6-Touch-LCD-1.47 Demo
DemoBasic DescriptionDependency Library
01_gfx_helloworldHelloWorld is displayed on the screenGFX_Library_for_Arduino
02_qmi8658_outputSerial port prints QMI8658 dataFastIMU
03_sd_card_testTest TF card--
04_lvgl_arduino_v8lvgl demoslvgl, GFX_Library_for_Arduino, esp_lcd_touch_axs5106l
05_lvgl_batteryUse the LVGL library to display the battery voltagelvgl, GFX_Library_for_Arduino, esp_lcd_touch_axs5106l
06_lvgl_brightnessUse the LVGL library to control and display screen brightnesslvgl, GFX_Library_for_Arduino, esp_lcd_touch_axs5106l
07_lvgl_qmi8658Use the LVGL library to display QMI8658 datalvgl, GFX_Library_for_Arduino, FastIMU, esp_lcd_touch_axs5106l
08_lvgl_imageUse the LVGL library to display imageslvgl, GFX_Library_for_Arduino, esp_lcd_touch_axs5106l

Arduino Project Parameter Setting

  • Each demo must be configured with parameters before flashing


01_gfx_helloworld


【Demo description】


This demo demonstrates that ESP32-C6-Touch-LCD-1.47 uses the GFX_Library_for_Arduino library to drive the screen and display HelloWorld on the screen

【Hardware connection】


  • Connect the board to the computer

【Code analysis】


  • Create an object bus of the Arduino_ESP32SPI class to configure the SPI bus GPIO, and create an object gfx of the Arduino_ST7789 class to drive the ST7789 display
Arduino_DataBus *bus = new Arduino_ESP32SPI(45 /* DC */, 21 /* CS */, 38 /* SCK */, 39 /* MOSI */);

Arduino_GFX *gfx = new Arduino_ST7789(
  bus, 47 /* RST */, 0 /* rotation */, false /* IPS */,
  172 /* width */, 320 /* height */,
  34 /*col_offset1*/, 0 /*uint8_t row_offset1*/,
  34 /*col_offset2*/, 0 /*row_offset2*/);

【Result demonstration】


  • HelloWorld is displayed on the screen.



02_qmi8658_output


【Demo description】


This demo demonstrates that ESP32-C6-Touch-LCD-1.47 acquires QMI8658 data and prints it using serial port

【Hardware connection】


  • Connect the board to the computer

【Code analysis】


  • Initialize QMI8658
int err = IMU.init(calib, IMU_ADDRESS);
if (err != 0) {
  Serial.print("Error initializing IMU: ");
  Serial.println(err);
  while (true) {
    ;
  }
}

【Result demonstration】


  • Open the serial port monitor to see the accel and gyro data of the X, Y, and Z axes printed



03_sd_card_test


【Demo description】


This demo demonstrates that ESP32-C6-Touch-LCD-1.47 tests the read and write functions of the TF card

【Hardware connection】


  • Connect the board to the computer
  • Insert the TF card into the card slot (TF card needs to be formatted as FAT32)

【Code analysis】


  • SPI interface initialization and TF card initialization
#ifdef REASSIGN_PINS
  SPI.begin(sck, miso, mosi, cs);
  if (!SD.begin(cs)) {
#else
  if (!SD.begin()) {
#endif
    Serial.println("Card Mount Failed");
    return;
  }

【Result demonstration】


  • Insert the TF card into the computer, and you can find two more files: test.txt and foo.test. The content of the foo.txt is Hello World!, and the content of the test.txt is empty



04_lvgl_arduino_v8


【Demo description】


This demo demonstrates that ESP32-C6-Touch-LCD-1.47 runs the lvgl demos

【Hardware connection】


  • Connect the board to the computer

【Precautions】


  • If the lvgl library is installed online, you need to copy the demos folder to src

【Code analysis】


  • Select the lvgl demos to run
lv_demo_widgets();
// lv_demo_benchmark();
// lv_demo_keypad_encoder();
// lv_demo_music();
// lv_demo_stress();

【Result demonstration】


  • It can be operated by touch


05_lvgl_battery

Collapse

【Demo description】


This demo demonstrates that ESP32-C6-Touch-LCD-1.47 displays battery voltage and ADC values on the screen using the lvgl library

【Hardware connection】


  • Connect the board to the computer

【Code analysis】


  • Initialize the UI and create a 1000ms timer to obtain the data of the adc and convert the data into a voltage
lvgl_battery_ui_init(lv_scr_act());

【Result demonstration】




06_lvgl_brightness


【Demo description】


This demo demonstrates that ESP32-C6-Touch-LCD-1.47 displays the screen brightness on the screen using the lvgl library, and controls the screen brightness through the slider

【Hardware connection】


  • Connect the board to the computer

【Code analysis】


  • Initialize the UI, and create a slider value change callback, when the value of the slider changes, modify the screen brightness
lvgl_brightness_ui_init(lv_scr_act());

【Result demonstration】




07_lvgl_qmi8658


【Demo description】


This demo demonstrates that ESP32-C6-Touch-LCD-1.47 acquires QMI8658 data and displays it using the lvgl library

【Hardware connection】


  • Connect the board to the computer

【Code analysis】


  • Initialize the UI and create a 100ms timer to obtain data from QMI8658
lvgl_qmi8658_ui_init(lv_scr_act());

【Result demonstration】




08_lvgl_image


【Demo description】


This demo demonstrates that ESP32-C6-Touch-LCD-1.47 runs the lvgl to display images.

【Hardware connection】


  • Connect the board to the computer

【Preparation】



  • Copy image_1.c to the project folder
  • Add the following code to 06_lvgl_image.ino to declare the image
LV_IMG_DECLARE(image_1);
  • Set the image to be displayed
lv_img_set_src(img, &image_1);

【Result demonstration】




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 demos, to assist users in mastering the development board and facilitating secondary development.

Environment Setup

Download and Install Visual Studio

  • Open the download page of VScode official website, choose the corresponding system and system bit to download

  • 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

    • 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 OIffline
  • For more information about how to install the Espressif IDF plugin, see Install Espressif IDF Plugin

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




Create Demo

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


  • Select your current IDF version


  • 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

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


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


Modify Driver Object

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


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


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"


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


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


  • 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


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


  • 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


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


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


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


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


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:



Demo

  • ESP32-C6-Touch-LCD-1.47 Demo
DemoBasic Description
01_factoryComprehensive test demo
02_sd_card_testTest the read and write of the TF card
03_lvgl_exampleDisplay lvgl demos
04_lvgl_imageUse lvgl library to display images

01_factory


【Demo description】


This demo tests the functionality of the ESP32-C6-Touch-LCD-1.47 onboard modules, the information of each module will be displayed on the screen, and the user can swipe left and right through the touch screen to switch between pages

【Hardware connection】


  • Connect the board to the computer
  • Insert the TF card into the card slot

【Code analysis】


  • Peripheral initialization
    i2c_bus_handle = bsp_i2c_init();
    bsp_battery_init();
    bsp_wifi_init("WSTEST", "waveshare0755");
    bsp_display_init(&io_handle, &panel_handle, EXAMPLE_LCD_H_RES * EXAMPLE_LCD_DRAW_BUFF_HEIGHT);
    bsp_touch_init(&touch_handle, i2c_bus_handle, EXAMPLE_LCD_H_RES, EXAMPLE_LCD_V_RES, EXAMPLE_DISPLAY_ROTATION);
    bsp_sdcard_init();
    ESP_ERROR_CHECK(app_lvgl_init());
    lv_fs_fatfs_init();


    bsp_display_brightness_init();
    bsp_display_set_brightness(100);
  • LVGL graphics library configuration
if (lvgl_port_lock(0))
{
    lvgl_ui_init();
    lvgl_port_unlock();
}

【Result demonstration】


 


02_sd_card_test


【Demo description】


This demo demonstrates that ESP32-C6-Touch-LCD-1.47 tests the read and write functions of the TF card

【Hardware connection】


  • Connect the board to the computer
  • Insert the TF card into the card slot (TF card needs to be formatted as FAT32)

【Code analysis】


  • Initialize SPI
   spi_bus_config_t bus_cfg = {
       .mosi_io_num = PIN_NUM_MOSI,
       .miso_io_num = PIN_NUM_MISO,
       .sclk_io_num = PIN_NUM_CLK,
       .quadwp_io_num = -1,
       .quadhd_io_num = -1,
       .max_transfer_sz = 4000,
   };
   ret = spi_bus_initialize(host.slot, &bus_cfg, SDSPI_DEFAULT_DMA);
   if (ret != ESP_OK) {
       ESP_LOGE(TAG, "Failed to initialize bus.");
       return;
   }
  • Mount the TF card
   sdspi_device_config_t slot_config = SDSPI_DEVICE_CONFIG_DEFAULT();
   slot_config.gpio_cs = PIN_NUM_CS;
   slot_config.host_id = host.slot;
   ESP_LOGI(TAG, "Mounting filesystem");
   ret = esp_vfs_fat_sdspi_mount(mount_point, &host, &slot_config, &mount_config, &card);

【Result demonstration】


  • Insert the TF card into the computer, and you can find three more files: test.txt, FOO.TXT and NIHAO.TXT. Among them, the content of the FOO.TXT is Hello SD!, the content of the NIHAO.TXT is Hello SD!, and the content of the test.txt is empty



03_lvgl_example


【Demo description】


This demo demonstrates that ESP32-C6-Touch-LCD-1.47 runs the lvgl demos

【Hardware connection】


  • Connect the board to the computer

【Code analysis】


  • Select the lvgl demos to run
        // lv_demo_benchmark();
        // lv_demo_music();
        lv_demo_widgets();
        lvgl_port_unlock();

【Result demonstration】


  • It can be operated by touch



04_lvgl_image


【Demo description】


This demo demonstrates that ESP32-C6-Touch-LCD-1.47 runs the lvgl to display images.

【Hardware connection】


  • Connect the board to the computer

【Preparation】



  • Copy image_1.c to the main folder
  • Add "image_1.c" to the CMakeLists.txt in the main folder
idf_component_register(SRCS "main.c" "image_1.c"
                    INCLUDE_DIRS ".")
  • Add the following code to main.c to declare the image
LV_IMG_DECLARE(image_1);
  • Set the image to be displayed
lv_img_set_src(img, &image_1);

【Result demonstration】




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-C6-Touch-LCD-1.47-Demo\Firmware

Resources

Schematic Diagram

Demo

Project Document

Datasheets

ESP32-C6

Software Tools

Arduino

VScode

Firmware Flashing Tool

FAQ

Question: What should I do if the Arduino demo does not show up after downloading?


Question: After the module downloads the demo and re-downloads it, why sometimes it can't connect to the serial port or the flashing fails?

 Answer:
  • Long press the BOOT button, plug in the USB at the same time, then release the BOOT button, at this time the module can enter the download mode, which can solve most of the problems that can not be downloaded.


Question: Why does the module keep resetting and flicker when viewed the recognition status from the device manager?

 Answer:
  • It may be due to Flash blank and the USB port is not stable, you can long-press the BOOT button, press RESET at the same time, and then release RESET, and then release the BOOT button, at this time the module can enter the download mode to flash the firmware (demo) to solve the situation.


Question: How to deal with the first compilation of the program being extremely slow?

 Answer:
  • It's normal for the first compilation to be slow, just be patient


Question: How to handle the display "waiting for download..." on the serial port after successfully ESP-IDF flashing?

 Answer:
  • If there is a reset button on the development board, press the reset button; if there is no reset button, please power it on again


Question: What should I do if I can't find the AppData folder?

 Answer:
  • Some AppData folders are hidden by default and can be set to show.
  • English system: Explorer->View->Check "Hidden items"
  • Chinese system: File Explorer -> View -> Display -> Check "Hidden Items"


Question: How do I check the COM port I use?

 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 the Device Manager; expand the "Ports (COM and LPT)" section, where all COM ports and their current statuses will be listed.
②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.


Question: Why does the program flashing fail when using a MAC device?

 Answer:


Question: How to use SquareLine Studio to design interfaces?

 Answer:


Support

Monday-Friday (9:30-6:30) Saturday (9:30-5:30)

Email: services01@spotpear.com


[Tutorial Navigation]