Adafruit_ST7789 on a custom ESP32-S3 board

I have a custom ESP32-S3 board and I have tried to connect the display ST7789 ( the model with 6 pins)
As a demo test I have used the sketch "graphictest_Feather_ESP32S2.ino".
However, I don't see any image on the display. In the serial terminal I see that the sketch is running because I see this output
"Hello! Feather TFT TestInitialized
876
done"

The initial declarations are the following

#include <Adafruit_GFX.h> 
#include <Adafruit_ST7789.h> 
#include <SPI.h>

#define TFT_RST 7

#define TFT_DC 8

#define TFT_MOSI 6

#define TFT_SCLK 5

Adafruit_ST7789 tft = Adafruit_ST7789(-1, TFT_DC, TFT_MOSI,TFT_SCLK,TFT_RST);

I am using the following libraries "Adafruit_GFX"v1.11.1 and "Adafruit_ST7789" v.10.4
In the board manager I have selected the board ESP32-S3-USB-OTG" and with this option I have no issues in running other sketches.

The MOSI and SCLK pins can be any ESP32-S3 GPIO or is it necessary to use specific pins? I have connected the dispaly RST pin directly to ESP32 GPIO7 without any pull-up or pull-down resistor. Is it correct? Thanks

i have the exact same issue

1 Like

I had the same problem when I first built the setup few years ago and the solution was SPI_MODE2:

tft.init(240, 240, SPI_MODE2);

Recently that stopped working again and now it takes to use SPI_MODE3

tft.init(240, 240, SPI_MODE3);

Another solution was to use the TFT_eSPI library. It's a bit weird to setup initially but then it just works.

Cheers

using a ESP32-S3-DevKitC-1 with a Waveshare General 2inch LCD Display Module IPS Screen 240×320 ST7789
I ran File>Examples>Adafruit_ST7735_and_ST7789_Library>graphicstest_st7789
using the following parameters

#include <Adafruit_GFX.h>     // Core graphics library
#include <Adafruit_ST7789.h>  // Hardware-specific library for ST7789
#include <SPI.h>

// ESP32_S3_DevKit_1 connections
#define TFT_CS    10  
#define TFT_DC    9
#define TFT_MOSI  11  // DIN on Waveshare
#define TFT_CLK   12
#define TFT_RST   3

Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);

void setup(void) {
  Serial.begin(115200);
 delay(1000);
  Serial.print(F("Hello! ST77xx TFT Test"));
  tft.init(240, 320);           // Init ST7789 320x240

worked OK