Connecting ESP32 S3 to a 1.8" TFT

I've searched and not found a single thing about connecting the ESP32S3 to a TFT like mine. The display pins are RST, CS, D/C, DIN, CLK, VCC, BL and GND. I tried to connect pins according to other people using the S3s predecessor matching it to the pinout of S3 but it doesn't work. Other versions doesn't have the same display pin as my tft. Please give me the wiring as well as the User_Setup.h code.
Currently I am using this test code:

#include <TFT_eSPI.h>

TFT_eSPI tft = TFT_eSPI();

void setup() {
  Serial.begin(115200);
  Serial.println("Initializing display...");

  tft.init();
  tft.setRotation(1);
  tft.fillScreen(TFT_BLACK);
  delay(500);
  tft.fillScreen(TFT_RED);
  delay(500);
  tft.fillScreen(TFT_GREEN);
  delay(500);
  tft.fillScreen(TFT_BLUE);
  delay(500);
  tft.fillScreen(TFT_WHITE);
}

void loop() {
  for (int i = 0; i < 160; i += 10) {
    tft.fillRect(0, i, 128, 10, random(0xFFFF));
    delay(100);
  }
}

But the screen just flickers white, it also prints this message in my serial monitor:

Initializing display...
Guru Meditation Error: Core  1 panic'ed (StoreProhibited). Exception was unhandled.
Core  1 register dump:
PC      : 0x42002d37  PS      : 0x00060530  A0      : 0x82002e0c  A1      : 0x3fca2b30  
A2      : 0x3fc979b8  A3      : 0x00000001  A4      : 0x0000000b  A5      : 0x0000000b  
A6      : 0x000000ff  A7      : 0x60004000  A8      : 0x00000010  A9      : 0x08000000  
A10     : 0x3fc97acc  A11     : 0x019bfcc0  A12     : 0x00000001  A13     : 0x00000000  
A14     : 0x00000100  A15     : 0x019bfcc0  SAR     : 0x00000018  EXCCAUSE: 0x0000001d  
EXCVADDR: 0x00000010  LBEG    : 0x40056f5c  LEND    : 0x40056f72  LCOUNT  : 0xffffffff  
ELF file SHA256: 1294d5a93
Rebooting...

If the 'normal' setup doesn't work, maybe your TFT is unique. In that case only the maker of the TFT will know the answer.
OR you messed up the 'normal' setup and connections.

You have "a TFT"... The datasheet would tell a lot more.

Thank you for replying. I am currently trying to get the datasheet from the seller but in the meantime the product description states that the module port is compatible with the 1602 LCD. Does that help with anything, sorry I'm really new to this type of stuff. Oh and it uses and ST7735 driver.

can you give a link to the display?
or a photo of the pin layout?


The link to the display:
https://www.tokopedia.com/rajacell/lcd-tft-18-128x160-pixel-serial-spi-module-display-for-arduino

You tried but the sales site doesn't help much. Maybe some helper has played with that device.

@mkl1901 The TFT_eSPI library has a default setup file that can be modified to fit your configuration, alternatively there is a setup select header file can be used to select a file preconfigured for various displays and controllers, these also can be modified to fit your pin out etc.

Watch this YouTube video it gives a pretty good idea of what to do.

Just for example this is the pin out for a S3 I have setup on my bench

mosi 11 // (DIN)
miso 12 // not always required
sck 13 // (CLK)
led 5 // (BL) not always required
cs 6
dc 7 // (D/C)
rst 8

I made an edit to the pin numbering for the S3

Hi, I tried to use your setup but it still won't work. I've doubled check the wiring and stuff. But it still won't budge.
Here's my user setup incase I did something wrong:

// Enable ST7735 Driver
#define ST7735_DRIVER

// Define TFT Display Dimensions
#define TFT_WIDTH  128
#define TFT_HEIGHT 160

#define TFT_MOSI            11
#define TFT_SCLK            13
#define TFT_CS              6
#define TFT_DC              7
#define TFT_RST             8

// SPI Communication Speed (Lower if flickering)
#define SPI_FREQUENCY  10000000  // 20 MHz (Try 10 MHz if unstable)

// Display Rotation (0 to 3 for different orientations)
#define TFT_ROTATION 1

Hi, Do you still have this error?

Then refer to the following issue thread (and others) ESP32S3 in TFT_eSPI issues:

In summary, two potential solutions are discussed:

  1. Use 2.0.14 of Espressif board package.
  2. Define USE_HSPI_PORT in User_Setup.h.

I think they are worth a try.

I had a similar display working with ESP32-C3 with ESP32 core 2.0.14
with ESP32 core 3.1.1 GOES INTO A RESET LOOP and fails with ESP32 core 2.0.15

tried it on an ESP32-S3-DevKitC-1 with ESP32 core 3.1.1 GOES INTO A RESET LOOP
does not work with ESP32 core 2.0.14 blank screen

tried with

#define USE_HSPI_PORT

no longer resets but nothing on screen - probably need to change the pins

file User_Setup.h

// TFT_eSPI setup.h file for  ESP32-S3  1.8 inch_ST7735_TFT

// note: ESP32 core 3.1.1 DOES NOT WORK - GOES INTO A RESET LOOP
// ESP32-C3 works with ESP32 core 2.0.14 fails with ESP32 core 2.0.15

// ESP32-S3-DevKitC-1 with ESP32 core 3.1.1 GOES INTO A RESET LOOP
//   does not work with ESP32 core 2.0.14 blank screen


#define USER_SETUP_INFO "User_Setup"

#define USE_HSPI

#define ST7735_DRIVER      // Full configuration option, define additional parameters below for this display

//#define ST7735_GREENTAB
// For ST7735, ST7789 and ILI9341 ONLY, define the colour order IF the blue and red are swapped on your display
// Try ONE option at a time to find the correct colour order for your display
//  #define TFT_RGB_ORDER TFT_RGB  // Colour order Red-Green-Blue
//  #define TFT_RGB_ORDER TFT_BGR  // Colour order Blue-Green-Red

// For ST7789, ST7735, ILI9163 and GC9A01 ONLY, define the pixel width and height in portrait orientation
#define TFT_WIDTH  128 // ST7789 240 x 240 and 240 x 320
#define TFT_HEIGHT 160 // ST7789 240 x 320

// If colours are inverted (white shows as black) then uncomment one of the next
// 2 lines try both options, one of the options should correct the inversion.

// #define TFT_INVERSION_ON
// #define TFT_INVERSION_OFF

// ESP32-C3 supermini 
#define TFT_CS   10//SS     // GPIO 7  
#define TFT_MOSI 11//MOSI   // GPIO 6
#define TFT_SCLK 12//SCK    // GPIO 4
#define TFT_MISO -1     //MISO 

#define TFT_DC   9
#define TFT_RST  5

#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

#define SPI_TOUCH_FREQUENCY  2500000




1 Like

Same in my case with XIAO ESP32-S3. But it seems this solution doesn't work for some people.

Similar questions have been asked in this forum, so I list up several threads posted in TFT_eSPI Issues as references.

I have no idea why there would be any difference in the solutions for the same MCU architecture :worried:

I had the same problem too

With ESP32-CAM I use attached file from Interface TFT ST7735 Display with ESP32

Adapt lines to your config
#define TFT_RST 4 // 16
#define TFT_DC 2 // 17

In setup() of your sketch
Add & adapt
SPI.begin(14, -1, 13, -1); // SPI.begin(SCK, MISO, MOSI, SS);

My ST7735 160x80 use 7 wires
3V3
GND
SCK
MOSI
CS=GND
RST
DC

tft_setup.h (1.3 KB)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.