Nano/ESP32 with SSD1309 with U8G2 Library using SPI Doesn't Work

Hello all,

I am trying to interface with a 128x64 Graphic OLED display from MIDAS that I purchased from Farnell here:

with the following datasheet:

The datasheet is… lacking, in places, such as where it lists the value of IDD with VDD = 13V at 50% checkboard, after having just specified maximum voltage of VDD as 4V. I suspect this is simply a typo that was meant to say ICC/VCC though, and so I don’t have any reason not to trust the rest of the sheet. Anyway, the datasheet claims that the display uses an “SSD1309Z” driver. I believe the datasheet for this driver can be found here:

I found the U8G2 library (Home · olikraus/u8g2 Wiki · GitHub), which claims to be able to support this driver, and hooked up the display using an FFC/FPC breakout board as follows:

All the power rails depicted are provided externally by regulators. The SSD1309 datasheet provides some guidance (in Figure 8-15) as to the value of the resistor between Iref and GND, and recommended 900kOhms when VCC is 12V, however the 10uA target is apparently ±2uA and the 1MOhm resistor that I had available should result in a 9uA target when VCC is 12V.

Neither datasheet provided much justification as to the value of the capacitor between VCOMH and GND, however the SSD1309 datasheet does have an example circuit where they use a 2.2uF capacitor at the end. I didn’t have a 2.2uF capacitor available at short notice, so I am used 4x10uF capacitors in series to achieve something as close as possible.

I have tried this circuit both with an ESP32 DevKitC board (without the level shifter voltage dividers present in the picture above, since the ESP32 is a 3.3V I/O device) and an Arduino Nano (as shown above).

This is the code I am currently trying to test on the Nano:

#include <Arduino.h>
#include <U8x8lib.h>

#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>

// Please UNCOMMENT one of the contructor lines below
// U8x8 Contructor List
// The complete list is available here:
// Please update the pin numbers according to your setup. Use U8X8_PIN_NONE if the reset pin is not connected

U8X8_SSD1309_128X64_NONAME0_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_SSD1309_128X64_NONAME0_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_SSD1309_128X64_NONAME2_4W_HW_SPI u8x8(/* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8X8_SSD1309_128X64_NONAME2_4W_SW_SPI u8x8(/* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);

// End of constructor list

void setup(void)
  pinMode(13, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(8, OUTPUT);


void loop(void)
  u8x8.drawString(0, 0, "Hello World!");
  u8x8.refreshDisplay();		// only required for SSD1606/7

I have tried all 4 of the constructors in the code there, with the same result on all of them. The problem is that the screen will not turn on/do anything, only remaining completely blank.

I have verified that the RESET pin starts LOW before becoming and staying HIGH.
I have verified that the CS pin is normally HIGH but drops LOW while the MCU attempts to communicate with the display.
I have verified that the SCLK pin oscillates while the MCU attempts to communicate with the display.
I have verified that there is information on the MISO line while the MCU attempts to communicate with the display.

I am so far unable to work out why the display isn’t working at all. I am fairly certain the wiring between the FFC/FPC breakout board and the rest of the circuit is correct, which leads me to come to the conclusion that it could be one of the following situations:

  • The library is not compatible with my display
  • The datasheet of the display (not the driver) is incorrect and one or more of the pins are located elsewhere
  • The display is broken on arrival or I managed to break it in someway, although I’m not show how I would have done this, I never went over 3.3V VDD and 12V VCC and I don’t believe I wired them incorrectly according to the datasheet
  • The 1MOhm resistor is too much
  • The 4x10uF capacitors are not a sufficient replacement

I was hoping that someone might be able to offer some advice as to why they think my circuit might not be working at all as currently I am completely lost.

Thanks to anyone in advance,

Bump as it's been a few days and I am still unable to find the solution by myself...

Your display looks similar to this 2.4 inch OLED from Ebay

It appears to have quite a lot of external components on the pcb.
Small 0.96" SSD1306 or 1.3" SH1106 Ebay modules have very few external components.

I would start with a ready made module. I am sure that U8g2 will work fine.

The Farnell docs do not seem to be very helpful.
If you can't find a reliable schematic, just steal the layout from the Ebay pcb.

Small SSD1306/SH1106 modules are widely available in Europe.
You can develop your software with a small module while you are waiting for a display to arrive from China.

No. I do not have a SSD1309. It just looks like SSD1306 with more convenient hardware scrolling.


Hi David,

Thank you for your advice. I believe your suggestion to buy a ready made module is probably the best course of action for me at this point. Thank you for pointing me in the right direction on ebay, I had not realised they are quite as abundant as they are!

Thank you very much,