after spending hours on searching hopefully you can help me.
I’ve got a 4pin OLED display with the description GND VDD SCK SDA. This should be then SPI.
I tried several combinations of wiring it with my photon and running it with “Adafruit_SSD1306/Adafruit_SSD1306.h”.
Sadly, without any success. Could anyone give me a hint, how to wire and code it.
I tried the following:
define OLED_DC D3 [wired to SDA]
define OLED_CS D4 [wired to SCK]
define OLED_RESET D5 [not wired]
Adafruit_SSD1306 display(OLED_DC, OLED_RESET, OLED_CS);
GND is wired to GND and VDD to 3,3V.
I switched SDA/SCK but this also didn’t work.
Almost all descriptions are covering the 6pin display.
I don’t see any pull-up resistors in your photo. If the display board does not have its own pull-ups, you need to add them. A pair 4.7k ohm to 3.3V for each line is the traditional value but if you don’t have that exact value, anything from 1k to 10k will work.
I bought a similar screen, but don’t have the exact pinout I used. This is the photo I have. Looks like D0 to the far right pin, and D1 to the second pin. I did use VIN for VCC (5V).
The one thing I would try changing would be to change the I2C address to 0x3C, and check for any indications on the back for what could be a different address from the two known.
The trick was to add the resistors for the pull-up. @bko: You’re my man Thanks.
@qwerty: You OLED is based on SCL. My has SCK, exactly this was the problem. It was confusing, because I received two different OLEDs from the same provider.
And here is the datasheet, they finally send to me:
Just to clarify here:
4-wire SPI does not include the Vcc/GND pins but refers to the 4 dedicated SPI lines CS/SS, SCK, MOSI & MISO.
This display fearures a 2-wire inteface and in this particular case I2C.
For that reason I’d alter the topic title (which was: “OLED 4pin SPI (GND VDD SCK SDA) with Photon”) accordingly.
This is forum for devices from Particle–it looks like you have an Arduino there. You will get better help in a forum for you particular device.
That said the usual problem is no pull-up resistors on the SCK and SDA.
It also look like you are using a resistor to power a 3.3V display from a 5V supply which I really cannot recommend. Lots of other ways to get 3.3V that are better if you do some research.
Your pull-up resistors go from the SCK and SDA pins on the display to display supply pin. Any value from 2.2k to 4.7k ohm should be fine. If you have buy something, get 4.7k ohm.
Your processor may be able to use internal pull-up on these lines but with the mix of 3.3V and 5V systems, I cannot recommend that either.