ST7789 component bug (SOLVED)

Any bugs you encounter with Flowcode should be discussed here.
Sasi
Posts: 38
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 12:11 pm
Has thanked: 7 times
Been thanked: 2 times

ST7789 component bug (SOLVED)

Post by Sasi »

Hello,

I wanted to try a 240x240 1,3" display module with the ST7789 driver, but it didn't work. I tested it with PIC16F18875 MCU.
Then I saw that someone else had also the same problem with this component macro.
I took a snapshot of the display control.
The yellow signal is for SCL, the green is for D / C and the blue is for SDA.
ST7789Dataline.jpg
ST7789Dataline.jpg (89.22 KiB) Viewed 3414 times
ST7789_TEST.fcfx
(9.9 KiB) Downloaded 109 times
You can see that the MCU data output and the LCD drive data output are sometimes active at the same time, which does not seem to be correct.
Is this component macro reparable?
Does it use a hardware SPI module? If it does, how can I select the channel to use.

Best Regards,
Sasi
Last edited by Sasi on Fri Nov 19, 2021 8:35 pm, edited 1 time in total.

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: ST7789 component bug

Post by BenR »

Hi Sasi,

Do you have a link to the specific display you're using so we can see how it's configured.

Sasi
Posts: 38
Joined: Wed Dec 02, 2020 12:11 pm
Has thanked: 7 times
Been thanked: 2 times

Re: ST7789 component bug

Post by Sasi »

Hi Ben,

I have a few pieces of this type.
GMT130_v1_0.jpg
GMT130_v1_0.jpg (55.13 KiB) Viewed 3378 times
I hope there is correct data on the PCB. :roll:

Thanks:
Sasi

Sasi
Posts: 38
Joined: Wed Dec 02, 2020 12:11 pm
Has thanked: 7 times
Been thanked: 2 times

Re: ST7789 component bug

Post by Sasi »

I also tried it with PIC18F27Q10 MCU. I used only the "Initialise" command of macro.
The problem is same as before.
This happened on the data line after a Reset:
ST7789_INIT.jpg
ST7789_INIT.jpg (54.67 KiB) Viewed 3374 times
ST7789Dataline_Init.jpg
ST7789Dataline_Init.jpg (103.95 KiB) Viewed 3374 times
ST7789_TEST_Q10.fcfx
(8.77 KiB) Downloaded 107 times
The beginning of the second (EFh) byte is not perfect either.

I hope I could help you.
Have a nice weekend.

Sasi

Sasi
Posts: 38
Joined: Wed Dec 02, 2020 12:11 pm
Has thanked: 7 times
Been thanked: 2 times

Re: ST7789 component bug

Post by Sasi »

Hello,

I think I found a possible cause of the error.
In the Initialization macro, the clock signal starts from a high level when the MCU sends the first byte to the LCD module. (01h, Software reset)
A rising edge is missing to write the MSB bit of the first data byte. The first data byte has only 7 clock pulses.
ST7789_Initialise_First_byte.jpg
ST7789_Initialise_First_byte.jpg (60.54 KiB) Viewed 3288 times
Therefore, the LSB bit of the first data byte will be the MSB bit of the second data byte.
This shift is true for the entire data stream, so both the 52h command (Read display brightness value)
and the 56h command (Read content adaptive brightness control) appear on the data line,
switching the SDA line of the LCD module to output mode.

Regards,

Sasi

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: ST7789 component bug

Post by BenR »

Hello,

Thanks for letting us know, I've now created an update for the component for you on the library update system which should hopefully fix the clock problem.

Sasi
Posts: 38
Joined: Wed Dec 02, 2020 12:11 pm
Has thanked: 7 times
Been thanked: 2 times

Re: ST7789 component bug

Post by Sasi »

Hi Ben,

The clock is OK now, but the display still does not work. :(
The anomaly is still on the SDA pin.
I'm still experimenting with it.

Regards,
Sasi

Sasi
Posts: 38
Joined: Wed Dec 02, 2020 12:11 pm
Has thanked: 7 times
Been thanked: 2 times

Re: ST7789 component bug

Post by Sasi »

Hi Ben,

I implemented and tested the initialization datas and commands of the ST7789 display with an SPI Master macro.
If the polarity of the clock is "Idle low" and the phase of the clock is "Leading edge" then I experience the original problem.
If I set the polarity of the clock to "Idle High" and leave its phase on "Leading Edge", it works correctly.
I don't know why, but the display works in this setting only. :o (I read the description of the ST7789 chip superficially.) :oops:
Would you set the polarity of the clock to "Idle High"?

Thanks,
Sasi
ST7789_InitTEST_working.fcfx
(18.56 KiB) Downloaded 115 times

Sasi
Posts: 38
Joined: Wed Dec 02, 2020 12:11 pm
Has thanked: 7 times
Been thanked: 2 times

Re: ST7789 component bug

Post by Sasi »

Hi Ben,

Can you change the polarity of the clock signal, please?
Or is it a more complex task and takes longer?

Regards,
Sasi

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: ST7789 component bug

Post by BenR »

Hi Sasi,

Thanks for letting us know and sorry for the delay.

I've made a change to the component for you now so that it should idle high and hopefully that will solve the problem.

Post Reply