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.
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
ST7789 component bug (SOLVED)
-
- 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)
Last edited by Sasi on Fri Nov 19, 2021 8:35 pm, edited 1 time in total.
-
- Matrix Staff
- Posts: 1739
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 440 times
- Been thanked: 603 times
Re: ST7789 component bug
Hi Sasi,
Do you have a link to the specific display you're using so we can see how it's configured.
Do you have a link to the specific display you're using so we can see how it's configured.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Re: ST7789 component bug
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:
The beginning of the second (EFh) byte is not perfect either.
I hope I could help you.
Have a nice weekend.
Sasi
The problem is same as before.
This happened on the data line after a Reset:
The beginning of the second (EFh) byte is not perfect either.
I hope I could help you.
Have a nice weekend.
Sasi
Re: ST7789 component bug
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. 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
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. 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
-
- Matrix Staff
- Posts: 1739
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 440 times
- Been thanked: 603 times
Re: ST7789 component bug
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Re: ST7789 component bug
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. (I read the description of the ST7789 chip superficially.)
Would you set the polarity of the clock to "Idle High"?
Thanks,
Sasi
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. (I read the description of the ST7789 chip superficially.)
Would you set the polarity of the clock to "Idle High"?
Thanks,
Sasi
-
- Matrix Staff
- Posts: 1739
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 440 times
- Been thanked: 603 times
Re: ST7789 component bug
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel