Google Chat: zj734465502@gmail.com
+86-0755-88291180
sales01@spotpear.com
dragon_manager@163.com
services01@spotpear.com
manager01@spotpear.com
WhatsApp:13246739196
ESP32-S3-LCD-1.69 is a low-cost, high-performance MCU board designed by Waveshare, embedded with 240MHz dual-core processor, tiny size, with onboard 1.69inch 262K LCD display, Lithium battery recharge manager, 6-axis sensor (3-axis accelerometer and 3-axis gyroscope), WiFi/Bluetooth antenna, RTC, and so on, which makes it easy for you to develop and integrate it into products quickly.
When using the GPIO header reserved on the ESP32-S3-LCD-1.69 board, please pay attention to the wiring colors and corresponding functions.
Please avoid wrong wiring as it may cause the burning of the board.
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 select, 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 serial synchronization clock is collected on the first clock transition edge or the second clock transition edge. 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, when the first falling edge of SCLK starts to transmit data, 8-bit data is transmitted in one clock cycle, using SPI0, bit-by-bit transmission, high-order first, and low-order last.
https://espressif.github.io/arduino-esp32/package_esp32_index.json
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
File name | Description | Version | Can it be downloaded directly? |
---|---|---|---|
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 | —— | —— |
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!");
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.
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.
This example demonstrates an example of plotting WiFi band signal strength on the ST7789 display to implement the function of a WiFi analyzer.
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(); }
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
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
This example demonstrates the use of LVGL for graphics display, communicating with the QMI8658 IMU to obtain accelerometer and gyroscope data
Effect demonstration
This function button is designed to solve the problem that peripheral buttons have few functions. In the V2 version, we made some adjustments:
Peripherals | 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 |
The working principle is as follows:
After pressing the PWR, the battery can be powered, and when the system starts, the system should define SYS_EN 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 SYS_OUT, the system detects SYS_OUT press, continuous press and long press, and can customize the shutdown control operation, such as the system sets SYS_EN low level to disconnect the battery power supply in long press mode, and the multi-function button can be used.
Effect demonstration
This example demonstrates the LVGL Widgets example. The frame rate can reach 20~30 frames in dynamic state
Effect demonstration
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
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
├── CMakeLists.txt ├── main │ ├── CMakeLists.txt │ └── main.c └── README.md
the CMakeLists.txt
.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. ar at the bottom of VSCode UIWhen 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:
In this example, the ST7789 is driven by SPI to display functions such as text, images, and drawing
This example shows the LVGLdemo and uses LVGL to display image data
Effect demonstration
In this example, the PCF85063 is driven in a simple way to perform the time storage and read function
Effect demonstration
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
After receiving the goods, please check whether there is a QC label on the board, if there is a V2QC label, it is a new version of V2. This version has a slightly different pin definition.
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. 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!
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.
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.
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.
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!
Monday-Friday (9:30-6:30) Saturday (9:30-5:30)
Mobile: +86 13434470212
Email: services01@spotpear.com