Uncategorized

Dual LCD notes

load older messages load to my last message full transcript highlights

Feeds

Feeds
0:30
1

Q: How to connect ST7789 LCD to Raspberry Pi

ichirowI’m trying to connect to this LCD ( sry 4 japanese page:( use translate plz ) This monitor driver is ST7789, 7pins.[GND VCC SCL SDA RES DC BLK] And now I’m connecting to pi like this imgur.com/a/BFWUAXN I’m using Python_ST7789 library. The installation was success and The example progra…

tlfong01

tlfong01
2309
Hi @ichirow, Welcome and nice to meet you. You might find my answer to the following question helpful to newbies getting started: How to connect ST7789 LCD to SPI Bus 1 as 2nd screen? raspberrypi.stackexchange.com/questions/104846/…. Please feel free to ask me more newbie questions! 🙂
Google does not know how to translate your LCD Japanese spec into English or Chinese, but I compare your IPS with what I am studying seems to be the same config. So I think my answer referred above should still be helpful to you. (1) TFT LCD 240×240 IPS 65K 3.3V SPI ST7789 -¥1,069 amazon.co.jp/gp/product/B07P7W8D8J/… (2) DisplayModule ST7789VW 1.3″ 240×240 IPS TFT SPI – $10 displaymodule.com/products/…
ichirow

ichirow
@tifong01 Hi thank you for answer for my question, I read that question, but I couldn’t see first picture so I couldn’t get know how to connect LCD to Pi sry:(
@tifong01 thank you for tell me the product, I checked it. it seems exactly same
tlfong01

tlfong01
2309
About the connection, you might like to read Refs 2, 3 of my answer. They include wiring instructions. Let me know if you find which connection confuses you. PS – Actually my answer also includes a wiring chart and a schematic.
Or do you need this pinout picture: pinout.xyz ?
ichirow

ichirow
4
@tlfong01 the confusing point is wiring…. I think SPI is correct, DC and VCC are suspect. 18 is a good pin for DC, Pi is providing power correctly? How to find the wiring errors, and what is the BLK(I know use as turn to backlight but signals)
@tlfong01 Mercy me about missspell your name btw…. thx about pinout.xyz. I can find pics like that and wiring to pi everytimes.
tlfong01

tlfong01
2309
Ah, no problem about misspelling my user name. Actually I did not notice it! 😦 I usually cut and paste the user name, especially when the username is long, to prevent typo errors and also to save time. About the wiring problem: (1) There are two kinds of connectors: (a) 7 pin, and (b) 12 pin. I think you are using the 7 pin version. Correct me if otherwise. Now let me take a look and come back to you later.
Ah, I read the schematic again and found it badly drawn and not well commented for newbies. So I improved it. Please read my updated answer and let me know if it is all clear now. Thanks. Cheers.
Hi @ichirow, By the way, your username reminds me of the world famous 铃木一朗 and 王貞治. I know 王貞治 better because he has “only one foot”! 🙂
ichirow

ichirow
0:30
@tlfong01 sry, late response, Yes I’m using 7 pin version. sry where is updated comment. yep, same name, this name came from real name (It is not real name) 一 meaning a first male of family and 郎 meaning a man. I like this name.
tlfong01

tlfong01
It is my answer to the question, already referred in my first comment above. See update at the bottom of answer: raspberrypi.stackexchange.com/questions/104846/…. Ah, jogging time for me, see you late this evening or tomorrow. Cheers. Ah yes, I am 次郎, second son of the family.
joan

joan
You need to find out if the Adafruit library is using hardware SPI or software SPI. Given a speed of 40 MHz is mentioned in the code that suggests hardware SPI (software SPI in Python would be about 50 kHz, not 40 MHz). If it is using hardware SPI you are using the wrong GPIO.
ichirow

ichirow
4
@tlfong01 reviewed wiring and some fix and debug but blank….. maybe hardware is dead. good luck jogging! cu later
@joan hi, thank you for reviewing but some people have already works with this program…. wondering asking only my probrem?
@joan sry, I got misunderstand, what is the hardware SPI and software SPI in Adafruits libraries. Can I find and fix it?
joan
joan
I do not know. I do not use the Adafruit libraries.
ichirow
@joan okay, I referred the source code. It seems hardware gpio.github.com/adafruit/Adafruit_Python_GPIO/blob/master/… it is wrong…?
joan

joan
0:30
The code can do hardware (using spidev) or software (using bit bang). I don’t know which it is doing in your case. If you are using SPI hardware you need to use the dedicated SPI GPIO. See pinout.xyz GPIO 7-11.
ichirow

ichirow
4
@joan I figured…. Okay, I’m using hardware SPI GPIO (may be misunderstanding…. its about learning progress.) and I am testing this Device(LCD) connect to Arduino with another reference (simple-circuit.com/arduino-st7789-ips-tft-display-example) but it is still blank, so this LCD is garbage’s probability is very high. So, I ordered other screens with Amazon….
tlfong01

tlfong01
2309
Hi @ichirow, Ah, I think even your ST7789 does not work in both Rpi and Arduino, the probability of your LCD module faulty is NOT very high. I think the probability is lower than other things, like software bug etc. I have taken the liberty to compile your wiring into one compete diagram, and pasted into your question, so that everybody can help double check if every end to end wiring is correct.
Hi @ichirow, I googled and found 2 python libraries for Rpi. I have included them in your question. The second library looks better, but I not tried either. One potential problem is that the driver is originally from AdaFruit, modified for Rpi, but there might be OS incompatibility problems, eg, work for jessie, but not stretch, or buster.
ichirow

ichirow
4
@tlfong01 I slept well and read well your answer of another question. thank you for adding the figures editting from my figures. I cannot running examples so wirings is the points. I am trying anything wiring in the progress. ST7789 is endure miswiring btw? e.g. overvoltage, reverse currents etc.
@tlfong01 Thank you for googled, I couldn’t find the second library. I’m going to test that. gracias. grazie. merci.
11 hours later…
tlfong01

tlfong01
2309
11:19
@ichirow (1) I have also taken liberty to add a pin description to your question, so that (a) Other newbies can share your success/failure experience, and avoid reinventing new wheels, or frying more LCD modules! 🙂 (b) Other ninjas can look at your pin description and suggest you how to troubleshoot, eg, (i) After initialization, how to use a multi-meter to measure the pin voltage levels (should RST High or Low, DC Hig or Low?)
(ii) When getting a blank screen, or picture too slow, how to use a multi-meter (Note 1) to measure the SPI signal pins (Should CS be very Low, CLK middle, …? Note 1 – Of course rich guys should use a oscilloscope, but poor guys can use blinking LEDs, push buttons, multi-meter to also do the troubleshooting job effectively.
2 hours later…
tlfong01

tlfong01
2309
12:54
You asked what is the use what chip select signal CS0 and CS1. This is what I answered in the answer I referred. You need to wiki and google SPI to understand everything. But for my dual ST7789 LCD project, it is something like this. I am connecting two LCD modules to the same SPI0 bus, each module as the same SCLK, MOSI, MISO wires connected. The only difference is that module A CS pin is connected to SPI CS0 pin, and Module B’s CS pin is connected to SPI CS1 pin.
Now if I set CS0 Low, and CS1 High, then Module A will be selected, and will talk to Rpi through SPI CLK, MOSI, MISO wires. At the same time, Module B is NOT selected, and will not respond to SPI signals.
Now the catch is this. For your 7 pin module, the LCD’s CS wire is CONNECTED TO GROUND, therefore ALWAYS SELECTED, no matter Rpi’s CS0, CS1 are High or Low, LCD does not care, always respond. So what I suggested to the OP of that question is suggesting him to extract the LCD’s CS wire, DO NOT CONNECT TO GROUND, but connect to Rpi SPI CS1, then this modified LCD will be selected if Rpi SPI CS1 is low.
I have been trying to explain this to a coople of other user asking why they can not use two LCDs. But they don’t try to understand what I am talking about, and gave up, … 😦
.END

Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s