Skip to content

LCD (SPI) Panel Connection

Timo Kokkonen edited this page Jul 21, 2023 · 17 revisions

Starting firmware version 1.4.0 Fanpico-0804D boards support SPI LCD displays via J18 connector.

Currently there is just "default" theme, however we are hoping for user contributions for new themes to be included in future firmware releases. See "Creating Custom LCD Themes" for information on how to create your own theme.

320x240 resolution:

theme-default-320x240-small

480x320 resolution:

theme-default-480x320-small

Supported Displays

Currently only 320x240 and 480x320 resolution displays are supported. Larger screens should work but whole display is not used (support for larger resolutions shouldn't be difficult to add)

Tested Display Modules

Manufacturer Model Resolution Type Notes SYS:DISP command
Generic "2.8 TFT SPI 240X320 V1.2" (Red PCB) 240x320 TFT ILI9341 Controller, common LCD module for Arduino, etc... "SYS:DISP lcd=ILI9341"
Waveshare 2inch LCD Module 240x320 IPS ST7789V Controller "SYS:DISP lcd=ST7789"
Waveshare 3.5inch RPi LCD (A) 320x480 TFT ILI9486 Controller "SYS:DISP lcd=ILI9486,rotate=90,swapcolors,16bit" or "SYS:DISP lcd=waveshare35a"
Waveshare 3.5inch RPi LCD (B) Rev2.0 320x480 IPS ILI9486 Controller "SYS:DISP lcd=waveshare35bv2"

Supported Controllers

LCD Controller (Chip) Resolution Notes
ILI9341 240x320 Tested OK.
ST7789 240x320 Tested OK.
ILI9486 320x480 RPi modules usually need option "16bit" to work.
HX8357 320x480 Not tested.

Configure LCD Display

By default I2C bus (for OLED display) TTL Serial (UART) are active. Since SPI shares pins with I2C and UART those connectors cannot be used when there is LCD Display connected to connector J18.

To configure LCD Display we must activate SPI mode (this explicitly disables I2C and UART) and configure the type of LCD panel that is connected.

For example to use generic ILI9341 based LCD module following:

SYS:SPI 1
SYS:DISP lcd=ILI9341
CONF:SAVE
*RST

Configuring Additional Options

Some display modules may require additional settings to work properly (to fix colors, orientation, etc).

For example, it is possible to rotate screen (default rotation is "90" so to flip screen upside down use "270"):

SYS:DISP lcd=ILI9341,rotate=270

Or swap red and green colors if colors don't display correctly:

SYS:DISP lcd=ILI9341,swapcolors

See SYS:DISP for more details.

SPI Display Connection

NOTE! When using SPI connector, OLED display connector(s) and Serial TLL connector cannot be used at the same time, since I2C/UART share same pins as the SPI on connector J18.

J18 Pin LCD Panel Pin Description
1 DC Data/Command selector pin
2 Vcc / Vin 3.3V DC power for the LCD display
3 SCK SPI Clock Input pin
4 MOSI SPI Microcontroller Out Serial In pin
5 CS SPI Chip Select
6 GND Ground
7 RST Display Reset
8 LED / BL Display Backlight
9 5V 5V power
10 GND Ground

NOTE current PCBs only have 6-pin connector (future ones are planned to include 8-pin connector). When using SPI LCD panel on current boards it may be necessary connect Vcc (pin 2) to RST and LED pins on the LCD display (unless display has built-in pull up resistors on those pins).

lcdspiconnector