lovyan03 / LovyanGFX

SPI LCD graphics library for ESP32 (ESP-IDF/ArduinoESP32) / ESP8266 (ArduinoESP8266) / SAMD51(Seeed ArduinoSAMD51)
Other
1.03k stars 189 forks source link

ST7789 on 16b parallel ESP32-S3 #291

Closed jonsmirl closed 1 year ago

jonsmirl commented 1 year ago

I have a 16b parallel ST7789 panel hooked up to an ESP32-S3 but it doesn't display anything. The driver for the ST7789 does not appear to be fully completed. I also have a ILI948x hooked up to ESP32-S3 16b parallel which does work.

What changes are needed in the ST7789 driver to make it work with 16b parallel? Do I need to implement getMadCtl() or setColorDepth_impl()?

lovyan03 commented 1 year ago

The ST7789 parallel should work. You may have the wrong configuration.

jonsmirl commented 1 year ago

How do you set in the panel dimensions? Mine is 240 x 320.

Is this correct?

       _cfg.panel_height = _cfg.memory_height = 320;
+      _cfg.memory_width  = _cfg.panel_width  = 240;
lovyan03 commented 1 year ago

それは正しいですが、画面に何も表示されないのであれば、問題は別にあります。

jonsmirl commented 1 year ago

We put a scope on it and none of the signals are changing -- RD, WR, CS, DC all high. None of the data lines are changing. It is like the scan out process never got started.

I started off from this demo: https://github.com/radiosound-com/makerfabs-parallel-tft-lvgl-lgfx https://www.youtube.com/watch?v=ZWtTmmne6Bo That board is ESP32-S3 with 16b parallel ILI948x. The board we are building is ESP32-S3 with 16b parallel ST7789

I then modified that code with these two small patches to adjust for the pinout of PCB and ST7789. jds_patch.zip

lovyan03 commented 1 year ago

そもそも信号が出力されないのであれば、パネルの種類が何であるかは関係がありません。 ボードが壊れているか、プログラムが起動していない可能性はないですか?

問題を再現できる最小のコードを提示してください。 私に他人のコードの差分を読むために無駄な時間を使わせないでください。

jonsmirl commented 1 year ago

Someone mentioned that board is 8bit parallel. Can you confirm its 16bit for sure?

It is 16b parallel; we made the PCB. PCB is over at the LCD vendor, they are trying to figure out what is wrong with it. I suspect the panel is not getting initialized correctly.

sukesh-ak commented 1 year ago

Here is the config file for their display, if it helps.

https://github.com/radiosound-com/makerfabs-parallel-tft-lvgl-lgfx/blob/master/main/LGFX_MakerFabs_Parallel_S3.hpp

jonsmirl commented 1 year ago

We believe the problem is in panel level configuration for the ST7789

https://github.com/radiosound-com/LovyanGFX/blob/4a0c312ae0851c2fe5b43544f8c37a7358e76d90/src/lgfx/v1/panel/Panel_ST7789.hpp

On Thu, Oct 27, 2022 at 9:33 AM Sukesh Ashok Kumar @.***> wrote:

Here is the config file for their display, if it helps.

https://github.com/radiosound-com/makerfabs-parallel-tft-lvgl-lgfx/blob/master/main/LGFX_MakerFabs_Parallel_S3.hpp

— Reply to this email directly, view it on GitHub https://github.com/lovyan03/LovyanGFX/issues/291#issuecomment-1293534583, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAADUX7YLZDOOROVFQIIWLTWFKAEDANCNFSM6AAAAAARCKPXCU . You are receiving this because you authored the thread.Message ID: @.***>

-- Jon Smirl @.***

lovyan03 commented 1 year ago

We put a scope on it and none of the signals are changing -- RD, WR, CS, DC all high. None of the data lines are changing. It is like the scan out process never got started.

I am asking you to review the settings because you made this statement

lovyan03 commented 1 year ago

I will not devote my time to you unless you provide concise and sufficient information

jonsmirl commented 1 year ago

We have all of the signals changing now. I am not being very helpful because the PCB is in China and I am in Boston. They have one in the mail to me but it is not here yet.

Right now I make changes to the code and send it to China and then they try it and tell me it doesn't work. Then I have to guess what is wrong and try again. The manufacturer got tired of doing this and gave the prototype board to the LCD vendor. LCD vendor has not done anything with it yet. We are just trying to get a demo working to ensure PCB is ok before making 100 units.

jonsmirl commented 1 year ago

I don't believe anything is seriously wrong with the code, they is just some minor initialization bit which is wrong.

For example I think the CS is inverted for the panel, so I inverted it. That did not get the panel going. Next I tried messing around with the initialization commands to the panel.

The LCD vendor gave us this working code for STM32 and ST7789 in parallel mode. I tried copying the panel initialization out of it but that did not work. https://drive.google.com/file/d/1TfI27JAXaW10xw7ZKdARDKgKRqGLr2R_/view?usp=share_link

sukesh-ak commented 1 year ago

@jonsmirl You need to get a prototype board and test it yourself. Currently you are shooting in the dark here unfortunately.

lovyan03 commented 1 year ago

One of my biggest pet peeves in this world is being asked to mediate questions in hearsay form.

When you are able to verify the configuration yourself using the breakout board, please ask the question again.

jonsmirl commented 1 year ago

Still in the mail coming from China.

lovyan03 commented 1 year ago

You first stated that "ILI948x worked". Is the hardware you used for testing then the same as this one? I suggest you connect the DevKit to the LCD breakout board with a jumper wire to see if it works

jonsmirl commented 1 year ago

I have one of these: https://www.makerfabs.com/esp32-s3-parallel-tft-with-touch-ili9488.html

The LCD connector on the makerfab board is incompatible with my ST7789 (50p vs 40p). So we had a new PCB is made for the ST7789 LCD. We need to use this LCD specifically due to mechanical constraints. I tried to build a working S3 image for the ST7789 here in Boston. I have S3 board, just no way to attach it to LCD panel. I put scope on all of the lines and they look ok. I then sent that image to China and they loaded it on the board. China reports that the signals are on the LCD pins and the backlight is working but nothing on LCD.

I tried inverting CS which did not help. I tried adding in some different panel init, did not work. So now new PCB is on the way to me. When it gets here I can put logic analyzer on it and likely see what problem is. Hopefully, since I am SW person, not HW.

I do have some of the LCDs and I have S3 modules. I could trying ordering a LCD breakout board and see how far I can get. I did not try that earlier because I am not certain if I can get the LCD out of the housing without breaking it. And it needs to be out of the housing to access the FPC cable. They are sending me panels in the mail which are not in the housing.

lovyan03 commented 1 year ago

つまりあなたは問題の原因がハードなのかソフトなのか確かめる前に、ソフトウェアを疑った上、私にデバッグ作業を強制しようとしたんですよね? 不具合の証拠を集めるのはお前の仕事です。現時点で私があなたに協力する理由はなにもない。

JohnTaipei commented 1 year ago

my pcb esp32-s3 + lovyangfx + st7789 16-bits mode works fine

do you use 40 pins FPC st7789 lcd?

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 1 year ago

This issue has been automatically closed because it has not had recent activity. Thank you for your contributions.

jonsmirl commented 1 year ago

If someone comes across this in the future....

The people designing this ST7789 board were new to LCDs. The reason why this did not work was because the LCD was wired into parallel 8080 mode instead of RGB mode. The software people were unaware of this.