TFT_eSPI no display output

I'm having some difficulty with getting the display driver to work in TFT_eSPI on any screen. Multiple attempts to get this working have failed. I have successfully tested both these screens with Adafruit drivers on separate projects but am unable to get them working here.

hardware:
ESP32-wroom-32
ILI9341 (it was given to me so I don't know where it came from)
ST7735 https://www.banggood.com/1_8-Inch-TFT-LCD-Display-Module-SPI-Serial-Port-With-4-IO-Driver-p-1164351.html

Here is my code using TFT_eSPI. I get no errors when compiling.

#include "SPIFFS.h"
#define FS_NO_GLOBALS
#include <FS.h>

// JPEG decoder library
#include <JPEGDecoder.h>

// SPI library, built into IDE
#include <SPI.h>

// Call up the TFT library
#include <TFT_eSPI.h> // Hardware-specific library for ESP8266
// The TFT control pins are set in the User_Setup.h file <<<<<<<<<<<<<<<<< NOTE!
// that can be found in the "src" folder of the library

// Invoke TFT library
TFT_eSPI tft = TFT_eSPI();
setup_t user;

void setup() {
 
  Serial.begin(115200);
 
  if (!SPIFFS.begin(true)) {
    Serial.println("An Error has occurred while mounting SPIFFS");
    return;
  }
  
  tft.begin();
  tft.setRotation(0);  // 0 & 2 Portrait. 1 & 3 landscape
  tft.fillScreen(TFT_BLACK);
  delay(2000);

  tft.setRotation(0);  // portrait
  tft.fillScreen(random(0xFFFF));

  drawJpeg("/arduino.jpg", 0, 0);
  tft.init();
}

Maybe there is a better way to do this but I have added the "Read_User_Setup.ino" to my code to show current settings.
Here is my serial output while using ILI9341

===========================
Drawing file: /arduino.jpg
===========================
===============
JPEG image info
===============
Width      :160
Height     :128
Components :1
MCU / row  :10
MCU / col  :8
Scan type  :4
MCU width  :16
MCU height :16
===============

Total render time was    : 58 ms
=====================================

[code]
TFT_eSPI ver = 1.4.5
Processor    = ESP32
Frequency    = 240 MHz
Transactions = Yes 
Interface    = SPI 
Display driver = 9341
Display width  = 240 
Display height = 320 

MOSI    = D23 (GPIO 23)
MISO    = D19 (GPIO 19)
SCK     = D18 (GPIO 18)
TFT_CS   = D15 (GPIO 15)
TFT_DC   = D0 (GPIO 0)
TFT_RST  = D2 (GPIO 2)

Font GLCD   loaded
Font 2      loaded
Font 4      loaded
Font 6      loaded
Font 7      loaded
Font 8      loaded
Smooth font enabled

Display SPI frequency = 27.0 MHz

Troubleshooting:

Tried just turning the screen black as seen in my code, nothing changes.
configured User_Setup.h for ILI9341 and configured pins as shown in serial output
configured User_Setup.h for ST7735, tested every tab option. Sometimes I would see all pixels have random colors but this was very intermittent.
Used the same pin layout for both displays. Except ST7735 has no MISO pin.

Hopefully someone can see what I did wrong here

  1. Install the TFT_eSPI library

  2. read instructions for wiring

  3. read instructions for User_Setup

  4. run the examples that come with the library.

  5. choose the simplest examples first.

  6. make notes on paper

  7. compose your question carefully

  8. the ST7735 link is excellent

  9. you can probably find your exact ILI9341 board at the same shop.

  10. or Google for ILI9341 "images". Compare with the item on your desk.

  11. quote which example gives your problem

  12. paste your "User_Setup"

  13. type the paper notes to your message.

This advice applies to all library questions. Provide the correct information. You will probably get the exact solution in the first reply.

I would not start with a SPIFFS example. Try the simpler examples first.
Of course you can say:

Every other example works 100% except for this SPIFFS example

David.

@david_prentice Thank you for the replay. However, I have done these steps. The script I'm running is the based on https://github.com/Bodmer/TFT_eSPI/tree/master/examples/160%20x%20128/TFT_SPIFFS_Jpeg with additional print statements. I also have verified this is a screen printing issue because I don't see a black screen from this scrip

  tft.begin();
  tft.setRotation(0);  // 0 & 2 Portrait. 1 & 3 landscape
  tft.fillScreen(TFT_BLACK);
  delay(2000);

Perhaps I missed something but I would expect the screen to at least show black. Additionally if you read the serial output you will see the image properties as read on the Arduino indicating SPIFFE is working properly.

  1. Install the TFT_eSPI library: done

  2. read instructions for wiring : done and tried multiple variations

  3. read instructions for User_Setup: done, please see below

  4. run the examples that come with the library.: done, they don't seem to work in my configuration. If you have an example that works for you may you provide it with the wiring hookup?

  5. choose the simplest examples first. : I feel that the code above should be a very simple example that should work

  6. make notes on paper.: actually have done this so I can keep track of the wiring

  7. compose your question carefully: I have done my best to craft this question as best I can. If there is anything I am missing I am happy to provide what I can.

  8. the ST7735 link is excellent: thank you

  9. you can probably find your exact ILI9341 board at the same shop.: I have spent some time looking for this board but am unable to find it. It does have the same pin location as this one. 2.8 inch ili9341 240x320 spi tft lcd display touch panel spi serial port module Sale - Banggood.com

  10. or Google for ILI9341 "images". Compare with the item on your desk.: please see 9

  11. quote which example gives your problem : I am using this example 160 x 128/TFT_SPIFFS_Jpeg, but again I would expect the above code to work

  12. paste your "User_Setup" : good idea, Here is the uncommented code

#define ILI9341_DRIVER


#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS   15  // Chip select control pin
#define TFT_DC    0  // Data Command control pin
#define TFT_RST   2  // Reset pin (could connect to RST pin)


#define LOAD_GLCD   // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2  // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4  // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6  // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7  // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-.
#define LOAD_FONT8  // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
//#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
#define LOAD_GFXFF  // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts

#define SMOOTH_FONT

#define SPI_FREQUENCY  27000000 // Actually sets it to 26.67MHz = 80/3

#define SPI_READ_FREQUENCY  20000000

#define SPI_TOUCH_FREQUENCY  2500000

Here is the "User_Setup" when testing ST7735. Note, I have tested with every "tab" option

#define ST7735_DRIVER      // Define additional parameters below for this display


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

#define ST7735_INITB
// #define ST7735_GREENTAB
// #define ST7735_GREENTAB2
//#define ST7735_GREENTAB3
// #define ST7735_GREENTAB128    // For 128 x 128 display
// #define ST7735_GREENTAB160x80 // For 160 x 80 display (BGR, inverted, 26 offset)
// #define ST7735_REDTAB
//#define ST7735_BLACKTAB
// #define ST7735_REDTAB160x80   // For 160 x 80 display with 24 pixel offset


#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS   15  // Chip select control pin
#define TFT_DC    0  // Data Command control pin
#define TFT_RST   2  // Reset pin (could connect to RST pin)
//#define TFT_RST  -1  // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST


#define LOAD_GLCD   // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2  // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4  // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6  // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7  // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-.
#define LOAD_FONT8  // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
//#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
#define LOAD_GFXFF  // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts


#define SMOOTH_FONT

#define SPI_FREQUENCY  27000000 // Actually sets it to 26.67MHz = 80/3

#define SPI_READ_FREQUENCY  20000000

#define SPI_TOUCH_FREQUENCY  2500000
  1. type the paper notes to your message.: Here is what I have for my wiring notes. The name on the right represents the pins used on the ESP32;

LED - (5v)
SCK - (SCLK) Serial clock
SDA - (MOSI)
AO - (DC)
RESET - (RESET)
CS - (CS) Chip Select
GND - (Ground)
VCC - (3.3v)

Going through this again I might be missing something outside of the basic script. Like wiring. I'd like to see if you have an example that works for you. Have you been able to get this working successfully? I'm just not sure how to get this scrip any more basic than "tft.fillScreen(TFT_BLACK);"

I don't think the issue is the program but I suspect a pin or wiring issue. Everything is directly connected through a breadboard and I have varied the pins and wiring multiple times. Do I have the pins labeled correctly in my notes?

got it figure out. just crossed some wires in my head as well as the board...

Bodmer's default connects are:

// For ESP32 Dev board (only tested with ILI9341 display)
// The hardware SPI can be mapped to any pins

//#define TFT_MISO 19
//#define TFT_MOSI 23
//#define TFT_SCLK 18
//#define TFT_CS    15  // Chip select control pin
//#define TFT_DC    2  // Data Command control pin
//#define TFT_RST   4  // Reset pin (could connect to RST pin)

I suggest that you wire up with his defaults.

And yes, your trivial program should obviously draw a BLACK screen. Personally, I would choose a primary colour.

I would expect to see a regular pcb rather than a bare WROOM32 module.
But you should wire SCK on your display to GPIO18 on the WROOM32 module. I have no idea what the [35] label means.

A typical Ebay pcb has numbers printed on each pin e.g. GPIO18 is printed D18.

When the default wiring works ok, you can change pins to suit your personal preference.

David.

Well done. Run all the regular examples.

Then copy some files to SPIFFS by following the instructions.

And try the SPIFFS examples.
They should all work nicely.

David.