Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for GC9503V LCD Driver (Panlee and WirelessTag 86 Box) #2417

Open
tomayr opened this issue Oct 3, 2023 · 33 comments
Open

Add support for GC9503V LCD Driver (Panlee and WirelessTag 86 Box) #2417

tomayr opened this issue Oct 3, 2023 · 33 comments

Comments

@tomayr
Copy link

tomayr commented Oct 3, 2023

Describe the problem you have/What new integration you would like

Would like to add support for the GC9503V LCD Driver so ESPHome can be installed on all current generation Panlee and Wireless Tag ESP32 3.95" Displays. These look identical to the Sonoff NSpanel Pro.

Please describe your use case for this integration and alternatives you've tried:

Would like to use ESPHome as a base for a home automation thermostat with this Panlee panel.

Additional context

@netweaver1970
Copy link

+1. I bought 2 of them, by accident. INstead of gathering dust in a box, it would be nice to have it supported.
Thanks.

@NdS-Research-Facilities

+1 and also needs the touch sensor FT6336U

@RcRaCk2k
Copy link

RcRaCk2k commented Dec 28, 2023

Yeah i also bought 4inch ESP32 S3 Touchable Screen Durable WiFi 86 Central Control Panel Widely Use on eBay. This device also have the Display GC9503V on board.

https://www.ebay.de/itm/355184665406

Looking forward for support of that device.

PS: There is support for Arduino https://github.com/moononournation/Arduino_GFX/blob/master/library.properties

@Quanghoster
Copy link

+1

@nagyrobi
Copy link
Member

nagyrobi commented Jan 4, 2024

OpenHASP seems to work on these too.

@psfshr
Copy link

psfshr commented Jun 12, 2024

+1

2 similar comments
@nithino
Copy link

nithino commented Aug 30, 2024

+1

@xiasi0
Copy link

xiasi0 commented Sep 18, 2024

+1

@dmit2k
Copy link

dmit2k commented Oct 24, 2024

Hello,

any progress with gc9503v support so far? This chip becomes pretty popular driver for inexpensive boards and more of them appear on the market.

It already has Arduino support which can be used as a reference design point as I understand.

@clydebarrow
Copy link

The st7701s driver should work for it, probably just need a custom init sequence.

@elik745i
Copy link

any progress? I got it working but over MQTT through custom sketch in Arduino IDE
https://www.youtube.com/watch?v=e3j2usPWanU

@clydebarrow
Copy link

through custom sketch in Arduino

So you must have the init sequence - you can configure that in YAML with the ST7701S driver.

@GiorgioAresu
Copy link

Can the init sequences (or the ST7701S component) be debugged in some way or is it just trial and error? This is my configuration, mainly referenced on openhasp as that works great (but the poor homeassistant integration and old lvgl makes it a pain to work with in my setup):

