A step-by-step guide to wiring and driving the 2.0" full-color 240x320 TFT LCD (ST7789V driver, 7-pin SPI) with an ESP32.
The module has 7 pins on the header:
| Pin | Function |
|---|---|
| CS | Chip Select |
| DC | Data/Command select (sometimes labeled "DS" or "A0") |
| RST | Reset |
| SDA | SPI Data In (MOSI) |
| SCL | SPI Clock |
| VCC | Power (3.3V) |
| GND | Ground |
Note on "DS": Some sellers label the Data/Command pin as "DS" instead of "DC" — they're the same pin. This tutorial uses "DC" since that's the standard name used in most libraries and wiring diagrams.
⚠️ This display is 3.3V only. ESP32 GPIO and 3V3 output are already 3.3V, so this is a direct, safe match — do not power it from 5V.
| TFT Pin | ESP32 Pin | Notes |
|---|---|---|
| VCC | 3V3 | Power |
| GND | GND | Ground |
| SCL | GPIO18 (VSPI SCK) | SPI Clock |
| SDA | GPIO23 (VSPI MOSI) | SPI Data (MOSI) |
| RST | GPIO4 | Reset (any free GPIO works) |
| DC | GPIO2 | Data/Command (any free GPIO works) |
| CS | GPIO5 (VSPI CS0) | Chip Select |
You can use different GPIOs for RST, DC, and CS — they're just digital outputs, not fixed SPI pins. SCL and SDA should stay on the ESP32's hardware SPI pins (18 and 23 on VSPI) for best performance, though software SPI also works if needed.