Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: ST7789V2 LCD Controller

by afoken (Chancellor)
on Aug 18, 2024 at 22:02 UTC ( [id://11161205]=note: print w/replies, xml ) Need Help??


in reply to ST7789V2 LCD Controller

... which approach would you start with?

The website you linked to has several examples for Raspi and Arduino. Study the code. Way down on the page are links to a schematic and the ST7789V2 datasheet.

Schematics are primitive, just level converters and a voltage regulator connected between the "public" interface to the outside world and the LCD controller. LCD backlight is PWM controlled by the outside interface (pin 1). Other signals look like I²C (SDA, SCL), there is also a chip select (CS), data/control switch (D/C), and a reset line (RST). Reading the Spec at the top of the web page lists SPI, not I²C as control interface. So SDA should be named MOSI, SCL should be named CLK, and having a CS line makes total sense with SPI. Note that there is no MISO, as usual for many LCDs. They are write-only devices.

On top of the website, you can see a timing diagram sending 16 bit RGB565 pixel data. This is how you write into display memory - pixel by pixel, with D/C set high. With a little bit of luck, there is a way to move to a selected pixel before writing, probably by setting D/C low.

The ST7789V2 datasheet starts with a lot of electrical stuff, the serial interface is documented in chapter 8.4 and following explaining low-level SPI, Commands are in chapter 9. Note that you can not read back from the display, the required data line (MISO) is not available at the outside interface.

So this is how I would start. Read the website, the datasheet, the example code. Example code often stinks and most times lacks any error checks. Datasheets omit little details and sometimes are plain wrong. Get used to it.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11161205]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2026-03-07 05:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.