Flickering with SSD1306 over SPI using u8glib

I bought an 1.3" 128X64 OLED display on ebay some time ago, I believe it uses the SSD1306 chip. The display has 6 pins (VCC, GND, CLK, MOSI, CS, D/C), there is no reset line. I connected CLK and MOSI to the HW SPI ports of an Arduino Micro, CS to port 7, and D/C to port 8. Triple checked the wiring.

Running the HelloWorld example with the constructor below results in the text showing up on the screen, but the display refreshes lead to flickering (see video).

U8GLIB_SSD1306_128X64 u8g(7, 8);

Has anybody seen this sort of thing before and can advise on how to approach this problem?

Thanks,
Ralf

hi,

looks like you have an SPI display there so give another constructor a try: (with arguments for CLK and MOSI and with your pin numbers of course, A0 = DC)

U8GLIB_SSD1306_128X64 u8g(13, 11, 10, 9); // SW SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9

i am a total newbie to this but maybe it helps.

viel erfolg :slight_smile:

Alex

Hi Alex,

I've tried that, rewired for SW SPI, i.e. used standard ports for CLK and MOSI, and used this constructor line. Unfortunately, the display remains black :frowning:

I've also tried the Adafruit 1306 library (GitHub - adafruit/Adafruit_SSD1306: Arduino library for SSD1306 monochrome 128x64 and 128x32 OLEDs), but with the same effect, flickering with HW SPI and darkness with SW.

Thank you anyway, that was certainly worth a try!

Ralf

I also had such a effect once. Try changing your power supply, e.g. 3.3V instead of 5V or 5V instead of 3.3V

Oliver

olikraus:
I also had such a effect once. Try changing your power supply, e.g. 3.3V instead of 5V or 5V instead of 3.3V

Oliver

That was it! Changing from 5V to 3.3V, and the flickering is gone. Apparently, this display is not laid out for 5V. Damn, I could have thought about this myself.

Thanks a bunch!
Ralf

Run into the same problem. This thread save my day!
I'd believe that in the sellers description was 5V compatible. Some Aliexpress. But I may be wrong.
Anyway many thanks guys!!