Connecting ssd1309 oled display on dragonboard using i2c

(https://github.com/sparkfun/HyperDisplay_SSD1309_ArduinoLibrary)

I am trying to connect this display on dragonboard using i2c but it is not showing up on i2cdetect and also I am not sure how to run this library on dragonboard ( I have installed debian terminal only os )

What output are you seeing with i2cdetect?

PS The library you have selected is designed to work on an Arduino… you will need to replace everything that comes from the #include <Arduino.h> headers with direct linux-i2c or libmraa calls to get it to work.

It shows no address just –

Ok… I guess, strictly speaking, I did only ask about output.

However I think things may go faster with a bit more verbosity on your side about what you have actually done. How is the device connected to the board, what voltage level shifter board are you using (including board rev if applicable), which i2cdetect commands did you run, which I2C buses did you scan, etc, etc, etc.

I can confirm that a SSD1306 works on DB410C (96boards-sensors board driving an SSD1306 OLED display - YouTube) and the datasheet makes it look like the way SSD1309 handles multi-interfaces (parallel, SPI, I2C) looks pretty similar. However since this video is five years old at this point I’m afraid I can no longer remember how i2cdetect behaves with SSD1306.

Sorry about that
I have connected sda scl pins to a level shifter which converts 1.8v to 3.3v
Vcc is 3.3v on oled
I was able get i2cdetect working

command I used i2cdetect -r -y 0

and it shows at correct address 3c but it is inconsistent like shows up 2-3 in 5 tries.
https://www.youtube.com/watch?v=OmcbZuK8LnY
I followed this link and tried out ./graphics_test 0 and gives out error

no such device or address

pics for reference

level shifter used https://robu.in/product/txs0108e-high-speed-full-duplex-8-channel-logic-level-converter/?gclid=CjwKCAjwxuuCBhATEiwAIIIz0VRAzgmZE0T-OyFn_Ukd2kSisM7aSSEHhyF78-KnreDeY5grOplFwRoC08cQAvD_BwE
Any ideas why theres such weird behaviour?

thanks for the help got it to work https://www.youtube.com/watch?v=zPxMFZIZAOI
this was my issue just needed to add a pull up resistor.

Great to hear this. I was about to blame your hardware setup :wink: although I admit I may not have remembered to suggest adding a pull up…

1 Like

I found that most level shifters create a lot of trouble on I2C signals. When you have long wires (the jumpers you are using), the level shifter generates extra transitions on the signal edges causing I2C to be unreliable.

The PCA9306 level shifter always works even with long wires. As well the Adafruit/Sparkfun level shifters that use BSS138 transistors always work.

This might have nothing to do with your issues, but it is something for you to try.

If you have access to an oscilloscope, then checking the signal quality becomes easy.

1 Like