Need help connecting Waveshare 1.5" OLED screen to Teensy 4.1 (SSD1351)

TeensyNoob42

New member
Hello TeensyNoob here,

I can't get my Waveshare 1.5" working with my Teensy 4.1.
What I tried so far:

1) Connecting it via SPI (SPI0):

By connecting it as follow:

VCC to 3.3
GND to GND
DIN to PIN 11 (MOSI)
CLK to PIN 13 (SCK)
CS to PIN 10 (CS)
DC to PIN 8
RST to PIN 9

Down below is my code, for SPI1 I just changed the input pins.

2) Connecting it via SPI1

VCC to 3.3
GND to GND
DIN to PIN 26 (MOSI)
CLK to PIN 27 (SCK)
CS to PIN 38 (CS)
DC to PIN 8
RST to PIN 9

Each time I just get a black screen, connecting it to a Arduino Uno worked without a problem. I'm using a PlattformIO and imported the Libraries with PlattformIO.

Do someone know what I'm doing wrong? My guess is that something with the SPI protocol is wrong. I would be glad if someone could help me. Thanks in advance!

When I run the code, it prints "Display Startup...!" and "Display Ready!", so no error there.

My code:

Display.h:

Code:
#ifndef DISPLAY_H
#define DISPLAY_H

#include <Arduino.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1351.h>

extern Adafruit_SSD1351 OLED;

class Display {
    public:
        Display();
        void Startup();
};

#endif

Display.cpp:

Code:
#include <Display.h>

// Screen dimension
const byte SCREEN_WIDTH = 128;
const byte SCREEN_HEIGHT = 128;

// Pins
const byte CS_PIN = 10; // for CS1: 38
const byte DC_PIN = 8;
const byte RST_PIN = 9;
const byte DIN_PIN = 11; // for MOSI1: 26
const byte CLK_PIN = 13; // for SCK1: 27

// Color
const uint16_t WHITE = 0xFFFF;

// Display
Adafruit_SSD1351 OLED = Adafruit_SSD1351(SCREEN_WIDTH, SCREEN_HEIGHT, &SPI, CS_PIN, DC_PIN, RST_PIN); // for SPI0
//Adafruit_SSD1351 OLED = Adafruit_SSD1351(SCREEN_WIDTH, SCREEN_HEIGHT, &SPI1, CS_PIN, DC_PIN, RST_PIN); // for SPI1

Display::Display() 
{
   //OLED.begin();
}

void Display::Startup() 
{
    Serial.println("Display Startup...!");
    OLED.begin();
    OLED.fillScreen(WHITE);
    Serial.println("Display Ready!");
}

main.cpp:

Code:
#include <SPI.h>
#include <Arduino.h>
#include <Display.h>

Display display;

void setup() {
    Serial.begin(9600);
    display.Startup();
    Serial.println("Ready!");
}

void loop() {
  
}
 
Might help to see a picture of your setup. For example it might show if there is a bad soldering joint or the like. For example we have several times
when people use a breadboard and the Teensy is not soldered to the breakout pins. That is friction fitting typically does not work.

I don't have this display, I did test out a different one DIYMall 1.5 with this driver about 2.5 years ago. And the library worked then.
 
Might help to see a picture of your setup. For example it might show if there is a bad soldering joint or the like. For example we have several times
when people use a breadboard and the Teensy is not soldered to the breakout pins. That is friction fitting typically does not work.

I don't have this display, I did test out a different one DIYMall 1.5 with this driver about 2.5 years ago. And the library worked then.

Thanks! I tried it with a breadboard first and only once with direct connection but I guess my code what at this point still buggy. Now it seems to work with direct connection. My code above seems to work with SPI0.

IMG_0115.jpg
 
The other thing to mention, is with longer wires and going through multiple connections (like breadboard) signals can get get weaker...
Also some breadboards and wires make bad connections.

But assuming connectivity and longer wires. sometimes libraries might choose too high a speed for SPI and you might need to slow it down... How... depends on library.

Good luck
 
The other thing to mention, is with longer wires and going through multiple connections (like breadboard) signals can get get weaker...
Also some breadboards and wires make bad connections.

But assuming connectivity and longer wires. sometimes libraries might choose too high a speed for SPI and you might need to slow it down... How... depends on library.

Good luck

Thanks for the info. I also noticed that my old breadboard has some bad connections while a newer one works better. How do I notice if the speed for the SPI is too high?
 
Back
Top