ESP32 + TFT not working - Screen Blank - Help!

whateverfast
Posts: 2
Joined: Fri Nov 04, 2022 4:50 am

ESP32 + TFT not working - Screen Blank - Help!

Postby whateverfast » Fri Nov 04, 2022 5:19 am

Hi,

I am trying to do this project: https://electropeak.com/learn/interfaci ... ith-esp32/

I have an ESP32S and a TFT SP1 2.8. I installed the TFT_eSPI libraries (using arduino ide) and edit the USER_SETUP file with the appropriate PINS and versions (I believe). However, I tried different configurations but I was unable to turn on the TFT. I know that the TFT is working because I have used it with another board.

In the USER_SETUP tried with different drivers: ILI9341_DRIVER and ILI9341_2_DRIVER and the result is the same. Also different PINS.

I also run with the differenr boards types: DO IT ESP32 DEVKIT V1, and other ones that also compile.

Can you please help :) Thank you

The pins are the following in the USER_SETUP file
#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS 15 // Chip select control pin
#define TFT_DC 4 // Data Command control pin
#define TFT_RST 2 // Reset pin (could connect to RST pin)

The arduino code is the following:

Code: Select all

#include <TFT_eSPI.h> // Hardware-specific library
#include <SPI.h>

TFT_eSPI tft = TFT_eSPI();       // Invoke custom library

void setup(void) {
  tft.init();
  tft.setRotation(0);
  Serial.begin(57600); // For debug
  tft.fillScreen(TFT_WHITE);
  Serial.println("Setup Done");
  Serial.println(TFT_MISO);
  Serial.println(TFT_MOSI);
  Serial.println(TFT_SCLK);
  Serial.println(TFT_CS);
  Serial.println(TFT_DC);
  Serial.println(TFT_RST);  
  Serial.println(TFT_WIDTH);
  Serial.println(TFT_HEIGHT);
  #ifdef ILI9341_DRIVER
  Serial.println("ILI9341_DRIVER");
  #endif
  #ifdef ILI9341_2_DRIVER
  Serial.println("ILI9341_2_DRIVER");
  #endif
}


void loop() {
   tft.fillScreen(TFT_GREEN);
   delay(250);
   tft.fillScreen(TFT_BLACK);
   delay(250);
   tft.fillScreen(TFT_WHITE);
   delay(250);
   tft.fillScreen(TFT_RED);
   delay(250);
}
Attachments
IMG_20221104_115556.jpg
IMG_20221104_115556.jpg (441.45 KiB) Viewed 3371 times
User_Setup.h
(16.76 KiB) Downloaded 267 times

vritzka
Posts: 22
Joined: Wed Sep 07, 2022 5:33 am

Re: ESP32 + TFT not working - Screen Blank - Help!

Postby vritzka » Sat Nov 05, 2022 1:15 pm

Does at least the background light turn on?

whateverfast
Posts: 2
Joined: Fri Nov 04, 2022 4:50 am

Re: ESP32 + TFT not working - Screen Blank - Help!

Postby whateverfast » Sun Nov 06, 2022 2:26 am

The background light flickers when I press the reset button. I have also tried with a different library and still no success. I double-checked the pins but had no success. Any ideas?

Code: Select all

#include <Arduino_GFX_Library.h>

#define TFT_SCK    18
#define TFT_MOSI   23
#define TFT_MISO   19
#define TFT_CS     15
#define TFT_DC     21
#define TFT_RESET  17

void setup(void)
{
  Serial.begin(115200);
  Serial.print("MOSI: ");
  Serial.println(MOSI);
  Serial.print("MISO: ");
  Serial.println(MISO);
  Serial.print("SCK: ");
  Serial.println(SCK);
  Serial.print("SS: ");
  Serial.println(SS); 
  
  Arduino_ESP32SPI bus = Arduino_ESP32SPI(TFT_DC, TFT_CS, TFT_SCK, TFT_MOSI, TFT_MISO);
  Arduino_ILI9341 display = Arduino_ILI9341(&bus, TFT_RESET);
 
  display.begin();
  display.fillScreen(WHITE);
  display.setCursor(20, 20);
  display.setTextSize(2);
  display.setTextColor(BLUE);
  display.print("Hello world");
}
 
void loop() {
  }

vritzka
Posts: 22
Joined: Wed Sep 07, 2022 5:33 am

Re: ESP32 + TFT not working - Screen Blank - Help!

Postby vritzka » Mon Nov 07, 2022 2:31 am

The screen backlight should glow up as soon as you connect 3.3 V and ground.

Since its an LED, you need to connect it through a resistor (100 OHM would work).

It seems there is no resistor now. So maybe the high current draw makes the ESP32 turn off and thats why it doesn't work.

Who is online

Users browsing this forum: Google [Bot] and 39 guests