Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Added ST7789 initialization #182
Thanks for you input.
I have an ST7789 board that has the CS line tied low permanently, this board will not work with SPI_MODE0 but does with SPI_MODE3.
Can you test if the same happens with your display if you tie the CS line permanently low? If you can, then let me know your findings.
Also does your board work OK with the CS line driven and with SPI_MODE3?
I don't think CS line is related to SPI mode. CS low simply means that the slave device is permanently selected. This makes sense in our design (we are building “ESP32 WiPhone”) because display uses a dedicated SPI line, so there is always only one slave - the screen.
Also, according to the ST7789V datasheet:
I think, this means that SPI_MODE0 and SPI_MODE3 should both work.
In my testing, SPI_MODE0, SPI_MODE3 and SPI_MODE2 all work no matter how CS is connected (tied low or driven). The frame rate appears to be the same in these three modes. The only mode that doesn't work for me is SPI_MODE1 (no matter how CS is connected).
So by some luck SPI_MODE2 also works for me.
Certainly, it is strange that SPI_MODE0 doesn't work for you. I guess, it might be caused by impedance differences in your specific setup. So, in general, it might be wise to allow users to select SPI mode.
Oh, I actually remembered one dev board I have that had problems with the ST7789 screen: it required a soft reset in order for the screen to work properly. Otherwise, the screen would always stay white.
But this bug disappeared after I changed SPI mode to SPI_MODE3