ESP32-3248S035 (3.5″ CYD) display: specs, driver revisions & setup
The 3.5-inch member of the Cheap Yellow Display family: a 320×480 ST7796 SPI TFT on an ESP32. The C version has GT911 capacitive touch on I2C; the R version has an XPT2046 that shares the display's SPI bus, which is different from the 2.8-inch CYD.
ESP32-3248S035 (3.5″ CYD) display specifications
Which ESP32-3248S035 (3.5″ CYD) revision do you have?
Boards sold under the same name ship with different display driver ICs. Code written for one revision shows a white screen, wrong colours or nothing at all on the other, so identify yours first.
| Revision | Driver IC | How to identify | Library settings |
|---|---|---|---|
| ESP32-3248S035C (capacitive) | ST7796 | Glass touch panel; GT911 answers on I2C at 0x5D (0x14 on some units) | TFT_eSPI or LovyanGFX: ST7796 driver, 320×480, BGR colour order. Touch: GT911 on SDA 33, SCL 32, RST 25, INT 21 |
| ESP32-3248S035R (resistive) | ST7796 | Resistive film panel, works with a stylus; nothing answers on I2C | TFT_eSPI: ST7796_DRIVER, 320×480, TOUCH_CS 33. The XPT2046 shares MOSI 13, MISO 12, SCLK 14 with the display; touch IRQ is GPIO 36 |
ESP32-3248S035 (3.5″ CYD) display and touch pins
| Signal | GPIO | Notes |
|---|---|---|
| TFT MOSI | 13 | HSPI; shared with XPT2046 on the R version |
| TFT MISO | 12 | HSPI; shared with XPT2046 on the R version |
| TFT SCLK | 14 | HSPI; shared with XPT2046 on the R version |
| TFT CS | 15 | |
| TFT DC | 2 | |
| TFT RST | -1 | Not connected to a GPIO |
| Backlight | 27 | GPIO 21 on the 2.8″ CYD; do not copy that setting |
| Touch SDA (C) | 33 | GT911 I2C |
| Touch SCL (C) | 32 | GT911 I2C |
| Touch RST (C) | 25 | GT911 |
| Touch INT (C) | 21 | GT911 |
| Touch CS (R) | 33 | XPT2046, on the display SPI bus |
| Touch IRQ (R) | 36 | XPT2046; input-only pin |
| SD card CS / MOSI / SCLK / MISO | 5 / 23 / 18 / 19 | VSPI, separate from the display |
| RGB LED R / G / B | 4 / 16 / 17 | |
| Light sensor (CDS) | 34 | Analog input |
| Speaker | 26 |
From ESP32-3248S035 (3.5″ CYD) prototype to production
Dev boards are ideal for proving a UI, but their panels are bought on the open market: the controller can change between batches, there is rarely a datasheet, and lifetime is not guaranteed. For a product, specify a module with a fixed driver IC per production lot, a datasheet and a lifecycle commitment.
We do not list a standard module in the exact 3.5″ 320×480 format yet; our direct factories can build to this spec. Send your requirements and we confirm feasibility, MOQ and lead time for your project.
Before you debug code
- Confirm which revision you have (table above): driver IC changes are the most common cause of a white screen.
- Check the backlight pin is not reused in your sketch.
- Change one setting at a time (driver, inversion, colour order), and keep a known-good example to compare against.
Configuration examples
#define ST7796_DRIVER
#define TFT_WIDTH 320
#define TFT_HEIGHT 480
#define TFT_MISO 12
#define TFT_MOSI 13
#define TFT_SCLK 14
#define TFT_CS 15
#define TFT_DC 2
#define TFT_RST -1
#define TFT_BL 27
#define USE_HSPI_PORT
#define SPI_FREQUENCY 65000000
#define SPI_READ_FREQUENCY 20000000
// if the picture is unstable, drop SPI_FREQUENCY to 24000000
// (the rzeldent board definition runs this panel at 24 MHz)#define TOUCH_CS 33
#define SPI_TOUCH_FREQUENCY 2500000
// touch IRQ is GPIO 36; TFT_eSPI's built-in touch does not need it#define TOUCH_SDA 33
#define TOUCH_SCL 32
#define TOUCH_RST 25
#define TOUCH_INT 21
#define TOUCH_I2C_ADDR 0x5D // try 0x14 if nothing answers
#define TOUCH_I2C_FREQ 400000Frequently asked questions
Is the ESP32-3248S035 the same as the Cheap Yellow Display?
It is the 3.5-inch board in the same Sunton family, but it is not pin-compatible in software. It uses an ST7796 at 320×480 instead of an ILI9341 or ST7789 at 240×320, the backlight is on GPIO 27 instead of 21, and the touch wiring is different.
Why does touch not work with my 2.8-inch CYD code on the R version?
On the 2.8-inch CYD the XPT2046 has its own SPI pins (25, 32, 33, 39). On the ESP32-3248S035R it shares the display bus (MOSI 13, MISO 12, SCLK 14) and only has its own chip select on GPIO 33. Point the touch library at the display's SPI bus and set the touch chip select to 33.
What I2C address does the GT911 use on the C version?
Board definitions use 0x5D. A GT911 can also start at 0x14, depending on the level of its INT pin during reset, so scan the bus on SDA 33 and SCL 32 if 0x5D does not answer.
How fast can the SPI clock run?
Published configurations differ: the rzeldent board definition uses 24 MHz and the openHASP configuration uses 65 MHz. Start at 24 MHz and raise it once the picture is stable. A full 320×480 RGB565 frame is 307,200 bytes, about 0.1 s at 24 MHz, so redraw only the area that changed.
Does the board have PSRAM?
No. It uses an ESP32-WROOM-32 with 4 MB of flash and no PSRAM, so a full 320×480 16-bit frame buffer (307,200 bytes) does not fit comfortably in RAM. Use partial draw buffers, as the board definitions do.
Sources
- rzeldent/platformio-espressif32-sunton, esp32-3248S035C.json (commit e49cbfed)
- rzeldent/platformio-espressif32-sunton, esp32-3248S035R.json (commit e49cbfed)
- openHASP, user_setups/esp32/esp32-3248s035.ini (commit c4fb5a78)
- witnessmenow/ESP32-Cheap-Yellow-Display, PINS.md (2.8″ CYD pin map, for comparison)
Not sure which display fits your design?
Send us your size, interface and host processor. A display engineer replies within 12 hours with 2–3 options, datasheets and init code. Samples from 1 pc.