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

ESP32 DEV KIT V1+ST7789+2.4 TFT only backlight #1283

Closed PeiaLo closed 3 years ago

PeiaLo commented 3 years ago

It just light the backlight but no display in every example in eSPI. I think wiring is fine,cause it can display normally when run other library. so I check from Read_ User_Setup:

11:08:02.983 -> [code]
11:08:02.983 -> TFT_eSPI ver = 2.3.70
11:08:02.983 -> Processor    = ESP32
11:08:02.983 -> Frequency    = 240MHz
11:08:02.983 -> Transactions = Yes
11:08:02.983 -> Interface    = SPI
11:08:02.983 -> Display driver = 7789
11:08:02.983 -> Display width  = 240
11:08:02.983 -> Display height = 320
11:08:02.983 -> 
11:08:02.983 -> MOSI    = GPIO 23
11:08:02.983 -> MISO    = GPIO 19
11:08:02.983 -> SCK     = GPIO 18
11:08:02.983 -> TFT_CS   = GPIO 15
11:08:02.983 -> TFT_DC   = GPIO 0
11:08:02.983 -> TFT_RST  = GPIO 2
11:08:02.983 -> 
11:08:02.983 -> TFT_BL     = GPIO 22
11:08:02.983 -> 
11:08:02.983 -> Font GLCD   loaded
11:08:02.983 -> Font 2      loaded
11:08:02.983 -> Font 4      loaded
11:08:02.983 -> Font 6      loaded
11:08:02.983 -> Font 7      loaded
11:08:02.983 -> Font 8      loaded
11:08:02.983 -> Smooth font enabled
11:08:02.983 -> 
11:08:02.983 -> Display SPI frequency = 27.00
11:08:02.983 -> [/code]

in user setup select

#include <User_Setup.h>   
#include <User_Setups/Setup18_ST7789.h>            // Setup file configured for ST7789

here's what I choose in user setup

#define ST7789_DRIVER      // Full configuration option, define additional parameters below for this display
#define TFT_SDA_READ      // This option is for ESP32 ONLY, tested with ST7789 and GC9A01 display only
#define TFT_RGB_ORDER TFT_RGB  // Colour order Red-Green-Blue
#define TFT_BL   22            // LED back-light control pin

// For ESP32 Dev board (only tested with ILI9341 display)
// The hardware SPI can be mapped to any pins

#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS 15  // Chip select control pin
#define TFT_DC 2 // Data Command control pin
#define TFT_RST 4  // Reset pin (could connect to RST pin)
#define TFT_RST -1  // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST

 #define SPI_FREQUENCY  10000000

// Optional reduced SPI frequency for reading TFT
#define SPI_READ_FREQUENCY  20000000

// The XPT2046 requires a lower SPI clock rate of 2.5MHz so we define that here:
#define SPI_TOUCH_FREQUENCY  2500000

these two parts can't modified ,is that the reason I can only light up backlight but no display in every example in eSPI? how can I solve it?

11:08:02.983 -> TFT_DC   = GPIO 0
11:08:02.983 -> TFT_RST  = GPIO 2

11:08:02.983 -> Display SPI frequency = 27.00

#define TFT_DC 2 // Data Command control pin
#define TFT_RST 4  // Reset pin (could connect to RST pin)

 #define SPI_FREQUENCY  10000000

thank you

Bodmer commented 3 years ago

It looks like the right setup file is not being called up as the results from the ESP32 do not tie up with the pin definitions and SPI frequency you are using.

Examine the User_Setup_Select.h file and see which setup file is being loaded, make sure that is the one you want.