2 inch TFT Display

Hey all,

I have a 2 inch TFT 7P display with the following pins:

CS
DC
RST
SDA
SCL
VCC
GND

The back of the display reads
2.0TFTSPI
GMT020-02
VER:1.1

When i connect the display to either a arduino uno and a ESP32 i cant get the display to work.
The turns on the backlight but i cant get anything to show on it.
When i test the display with a i2c checker it keeps telling me 'no i2c adress found'

What am i doing wrong and how can i make this display to work?

the SPI TFT Display
sda -MOSI

Hey ua6em,

What do u mean with:
sda -MOSI?

Check wiring and take a view to gain the knowledge:

hth

Because your display uses SPI.

It is a common misunderstanding to always associate SCL and SDA with I2C.
SCL : serial clock, SDA : serial data, are general names. SPI is also serial.

As soon as you see CS and DC together with SDA and SCL, you can be quite sure it is SPI.

Which confirms it.

Ah that's good to know, i will try that later today

Did you have any luck getting it to work?I keep trying with an esp32 and only the backlight turns on.

can you give a link to the specific display you are using?
or at least a photo?
which display libraries have you used?
have did you connect the display to the ESP32?
upload your code (using code tags </>)?

the display is this one:

https://www.aliexpress.us/item/2255801096152347.html?spm=a2g0o.order_list.order_list_main.35.5f001802oiPbMd&gatewayAdapt=glo2usa

I kind of got it working, the following code works to add images to the display, but the text didnt work:

#include <Adafruit_GFX.h>      // Core graphics library
#include <Adafruit_ST7789.h>   // ST7789 driver library
#include <SPI.h>

// Define pins for Wemos ESP32-S2 Mini
#define TFT_CS    7   // Chip select
#define TFT_RST   16  // Reset
#define TFT_DC    6   // Data/Command
#define TFT_MOSI  35  // SPI MOSI pin
#define TFT_SCLK  36  // SPI Clock pin

//Connect vcc to 3.3v and GND to GND.

// Initialize ST7789 display object
Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);

void setup() {
  // Start serial communication (ensure the proper BOOT/RESET sequence)
  Serial.begin(115200);
  delay(2000); // Give time for Serial Monitor to initialize

  // Initialize SPI
  SPI.begin(TFT_SCLK, -1, TFT_MOSI, TFT_CS);
  Serial.println("SPI initialized.");

  // Initialize the TFT display
  tft.init(240, 320);          // Adjust for your display dimensions
  tft.setRotation(0);          // Set display orientation
  tft.fillScreen(ST77XX_BLACK); // Clear the screen with black
  Serial.println("Display initialized.");

  // Display initial message
  tft.setTextColor(ST77XX_WHITE);
  tft.setTextSize(2);
  tft.setCursor(10, 10);
  tft.println("Wemos ESP32-S2");
  tft.setCursor(10, 40);
  tft.println("Display Test");
  Serial.println("Text displayed on TFT.");
}

void loop() {
  // Cycle through colors for the screen background
  tft.fillScreen(ST77XX_RED);
  delay(1000);
  tft.fillScreen(ST77XX_GREEN);
  delay(1000);
  tft.fillScreen(ST77XX_BLUE);
  delay(1000);

  // Draw shapes as a demonstration
  tft.fillScreen(ST77XX_BLACK);
  tft.drawCircle(120, 120, 50, ST77XX_WHITE); // Draw a white circle
  delay(1000);

  tft.fillCircle(120, 120, 30, ST77XX_YELLOW); // Fill a yellow circle
  delay(1000);

  // Loop back to cycling colors
}

Since the loop() function immediately overwrites any text you would have displayed in setup(), how do you know that displaying the text didn't work?

Now, if you put a delay(2000); at the end of setup() and still didn't see any text, that would be interesting.

the link in post 1 states display Driver IC ST7735S
try the Adafruit-ST7735-Library

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