Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4407

Interfacing (DSI, CSI, I2C, etc.) • Two SPI Displays (ST7796S) on Raspberry Pi 5

$
0
0
I'm trying to get some SPI displays running on my RPI5 since quite a while. Unfortunately I do not really understand in detail, what I'm doing, which brings a lot of frustration with it.

I finally decided to use two 4inch ST7796S Displays and I followed this post first:
viewtopic.php?t=358240&hilit=4in.bin#p2165638

I connected one of the displays as following:
CS => GPIO 22 (PIN 15)
RESET => GPIO 27 (PIN 13)
DC/RS => GPIO 17 (PIN 11)
SDI (MOSI) => GPIO 10 (PIN 19)
SCK => GPIO 11 (PIN 23)
LED => GPIO 5 (PIN 29)
SDO (MISO) => GPIO 9 (PIN 21)

After doing these steps and doing a reboot, I am able to see at least the console on one display and I was excited for a quick moment. Afterwards I tried to use this display to show stuff I am creating in my Python program. I tried to use some example scripts I found for this display, relying on displayio and , but as soon as board.SPI() is called, the script returns an OSError and says, that /dev/spidev0.0 does not exist. If I check, what I have in /dev, I do indeed only see spidev0.1 and spidev10.0.

Code:

# Circuit Python example for ST7796S TFT displayimport boardimport displayioimport terminaliofrom adafruit_display_text import labelfrom libraries.circuitpython_st7796s import ST7796S# Support both 8.x.x and 9.x.x. Change when 8.x.x is discontinued as a stable release.try:    from fourwire import FourWireexcept ImportError:    from displayio import FourWire# 4.0" ST7796S Displaydisplayio.release_displays()DISPLAY_WIDTH = 480DISPLAY_HEIGHT = 320DISPLAY_ROTATION = 180tft_cs = board.D16tft_dc = board.D17tft_rst = board.D27ts_cs = board.D6spi = board.SPI()
My /boot/firmware/config.txt looks like this:

Code:

dtparam=spi=ondtparam=spi0-2cs# qdtft 4indtoverlay=mipi-dbi-spi,speed=48000000dtparam=compatible=4in\0panel-mipi-dbi-spidtparam=write-only,cpha,cpoldtparam=width=480,height=320,width-mm=84,height-mm=56dtparam=reset-gpio=27,dc-gpio=17,backlight-gpio=5
And the complete result I get from the test script:

Code:

Traceback (most recent call last):  File "/home/pi/puzzlepi/spi/test.py", line 33, in <module>    spi = board.SPI()          ^^^^^^^^^^^  File "/home/pi/venvpp/lib/python3.11/site-packages/board.py", line 482, in SPI    return busio.SPI(SCLK, MOSI, MISO)           ^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "/home/pi/venvpp/lib/python3.11/site-packages/busio.py", line 377, in __init__    self._spi = _SPI(portId)                ^^^^^^^^^^^^  File "/home/pi/venvpp/lib/python3.11/site-packages/adafruit_blinka/microcontroller/generic_linux/spi.py", line 25, in __init__    self._spi = spi.SPI(device=(portid, 0))                ^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "/home/pi/venvpp/lib/python3.11/site-packages/Adafruit_PureIO/spi.py", line 149, in __init__    raise IOError(f"{device} does not exist")OSError: /dev/spidev0.0 does not exist
Now I'm completely blind what I have to change or do to get the first display running. And I would appreciate any hint or help!

Statistics: Posted by Tetrikus — Thu Dec 12, 2024 1:19 pm — Replies 1 — Views 51



Viewing all articles
Browse latest Browse all 4407

Trending Articles