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
Other
3.79k stars 1.09k forks source link

ESP8266 - Only Backlight No Graphics on ST7789 TFT Display #1630

Closed audreylim closed 2 years ago

audreylim commented 2 years ago

Hi!

I'm trying to get my TFT display working, but all I see is the backlight and no graphics. I uploaded this code https://github.com/Bodmer/TFT_eSPI/blob/master/examples/Generic/Gradient_Fill/Gradient_Fill.ino to my ESP8266 from the Arduino IDE.

I got my ESP from here https://www.amazon.com/HiLetgo-Internet-Development-Wireless-Micropython/dp/B010O1G1ES/ref=asc_df_B010O1G1ES/?tag=hyprod-20&linkCode=df0&hvadid=309818716690&hvpos=&hvnetw=g&hvrand=13377053487764932588&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9067609&hvtargid=pla-361876718784&th=1 and my 1.3" TFT 240x240 SPI ST7789 from here https://www.amazon.com/MakerFocus-Display-1-3inch-Interface-Routines/dp/B07P9X3L7M

My PIN connections are: GND - GND VCC - 3v3 SCL - D5 SDA - D7 RES - D2 DC - D1 Reference: https://simple-circuit.com/esp8266-nodemcu-st7789-tft-ips-display/

I've uploaded the code, unplugged and plugged the usb, held on to the reset button, but all I see is the backlight. Is there something I am missing?

Thank you!

image image

sayanee commented 2 years ago

@audreylim It seems like you are connecting to the 2 I2C pins SCL - D5, SDA - D7 when it should be the 4 SPI pins. Re-wire again?

image
Bodmer commented 2 years ago

Pins D5 and D7 are correct. These map to GPIO 14 and GPIO 13.

Run the Read_User_Setup diagnostic sketch to check you have correctly edited the user setup file. Look at the serial output to check compiler is picking up correct pins and TFT driver. Post output here if you are not sure.

Bodmer commented 2 years ago

You must solder the header pins to the display as well!

audreylim commented 2 years ago

Thanks @Bodmer , @sayanee

I uploaded the Read_User_Setup and got this:

Screenshot 2022-02-10 085219

Bodmer commented 2 years ago

You need to set the monitor window baud rate to 115200

Bodmer commented 2 years ago

I made a mistake above, I meant pins D5 and D7 are correct. These map to GPIO 14 and GPIO13.

audreylim commented 2 years ago

oh wow, here's the output:


[code]
TFT_eSPI ver = 2.4.32
Processor    = ESP8266
Frequency    = 80MHz
Voltage      = 3.29V
Transactions = No
Interface    = SPI
SPI overlap  = No

Display driver = 9341
Display width  = 240
Display height = 320

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
[/code]
Bodmer commented 2 years ago

It looks like you have not edited the User_Setup.h file.

You need to comment out this line. Uncomment this line. Uncomment this line.

Uncomment this line. Then change the pin numbers here, comment out the TFT_CS line as you do not use it.

audreylim commented 2 years ago

Just did all that, but still only backlight and no graphics. The code I uploaded is this https://github.com/Bodmer/TFT_eSPI/blob/master/examples/Generic/Gradient_Fill/Gradient_Fill.ino

Serial output:

[code]
TFT_eSPI ver = 2.4.32
Processor    = ESP8266
Frequency    = 80MHz
Voltage      = 3.29V
Transactions = No
Interface    = SPI
SPI overlap  = No

Display driver = 7789
Display width  = 240
Display height = 240

TFT_DC   = PIN_D1
TFT_RST  = PIN_D2

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
[/code]
Bodmer commented 2 years ago

Report looks good now. Have you soldered the header to the display board?

audreylim commented 2 years ago

Bingo, it was the soldering. Thank you so much!

image

Bodmer commented 2 years ago

Great, glad it is working for you.