【已解决】ESP32-S3如何驱动QSPI接口的LCD?

seanfan@qq.com
Posts: 16
Joined: Mon Dec 14, 2020 1:02 pm

【已解决】ESP32-S3如何驱动QSPI接口的LCD?

Postby seanfan@qq.com » Fri Jun 30, 2023 12:01 pm

目前项目用ESP32-S3来驱动QSPI接口的LCD,驱动IC为GC9B71(规格书参考附件)。试着在ESP-IDF的范例spi_lcd_touch_example_main基础修改了一下,没办法点亮屏,已修改部分请参考附件代码。发现应该要修改esp_lcd_panel_io_spi.c这个文件来适配QSPI的时序。
请问能否提供一些修改指南?或者类似项目参考,谢谢!
Attachments
GC9B71 DataSheet V1.0(1).pdf
(5.71 MiB) Downloaded 1044 times
spi_lcd_touch_example_main.c
(13.53 KiB) Downloaded 1111 times
esp_lcd_panel_gc9b71.c
(11.8 KiB) Downloaded 940 times

liyang5945
Posts: 11
Joined: Fri Jun 23, 2023 6:49 pm

Re: ESP32-S3如何驱动QSPI接口的LCD?

Postby liyang5945 » Mon Jul 03, 2023 2:27 am

目前lilygo有一款开发板配了QSPI的屏幕,你可以去他们github仓库看一下,里面有QSPI屏幕驱动,稍微改下参数应该就可以用 https://github.com/Xinyuan-LilyGO/T-Dis ... m67162.cpp

mainy4210
Posts: 2
Joined: Mon Jul 17, 2023 2:19 am

Re: ESP32-S3如何驱动QSPI接口的LCD?

Postby mainy4210 » Mon Jul 17, 2023 2:34 am

请问一下是否已经点亮了吗,可以发一份资料到邮箱:1443176576@qq.com吗?

ESP_lzw655
Posts: 27
Joined: Mon Oct 10, 2022 2:47 am

Re: ESP32-S3如何驱动QSPI接口的LCD?

Postby ESP_lzw655 » Tue Jul 18, 2023 11:50 am

目前官方仅适配过 ST77903 这一款 QSPI LCD(无内置 GRAM),参考 issue https://github.com/espressif/esp-idf/is ... 1622838282.

而 GC9B71 有内置 GRAM,驱动方式有很大不同,但通过自行配置 SPI 是可以实现的,关键在于发送颜色数据时 spi_transaction_t 需要使用 SPI_TRANS_MODE_QIO 标志使能 4-bit 模式,而发送命令时 spi_transaction_t 仅使用 1-bit。

ESP_lzw655
Posts: 27
Joined: Mon Oct 10, 2022 2:47 am

Re: ESP32-S3如何驱动QSPI接口的LCD?

Postby ESP_lzw655 » Wed Jul 19, 2023 2:26 am

可以参考 https://github.com/espressif/esp-idf/is ... 1640708335 提供的 SPD2010 示例,驱动原理是一样的。

gonghongliang
Posts: 2
Joined: Sun Aug 06, 2023 3:37 am

Re: ESP32-S3如何驱动QSPI接口的LCD?

Postby gonghongliang » Sun Aug 06, 2023 3:58 am

After using this example(SPD2010), I lit up the screen, but encountered the same problem as in the video(https://www.bilibili.com/video/BV1Lj411 ... da6a91f2ad), which has incorrect pixels when only refreshing the arc.Other shapes were normal.
i have test it on gc9b71 and SPD2010(as you have mentiented), all are exactly the same error.
i use gc9b71 example in https://github.com/DoctorTag/esp32S3_watch
I strongly suspect that this may be a bug in lvgl(no matter 8.0~8.3)
Attachments
arc-error.jpg
圆弧出现花屏
arc-error.jpg (47.46 KiB) Viewed 8070 times

ESP_lzw655
Posts: 27
Joined: Mon Oct 10, 2022 2:47 am

Re: ESP32-S3如何驱动QSPI接口的LCD?

Postby ESP_lzw655 » Tue Aug 08, 2023 8:09 am

Sorry, I can't see the specific reason right now either.

However, the probability of LVGL having a bug is relatively low, as we've successfully run this demo on other screens.

In the next two weeks, I'll attempt to drive the SPD2010 and GC9B71 displays to see if the same issue arises.

ESP_lzw655
Posts: 27
Joined: Mon Oct 10, 2022 2:47 am

Re: ESP32-S3如何驱动QSPI接口的LCD?

Postby ESP_lzw655 » Thu Aug 17, 2023 5:35 am

gonghongliang wrote: After using this example(SPD2010), I lit up the screen, but encountered the same problem as in the video(https://www.bilibili.com/video/BV1Lj411 ... da6a91f2ad), which has incorrect pixels when only refreshing the arc.Other shapes were normal.
i have test it on gc9b71 and SPD2010(as you have mentiented), all are exactly the same error.
i use gc9b71 example in https://github.com/DoctorTag/esp32S3_watch
I strongly suspect that this may be a bug in lvgl(no matter 8.0~8.3)
Good news, I successfully drive the GC9B71 QSPI LCD. The demo project is as below. Please carefully read the "README.md" and configure ESP-IDF as required.
GC9B71_QSPI_1_89_320_386.zip
(33.11 KiB) Downloaded 733 times
lvgl.jpg
lvgl.jpg (116.39 KiB) Viewed 7894 times
And I also have the same problem as below before. This situation occurs when I draw color bars every 2N+1 (N is an integer) rows or columns, but when I refresh every 2N (N is an integer) rows or columns, the display appears normal.
bad.jpg
bad.jpg (211.16 KiB) Viewed 7894 times
So I use the below code to round the start coordinate into 2N, and round the end coordinate into 2M+1. Then register it into LVGL by rounder_cb of lv_disp_drv_t.

Code: Select all

void lvgl_port_rounder_callback(struct _lv_disp_drv_t * disp_drv, lv_area_t * area)
{
    uint16_t x1 = area->x1;
    uint16_t x2 = area->x2;
    uint16_t y1 = area->y1;
    uint16_t y2 = area->y2;

    // round the start of area down to the nearest even number
    area->x1 = x1 > 0 ? (((x1 - 1) >> 1) << 1) : 0;
    area->y1 = y1 > 0 ? (((y1 - 1) >> 1) << 1) : 0;

    // round the end of area up to the nearest odd number
    area->x2 = ((x2 >> 1) << 1) + 1;
    area->y2 = ((y2 >> 1) << 1) + 1;
}

ESP_lzw655
Posts: 27
Joined: Mon Oct 10, 2022 2:47 am

Re: ESP32-S3如何驱动QSPI接口的LCD?

Postby ESP_lzw655 » Thu Aug 17, 2023 5:37 am

seanfan@qq.com wrote:
Fri Jun 30, 2023 12:01 pm
目前项目用ESP32-S3来驱动QSPI接口的LCD,驱动IC为GC9B71(规格书参考附件)。试着在ESP-IDF的范例spi_lcd_touch_example_main基础修改了一下,没办法点亮屏,已修改部分请参考附件代码。发现应该要修改esp_lcd_panel_io_spi.c这个文件来适配QSPI的时序。
请问能否提供一些修改指南?或者类似项目参考,谢谢!
请参考最新回复。

gonghongliang
Posts: 2
Joined: Sun Aug 06, 2023 3:37 am

Re: ESP32-S3如何驱动QSPI接口的LCD?

Postby gonghongliang » Thu Aug 17, 2023 2:31 pm

Code runs perfectly!

Who is online

Users browsing this forum: No registered users and 43 guests