Hi guys! I have a very big problem. I ordered a KMR-1.8 SPI TFT Display(TUTORIAL: How to work with a 1.8" SPI TFT with strange incorrect labelling! - YouTube - like this one. Also used this tutorial for wiring) from a local retailer along with a WeMos D1 (not mini). The D1 works just fine, I tested it with a vibration motor and an IR Receiver. No problems. But it just does not want to work with the screen. I tried using a variety of libs but none of them worked. Currently I use this one GitHub - Bodmer/TFT_eSPI: Arduino and PlatformIO IDE compatible TFT library optimised for the Raspberry Pi Pico (RP2040), STM32, ESP8266 and ESP32 that supports different driver chips. I have to note that every single tutorial on this screen has a different approach and I'm more than confused. Also, I'm a beginner so I don't have a lot of experience. My connections are(I am using board reference because I'm not familiar with in code terms):
LED- -> Ground
LED + -> 3v3 (because one or two post suggested it works with 3v3 also)
MOSI -> -
MISO -> -
SCK -> -
CS -> SS/D8
SCL -> SCK/D5
SDA -> MOSI/D7
A0 -> D6
RESET -> D4
VCC -> 3V3
GND -> Ground
EDIT: Forgot to mention, the screen remains white all the time. This is the problem.
Sorry if I made any big mistakes, it's my first build. And thanks in advance.
First off. The quality of Internet Tutorial is 20%. He does not understand what he is talking about.
Master SPI pins have several names
e.g. MOSI, SDI, DI, DIN, ... (SDA if bidirectional data)
e.g. MISO, SDO, DO, DOUT
e.g. SCK, SCLK, SCL, ...
Auxiliary pins:
e.g. RS, DC, A0, ...
e.g. RESET, RST, ...
The reason for the strange pinout: that display will plug into 16-pin LCD header on an 8051 dev board.
The LED+ will probably need an extra series resistor if you connect to +5V
The VCC goes to an AMS1117 regulator. Connect to 5V. If you only have 3.3V, short jumper J1.
LED- -> Ground
LED + -> 3v3 (because one or two post suggested it works with 3v3 also)
MOSI -> -
MISO -> -
SCK -> -
CS -> SS/D8
SCL -> SCK/D5
SDA -> MOSI/D7
A0 -> D6
RESET -> D4
VCC -> 3V3
GND -> Ground
Please change A0 (DC) to a different pin. D6 has SPI MISO function.
In practice, VCC=3.3V will be fine without shorting J1.
Which "Wemos D1" do you have.
Wemos D1 R1 which is a Uno format board.
Wemos D1 R2 is a Uno format board with different pinout.
Wemos D1 mini is a small pcb. (Lolin D1 mini)
These 128x160 colour TFT tend to have Sitronix ST7735S controllers.
There are many different makes. Run Bodmer's Read_ID_bitbash program and copy-paste the result.
David.
So. To start from the beginning. The video was listed in the product description. Second, also in the product description it specifies it is a ST7735 without a S at the end. And what I forgot to mention because I was very annoyed at the lcd when I wrote the post is that the website specifies to run each I/O connection through a 500-2kOhm resistor. Sorry I forgot to mention the details above. As for the WeMos, it is a D1 R2.
Here it's the Read_ID_bitbash:
===========================
Register 0x01: 0x00
Register 0x04: 0xFFFFFF
Register 0x09: 0xFFFFFFFF
Register 0x0A: 0xFF
Register 0x0B: 0xFF
Register 0x0C: 0xFF
Register 0x0D: 0xFF
Register 0x0E: 0xFF
Register 0x0F: 0xFF
Register 0x2E: 0xFFFFFF
Register 0x3F: 0xFFFFFFFF
Register 0xDA: 0xFF
Register 0xDB: 0xFF
Register 0xDC: 0xFF
Looks like driver chip is: Unknown
PS: I don't think it looks that good.
In case you did not realise, your output is complete crap.
I ran it (on an ESP32 after setting the correct pin defines)
TFT driver register values:
===========================
Register 0x01: 0x00
Register 0x04: 0x7C89F0
Register 0x09: 0x610000
Register 0x0A: 0x08
Register 0x0B: 0x00
Register 0x0C: 0x06
Register 0x0D: 0x00
Register 0x0E: 0x00
Register 0x0F: 0x00
Register 0x2E: 0x00
Register 0x3F: 0xFFFFFFFF
Register 0xDA: 0x7C
Register 0xDB: 0x89
Register 0xDC: 0xF0
===========================
Looks like driver chip is: ST7735S (empirical value)
Please show your defines. And verify your wiring matches with a photo.
Yes, the ID sketch is very useful. But only when you use the correct defines and wiring. e.g.
//NodeMCU
#define TFT_MOSI D7
#define TFT_SCK D5
#define TFT_CS D8
#define TFT_DC D3
#define TFT_RESET D4
*/
//ESP32 for David Prentice
#define TFT_MOSI 23
#define TFT_SCK 18
#define TFT_CS 5
#define TFT_DC 13
#define TFT_RESET 12
When you get meaningful output, you know your wiring matches the defines. And you can edit the User_Setup accordingly.
David.
So, I fixed my inputs an they are
//NodeMCU
#define TFT_MOSI D7
#define TFT_SCK D5
#define TFT_CS D8
#define TFT_DC D3
#define TFT_RESET D4
and the output is
===========================
Register 0x01: 0x00
Register 0x04: 0x7C89F0
Register 0x09: 0x610000
Register 0x0A: 0x08
Register 0x0B: 0x00
Register 0x0C: 0x06
Register 0x0D: 0x00
Register 0x0E: 0x00
Register 0x0F: 0x00
Register 0x2E: 0x283A0C
Register 0x3F: 0x74185074
Register 0xDA: 0x50
Register 0xDB: 0x18
Register 0xDC: 0x74
===========================
Looks like driver chip is: ST7735S (empirical value)
but after I edit User_Setup.h and upload the code it still refuses to work and shows only a white screen. I checked my input via Read_User_Setup and it is
TFT_eSPI ver = 2.3.53
Processor = ESP8266
Frequency = 80MHz
Voltage = 3.95V
Transactions = No
Interface = SPI
SPI overlap = No
Display driver = 7735
Display width = 128
Display height = 160
TFT_CS = PIN_D8
TFT_DC = PIN_D3
TFT_RST = PIN_D4
Font GLCD loaded
Font 2 loaded
Font 4 loaded
Font 6 loaded
Font 7 loaded
Font 8 loaded
Smooth font enabled
Display SPI frequency = 27.00
Why?
Congratulations. The Read_ID report looks fine.
The Read_User_Setup looks fine too.
This is my Read_User_Setup:
TFT_eSPI ver = 2.2.11
Processor = ESP32
Frequency = 240MHz
Transactions = Yes
Interface = SPI
Display driver = 7735
Display width = 128
Display height = 160
MOSI = GPIO 23
MISO = GPIO 19
SCK = GPIO 18
TFT_CS = GPIO 5
TFT_DC = GPIO 13
TFT_RST = GPIO 12
TOUCH_CS = GPIO 16
Font GLCD loaded
Font 2 loaded
Font 4 loaded
Font 6 loaded
Font 7 loaded
Font 8 loaded
Smooth font enabled
Display SPI frequency = 8.00
Touch SPI frequency = 2.50
and this is the Read_User_Setup when I use Wemos D1 R1
TFT_eSPI ver = 2.2.11
Processor = ESP8266
Frequency = 80MHz
Voltage = 3.25V
Transactions = Yes
Interface = SPI
SPI overlap = No
Display driver = 7735
Display width = 128
Display height = 160
TFT_DC = PIN_D4
TFT_RST = PIN_D3
TOUCH_CS = PIN_D1
Font GLCD loaded
Font 2 loaded
Font 4 loaded
Font 6 loaded
Font 7 loaded
Font 8 loaded
Smooth font enabled
Display SPI frequency = 8.00
Touch SPI frequency = 2.50
Don't worry about my SPI frequency. I have it deliberately slow when I capture with a Logic Analyser.
It looks like I should upgrade my TFT_eSPI version.
I strongly advise you to enable Transactions. Does not matter for TFT-only programs but is important for Touch, SD, Flash-Memory chips, ...
David.
I think I see the problem, mine says Transactions = No instead of Transactions = Yes. What is causing this?
In your User_Setup enable this line
#define SUPPORT_TRANSACTIONS
I doubt that it would stop your ST7735. But is simple enough to enable / disable
Sooo... I still have a white screen after I updated the User_Setup.h What can be the problem at this point?
EDIT: I start to believe that the Display might be damaged. After all, it was delivered in an envelope with a bit of bubble wrap around.
Sooo. One over another I found the problem. Kind of. I wired both LED+ and VCC to 3v3 (or 5V or VIN) with a 1kOhm resistance and now it only flickers the colors change on the screen. What can be a fix to this?
My apologies. I did not look closely enough at #4
Register 0xDA: 0x50
Register 0xDB: 0x18
Register 0xDC: 0x74
This is not what I would expect. I suspect it is a similar 132x162 controller that is made by a different company than Sitronix.
All the same, I would expect it to work. I have a GC9101 and a GC9102 display that are "similar" to ST7735.
In fact the GC9102 is mounted on a blue KMR-1.8 SPI pcb that has the same surface mounted components as your link in #0.
If you are in the UK, PM me.
If not, I suggest that you ask the shop for a replacement.
Regarding the header pin layout. I always put the SD and the TFT on the same hardware SPI bus. So several pins are just connected together. The Red SPI boards have the SD pins at the other side of the pcb which is less convenient.
Most ST7735 boards seem to have the monster SD Card holder. A microSD is much more convenient.
David.
So if I understand correctly, I have a bad LCD right? And no, I'm sadly from Romania so I just have to send it for a replacement if you say it's bad.
It is probably fine. But you have verified your wiring with the Read_ID program and the proven TFT library did not work.
My only other suggestion is
#define SPI_FREQUENCY 8000000
#define SUPPORT_TRANSACTIONS
Sorry that we could not be more help.
David.
#define SPI_FREQUENCY 8000000
#define SUPPORT_TRANSACTIONS
Tried this and still no. As soon as they are open I'll return it. Thanks a lot. I'll be back when I get the replacement.