Skip to content

Waveshare RPi LCD (Rev C)

Models~

The Waveshare RPi LCD (Rev C) display comes in 3.5" and 4.0" sizes:

Model 3.5inch (Rev C) 4.0inch (Rev C)
SKU 15811 16099
Resolution 480x320 480x320
TFT controller ILI9486 ST7796
Interface SPI SPI
Touchscreen Resistive Resistive
Touch controller XPT2046 XPT2046
Screen dimming ✅ yes ✅ yes

Backlight Control~

By default the display is always on. To enable backlight dimming, you can connect the pads marked by the red arrow using a 0R resistor or a direct solder connection:

Attention (*)

The WaveShare 3.5" RPi LCD Revision C (SKU 15811) and WaveShare 4.0" RPi LCD Revision C (SKU 16099) have the solder jumper on the back to enable PWM backlight dimming. Most revisions of this board do not have this feature!

Development Boards~

ESP32 One~

The Waveshare ESP32 One development board has the same form factor as the Raspberry Pi Zero, inluding a 40 pin GPIO header. The ESP32 One is plug-and-play compatible with the Waveshare RPi LCD (Rev C) 3.5" and 4".

This board has 4 MB flash and 8 MB PSRAM.

Schematics

Pin Configuration~

LCD Pin Function ESP32 Pin Config Name Display Pin
1 Module Power 3.3V 3.3V 3.3V
2 Module Power 5v 5V 5V
3 Not connected NC
4 5V
5-10 Not connected NC
11 Touch Interrupt NC TP_IRQ
12 (*) LED Backlight PWM GPIO26 TFT_BCKL LCD_LED
13 Not connected NC
14 Module Ground GND GND
15-16 Not connected NC
17 Module Power 3.3V 3.3V
18 Data Command control pin GPIO4 TFT_DC LCD_RS
19 SPI Master Out Slave In GPIO13 TFT_MOSI LCD/SI/TP_SI
20 Not connected NC
21 Touch Panel Slave Out GPIO12 TFT_MISO TP_SO
22 LCD Reset pin GPIO32 TFT_RST RST
23 SPI Clock GPIO14 TFT_SCLK LCD_SCK/TP_SCK
24 Chip select control pin GPIO5 TFT_CS LCD_CS
25 Module Ground GND GND
26 Touch Chip Select GPIO22 TOUCH_CS TP_CS

SPI MISO, MOSI and SCLK are shared between the touch controller and the LCD controller.

You can also use jumper wires to connect the display to any ESP32 development board:

6 GPIOs are required to drive the SPI display. One additional GPIO is needed for the XPT2046 touch sensor and one extra GPIO for backlight dimming. Including the VCC and GND pins, a total of 13 connections need to be made to the MCU.

LCD Configuration~

The lcd_config.ini file specifies the different properties of the display, except for the actual pin configuration:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
raspberrypi =
    -D RPI_DISPLAY_TYPE=1
    -D ST7796_DRIVER=1
    -D TFT_WIDTH=320
    -D TFT_HEIGHT=480
    -D TFT_ROTATION=0 ; 0=0, 1=90, 2=180 or 3=270 degree
    -D SPI_FREQUENCY=80000000
    -D SPI_TOUCH_FREQUENCY=2500000
    -D USER_SETUP_LOADED=1
    -D TOUCH_DRIVER=2046 ; XPT2046 Resistive touch panel driver
    -D SUPPORT_TRANSACTIONS

HASP build_flags~

Specify the LCD Configuration to use and define the GPIOs in the environment build flags:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
build_flags =
    ${env.build_flags}
    ${esp32.build_flags}
    -DBOARD_HAS_PSRAM               ; uses 78kB

; -- TFT_eSPI build options ------------------------
    ${lcd.raspberrypi}
    ${esp32.hspi}        ; Use HSPI hardware SPI bus
    -D TFT_CS=5
    -D TFT_DC=4
    -D TFT_RST=32
    -D TFT_BCKL=26       ; Default, configurable via web UI
    -D TOUCH_CS=22
    -D SD_CS=15          ; Currently not supported

Last update: 2023-12-09