SSD1306 1.3" OLED – How to switch from SPI to I2C?

Hi,
I have a 1.3" SH1106 OLED display labeled "VER1.2 4-SPI". This display supports SPI and I2C. I want to use it with I2C. I tried wiring it directly as I2C but it didn't work.

I’ve attached a photo of the back.
What do I need to change to make it work with I2C?

Thanks in advance!

Hi @memre8 I think where you purchased this OLED they give you the option to choose I2C (4 pin) or SPI (7 pin) displays. From the front they look the same but the interface is I2C or SPI but not both. So connect it as SPI or buy another one.

1 Like

Please, post the other side of the OLED so that pin signals are visible.

Sometimes you have to short a pad or remove a resistor, there should be documentation where you bought it.

I was told where I bought it that it supports both.

look at the backside ,


they even specify the type of interface

Part of the confusion is they label the SPI clock and MOSI pins SCK and SDA. This can lead to the wrong conclusion that it supports I2C.

Your OLED can only be operated using SPI Port. SO, follow these instrutions for connection between UNO and OLED and run a test program to see 1A234 on the OLED.

Table:

UNO                  OLED
5V                   VCC
GND                  GND
MOSI (DPin-11)       SDA
SCK (DPin-13)        SCK
SS/ (DPin-10)        CS
DPi-8                RST (to initialize the display)

DPin-9               DC  (Data or Command Select)
                     LOW (UNO sends command to OLED like: cursor set,
                         intensity control etc.)
                     HIGH (UNO sends data for OLED: Alphanumeric message)

I found this

at this link https://cdn-shop.adafruit.com/product-files/5228/5223-ds.pdf

1 Like

Your findings are similar to the Table of #9 which I have got from AI.

Hi my friends,
I looked around a little bit on google to confirm what I feel logic:
SPI and I2C are two totally different transmission protocols, there is no way to mix them up. That´s logic because:
1.)I2C has one transmission line (SDA) for sending and receiving data SPI has two lines MOSI and MISO.
2.) I2C identifies transmission of multiple devices via the I2C-address, SPI uses the chipselect (CS) line to distinguish different devices.
3.) SPI can use a reset signal (RST) I2C does not.

At the end trying to use I2C with a SPI device is like using Blutooth on WiFi.

Have you tried the connections of #9, #10?

Some displays offer ways to select which protocol is used.

The version of the SSD1306 display in this post uses resistors to make the selection. The board silkscreen shows how. The one in this post is a bit more cryptic but its layout is more similar to the SPI board of this topic. The board here has solder jumper pads to make the selection. The one here even allows for parallel (8-line) data mode.

The board of @memre8 seems to be designed for SPI usage only and have less pins connected. If you feel adventurous you may experiment and try to figure out which pins to pull up/down and use some fine pitch soldering to do so...

... and after cutting resistors and connecting MOSI to SPA you tell me the I2C address please.
... or is it MISO ? or maybe MOSI and MISO together to SPA.

ok, I will add something here:
in fact there are oled displays available on the market which provide both protocols to choose with jumpers or solder points. This is not converting this is choosing between two separate options. The oled which @memre8 shows on his foto is NOT convertable.

That's what I wrote.

If the OLED connections on the flex cable are the same as those on modules with the solder selections, TS could figure out the pins on the flex cable that need pull-up/down to select i2c and solder wires to make that selection. In all selectable modules it's only two or three connections. Of course that requires more effort than just buying a different module - and as I wrote he would have to feel adventurous (and have some fine soldering skills)...

I wish you a lot of good luck.
Buying the right one and keep the other SPI for future projects instead of killing the SPI-version by applying an adventure surgery will save much time and some money.

If you are sure (I am sure) that your OLED is SPI display, then you should try #9 and #10 to operate it using SPI Port. If you don't try you ever learn.