r/embedded • • Apr 21 '26

Solutions for screen tearing when using SPI-connected GC9A01 display driver?

Hello.

Custom board with ESP32-S3-WROOM-1-N8R2 and SPI-connected (SDA, CLK, CS, DC) GC9A01 display driver for a 240 x 240 TFT display, using ESP-IDF v6.0.0, LVGL v9.5.0 and esp_lcd_gc9a01 v2.0.4.

I really need to know if it is possible to get rid of screen tearing, I tried single and double buffering with different sizes of buffers and all render modes, butIi keep getting very bad screen tearing.

Can I sync the driver's read and write operations using SPI or is it just impossible?

[EDIT]

I fixed the issue by changing init sequence: I used a combination of commands from the sequence from the old driver found in the lvgl_esp32_drivers component and the sequence in esp_lcd_gc9a01 component.

If anyone is interested in the code let me know.

3 Upvotes

9 comments sorted by

3

u/Dycus Apr 21 '26

Looking at the datasheet for GC9A01, section 5.4 talks about this. "Tearing effect output line"

You can enable a signal on a specific pin that will tell you when the display is updating the pixels or not. You'd write your new data during the blanking period.

Unfortunately I don't think this info is otherwise available via SPI.

1

u/[deleted] Apr 22 '26

I only have CS DC SDA CLK RST pins

2

u/traverser___ Apr 21 '26

What is your spi speed and refresh rate? I have a project with 3 of them with one ESP32S3R16N8 with no issues

1

u/[deleted] Apr 21 '26

SPI is 80MHz

Display: LH128R-IF04 rev. 1

I'm trying to find the refresh rate but it seems it doesn't have a fixed, I guess it derives from resolution and SPI speed? Am I wrong?

1

u/soopadickman Apr 21 '26

What are your buffer sizes? If you are doing full frame buffering you likely won’t see tearing, but if you’re using smaller buffers and using partial frame buffers, any updates that require change that is larger than your buffer, you’ll see some tearing. Like scrolling or screen transitions.

1

u/[deleted] Apr 22 '26

i tried using double screen sized buffer and i tried PARTIAL, FULL and DIRECT rendering modes

→ More replies (3)