logo elektroda
logo elektroda
X
logo elektroda
Dostępna jest polska wersja

Czy wolisz polską wersję strony elektroda?

Nie, dziękuję Przekieruj mnie tam

ESP32 DevKit v1 + LCD ILI9486 white screen - no image, SPI pin configuration

darex120 2142 34
Best answers

Why does my ILI9486 display stay white on an ESP32 DevKit v1 with this SPI pin setup, and what should I change in the TFT_eSPI configuration?

The white screen is most likely a TFT_eSPI configuration/pin-mapping problem on the ESP32, not a bad display, especially since the screen already works on Arduino Uno [#21785126] For TFT_eSPI, make sure User_Setup.h includes the full panel settings, not just the driver: `#define ILI9486_DRIVER`, `#define TFT_RGB_ORDER TFT_BGR`, `#define TFT_WIDTH 240`, `#define TFT_HEIGHT 320`, and `#define TFT_INVERSION_OFF` [#21786805] Also use the verified ESP32 GPIO assignments for this library: `TFT_MISO 19`, `TFT_MOSI 21` (or 23), `TFT_SCLK 18`, `TFT_CS 5`, `TFT_DC 22`, `TFT_RST 17`—these are GPIO numbers, not Arduino pin names [#21786805] If you change the TFT driver in the user setup, delete the Arduino precompiled files in the temp directory and rebuild so the new configuration is actually used [#21789086]
Summary generated by AI based on the discussion content.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #31 21934510
    efi222
    Level 22  
    Posts: 773
    Help: 12
    Rate: 1212
    darex120 wrote:
    Do you only need to configure the pins in the user setup?

    Yes
    Not just the pins, but also the display resolution, driver, SPI bus frequency, etc.
    If everything is set up correctly, try clearing the system ‘temp’ directory and recompile the programme code.
  • ADVERTISEMENT
  • Invalid ESP32 pin mapping for SPI display

    #32 21934576
    darex120
    Level 18  
    Posts: 1112
    Help: 1
    Rate: 61
    I have the following settings:

    // ===============================
    // WAVESHARE ILI9486 + ESP32 SPI
    // ===============================

    #define ILI9488_DRIVER

    // ===== DIMENSIONS =====
    #define TFT_WIDTH 320
    #define TFT_HEIGHT 480

    // ===== ESP32 PINS =====
    #define TFT_MOSI 11
    #define TFT_MISO 13 // not used
    #define TFT_SCLK 12

    #define TFT_CS 10
    #define TFT_DC 9
    #define TFT_RST 8

    #define TFT_BL 7 // BACKLIGHT

    // ===== SPI =====
    #define SPI_FREQUENCY 27000000
    #define SPI_READ_FREQUENCY 16000000

    // ===== FONTS =====
    #define LOAD_GLCD
    #define LOAD_FONT2
    #define LOAD_FONT4
    #define LOAD_FONT6
    #define LOAD_FONT7
    #define LOAD_FONT8
    #define LOAD_GFXFF

    #define SMOOTH_FONT
  • ADVERTISEMENT
  • #33 21934654
    inot
    Level 38  
    Posts: 3567
    Help: 441
    Rate: 803
    Show how you have connected the ESP to the display.
  • ADVERTISEMENT
  • #34 21934880
    darex120
    Level 18  
    Posts: 1112
    Help: 1
    Rate: 61
    As for SPI, if that’s what you mean, it’s interesting that other libraries do work.
  • Missing TFT_eSPI defines and possible cached build issue

    #35 21934885
    efi222
    Level 22  
    Posts: 773
    Help: 12
    Rate: 1212
    The following definitions are missing from user_setup.h:
    #define TFT_RGB_ORDER TFT_BGR
    #define TFT_INVERSION_OFF // for TN displays
    #define USE_HSPI_PORT

    You previously mentioned that this is an ESP32S3, but the description in user_setup.h refers to an ESP32

    Have you cleared the system cache?
    If you have previously compiled this library with different settings, the Arduino IDE may be using a pre-compiled version of TFT_espi.

    darex120 wrote:
    other libraries work.

    Other libraries have their settings in the programme code.
    TFT_espi is quite a specific library.

    Which CoreESP32 do you have installed?

FAQ

TL;DR: On ESP32 DevKit v1 with TFT_eSPI, use GPIO 18/19/23 for SPI and define display options; as one expert noted, "Pins are of course GPIO." Add missing User_Setup defines to avoid the classic white screen. [Elektroda, efi222, post #21786805]

Why it matters: This FAQ helps makers quickly fix ESP32 + ILI9486/ILI9488 "white screen" or "rectangles only" issues with minimal rewiring and config.

Quick Facts

How do I wire an ILI9486/ILI9488 to an ESP32 DevKit v1 using TFT_eSPI?

Use GPIO numbers: SCLK=18, MISO=19, MOSI=21 (or 23), CS=5, DC=22, RST=17. Keep grounds common. These pins are verified for TFT_eSPI on ESP32. If your board routes differently, adjust in User_Setup. Quote: "Pins are of course GPIO." [Elektroda, efi222, post #21786805]

Why do I only get a white screen on the ESP32 with ILI9486?

Missing or wrong User_Setup defines cause a blank white screen. Add TFT_RGB_ORDER, TFT_WIDTH, TFT_HEIGHT, and TFT_INVERSION_OFF. Confirm CS/DC/RST GPIOs match wiring. Then recompile. Most white screens trace to setup or pin mismatches, not a dead panel. [Elektroda, efi222, post #21786805]

How can I prove the LCD works before debugging ESP32 firmware?

Test the shield on a known-good 5V platform like Arduino Uno using a simple demo. Backlight alone does not prove the controller initializes. Quote: "the backlighting of the screen is not proof." This isolates hardware faults from ESP32 or library issues. [Elektroda, gps79, post #21775591]

Will it work at 27 MHz SPI, or should I slow down?

A 27,000,000 Hz SPI clock is a practical starting point shown in the thread. If you see artifacts or timeouts, drop the frequency. Lowering to a mid‑teens MHz value often stabilizes marginal wiring. Keep wires short and powered correctly. [Elektroda, darex120, post #21775345]

ILI9488 shows rectangles and wrong colors—no text. How do I fix it?

Set TFT_RGB_ORDER (e.g., TFT_BGR), define TFT_WIDTH/TFT_HEIGHT, and ensure the correct driver macro is selected. Recheck CS/DC/RST pins. After init, draw text with a basic sketch to confirm. Color/geometry errors usually mean missing setup lines. [Elektroda, efi222, post #21786805]

What must be in TFT_eSPI’s User_Setup.h for these panels?

Include USER_SETUP_INFO, TFT_RGB_ORDER, TFT_WIDTH, TFT_HEIGHT, and TFT_INVERSION_OFF. Map SPI and control GPIOs: MISO, MOSI, SCLK, CS, DC, RST. If RST is tied to board reset, set TFT_RST to -1. Then rebuild. [Elektroda, efi222, post #21786805]

Do I use Arduino pin names or raw GPIO numbers on ESP32?

Use raw GPIO numbers, not Arduino digital pin aliases. Update TFT_eSPI defines to match ESP32 GPIO labeling. Quote: "Pins are of course GPIO." This prevents silent miswires that yield a white screen. [Elektroda, efi222, post #21786805]

What quick sketch can I use to verify text rendering?

Initialize TFT_eSPI, set rotation, clear the screen, set text color/size, and print three lines. The thread’s minimal sketch prints “ESP32 DEVKIT V1”, “ILI9488”, and “PlatformIO OK”. If text fails, revisit User_Setup and pins. [Elektroda, darex120, post #21788998]

My display works on Arduino but not on ESP32—does it still help to test?

Yes. Confirming it runs on Arduino proves the panel is alive. Then focus on ESP32-specific wiring and TFT_eSPI configuration differences. Once validated, you can swap microcontroller and library with confidence. [Elektroda, gps79, post #21775591]

Will this setup work at all on ESP32 DevKit v1?

Yes. Users reported successful ESP32 operation after correcting pin maps and adding the missing TFT_eSPI defines. If you still see a white screen, recheck CS/DC/RST and RGB order. [Elektroda, efi222, post #21786805]

What is TFT_eSPI?

It is the Arduino graphics library whose settings your configuration matches. It needs proper User_Setup defines and ESP32 GPIO mapping to drive ILI9486/ILI9488 reliably. [Elektroda, efi222, post #21786805]

What’s a fast 3‑step bring‑up for ESP32 + ILI9486/ILI9488?

  1. Wire GPIOs: SCLK=18, MISO=19, MOSI=21(23), CS=5, DC=22, RST=17.
  2. In User_Setup.h, add TFT_RGB_ORDER, TFT_WIDTH, TFT_HEIGHT, TFT_INVERSION_OFF, and map pins.
  3. Build the minimal text sketch and check for correct colors and text. [Elektroda, efi222, post #21786805]

Why does backlight turn on but nothing draws?

The LED backlight is independent of controller init. A lit panel can still fail to accept commands if SPI pins, CS/DC, or setup defines are wrong. Treat backlight as power only, not function. [Elektroda, gps79, post #21775591]

I only see shapes, not characters—could font or rotation be wrong?

Text can disappear if rotation mismatches width/height or color order. Set rotation, then define TFT_WIDTH/TFT_HEIGHT correctly and use setTextColor with a contrasting background. Rebuild after changes. [Elektroda, efi222, post #21786805]

Any edge cases I should watch for during troubleshooting?

If RESET ties to board RST, set TFT_RST to -1 in User_Setup to avoid conflicts. Otherwise, the screen may appear dead after firmware uploads. Quote: “// Set TFT_RST to -1 if...”. [Elektroda, efi222, post #21786805]

What did the original poster finally confirm about ILI9486 vs ILI9488?

They got ILI9486 working after adjustments, then saw rectangles on ILI9488 with the simple TFT_eSPI sketch. That points to setup/code differences between the two drivers. Share code for review next. [Elektroda, darex120, post #21788782]
Summary generated by AI based on the discussion content.
ADVERTISEMENT