Multiple spi displays -> need help
See original GitHub issueHi! I want to use more than one display on one spi line. I researched this, and came to the conclusion, that only the cs/ce pin must be different. So I wired two ssd1351 displays up and connected them as followed (BCM Numbers)
I guessed that I need to initialize the seccond display with gpio_cs_spi…
1st Display:
Mosi -> 10 SCLK -> 11 RES -> 25 DC -> 24 CS -> 8
2nd Display:
Mosi -> 10 SCLK -> 11 RES -> 25 DC -> 24 CS -> 7
Results:
Only on Display 2 (cs - 7) i get a picture. If i wire it up so that dc, reset and cs are individual for each display and only Mosi and Sclk are shared, i get the same results.
Type of Raspberry Pi
Raspberry Pi 4 / 4GB spi enabled latest buster lite
Linux Kernel version
Linux raspberrypi 5.4.72-v7l+ #1356 SMP Thu Oct 22 13:57:51 BST 2020 armv7l GNU/Linux
Expected behaviour
Both displays will display a picture (in the demo code below it is a text…) undependend to each other. Goal is that i can display something else on each display with minimal use of other GPIO’s.
Actual behaviour
Only one Display shows something. Allready testet the displays, both work just fine in “mono” mode without the other. I even tried an ssd1322 + ssd1351 same result.
The Code:
( I’ve left the stuff I tried in the code, but commented)
#!/usr/bin/python3
import os
import sys
import time
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
from luma.core.interface.serial import spi
#from luma.oled.device import ssd1322
from luma.core.interface.serial import gpio_cs_spi
from luma.oled.device import ssd1351
width1322 = 128
height1322 = 128
width1351 = 128
height1351 = 128
font = ImageFont.load_default()
interface22 = gpio_cs_spi(device=0, port=0, gpio_DC=14, gpio_RST=15, gpio_CS=7)
#interface22 = gpio_cs_spi(device=0, port=0, gpio_CS=8)
#interface22 = spi(device=0, port=0)
#oled22 = ssd1322(interface22)
oled22 = ssd1351(interface22)
oled22.clear()
interface51 = gpio_cs_spi(device=1, port=0, gpio_CS=7)
oled51 = ssd1351(interface51)
oled51.clear()
image22 = Image.new('RGB', (width1322, height1322))
image51 = Image.new('RGB', (width1351, height1351))
draw22 = ImageDraw.Draw(image22)
draw51 = ImageDraw.Draw(image51)
def ssd1322picture():
draw22.text((0, 20), "SSD1322", font=font, fill='white')
oled22.display(image22)
def ssd1351picture():
draw51.text((0, 64), "SSD1351", font=font, fill=(0, 255, 0))
oled51.display(image51)
while True:
ssd1322picture()
ssd1351picture()
time.sleep(10.0)
oled22.clear()
oled51.clear()
Can anyone help me with this topic? Is it even possible?
Issue Analytics
- State:
- Created 3 years ago
- Comments:28 (6 by maintainers)
Top GitHub Comments
Actually, I just thought - you will need to make sure each device has its own separate RESET line, as per @CRImier noted here: https://github.com/rm-hull/luma.oled/issues/311#issuecomment-721347009
Can you try running any of the luma.example demo on your SSD1322’s - particularly
demo.py
and maybejetset_willy.py
to see if they exhibit any weird artifacts.Also, to rule out the diff-to-previous changes that happened in luma.core 2.0.1, try changing your code as follows:
Let me know if that changes anything.