SPI TFT display/Each board/18. The 3.5 inch board
Each board · 18 of 20

The 3.5 inch board

The only board with more pixels: 320 × 480 on a 54.6 × 95.6 mm board, ST7796 in the library's table. Twice the bytes of the 2.8 inch, so its full redraw is the longest of the six, at least 61 ms on the wire at the library's 40 MHz.

What it is for

320 × 480 pixels is 153,600 of them: 307,200 bytes a frame, which at the library's 40 MHz clock is at least 61.4 ms on the wire, before the controller's own write time or anything your sketch does. Controller in the library's table: ST7796. The lit area is 48.96 × 73.44 mm, 0.153 mm a pixel, the same pixel as the 2.4 inch.

It is the main-screen size: twice the pixels of the 2.8 inch, with a menu, a chart and a status line on it at once. It is also twice the redraw.

Drag to turn it
The 3.5 inch board. Turn it over for the glass.

Outline and holes

What a full redraw costs, at least
61 ms
Read the numbers for
SPI clock40 MHz
Bytes a frame
307,200
On the wire, at least
61.4 ms
Full redraws a second, at most
16
The longest redraw of the six: at least 61 ms. That is 307 kB through one wire, a screen at a time. Thirty full redraws a second would need a clock of about 74 MHz, so animation here means redrawing only what moved.

The board is 54.6 mm across and 95.6 mm tall, 1.6 mm thick, with four 4.8 mm holes 48.0 mm apart across and 88.0 mm down, 3.3 mm in from the sides. The header holes are 2.54 mm apart, 17.78 mm across, pin 1 (GND) at the left, and the header's reference is H3.

The glass module is 53.16 × 81.74 mm on the back, almost the board's width; the tail comes through a slot 8.5 mm wide and 6 mm tall. The 5 V warning box is on the left of this board, down its long edge.

Front of the 3.5 inch board held upright: header holes GND 3V3 CS MOSI SCL DC RST BL across the top, a 15-way flat-cable socket on the left with its pin names, a 12-way socket taking the display's orange ribbon, a 5 V warning box on the left, and the text lonely binary 3.5 inch IPS TFT LCD on the right.
The face away from the glass. The warning box runs down the left.

The socket the panel plugs into

The ribbon goes into FPC2, a 12-way, 0.5 mm socket (KH-CL0.5-H2.0-12PIN-SMT). Its pin 1 is at the left end with the header at the top, numbered 1 to 12 left to right. What the board wires to each pin:

PinWired to
1GND
2the lamp's low sidethrough R1 and Q1
3, 43V3
5, 6not connected
7DC
8CS
9SCL
10MOSI
11RST
12GND

That is what the board does with each contact. The panel's own sheet does not match this socket's contacts, so this page does not print its table or rely on it; match the tail to the socket by looking at them. Nothing is read back from the glass: there is no MISO pad.

The backlight

Q1, a BSS138 N-channel transistor, sits on the low side of the lamp: its gate is the BL pad with R2 (10 kΩ) from gate to GND, its drain goes through R1 (2.2 Ω) to socket pin 2, and the lamp's high side is on 3V3. BL HIGH is lit; a BL pad nothing drives is dark.

Its two jumpers

Both are open as shipped.

  • GND, silkscreen GND CS, just below the socket: bridged, CS is tied to GND and the display is always selected. Do not then drive the CS pad.
  • 3V3, silkscreen 3V3 BL, at the lower right: bridged, BL is tied to 3V3 and the lamp is lit whenever there is power. Leave the BL pad unconnected.

Both are covered in the two solder jumpers.

Wiring and the constant

// 3V3 -> 3V3        GND -> GND
// SCL -> GPIO 12    MOSI -> GPIO 11      (classic ESP32: 18, 23)
// DC  -> GPIO 2     RST  -> GPIO 42      (classic ESP32: 2, 4)
// CS  -> GPIO 10    BL   -> GPIO 41      (classic ESP32: 15, 32)
LB_Display display(LB_TFT_35);
#include <LonelyBinaryDisplay.h>
LB_Display display(LB_TFT_35);    // the only line that changes per panel

3.3 V only. Wiring for your board has the pins for other chips.

What is different about this one

It is the only board with a different picture: 320 × 480, ST7796, where the three 240 × 320 boards use an ST7789. Everything else is the same circuit.

What that costs is time. How long a redraw takes has the arithmetic; the figure above has the short version. A sketch that cleared and redrew the screen every loop on the 2.4 inch will visibly sweep on this one, and the fix is to redraw what changed.

When it does not work

Animation is slow and I can see the screen being drawn

A full redraw is 307,200 bytes, at least 61 ms at 40 MHz, so at most about 16 whole screens a second before the sketch does anything else. Redraw only what moved, or draw into a framebuffer and push it once. Thirty whole redraws a second would need a clock the library does not use.

begin(true) printed that it could not allocate a canvas

A framebuffer here is 307,200 bytes, more than internal RAM will give. It needs PSRAM, which an ESP32-S3 board has when the module includes it and the classic ESP32 board does not. The library says so on Serial and draws straight to the glass instead; hasCanvas() tells your sketch which it got.

A long ribbon extension gives a scrambled or half-drawn picture

This panel runs at 40 MHz, twice the clock of the two smaller ones, and a long ribbon or jumper wires may not carry it. setSpiHz(20000000) before begin() halves it and doubles the redraw time; on a short ribbon you should not need it.

Which socket pin is which: 2.8 and 3.5 look identical

They are, except for pin 5, which is GND on the 2.8 and not connected here. Both count from the left with the header at the top. The reference on this board is FPC2 and its header is H3, where the 2.8 has FPC1 and H2, so a designator from one page is not the other's.

Where this goes next

Six wires, six ways to see nothing, and how to tell them apart without a meter.

When nothing appears →

Edit this page — content/books/lcd/the-3-5-inch-board.mdx

Community

Questions about this product

See what other owners have asked, and read their solutions.

This page covers several products. Choose yours to see the right discussions.

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Modules and blocks on the forum →