What the ILI9341 is
The Ilitek ILI9341 datasheet (V1.11) describes a single-chip driver for 240RGB×320 a-Si TFT panels with 262K colours. Its key figures:
- GRAM: 172,800 bytes on chip, which is one full 240×320 frame at 18 bits per pixel.
- Interfaces: 8080 MCU bus (8/9/16/18-bit), RGB, and 3-line or 4-line SPI.
- Supplies: VDDI (logic) 1.65 V to 3.3 V and VCI (analog) 2.5 V to 3.3 V.
- Operating temperature: −40 °C to +85 °C.
It is the controller behind many 2.2″ to 3.2″ SPI modules and many ESP32-2432S028R "Cheap Yellow Display" boards.
SPI clock: datasheet limit vs practice
The datasheet's 4-line SPI timing gives a minimum write clock cycle of 100 ns and a minimum read cycle of 150 ns. That is 10 MHz for writes and about 6.6 MHz for reads.
Many ESP32 projects drive ILI9341 modules at 40 MHz. That is well outside the datasheet, so it depends on the module and the wiring. Test at your final clock, and lower the clock for register or pixel reads.
Bring-up
- Hardware reset. The datasheet asks for a 5 ms wait after RESX goes high before sending commands, and no Sleep Out for 120 ms after a reset.
- Init table. Send it, then COLMOD (
3Ah=55hfor RGB565) and MADCTL (36h) for rotation and BGR order. - Sleep Out (
11h), then Display On (29h).
To confirm the controller, read the ID register D3h. The ILI9341 returns 93h 41h in its last two bytes. See how to tell an ILI9341 from an ST7789.
ESPHome: move to mipi_spi
ESPHome's ili9xxx platform is deprecated. Its source says it will be removed in ESPHome 2027.5.0. The mipi_spi driver has an ILI9341 model (320×240), so for a new configuration use:
platform: mipi_spiwithmodel: ILI9341, plusdc_pin, andcs_pinandreset_pinif they are wired to GPIOs.- An explicit
data_rate, because the default is 10 MHz. color_orderandinvert_colorsset to match the panel.
Common problems
Symptom | Check |
|---|---|
White screen | Reset not toggled, MOSI/MISO swapped, or the library is set to a different driver. Read |
Red and blue swapped | The BGR bit in MADCTL, or |
Lines or artefacts on one batch but not another | Some panels need a different init table. TFT_eSPI ships an alternative |
Corruption at high SPI clock | Lower the clock towards the datasheet's 10 MHz, shorten the wires, then raise it again while testing. |
Touch is a separate chip. Resistive modules usually use an XPT2046 on SPI, and capacitive ones use an I2C controller. See GT911 and CST816S.
ILI9341 library support
| Library | Driver / class | Notes |
|---|---|---|
| TFT_eSPI (Arduino) | ILI9341_DRIVER (or ILI9341_2_DRIVER) | |
| LovyanGFX (Arduino / ESP-IDF) | lgfx::Panel_ILI9341 | |
| ESP-IDF esp_lcd | espressif/esp_lcd_ili9341 |
User_Setup_ILI9341.h · LGFX_ILI9341.hpp. Pins are placeholders; we email updates when we add tested configurations.
Dev boards using ILI9341
Display modules using ILI9341
Guides & comparisons
ILI9341 vs ST7789: How to Tell Which Controller Your Display Has
Boards sold under the same name ship with ILI9341 or ST7789 controllers. Identify yours in minutes by symptoms or by reading the ID register, then apply the settings that fix white screens and wrong colours.
TroubleshootingTFT Display White Screen: 9 Causes and How to Fix Them
Backlight on, nothing drawn. A fault tree for the most common bring-up failure, with what to measure at each step and the datasheet limits that matter.
ILI9341 troubleshooting & FAQ
ILI9341 vs ST7789: which should I choose?
Both are 240×320 drivers with on-chip GRAM and wide library support. The datasheets differ on SPI speed: the ILI9341 specifies a 100 ns write cycle (10 MHz) and the ST7789V 66 ns (about 15 MHz). In practice choose by panel size, viewing angle and availability of the exact module.
Why does my ILI9341 show a white screen?
The most common causes are a missing or wrong reset, MISO/MOSI swapped, a backlight-only power path, or a library configured for a different driver. Read register 0xD3: an ILI9341 returns 0x93 0x41 in its last two bytes.
What SPI clock can ILI9341 handle?
The Ilitek datasheet gives a 100 ns minimum write cycle (10 MHz) and 150 ns for reads. Many ESP32 projects run 40 MHz, which is outside the datasheet, so test at your final clock and wiring. ESPHome's mipi_spi driver defaults to 10 MHz unless you set data_rate.
Is the ESPHome ili9xxx component being removed?
Yes. ESPHome marks ili9xxx as deprecated and its source says it will be removed in ESPHome 2027.5.0. Use platform: mipi_spi with model: ILI9341 instead.
