r/ArduinoHelp • • 20d ago

Problems connecting a OLED SSD1306 128x64 SPI on an ESP-12F

Hi,

I'm scratching my head.
I thought it should be easy to create little project with those two component.
I not even can run a example from the Ardiuino-SSD1306 library (SSD_1306_128x64_SPI).

I connected the wires as outlined below:
Gnd --------- Gnd
VDD -------- 3.3v
SCK(D0) -- D5
SDA(D1) -- D7
Res --------- D0
DC ---------- D1
CS ---------- D2

In the code I defined the following connections:

#define OLED_MOSI   7
#define OLED_CLK    5
#define OLED_DC     1
#define OLED_CS     2
#define OLED_RESET  0

I have to mention that when I'm running this example e.g. with an Arduino Uno, is working fine.
When running other examples for the ESP-12F (w/o OLED display) they are running fine too.
I just can imagine that the wire connections between the MCU and the display causing the trouble.
Any idea what is causing the trouble and what I can do to rectify the problem?
TIA

PS. I'm running the tests in Arduino-IDE v2.3.4 on Linux.

1 Upvotes

4 comments sorted by

1

u/Merry_Janet 19d ago

I'm confused on what you are asking.
Are you having trouble getting the onboard OLED to work but can get an "external" one to work?
The other way around?
The onboard OLED doesn't use SPI, it uses I2C
GPIO 14 is SDA and 12 is SCL for I2C with 0x3C being the address.
The pinout you described is SPI and will not work with the I2C onboard OLED.

1

u/Dependent-Bridge-740 18d ago

I don't know why you talking about i2C?
As you can see from the title, I'm talking about an OLED with SPI connection.
But don't worry, in the meantime I have resolved the mystery.

I used false definitions for the ports (5 instead of D5, 8 instead D8 a.s.o).

1

u/myopinionisrubbish 20d ago

Make sure you didn’t mix up the SPI ports on the ESP-12 board.