SPI issue or cable issue when seeing white screen on TFT display with ESP32 WROVER?

So I have a TFT display with ILI9488 to display JPEG images in a slideshow. The images are loaded into the display via its built-in SD card module.

I've been getting the infamous white screen of death on my display but finally things are working fine for a couple of days. Until yesterday, I needed to disconnect the wires from my display and reconnect them back. Voila! The white grim reaper returns.

I've been troubleshooting by changing my wires (female headers on both ends) and nothing works. I tested each wire to ensure connectivity, and they are all fine.

Until finally it worked again. But then it just stopped working by itself without me touching it. I mean one image would appear and when second image is loading, the white screen emerges. Also, now I'm seeing small black dots on the images. Did not appear when it was working then.

My error seems to be triggered by the code below.

 if (!SD.begin(SD_CS, vspi, 4000000)) {
    Serial.println("SD card initialization failed!");
    return;
  }

Does this sound like a SPI issue or cable issue? Or something else? I'm still new to this btw. I don't have pull-up resistors on each connection between display and ESP32 GPIOs. The display is powered by 5V and display's RESET pin is hardwired to 3.3V.

It sounds like a loose wire, cold solder joint, or power. What are you using to power the various pieces?

  1. Try to decrease SD card speed down to, say, 400KHz.
  2. Try also use shorter wires.
  3. Try to use HSPI for the display and VSPI for your SD card

Make another experiment.

1 Like

Post an annotated schematic, that would hopefully help us narrow down your problem. Be sure to show all connections and power sources.

You should never ever change the wiring while your circuit is powered up, because that is a sure fire way to damage things.

I'm using a 5V voltage regulator with a 2s LiPo battery as the power source. Specifically, MP1584EN regulator.

It was not powered up. Everything was off when I disconnected the wires that connect to the display.

Good, that is often a point that beginners miss. Glad to here you are doing things right.

1 Like

I just tried powering the entire circuit from ESP32 5V output and got the same result. So I guess this rules out power supply problem.

is anything else powered by the ESP32? e.g. sensors, relays, etc
give links to the specific TFT display and SD card reader?
is the SD reader onboard the TFT display or separate?
if separate how do you power it?
which graphics library are you using?

I would second the suggestions by @vvb333007 - I tend to use VSPI for the display and HSPI for SD reader
also try lowering the TFT SPI clock rate?
if you are using high SPI clock rates just moving or touching wires can cause intermittent problems - one reason why after prototyping industrial applications move to PCBs

Right now, the slideshow is running but the white screen appears when loading 2nd or 3rd image. This error is pretty consistent now.

Yes, I have a DFPlayer connected to ESP32. Here's the display - 3.5inch SPI Module ILI9488 SKU:MSP3520 - LCD wiki and it comes with built-in SD card reader. I'm using TJpg_Decoder library.

And I've soldered everything on perfboard so I can't separate to VSPI and HSPI at the moment.

I lowered clock to 400kHz and still no joy. The behavior is exactly the same like 1MHz or 4MHz. I even tried setting SD_CS LOW and HIGH before and after reading the JPG file.

The funny thing is that now I'm using the exactly same code, same images, same clock frequency, same wires and same hardware when it was working before I disconnected the cables from the display. So, can I assume the wires are the culprits?

if you have an oscilloscope have a look at the SPI signals

So, I tried what you said - 400KHz and use HSPI for the display and VSPI for your SD card but the issue persists. It's more erratic now. Meaning it works at times and doesn't. Sometimes a bit of wiggling of the wires would bring up the white screen, sometimes it doesn't. I even tried sandpapering the male headers on the TFT.

I wonder if my 20cm cable is too long for this kinda job? I tried 10cm and got same error.

Below is my TFT config.

#define ILI9488_DRIVER

#define TFT_SPI_PORT HSPI
//#define TFT_SPI_PORT VSPI

#define SD_CS    4   // Chip select pin for SD card

#define TFT_CS   5
#define TFT_DC   2
#define TFT_RST  -1   // Reset pin not used (wired to 3.3V)

#define TFT_MOSI 13   // HSPI MOSI
#define TFT_SCLK 14   // HSPI SCLK
#define TFT_MISO 19  // Only needed for SD card

#define LOAD_GLCD
#define LOAD_FONT2
#define LOAD_FONT4
#define LOAD_FONT6
#define LOAD_FONT7
#define LOAD_FONT8
#define LOAD_GFXFF

#define SPI_FREQUENCY	4000000

Given the length of you wires, can you please use GPIO#21 (or alike) instead of GPIO#5? It all looks as SPI conflict to me. Lets exclude CS wires from that by making them short and place away from each other.

20cm wires can make problems. Try to make shorter wires from MCU to TFT.

1 Like

Sorry without the schematic I cannot help you, good luck!

I found the culprit - a few bad solder joints. Apparently, they did buzz but just didn't buzz too well. After resoldering, the problem went away. Thanks to all who helped to troubleshoot.

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