display:
  - platform: st7701s
    show_test_card: true
    id: GC9503V
    color_order: RGB
    dimensions:
      width: 480
      height: 480
    reset_pin:
      number: 41 # LCD autoreset, use RGB_VS (TFT_VSYNC) signal to keep working
      allow_other_uses: true
    de_pin: 40
    hsync_pin:
      number: 42
      inverted: false
    vsync_pin:
      number: 41
      inverted: false
      allow_other_uses: true
    pclk_pin: 39
    pclk_inverted: true
    pclk_frequency: 15MHz
    data_pins:
      red:
        - 18         # R1
        - 8          # R2
        - 3          # R3
        - 46         # R4
        - 10         # R5
      green:
        - 14         # G0
        - 13         # G1
        - 12         # G2
        - 11         # G3
        - 16         # G4
        - 17         # G5 
      blue:
        - number: 45 # B1
          allow_other_uses: true
        - number: 48 # B2
          allow_other_uses: true
        - 47         # B3
        - 0          # B4
        - 21         # B5
    # SPI
    cs_pin: 38
    data_rate: 10MHz ## should be 15, not supported
    spi_mode: 0

    hsync_pulse_width: 10
    hsync_front_porch: 8
    hsync_back_porch: 40
    vsync_pulse_width: 10
    vsync_front_porch: 8
    vsync_back_porch: 40
    init_sequence:
      - [ 0xF0, 0x58, 0x05, 0x00 ]
      - [ 0xF1, 0x00, 0x00, 0x00 ]
      - [ 0xF2, 0x00, 0x00, 0x00 ]
      - [ 0xF6, 0x00, 0x20, 0x00 ]
      - [ 0xF9, 0x44, 0x3F, 0x00 ]
      - [ 0xF8, 0x22, 0x22, 0x22 ]
      - [ 0xF3, 0x00, 0x00, 0x00 ]
      - [ 0xF4, 0x00, 0x00, 0x00 ]
      - [ 0xF5, 0x00, 0x00, 0x00 ]
      - [ 0x71, 0x55 ]
      - [ 0x6F, 0x00 ]
      - [ 0x62, 0x01 ]
      - [ 0x63, 0x00 ]
      - [ 0x64, 0x01 ]
      - [ 0x65, 0x00 ]
      - [ 0x66, 0x20 ]
      - [ 0x67, 0x00 ]
      - [ 0x68, 0x20 ]
      - [ 0x69, 0x00 ]
      - [ 0x6A, 0x20 ]
      - [ 0x6B, 0x00 ]
      - [ 0x6C, 0x20 ]
      - [ 0x6D, 0x00 ]
      - [ 0x6E, 0x20 ]
      - [ 0x6F, 0x00 ]
      - [ 0x70, 0x00 ]
      - [ 0x61, 0x00 ]
      - [ 0x82, 0xB0 ]
      - [ 0x83, 0x00 ]
      - [ 0x84, 0xC4 ]
      - [ 0x85, 0x00 ]
      - [ 0x86, 0xC4 ]
      - [ 0x87, 0x00 ]
      - [ 0x88, 0xC4 ]
      - [ 0x89, 0x00 ]
      - [ 0x8A, 0xC4 ]
      - [ 0x8B, 0x00 ]
      - [ 0x8C, 0x00 ]
      - [ 0x81, 0x00 ]
      - [ 0xB1, 0x10 ]
      - [ 0xB2, 0x10 ]
      - [ 0xB3, 0x10 ]
      - [ 0xB4, 0x10 ]
      - [ 0xB5, 0x10 ]
      - [ 0xB6, 0x10 ]
      - [ 0xB7, 0x10 ]
      - [ 0xB8, 0x10 ]
      - [ 0xB9, 0x10 ]
      - [ 0xBA, 0x10 ]
      - [ 0xBB, 0x05 ]
      - [ 0xBC, 0x05 ]
      - [ 0xBD, 0x05 ]
      - [ 0xBE, 0x05 ]
      - [ 0xBF, 0x05 ]
      - [ 0xC0, 0x05 ]
      - [ 0xC1, 0x05 ]
      - [ 0xC2, 0x05 ]
      - [ 0xC3, 0x05 ]
      - [ 0xC4, 0x05 ]
      - [ 0x11 ]
      - delay 120ms
      - [ 0x29 ]


      # Alternative from https://github.com/smartpanle/PanelLan_esp32_arduino/blob/master/src/board/bc02/bc02_rgb_spi_init.hpp, doesn't work either
      # - [ 0xF0, 0x55, 0xAA, 0x52, 0x08, 0x00 ]
      # - [ 0xF6, 0x5A, 0x87 ]
      # - [ 0xC1, 0x3F ]
      # - [ 0xC2, 0x0E ]
      # - [ 0xC6, 0xF8 ]
      # - [ 0xC9, 0x10 ]
      # - [ 0xCD, 0x25 ]
      # - [ 0xF8, 0x8A ]
      # - [ 0xAC, 0x45 ]
      # - [ 0xA0, 0xDD ]
      # - [ 0xA7, 0x47 ]
      # - [ 0xFA, 0x00, 0x00, 0x00, 0x04 ]
      # - [ 0x86, 0x99, 0xA3, 0xA3, 0x51 ]
      # - [ 0xA3, 0xEE ]
      # - [ 0xFD, 0x28, 0x28, 0x00 ]
      # - [ 0x71, 0x48 ]
      # - [ 0x72, 0x48 ]
      # - [ 0x73, 0x00, 0x44 ]
      # - [ 0x97, 0xEE ]
      # - [ 0x83, 0x93 ]
      # - [ 0x9A, 0x72 ]
      # - [ 0x9B, 0x5A ]
      # - [ 0x82, 0x2C, 0x2C ]
      # - [ 0xB1, 0x10 ]
      # - [ 0x6D, 0x00, 0x1F, 0x19, 0x1A, 0x10, 0x0E, 0x0C, 0x0A, 0x02, 0x07, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x08, 0x01, 0x09, 0x0B, 0x0D, 0x0F, 0x1A, 0x19, 0x1F, 0x00 ]
      # - [ 0x64, 0x38, 0x05, 0x01, 0xDB, 0x03, 0x03, 0x38, 0x04, 0x01, 0xDC, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A ]
      # - [ 0x65, 0x38, 0x03, 0x01, 0xDD, 0x03, 0x03, 0x38, 0x02, 0x01, 0xDE, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A ]
      # - [ 0x66, 0x38, 0x01, 0x01, 0xDF, 0x03, 0x03, 0x38, 0x00, 0x01, 0xE0, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A ]
      # - [ 0x67, 0x30, 0x01, 0x01, 0xE1, 0x03, 0x03, 0x30, 0x02, 0x01, 0xE2, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A ]
      # - [ 0x68, 0x00, 0x08, 0x15, 0x08, 0x15, 0x7A, 0x7A, 0x08, 0x15, 0x08, 0x15, 0x7A, 0x7A ]
      # - [ 0x60, 0x38, 0x08, 0x7A, 0x7A, 0x38, 0x09, 0x7A, 0x7A ]
      # - [ 0x63, 0x31, 0xE4, 0x7A, 0x7A, 0x31, 0xE5, 0x7A, 0x7A ]
      # - [ 0x69, 0x04, 0x22, 0x14, 0x22, 0x14, 0x22, 0x08 ]
      # - [ 0x6B, 0x07 ]
      # - [ 0x7A, 0x08, 0x13 ]
      # - [ 0x7B, 0x08, 0x13 ]
      # - [ 0xD1, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2A, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xE5, 0x01, 0x68, 0x01, 0xD5, 0x01, 0xD7, 0x02, 0x36, 0x02, 0xA6, 0x02, 0xEE, 0x03, 0x48, 0x03, 0xA0, 0x03, 0xBA, 0x03, 0xC5, 0x03, 0xD0, 0x03, 0xE0, 0x03, 0xEA, 0x03, 0xFA, 0x03, 0xFF ]
      # - [ 0xD2, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2A, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xE5, 0x01, 0x68, 0x01, 0xD5, 0x01, 0xD7, 0x02, 0x36, 0x02, 0xA6, 0x02, 0xEE, 0x03, 0x48, 0x03, 0xA0, 0x03, 0xBA, 0x03, 0xC5, 0x03, 0xD0, 0x03, 0xE0, 0x03, 0xEA, 0x03, 0xFA, 0x03, 0xFF ]
      # - [ 0xD3, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2A, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xE5, 0x01, 0x68, 0x01, 0xD5, 0x01, 0xD7, 0x02, 0x36, 0x02, 0xA6, 0x02, 0xEE, 0x03, 0x48, 0x03, 0xA0, 0x03, 0xBA, 0x03, 0xC5, 0x03, 0xD0, 0x03, 0xE0, 0x03, 0xEA, 0x03, 0xFA, 0x03, 0xFF ]
      # - [ 0xD4, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2A, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xE5, 0x01, 0x68, 0x01, 0xD5, 0x01, 0xD7, 0x02, 0x36, 0x02, 0xA6, 0x02, 0xEE, 0x03, 0x48, 0x03, 0xA0, 0x03, 0xBA, 0x03, 0xC5, 0x03, 0xD0, 0x03, 0xE0, 0x03, 0xEA, 0x03, 0xFA, 0x03, 0xFF ]
      # - [ 0xD5, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2A, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xE5, 0x01, 0x68, 0x01, 0xD5, 0x01, 0xD7, 0x02, 0x36, 0x02, 0xA6, 0x02, 0xEE, 0x03, 0x48, 0x03, 0xA0, 0x03, 0xBA, 0x03, 0xC5, 0x03, 0xD0, 0x03, 0xE0, 0x03, 0xEA, 0x03, 0xFA, 0x03, 0xFF ]
      # - [ 0xD6, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2A, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xE5, 0x01, 0x68, 0x01, 0xD5, 0x01, 0xD7, 0x02, 0x36, 0x02, 0xA6, 0x02, 0xEE, 0x03, 0x48, 0x03, 0xA0, 0x03, 0xBA, 0x03, 0xC5, 0x03, 0xD0, 0x03, 0xE0, 0x03, 0xEA, 0x03, 0xFA, 0x03, 0xFF ]
      # - [ 0x3A, 0x66 ]
      # - [ 0x11 ]
      # - delay 200ms
      # - [ 0x29 ]

