SETUP ESP32 WROOM 32D with ST7789V AND TFT_eSPI library

Hello everyone, I would like to use my 2 Inch 240x320 IPS display, ST7789V driver , with the esp32 wroom 32D. Is this possible? If this Is possibile, how should the individual pins be connected. Do you recommend the TFT_eSPI.h library for this configurations or other libraries? Thank you very much for your patience.

Have a good evening

Sure why not?

The digital communication pins (MOSI, SCLK, CS, DC, reset, …) can be connected to any GPIO pins since the ESP32 has a GPIO matrix, meaning it can map the e.g. SPI peripheral to arbitrary GPIO pins.

The power pins (VCC, GND, backlight,…) should ofc go to the appropriate pins in accordance to the product description (most likely 3.3V, GND etc).

See TFT_eSPI/docs/PlatformIO/Configuring options.txt at master · Bodmer/TFT_eSPI · GitHub and Installing on PlatformIO · Bodmer/TFT_eSPI Wiki · GitHub.

TFT_eSPI is a big versatile library, you can do most stuff with it. If it doesn’t work you can also try


thank you very much for the response.
While I was waiting, I saw a bit which setup was better with tft_espi library. I was able to print to screen the resolution is 240x240 while the screen is 240x320. I changed the size in the setup but it does not change the result.
I now attach a picture of what appears on the screen.

What is the platformio.ini and user config file?

This is the contents of the .ini file:

[env:esp32doit-devkit-v1]

platform = espressif32

board = esp32doit-devkit-v1

framework = arduino

monitor_speed = 115200

monitor_port = COM3

lib_deps = bodmer/TFT_eSPI@^2.4.79

This is the contents of the User_Setup.h file:

#define USER_SETUP_INFO “User_Setup”

#define ST7789_DRIVER

#define TFT_WIDTH 240

#define TFT_HEIGHT 320

#define TFT_INVERSION_ON

#define LOAD_GLCD

#define LOAD_FONT2

#define LOAD_FONT4

#define LOAD_FONT6

#define LOAD_FONT7

#define LOAD_FONT8

#define LOAD_GFXFF

#define SMOOTH_FONT

#define SPI_READ_FREQUENCY 6000000

In the User_Setup_Select.h file, I uncommented this line:

#include <User_Setups/Setup25_TTGO_T_Display.h>

After that i modify Setup25_TTGO_T_Display.h with this:

// Setup for the TTGO T Display

#define USER_SETUP_ID 25

// See SetupX_Template.h for all options available

#define ST7789_DRIVER

#define TFT_SDA_READ // Display has a bidirectional SDA pin

#define TFT_WIDTH 240

#define TFT_HEIGHT 320

#define CGRAM_OFFSET // Library will add offsets required

//#define TFT_MISO -1

#define TFT_MOSI 19

#define TFT_SCLK 18

#define TFT_CS 5

#define TFT_DC 16

#define TFT_RST 23

#define TOUCH_CS -1

#define TFT_BL 4 // Display backlight control pin

#define TFT_BACKLIGHT_ON HIGH // HIGH or LOW are options

#define LOAD_GLCD

#define LOAD_FONT2

#define LOAD_FONT4

#define LOAD_FONT6

#define LOAD_FONT7

#define LOAD_FONT8

#define LOAD_GFXFF

#define SMOOTH_FONT

#define SPI_READ_FREQUENCY 6000000 // 6 MHz is the maximum SPI read speed for the ST7789V

hello everyone,
I solved the screen problem with ST7789V driver.

This is what needs to be uncommented in the file User_Setup.h

#define USER_SETUP_INFO “User_Setup”

#define ST7789_DRIVER

#define TFT_WIDTH 240

#define TFT_HEIGHT 320

#define TFT_INVERSION_ON

#define LOAD_GLCD

#define LOAD_FONT2

#define LOAD_FONT4

#define LOAD_FONT6

#define LOAD_FONT7

#define LOAD_FONT8

#define LOAD_GFXFF

#define SMOOTH_FONT

In the User_Setup_Select.h file, I uncommented this line:

#include <User_Setups/Setup23_TTGO_TM.h>

After that i modify Setup23_TTGO_TM.h :

// Setup for the TTGO TM (Music) ESP32 board with 2.4" ST7789V display

#define USER_SETUP_ID 23

// See SetupX_Template.h for all options available

#define ST7789_DRIVER

#define TFT_SDA_READ // Read from display, it only provides an SDA pin

//#define TFT_MISO 19  // Must be defined even though it is not used

#define TFT_MOSI 23  // Connected to display SDA line

#define TFT_SCLK 18

#define TFT_CS   05

#define TFT_DC   16

#define TFT_RST  17

#define TFT_BL   4

#define TOUCH_CS -1

#define TFT_WIDTH  240

#define TFT_HEIGHT 320

#define TFT_RGB_ORDER TFT_RGB  // Colour order Red-Green-Blue

//#define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red

// Black and white swap option

//#define TFT_INVERSION_ON

#define TFT_INVERSION_OFF

#define LOAD_GLCD

#define LOAD_FONT2

#define LOAD_FONT4

#define LOAD_FONT6

#define LOAD_FONT7

#define LOAD_FONT8

#define LOAD_GFXFF

#define SMOOTH_FONT

//#define SPI_FREQUENCY  40000000     // This display also seems to work reliably at 80MHz

//#define SPI_FREQUENCY  80000000

#define SPI_READ_FREQUENCY  6000000 // 6 MHz is the maximum SPI read speed for the ST7789V

that’s all,

HAVE A NICE DAY EVERYONE :slight_smile:

1 Like