question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple spi displays -> need help

See original GitHub issue

Hi! 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:closed
  • Created 3 years ago
  • Comments:28 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
rm-hullcommented, Nov 15, 2020

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

1reaction
rm-hullcommented, Nov 15, 2020

Can you try running any of the luma.example demo on your SSD1322’s - particularly demo.py and maybe jetset_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:

#Initialisation of the Screens
from luma.core.framebuffer import full_frame
oled1 = ssd1322(interface1, framebuffer=full_frame()) 
oled2 = ssd1322(interface2, framebuffer=full_frame()) 

Let me know if that changes anything.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Solved] Trouble with multiple SPI displays
I'm having my first try at multiple displays, and it isn't going great. I'm sure this is something I'm doing wrong ... Thanks...
Read more >
How to - Multiple SPI based Displays with TFT_eSPI on an ...
I'll show you how to use 2 or more SPI based displays with Bodmers TFT_eSPI library on an ESP32 micro-controller.
Read more >
HOWTO using SPI multi display (hardware mode). #13161
Run the command in the console to run the "Interlock" mode, for the possibility of individual output of information on displays (optional): SetOption73...
Read more >
Two is Better than One! How to connect Two SPI OLED ...
In this quick tutorial we will see how to connect and create the Arduino code to be able to address two SPI OLED...
Read more >
How to Use Multiple SPI Devices with OLED DIsplay Arduino
You can share the MOSI, MISO and SCK pins on the SPI bus. But each SPI device requires a unique CS (Chip Select)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found