spi:
  - id: lcd_spi
    clk_pin:
      number: 45
      allow_other_uses: true
    mosi_pin: 
      number: 48
      allow_other_uses: true```

@clydebarrow
Copy link

is it just trial and error?

Pretty much. First make sure the backlight is on. Leave the SPI data rate at the default (1MHz) - it's only for setup so it doesn't have to be fast. Try SPI mode 3.

@GiorgioAresu
Copy link

That didn´t work either. I made another few tries but without luck. Then I found this project https://github.com/strange-v/ha_deck which is a custom component that adds another layer on top of the displays themselves but supports this exact model (WT32S3-86S/ZX3D95CE01S) and it works. My understanding, looking a bit at the code, is that the changes required to get it working with the ST7701S are more than just an init sequence (which I also tried). I was trying to make some sort of custom component Frankenstein but couldn´t make it work, I'm too rusty with C and making a display driver as the first custom component seems a bit too much

@clydebarrow
Copy link

clydebarrow commented Jan 19, 2025

Well, if you want any more help, you'll need to show what you've tried so far. I'd suggest providing links to the device documentation, i.e. the schematic if available, the demo code where the GPIO assignments and init code are specified, and the yaml that you have tried so far. Links to any other drivers for the display chip will also be helpful.

Oh, I see much of that already above. More information is better. I'll have a further look when I have a little time.

@GiorgioAresu
Copy link

Sure, thanks! Here's everything I found so far:

    # Rest of the yaml from the comment above
    data_rate: 1MHz
    init_sequence:
      #HA_DECK
      - [ 0xF0, 0x55, 0xAA, 0x52, 0x08, 0x00 ]
      - [ 0xF6, 0x5A, 0x87 ]
      - [ 0xC1, 0x3F ]
      - [ 0xC2, 0x0E ]
      - [ 0xC6, 0xF8 ]
      - [ 0xC9, 0x10 ]
      - [ 0xCD, 0x25 ]
      - [ 0xF8, 0x8A ]
      - [ 0xAC, 0x45 ]
      - [ 0xA0, 0xDD ]
      - [ 0xA7, 0x47 ]
      - [ 0xFA, 0x00, 0x00, 0x00, 0x04 ]
      - [ 0xA3, 0xEE ]
      - [ 0xFD, 0x28, 0x28, 0x00 ]
      - [ 0x71, 0x48 ]
      - [ 0x72, 0x48 ]
      - [ 0x73, 0x00, 0x44 ]
      - [ 0x97, 0xEE ]
      - [ 0x83, 0x93 ]
      - [ 0x9A, 0x72 ]
      - [ 0x9B, 0x5a ]
      - [ 0x82, 0x2c, 0x2c ]
      - [ 0xB1, 0x10 ]
      - [ 0x6D, 0x00, 0x1F, 0x19, 0x1A, 0x10, 0x0e, 0x0c, 0x0a, 0x02, 0x07, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x08, 0x01, 0x09, 0x0b, 0x0D, 0x0F, 0x1a, 0x19, 0x1f, 0x00 ]
      - [ 0x64, 0x38, 0x05, 0x01, 0xdb, 0x03, 0x03, 0x38, 0x04, 0x01, 0xdc, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A ]
      - [ 0x65, 0x38, 0x03, 0x01, 0xdd, 0x03, 0x03, 0x38, 0x02, 0x01, 0xde, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A ]
      - [ 0x66, 0x38, 0x01, 0x01, 0xdf, 0x03, 0x03, 0x38, 0x00, 0x01, 0xe0, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A ]
      - [ 0x67, 0x30, 0x01, 0x01, 0xe1, 0x03, 0x03, 0x30, 0x02, 0x01, 0xe2, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A ]
      - [ 0x68, 0x00, 0x08, 0x15, 0x08, 0x15, 0x7A, 0x7A, 0x08, 0x15, 0x08, 0x15, 0x7A, 0x7A ]
      - [ 0x60, 0x38, 0x08, 0x7A, 0x7A, 0x38, 0x09, 0x7A, 0x7A ]
      - [ 0x63, 0x31, 0xe4, 0x7A, 0x7A, 0x31, 0xe5, 0x7A, 0x7A ]
      - [ 0x6B, 0x07 ]
      - [ 0x7A, 0x08, 0x13 ]
      - [ 0x7B, 0x08, 0x13 ]
      - [ 0xD1, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0xFF ]
      - [ 0xD2, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0xFF ]
      - [ 0xD3, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0xFF ]
      - [ 0xD4, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0xFF ]
      - [ 0xD5, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0xFF ]
      - [ 0xD6, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0xFF ]
      - [ 0x3a, 0x66 ]
      # - [ 0x11, CMD_INIT_DELAY, 200 ] // Sleep Out . CMD_INIT_DELAY=0x80, so this should translate to the next line?
      - [ 0x11, 0x80, 200 ]
      - [ 0x29 ]
      # - [ 0xFF, 0xFF ] // This is the edge case where the length would be 0xFF, so is it enough to just send a single 0xFF?
      - [ 0xFF ]

A picture of my board:
Image

I'm basically overwhelmed with all of this and not really sure on how to piece all of this together with the esphome way of doing the external components (or anything really, again way too rusty on my basic C skills)

@clydebarrow
Copy link

      # - [ 0x11, CMD_INIT_DELAY, 200 ] // Sleep Out . CMD_INIT_DELAY=0x80, so this should translate to the next line?
      - [ 0x11, 0x80, 200 ]
      - [ 0x29 ]
      # - [ 0xFF, 0xFF ] // This is the edge case where the length would be 0xFF, so is it enough to just send a single 0xFF?
      - [ 0xFF ]

Only looked quickly, but this is wrong, it should just be:

      - [ 0x11]
      - delay 200

The 0x29 is not needed, the driver does that. And the FF FF is just an end marker for the table, it's not to be sent. The 0x11 and delay may not be necessary but shouldn't do any harm.

@xiasi0
Copy link

xiasi0 commented Jan 19, 2025

- [ 0xF6, 0x5A, 0x87 ]
- [ 0xC1, 0x3F ]
- [ 0xC2, 0x0E ]
- [ 0xC6, 0xF8 ]
- [ 0xC9, 0x10 ]
- [ 0xCD, 0x25 ]
- [ 0xF8, 0x8A ]
- [ 0xAC, 0x45 ]
- [ 0xA0, 0xDD ]
- [ 0xA7, 0x47 ]
- [ 0xFA, 0x00, 0x00, 0x00, 0x04 ]
- [ 0x86, 0x99, 0xa3, 0xa3, 0x51 ]
- [ 0xA3, 0xEE ]
- [ 0xFD, 0x28, 0x28, 0x00 ]
- [ 0x71, 0x48 ]
- [ 0x72, 0x48 ]
- [ 0x73, 0x00, 0x44 ]
- [ 0x97, 0xEE ]
- [ 0x83, 0x93 ]
- [ 0x9A, 0x72 ]
- [ 0x9B, 0x5a ]
- [ 0x82, 0x2c, 0x2c ]
- [ 0xB1, 0x10 ]
- [ 0x6D, 0x00, 0x1F, 0x19, 0x1A, 0x10, 0x0E, 0x0C, 0x0A, 0x02, 0x07, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x08, 0x01, 0x09, 0x0B, 0x0D, 0x0F, 0x1A, 0x19, 0x1F, 0x00 ]
- [ 0x64, 0x38, 0x05, 0x01, 0xDB, 0x03, 0x03, 0x38, 0x04, 0x01, 0xDC, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A ]
- [ 0x65, 0x38, 0x03, 0x01, 0xDD, 0x03, 0x03, 0x38, 0x02, 0x01, 0xDE, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A ]
- [ 0x66, 0x38, 0x01, 0x01, 0xDF, 0x03, 0x03, 0x38, 0x00, 0x01, 0xE0, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A ]
- [ 0x67, 0x30, 0x01, 0x01, 0xE1, 0x03, 0x03, 0x30, 0x02, 0x01, 0xE2, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A ]
- [ 0x68, 0x00, 0x08, 0x15, 0x08, 0x15, 0x7A, 0x7A, 0x08, 0x15, 0x08, 0x15, 0x7A, 0x7A ]
- [ 0x60, 0x38, 0x08, 0x7A, 0x7A, 0x38, 0x09, 0x7A, 0x7A ]
- [ 0x63, 0x31, 0xE4, 0x7A, 0x7A, 0x31, 0xE5, 0x7A, 0x7A ]
- [ 0x69, 0x04, 0x22, 0x14, 0x22, 0x14, 0x22, 0x08 ]
- [ 0x6B, 0x07 ]
- [ 0x7A, 0x08, 0x13 ]
- [ 0x7B, 0x08, 0x13 ]
- [ 0xD1, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2A, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xE5, 0x01, 0x68, 0x01, 0xD5, 0x01, 0xD7, 0x02, 0x36, 0x02, 0xA6, 0x02, 0xEE, 0x03, 0x48, 0x03, 0xA0, 0x03, 0xBA, 0x03, 0xC5, 0x03, 0xD0, 0x03, 0xE0, 0x03, 0xEA, 0x03, 0xFA, 0x03, 0xFF ]
- [ 0xD2, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2A, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xE5, 0x01, 0x68, 0x01, 0xD5, 0x01, 0xD7, 0x02, 0x36, 0x02, 0xA6, 0x02, 0xEE, 0x03, 0x48, 0x03, 0xA0, 0x03, 0xBA, 0x03, 0xC5, 0x03, 0xD0, 0x03, 0xE0, 0x03, 0xEA, 0x03, 0xFA, 0x03, 0xFF ]
- [ 0xD3, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2A, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xE5, 0x01, 0x68, 0x01, 0xD5, 0x01, 0xD7, 0x02, 0x36, 0x02, 0xA6, 0x02, 0xEE, 0x03, 0x48, 0x03, 0xA0, 0x03, 0xBA, 0x03, 0xC5, 0x03, 0xD0, 0x03, 0xE0, 0x03, 0xEA, 0x03, 0xFA, 0x03, 0xFF ]
- [ 0xD4, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2A, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xE5, 0x01, 0x68, 0x01, 0xD5, 0x01, 0xD7, 0x02, 0x36, 0x02, 0xA6, 0x02, 0xEE, 0x03, 0x48, 0x03, 0xA0, 0x03, 0xBA, 0x03, 0xC5, 0x03, 0xD0, 0x03, 0xE0, 0x03, 0xEA, 0x03, 0xFA, 0x03, 0xFF ]
- [ 0xD5, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2A, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xE5, 0x01, 0x68, 0x01, 0xD5, 0x01, 0xD7, 0x02, 0x36, 0x02, 0xA6, 0x02, 0xEE, 0x03, 0x48, 0x03, 0xA0, 0x03, 0xBA, 0x03, 0xC5, 0x03, 0xD0, 0x03, 0xE0, 0x03, 0xEA, 0x03, 0xFA, 0x03, 0xFF ]
- [ 0xD6, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2A, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xE5, 0x01, 0x68, 0x01, 0xD5, 0x01, 0xD7, 0x02, 0x36, 0x02, 0xA6, 0x02, 0xEE, 0x03, 0x48, 0x03, 0xA0, 0x03, 0xBA, 0x03, 0xC5, 0x03, 0xD0, 0x03, 0xE0, 0x03, 0xEA, 0x03, 0xFA, 0x03, 0xFF ]
- [ 0x3a, 0x66 ]
- [ 0x11, 0x29 ]

hi Clyde This is the init_sequence I tried, and there is no output on the screen. It's worth noting that the GPIO is shared.

@xiasi0
Copy link

xiasi0 commented Jan 19, 2025

  - platform: ledc
    pin: GPIO05
    id: backlight
    frequency: 2000Hz
light:
  - platform: monochromatic
    output: backlight
    name: Backlight
    restore_mode: ALWAYS_ON
i2c:
  - id: bus_a
    sda: GPIO15
    scl: GPIO06
touchscreen:
  - platform: ft63x6
    interrupt_pin: GPIO4
    id: my_touchscreen
    display: my_display
    on_touch:
    - logger.log:
        format: Touch at (%d, %d)
        args: [touch.x, touch.y]
    - lambda: |-
        ESP_LOGI("cal", "x=%d, y=%d, x_raw=%d, y_raw=%0d",
            touch.x,
            touch.y,
            touch.x_raw,
            touch.y_raw
            );
spi:
  - id: lcd_spi
    clk_pin: 
      number: 45
      allow_other_uses: true
    mosi_pin: 
      number: 48
      allow_other_uses: true
display:
  - platform: st7701s
    id: my_display
    update_interval: never
    auto_clear_enabled: true
    spi_mode: MODE3
    data_rate: 1MHz
    color_order: RGB
    invert_colors: False
    show_test_card: true
    dimensions:
      width: 480
      height: 480
    cs_pin: GPIO 38
    de_pin: GPIO 40
    hsync_pin: GPIO 42
    vsync_pin: GPIO 41
    pclk_pin: GPIO 39
    # pclk_frequency: 12MHz
    # pclk_inverted: True
    # hsync_pulse_width: 8
    # hsync_front_porch: 10
    # hsync_back_porch: 20
    # vsync_pulse_width: 8
    # vsync_front_porch: 10
    # vsync_back_porch: 10
    init_sequence:
      - [ 0xF0, 0x55, 0xAA, 0x52, 0x08, 0x00 ]
      - [ 0xF6, 0x5A, 0x87 ]
      - [ 0xC1, 0x3F ]
      - [ 0xC2, 0x0E ]
      - [ 0xC6, 0xF8 ]
      - [ 0xC9, 0x10 ]
      - [ 0xCD, 0x25 ]
      - [ 0xF8, 0x8A ]
      - [ 0xAC, 0x45 ]
      - [ 0xA0, 0xDD ]
      - [ 0xA7, 0x47 ]
      - [ 0xFA, 0x00, 0x00, 0x00, 0x04 ]
      - [ 0xA3, 0xEE ]
      - [ 0xFD, 0x28, 0x28, 0x00 ]
      - [ 0x71, 0x48 ]
      - [ 0x72, 0x48 ]
      - [ 0x73, 0x00, 0x44 ]
      - [ 0x97, 0xEE ]
      - [ 0x83, 0x93 ]
      - [ 0x9A, 0x72 ]
      - [ 0x9B, 0x5a ]
      - [ 0x82, 0x2c, 0x2c ]
      - [ 0xB1, 0x10 ]
      - [ 0x6D, 0x00, 0x1F, 0x19, 0x1A, 0x10, 0x0e, 0x0c, 0x0a, 0x02, 0x07, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x08, 0x01, 0x09, 0x0b, 0x0D, 0x0F, 0x1a, 0x19, 0x1f, 0x00 ]
      - [ 0x64, 0x38, 0x05, 0x01, 0xdb, 0x03, 0x03, 0x38, 0x04, 0x01, 0xdc, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A ]
      - [ 0x65, 0x38, 0x03, 0x01, 0xdd, 0x03, 0x03, 0x38, 0x02, 0x01, 0xde, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A ]
      - [ 0x66, 0x38, 0x01, 0x01, 0xdf, 0x03, 0x03, 0x38, 0x00, 0x01, 0xe0, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A ]
      - [ 0x67, 0x30, 0x01, 0x01, 0xe1, 0x03, 0x03, 0x30, 0x02, 0x01, 0xe2, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A ]
      - [ 0x68, 0x00, 0x08, 0x15, 0x08, 0x15, 0x7A, 0x7A, 0x08, 0x15, 0x08, 0x15, 0x7A, 0x7A ]
      - [ 0x60, 0x38, 0x08, 0x7A, 0x7A, 0x38, 0x09, 0x7A, 0x7A ]
      - [ 0x63, 0x31, 0xe4, 0x7A, 0x7A, 0x31, 0xe5, 0x7A, 0x7A ]
      - [ 0x6B, 0x07 ]
      - [ 0x7A, 0x08, 0x13 ]
      - [ 0x7B, 0x08, 0x13 ]
      - [ 0xD1, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0xFF ]
      - [ 0xD2, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0xFF ]
      - [ 0xD3, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0xFF ]
      - [ 0xD4, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0xFF ]
      - [ 0xD5, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0xFF ]
      - [ 0xD6, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0xFF ]
      - [ 0x3a, 0x66 ]
    data_pins:
      red:
        - 18
        - 8
        - 3
        - 46
        - 10
      green:
        - 14
        - 13
        - 12
        - 11
        - 16
        - 17
      blue:
        - number: 45
          allow_other_uses: true
        - number: 48
          allow_other_uses: true
        - 47 
        - 0 
        - 21

YAML,The backlight and touch are working properly.

@GiorgioAresu
Copy link

GiorgioAresu commented Jan 19, 2025

This is the yaml I'm using without success, with the correct init sequence. I checked again all the pin definitions for what should be inverted and what not. I added a reference to where I got that, hopefully I didn´t do exactly the opposite, but I think I might have tried all the combinations by now 😆

esphome:
  platformio_options:
    board_build.arduino.memory_type: qio_opi
    board_build.arduino.psram_type: opi
    board_build.f_flash: 80000000L

psram:
  mode: octal
  speed: 80MHz

logger:
  baud_rate: 115200
  level: VERBOSE
  tx_buffer_size: 1024
  hardware_uart: UART0

esp32:
  board: esp32-s3-devkitc-1
  variant: esp32s3
  framework:
    # type: arduino
    type: esp-idf
    sdkconfig_options:
      # From: https://github.com/wireless-tag-com/ZX3D95CE01S-TR-4848/blob/master/sdkconfig
      CONFIG_SOC_SPI_MEM_SUPPORT_OPI_MODE: "y"
      CONFIG_ESPTOOLPY_FLASH_MODE_AUTO_DETECT: "y"
      CONFIG_ESPTOOLPY_FLASHMODE_QIO: "y"
  flash_size: 16MB

output:
  - platform: ledc
    pin: 5
    id: backlight_led
    frequency: 1kHz

light:
  - platform: monochromatic
    output: backlight_led
    name: Backlight
    id: backlight
    restore_mode: ALWAYS_ON
    default_transition_length: 200ms

sensor:
  - platform: htu21d
    model: sht21
    temperature:
      name: "Temperature"
    humidity:
      name: "Humidity"
    heater:
      name: "Heater"

i2c:
  sda: 15
  scl: 6
  frequency: 400kHz

touchscreen:
  - platform: ft63x6
    interrupt_pin: 4

spi:
  - id: lcd_spi
    clk_pin:
      number: 45
      allow_other_uses: true
    mosi_pin: 
      number: 48
      allow_other_uses: true

color:
  - id: COLOR_CSS_TOMATO
    red:   1.0000
    green: 0.3882
    blue:  0.2784
    white: 0.0000
display:
  - platform: st7701s
    # update_interval: 5s
    show_test_card: true
    lambda: |-
      it.fill(id(COLOR_CSS_TOMATO));
    id: GC9503V
    color_order: RGB
    dimensions:
      width: 480
      height: 480
    reset_pin:
      number: 41 # LCD autoreset, use RGB_VS (TFT_VSYNC) signal to keep working
      allow_other_uses: true
    de_pin:
      number: 40
      inverted: false # https://github.com/strange-v/ha_deck/blob/main/components/hd_device_wt32s3_86s/LGFX.hpp#L115
    hsync_pin:
      number: 42
      inverted: true # hsync_polarity = 1; Means idle high. https://github.com/strange-v/ha_deck/blob/main/components/hd_device_wt32s3_86s/LGFX.hpp#L106
    vsync_pin:
      number: 41
      inverted: true # vsync_polarity = 1; Means idle high. https://github.com/strange-v/ha_deck/blob/main/components/hd_device_wt32s3_86s/LGFX.hpp#L110
      allow_other_uses: true
    pclk_pin: 39
    pclk_inverted: false # https://github.com/strange-v/ha_deck/blob/main/components/hd_device_wt32s3_86s/LGFX.hpp#L116
    pclk_frequency: 15MHz
    data_pins:
      red:
        - 18         # R1
        - 8          # R2
        - 3          # R3
        - 46         # R4
        - 10         # R5
      green:
        - 14         # G0
        - 13         # G1
        - 12         # G2
        - 11         # G3
        - 16         # G4
        - 17         # G5 
      blue:
        - number: 45 # B1
          allow_other_uses: true
        - number: 48 # B2
          allow_other_uses: true
        - 47         # B3
        - 0          # B4
        - 21         # B5

    # SPI
    cs_pin:
      number: 38
      inverted: true # Active low? https://github.com/lovyan03/LovyanGFX/blob/55a0f66d9278faa596c8d51a8e8a3e537dd8f44f/src/lgfx/v1/platforms/esp32s3/Panel_RGB.cpp#L541-L548
    data_rate: 1MHz # Could be up to 15
    spi_mode: 0 # Idle low. https://github.com/strange-v/ha_deck/blob/main/components/hd_device_wt32s3_86s/LGFX.hpp#L114

    hsync_pulse_width: 10
    hsync_front_porch: 8
    hsync_back_porch: 40
    vsync_pulse_width: 10
    vsync_front_porch: 8
    vsync_back_porch: 40
    init_sequence:
      #HA_DECK
      - [ 0xF0, 0x55, 0xAA, 0x52, 0x08, 0x00 ]
      - [ 0xF6, 0x5A, 0x87 ]
      - [ 0xC1, 0x3F ]
      - [ 0xC2, 0x0E ]
      - [ 0xC6, 0xF8 ]
      - [ 0xC9, 0x10 ]
      - [ 0xCD, 0x25 ]
      - [ 0xF8, 0x8A ]
      - [ 0xAC, 0x45 ]
      - [ 0xA0, 0xDD ]
      - [ 0xA7, 0x47 ]
      - [ 0xFA, 0x00, 0x00, 0x00, 0x04 ]
      - [ 0xA3, 0xEE ]
      - [ 0xFD, 0x28, 0x28, 0x00 ]
      - [ 0x71, 0x48 ]
      - [ 0x72, 0x48 ]
      - [ 0x73, 0x00, 0x44 ]
      - [ 0x97, 0xEE ]
      - [ 0x83, 0x93 ]
      - [ 0x9A, 0x72 ]
      - [ 0x9B, 0x5a ]
      - [ 0x82, 0x2c, 0x2c ]
      - [ 0xB1, 0x10 ]
      - [ 0x6D, 0x00, 0x1F, 0x19, 0x1A, 0x10, 0x0e, 0x0c, 0x0a, 0x02, 0x07, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x08, 0x01, 0x09, 0x0b, 0x0D, 0x0F, 0x1a, 0x19, 0x1f, 0x00 ]
      - [ 0x64, 0x38, 0x05, 0x01, 0xdb, 0x03, 0x03, 0x38, 0x04, 0x01, 0xdc, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A ]
      - [ 0x65, 0x38, 0x03, 0x01, 0xdd, 0x03, 0x03, 0x38, 0x02, 0x01, 0xde, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A ]
      - [ 0x66, 0x38, 0x01, 0x01, 0xdf, 0x03, 0x03, 0x38, 0x00, 0x01, 0xe0, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A ]
      - [ 0x67, 0x30, 0x01, 0x01, 0xe1, 0x03, 0x03, 0x30, 0x02, 0x01, 0xe2, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A ]
      - [ 0x68, 0x00, 0x08, 0x15, 0x08, 0x15, 0x7A, 0x7A, 0x08, 0x15, 0x08, 0x15, 0x7A, 0x7A ]
      - [ 0x60, 0x38, 0x08, 0x7A, 0x7A, 0x38, 0x09, 0x7A, 0x7A ]
      - [ 0x63, 0x31, 0xe4, 0x7A, 0x7A, 0x31, 0xe5, 0x7A, 0x7A ]
      - [ 0x6B, 0x07 ]
      - [ 0x7A, 0x08, 0x13 ]
      - [ 0x7B, 0x08, 0x13 ]
      - [ 0xD1, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0xFF ]
      - [ 0xD2, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0xFF ]
      - [ 0xD3, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0xFF ]
      - [ 0xD4, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0xFF ]
      - [ 0xD5, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0xFF ]
      - [ 0xD6, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0xFF ]
      - [ 0x3a, 0x66 ]
      - [ 0x11 ]
      - delay 200ms # To be possibly removed after we get it working

Isn´t the ST7701S driver adding more stuff to the init sequence that shouldn't be there for the GC9503V? https://github.com/esphome/esphome/blob/dev/esphome/components/st7701s/st7701s.cpp#L163-L177
(but obviously it's not that easy, still doesn't work removing those lines)

@clydebarrow
Copy link

Again, only a quick look, but remove the inverted GPIO pin specifications. The only one that may be inverted is PCLK and if so you specify that differently. CS is definitely not inverted (it's active low, but the SPI driver handles that.)

Remove the reset pin from the display - it's not connected.

@clydebarrow
Copy link

Add this to the init sequence

     - [0xB0, 0]

That sets the signal polarities. It should be the power on default, but won't hurt.

@clydebarrow
Copy link

And another suggestion - any time you try something different, make sure to power cycle the board.

@GiorgioAresu
Copy link

GiorgioAresu commented Jan 20, 2025

display:
  - platform: st7701s
    # update_interval: 5s
    show_test_card: true
    lambda: |-
      it.fill(id(COLOR_CSS_TOMATO));
    id: GC9503V
    color_order: RGB
    dimensions:
      width: 480
      height: 480
    # reset_pin:
    #   number: 41 # LCD autoreset, use RGB_VS (TFT_VSYNC) signal to keep working
    #   # inverted: true
    #   allow_other_uses: true
    de_pin:
      number: 40
      # inverted: false # https://github.com/strange-v/ha_deck/blob/main/components/hd_device_wt32s3_86s/LGFX.hpp#L115
    hsync_pin:
      number: 42
      # inverted: true # hsync_polarity = 1; Means idle high. https://github.com/strange-v/ha_deck/blob/main/components/hd_device_wt32s3_86s/LGFX.hpp#L106
    vsync_pin:
      number: 41
      # inverted: true # vsync_polarity = 1; Means idle high. https://github.com/strange-v/ha_deck/blob/main/components/hd_device_wt32s3_86s/LGFX.hpp#L110
      # allow_other_uses: true
    pclk_pin: 39
    pclk_inverted: false # https://github.com/strange-v/ha_deck/blob/main/components/hd_device_wt32s3_86s/LGFX.hpp#L116
    pclk_frequency: 15MHz
    data_pins:
      red:
        - 18         # R1
        - 8          # R2
        - 3          # R3
        - 46         # R4
        - 10         # R5
      green:
        - 14         # G0
        - 13         # G1
        - 12         # G2
        - 11         # G3
        - 16         # G4
        - 17         # G5 
      blue:
        - number: 45 # B1
          allow_other_uses: true
        - number: 48 # B2
          allow_other_uses: true
        - 47         # B3
        - 0          # B4
        - 21         # B5

    # SPI
    cs_pin:
      number: 38
      # inverted: true # Active low? https://github.com/lovyan03/LovyanGFX/blob/55a0f66d9278faa596c8d51a8e8a3e537dd8f44f/src/lgfx/v1/platforms/esp32s3/Panel_RGB.cpp#L541-L548
    data_rate: 1MHz ## should be 15, not supported
    spi_mode: 0 # Idle low. https://github.com/strange-v/ha_deck/blob/main/components/hd_device_wt32s3_86s/LGFX.hpp#L114

    hsync_pulse_width: 10
    hsync_front_porch: 8
    hsync_back_porch: 40
    vsync_pulse_width: 10
    vsync_front_porch: 8
    vsync_back_porch: 40
    init_sequence:
      #HA_DECK
      - [ 0xF0, 0x55, 0xAA, 0x52, 0x08, 0x00 ]
      - [ 0xF6, 0x5A, 0x87 ]
      - [ 0xC1, 0x3F ]
      - [ 0xC2, 0x0E ]
      - [ 0xC6, 0xF8 ]
      - [ 0xC9, 0x10 ]
      - [ 0xCD, 0x25 ]
      - [ 0xF8, 0x8A ]
      - [ 0xAC, 0x45 ]
      - [ 0xA0, 0xDD ]
      - [ 0xA7, 0x47 ]
      - [ 0xFA, 0x00, 0x00, 0x00, 0x04 ]
      - [ 0xA3, 0xEE ]
      - [ 0xFD, 0x28, 0x28, 0x00 ]
      - [ 0x71, 0x48 ]
      - [ 0x72, 0x48 ]
      - [ 0x73, 0x00, 0x44 ]
      - [ 0x97, 0xEE ]
      - [ 0x83, 0x93 ]
      - [ 0x9A, 0x72 ]
      - [ 0x9B, 0x5a ]
      - [ 0x82, 0x2c, 0x2c ]
      - [ 0xB1, 0x10 ]
      - [ 0x6D, 0x00, 0x1F, 0x19, 0x1A, 0x10, 0x0e, 0x0c, 0x0a, 0x02, 0x07, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x08, 0x01, 0x09, 0x0b, 0x0D, 0x0F, 0x1a, 0x19, 0x1f, 0x00 ]
      - [ 0x64, 0x38, 0x05, 0x01, 0xdb, 0x03, 0x03, 0x38, 0x04, 0x01, 0xdc, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A ]
      - [ 0x65, 0x38, 0x03, 0x01, 0xdd, 0x03, 0x03, 0x38, 0x02, 0x01, 0xde, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A ]
      - [ 0x66, 0x38, 0x01, 0x01, 0xdf, 0x03, 0x03, 0x38, 0x00, 0x01, 0xe0, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A ]
      - [ 0x67, 0x30, 0x01, 0x01, 0xe1, 0x03, 0x03, 0x30, 0x02, 0x01, 0xe2, 0x03, 0x03, 0x7A, 0x7A, 0x7A, 0x7A ]
      - [ 0x68, 0x00, 0x08, 0x15, 0x08, 0x15, 0x7A, 0x7A, 0x08, 0x15, 0x08, 0x15, 0x7A, 0x7A ]
      - [ 0x60, 0x38, 0x08, 0x7A, 0x7A, 0x38, 0x09, 0x7A, 0x7A ]
      - [ 0x63, 0x31, 0xe4, 0x7A, 0x7A, 0x31, 0xe5, 0x7A, 0x7A ]
      - [ 0x6B, 0x07 ]
      - [ 0x7A, 0x08, 0x13 ]
      - [ 0x7B, 0x08, 0x13 ]
      - [ 0xD1, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0xFF ]
      - [ 0xD2, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0xFF ]
      - [ 0xD3, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0xFF ]
      - [ 0xD4, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0xFF ]
      - [ 0xD5, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0xFF ]
      - [ 0xD6, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x18, 0x00, 0x21, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x47, 0x00, 0x56, 0x00, 0x90, 0x00, 0xe5, 0x01, 0x68, 0x01, 0xd5, 0x01, 0xd7, 0x02, 0x36, 0x02, 0xa6, 0x02, 0xee, 0x03, 0x48, 0x03, 0xa0, 0x03, 0xba, 0x03, 0xc5, 0x03, 0xd0, 0x03, 0xE0, 0x03, 0xea, 0x03, 0xFa, 0x03, 0xFF ]
      - [ 0x3a, 0x66 ]
      - [ 0x11 ]
      - delay 200ms # To be possibly removed after we get it working
      - [ 0xB0, 0 ]

This is the log output for the display section. I see the data pins order is mixed up by the st7701s driver, does the gc9503v need the same treatment?

[08:08:15][C][:183]: ST7701S RGB LCD
[08:08:15][C][display.st7701s:184]:   Height: 480
[08:08:15][C][display.st7701s:185]:   Width: 480
[08:08:15][C][display.st7701s:186]:   CS Pin: GPIO38
[08:08:15][C][display.st7701s:188]:   DE Pin: GPIO40
[08:08:15][C][display.st7701s:192]:   Data pin 0: GPIO11
[08:08:15][C][display.st7701s:192]:   Data pin 1: GPIO16
[08:08:15][C][display.st7701s:192]:   Data pin 2: GPIO17
[08:08:15][C][display.st7701s:192]:   Data pin 3: GPIO18
[08:08:15][C][display.st7701s:192]:   Data pin 4: GPIO8
[08:08:15][C][display.st7701s:192]:   Data pin 5: GPIO3
[08:08:15][C][display.st7701s:192]:   Data pin 6: GPIO46
[08:08:15][C][display.st7701s:192]:   Data pin 7: GPIO10
[08:08:15][C][display.st7701s:192]:   Data pin 8: GPIO45
[08:08:15][C][display.st7701s:192]:   Data pin 9: GPIO48
[08:08:15][C][display.st7701s:192]:   Data pin 10: GPIO47
[08:08:15][C][display.st7701s:192]:   Data pin 11: GPIO0
[08:08:15][C][display.st7701s:192]:   Data pin 12: GPIO21
[08:08:15][C][display.st7701s:192]:   Data pin 13: GPIO14
[08:08:15][C][display.st7701s:192]:   Data pin 14: GPIO13
[08:08:15][C][display.st7701s:192]:   Data pin 15: GPIO12
[08:08:15][C][display.st7701s:193]:   SPI Data rate: 1MHz

About the power cycling, I'll do that thanks

@clydebarrow
Copy link

I see the data pins order is mixed up by the st7701s driver,

I suspect you have the data pins in the wrong order, but that will only affect the color, you should still see an image of some sort. though it could be very dark.

@clydebarrow
Copy link

Another point - I believe there are multiple hardware variants of the board. It would pay to double check that you are using the right data for the board you have. Also have you actually compiled any other firmware and got a display?

@GiorgioAresu
Copy link

GiorgioAresu commented Jan 20, 2025

The backlight is at full brightness, so I think even if dark, I should be able to see something.
Yes, the ones that work are HA_Deck (I'll copy from above so you don´t have to hunt):

And OpenHASP:

@creeloper27
Copy link

To add to @GiorgioAresu working firmware list, I am currently experimenting with using this display using Tasmota firmware (using this already previously mentioned Issue as a how to arendst/Tasmota#19489) and it works almost perfectly, there are some weird wobbly-like artifacts around the image though that I am trying to understand the cause of.

@sEbola76
Copy link

After a few days of struggling with the code, I managed to achieve a small success.
Image
However, the method on the ST7701s component did not work.
I created an external component based on the source code from: https://github.com/esphome/esphome/tree/dev/esphome/components/rpi_dpi_rgb and started testing various initialization codes sent via SPI.
The one from: https://github.com/wireless-tag-com/ZX3D95CE01S-TR-4848/blob/master/main/screen.c works.
The another one from @GiorgioAresu works after changing the last value from 0xB0 to 0x29.
But... esphome lvgl still doesn't work (black screen, only for a while after the reset I see boot image), I suspect that the problem is in the control of the LCD_CS (38) [active low] pin and LCD_RST [active low - must be high to work, the high state is obtained from RGB_VS (41) through the RC filter].

@GiorgioAresu
Copy link

That's a good step forward!
Did you try setting the inverted properties where appropriate, like in #2417 (comment)?

@sEbola76
Copy link

That's a good step forward! Did you try setting the inverted properties where appropriate, like in #2417 (comment)?

Check my code: https://github.com/sEbola76/gc9503v
I also have tested on second fresh module from Panlee, and everything is working.

Image

@clydebarrow
Copy link

esphome lvgl still doesn't work (black screen, only for a while after the reset I see boot image),

This turns out to be caused by a recent change that was meant to automate the setting of auto_clear_enabled but also had the effect that explicitly setting it to false resulted in it being true. Remove that setting and it should solve the issue. I have raised a PR to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests