Help! 2.42" - SSD1309 Display Not Working

OK, so no joy on the 2.42" screen. Here is my set-up:

Seeed Studio Xiao ESP32S3

2.42" 128x64 OLED SSD1309, 7pin, set to SPI
Screen inputs: GND, VCC, SCK, SDA, RES, DC, CS

Arduino IDE 2.3.4
-Xaio ESP boards loaded
Loaded Libraries:

  • Adafruit BusIO
  • Adafruit GFX Library
  • Adafruit SSD1306

Sketch:

#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64

#define OLED_MOSI  4  // D4
#define OLED_CLK   5  // D5 (SCK)
#define OLED_DC    3  // D3
#define OLED_CS    1  // D1
#define OLED_RST   2  // D2

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &SPI, OLED_DC, OLED_RST, OLED_CS);

void setup() {
  Serial.begin(115200);
 if (!display.begin(SSD1306_SWITCHCAPVCC, OLED_CS, OLED_DC, OLED_RST)) {
    Serial.println("SSD1309 not detected! Check wiring.");
    while (true); // Stop execution if display not found
  }

  Serial.println("SSD1309 detected!");
  
  display.clearDisplay();
  display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(10, 25);
  display.println("Hello, World!");
  display.display();
}

void loop() {
  // Nothing here, text stays on screen
}

All I get is a black screen.

Any help would be awesome and greatly appreciated!

1 Like

Please show me the connection between the SSD and S3, the pin names of S3 should follow the “XIAO ESP32S3/XIAO ESP32S3 Sense Pin List” in the Wiki.
Show me the link of SSD1309.
Please post a sketch.

SSD1309 / ESP32S3

GND GND
VCC 3V3
SCK D5 (GPIO5, SCK)
SDA (MOSI) D4 (GPIO4, MOSI)
RES D2 (GPIO2, Reset)
DC D3 (GPIO3, Data/Command)
CS D1 (GPIO1, Chip Select)

it’s really a I2c then?

Should be

#define OLED_MOSI  5  // D4   <---for and S3 
#define OLED_CLK   6  // D5 (SCK) <----- for an s3

HTH
GL :slight_smile: PJ :v:

On the back of the display there are 2 solder jumper points. IIC and SPI. It’s soldered on the SPI. I’m still learning so I don’t know the relation between SPI and i2C protocols, but this board is set for SPI and definitely not IIC.

Easy button (for now), I will flip the pins 4 and 5. Give me a sec.

Show us the link of SSD1309.
Please post the SSD1309 sketch.

should be: IMO… I may be all wet… but hay it’s your display :grin:

SSD1309 / ESP32S3

GND GND
VCC 3V3
SCK D5 (GPIO6, SCK)
SDA (MOSI) D4 (GPIO5, MOSI)
RES D2 (GPIO2, Reset)
DC D3 (GPIO3, Data/Command)
CS D1 (GPIO1, Chip Select)

HTH
GL :slight_smile: PJ :v:

https://www.amazon.com/dp/B09LND6QJ1?ref=ppx_yo2ov_dt_b_fed_asin_title

The sketch I’m using is in the first post of this thread. was there a different sketch that you wanted to see?

If you are making SPI connections, at least
D8 and D10 pins of S3 must be used.

1 Like

Hi there,

It’s a common thing with these, kinda Hybrid IMO, I often think its set right but wired wrong, or wired correct but programmed(#defines) wrong, or the pins I use for one MCU are different for another.
So there is a few permutations then add which interface SPI or I2C and you can see where I’m going…can get real fuzzy quick.
follow what @msfujino asks you’ll be going in no time and we all learn something! :+1:

HTH
GL :slight_smile: PJ :v:

Yes, I’m figuring that out as I am learning. Things are all mixed up and it’s amazing that we can get anything to work. I’m just glad there are smarter people than me out there that are willing to help.

Connections are,
The Adafruit_SSD1306 library may not support the SSD1309.
If it does not work, try the U8g2 library.

SSD       ESP32S3
GND <----> GND
VCC <----> 3V3
SCK <----> D8(SCK)
SDA <----> D10(MOSI)
RES <----> any pin
DC  <----> any pin
CS  <----> any pin

Hi there,

It’s NOT rocket SCience , but there is a process to the setup and some nuance between Xiao’s. The PINS and using the GPIO pin numbers versus the LOGICAL pin Names, D1,D2,D3 etc… or 2, 4, 7,8 ;
ALso the Preconfigured more or less Peripheral port pins.
for SPI, and I2C and I2S You see them listed in there respective colors for each, but also NOTE the GPIO numbers are different.
Always start there, is what @msfujino is alluding to :+1: if it’s SPI.

as he said if you can post a picture of the back where the jumper is :v:

You’ll get it. Just takes a few Swings at the ball…

GL :slight_smile: PJ :v:

Basic :setup

Advanced: setup

1 Like

nice graphics! Awesome!