Using HW I2C with SSD1306 display (no-ACK)

Hello everybody.

After several years lying in a drawer, I took my Arduino stuff and decided to do something with it.

I have a 0.96" 128x64 SSD1306 OLED display with I2C that I want to use. I made it work with u8g2 using SW I2C, but that's extremely slow when refreshing the display (it takes 605ms per frame).
I made some research and found out that using HW I2C I can get things move way faster. But I can't figure out how to make that work.

My setup

  • Arduino Nano rev3 (ATMega328, old bootloader)
  • Arduino IDE 1.8.13 under Linux Mint 64bits
  • Last version of u8g2 library
  • Pins on the display are connected like this (display-arduino). No pull-up resistors.
VCC - 5V
GND - GND
SCL - A5 (SCL)
SDA - A4 (SDA)

The display
As I said, it's been lying in a drawer for years. I remember I purchased it in AliExpress and that it was super cheap. It was advertised as «0.96" 128x64 SSD1306 OLED display I2C». It has the heltec.cn label that I've seen several times searching in the forum, plus an address selector (you can choose between 0x78 and 0x7A; it's set to 0x78). Find a picture attached.

What works
Using one of this constructors from u8g2 library, both work OK, it's just to slow.

U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0, SCL, SDA, U8X8_PIN_NONE);
U8G2_SSD1306_128X64_VCOMH0_F_SW_I2C u8g2(U8G2_R0, SCL, SDA, U8X8_PIN_NONE);

It takes a while, but the example u8g2/full_buffer/GraphicsTest runs perfect.

What I have (unsuccessfully) tried
Using other libraries, like Adafruit_SSD1306, hasn't worked for me.

Using i2c-scanner shows "No I2C devices found". That's why I assume this is a no-ACK kind of display.

Using any of the U8G2_SSD1306_128X64_xxx_F_HW_I2C constructors from u8g2 library. Display just does nothing.

Put 4K7 pull-up resistors in SCL and SDA. Nothing changed. HW not working, SW still working.

Soldering display pins 19 and 20 on the ribbon (can be seen in the attached picture). I did that after reading reading this. Nothing changed, HW doesn't work, SW still working.

Using old u8glib with constructor U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE). Looking at my old Arduino projects, seems like this is the way I tested the display when I purchased it, but doesn't seem to be working anymore. This test was made after soldering pins 19 and 20.

Final question
I guess the obvious answer is buying a new display from a more reliable marketplate.

But from the "this is the only one I have right now" point of view:
What could I do to make this display run the way I want? (fast through HW I2C)

Thanks for your time.

I suggest that you stick with the SW constructor if it works ok.

It looks as if you followed my original message

Without inspecting your pcb it may not be possible to link 19, 20 (D1, D2).

Nowadays most SSD1306 I2C displays come with working ACK. And they are pretty cheap.

David.

It works OK but terribly slow. It takes 605ms to draw a single frame.
I tweaked a bit the u8g2 lib and managed to lower that time to 567ms, but that's still too slow.
I tried to tweak the HW options too, but the code is quite complex and hard to follow.
Any other ideas? (apart from waiting for the new display I just purchased)

This topic was automatically closed after 48 days. New replies are no longer allowed.