Hello,
I have two SSD1351 displays (https://www.ebay.co.uk/itm/153564959422) and I want to use the both on a Teensy LC. (Genuine, purchased from Cool Components: Teensy LC with bootloader | eBay)
I have them both wired up to share the same SPI bus, Datta/Command, Reset but they have their own select lines:
- 3.3v power
- SPI Clock: Pin 11 (MOSI0)
- SPI Data: Pin 13 (SCK0 / LED)
- Data / Command: Pin 22
- Reset: Pin 23
- Select: Pins 24 & 25
When using the Adafruit_SSD1351 library I can use each display individually without any issue, however if I try to use both displays at the same time I seem to run into issues. If I let the Adafruit_SSD1351 library handle the reset lines, only the display which was setup last works. (Which makes sense, setting up the second display resets the initialisation of the first)
In order to try to get this to work, I've setup a minimal example based around the code from the Adafruit Uncanny Eyes project where the Adafruit_SSD1351 library is told not to handle any resets and this is then done separately:
When doing this, the displays both just display gibberish and the Teensy LC seems to lock up - Re-programming requires the use of the manual programming button and any flashing LEDs stop flashing.
I've attached my minimal sample, but I've included the same code below so you don't have to download it:
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1351.h>
const uint16_t DisplayColourBlack = 0x0000;
const uint16_t DisplayColourBlue = 0x001F;
const uint16_t DisplayColourRed = 0xF800;
const uint16_t DisplayColourGreen = 0x07E0;
const uint16_t DisplayColourCyan = 0x07FF;
const uint16_t DisplayColourMagenta = 0xF81F;
const uint16_t DisplayColourYellow = 0xFFE0;
const uint16_t DisplayColourWhite = 0xFFFF;
const uint8_t DisplayDataCommandPin = 22;
const uint8_t DisplayResetPin = 23;
const uint8_t DisplayChipSelectLeftPin = 24;
const uint8_t DisplayChipSelectRightPin = 25;
const uint8_t DisplayWidth = 128;
const uint8_t DisplayHeight = 128;
Adafruit_SSD1351 displayLeft = Adafruit_SSD1351(DisplayWidth, DisplayHeight, &SPI, DisplayChipSelectLeftPin, DisplayDataCommandPin, -1);
Adafruit_SSD1351 displayRight = Adafruit_SSD1351(DisplayWidth, DisplayHeight, &SPI, DisplayChipSelectRightPin, DisplayDataCommandPin, -1);
bool left = true;
void setup() {
pinMode(DisplayChipSelectLeftPin, OUTPUT);
digitalWrite(DisplayChipSelectLeftPin, HIGH);
pinMode(DisplayChipSelectRightPin, OUTPUT);
digitalWrite(DisplayChipSelectRightPin, HIGH);
pinMode(DisplayResetPin, OUTPUT);
digitalWrite(DisplayResetPin, LOW);
delay(10);
digitalWrite(DisplayResetPin, HIGH);
delay(500);
displayLeft.begin(12000000);
displayRight.begin(12000000);
displayLeft.fillScreen(DisplayColourCyan);
displayRight.fillScreen(DisplayColourMagenta);
}
void loop() {
if (left) {
displayLeft.fillScreen(DisplayColourBlack);
displayLeft.setCursor(0, 0);
displayLeft.setTextColor(DisplayColourWhite);
displayLeft.print("Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
}
else {
displayRight.fillScreen(DisplayColourBlack);
displayRight.setCursor(0,0);
displayRight.setTextColor(DisplayColourYellow);
displayRight.print("Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
}
left = !left;
delay(1000);
}
Thanks,
-Andrew.
DualDisplayTest.ino (1.99 KB)