I bought a generic 2.8" TFT LCD 240x320 Serial SPI Display that uses the ILI9341 driver.
I cannot seem to make it work with my RPi 4B. Does anyone have an idea as to why? Or ideas to further narrow down the problem?
Process
Although I cannot find a datasheet, this thread from raspberrypi.org says it is possible when following the Adafruit tutorial and connecting the LED to 3.3v.
Adafruit says:
Vin connects to the Raspberry Pi's 3V pin
GND connects to the Raspberry Pi's ground
CLK connects to SPI clock. On the Raspberry Pi, thats SLCK
MOSI connects to SPI MOSI. On the Raspberry Pi, thats also MOSI
CS connects to our SPI Chip Select pin. We'll be using CE0
D/C connects to our SPI Chip Select pin. We'll be using GPIO 25, but this can be changed later.
RST connects to our Reset pin. We'll be using GPIO 24 but this can be changed later as well.
Based on the Pi's datasheet and corroborated by the gpio readall command, I connected it to my RPi 4B as follows:
Display RPi 4B *physical pin*
---------------------------------
VCC 1
GND 9
LED 17
CS 24 (CE 0)
Reset 18 (GPIO 24, as per the Python3 code)
DC 22 (GPIO 25, as per the Python3 code)
MOSI 19
SCK 23
Pre-requisites
I followed these prerequisites to run standard updates, to make sure it has pip3 and python3 installed and I2C and SPI are enabled. I ran their test script and all is well.
The rgb_display_pillow_demo.py code that I want to execute also asks for dependencies to be installed:
This demo will draw a few rectangles onto the screen along with some text on top of that. This example is for use on (Linux) computers that are using CPython with Adafruit Blinka to support CircuitPython libraries. CircuitPython does not support PIL/pillow (python imaging library)!
These libraries are installed and I can run the script without errors.
Problem
I do not see anything appear on the screen. In fact, I should probably see a backlight of some sorts when powering the display on, without even running software, but I don't. Both the Pi and the display are working (vendor tested it on Arduino) and are connected with DuPont cables. It was factory soldered, so no cold joints can be assumed.
Perhaps I could test the display simply by executing these commands to rule out other issues:
FRAMEBUFFER=/dev/fb1 startx
con2fbmap 1 1
It is my understanding this would bring the console up on this TFT display. And I would then be able to revert to it being displayed via HDMI via:
con2fbmap 1 0