I have an OLED with this 7 pin pinout:


I want to use an existing code i found that makes use of U8Glib. But in the example, use uses 4 pins to control the OLED via I2C. This is the pinout he uses:


Is it possible to control my OLED via 4 pins and use U8Glib to simplify my project by making use of the example code i found?

EDIT: Here is also a picture of the back of the OLED PCB that mentions how to use IIC but i do not understand it! back of pcb

  • 2
    That looks like it may be an SPI interface, not I2C, so no. You can't. – Majenko Jul 8 '17 at 13:45
  • Unless of course U8Glib has an SPI example for that board. I assume it's an SSD1306? Most small OLEDs are... – Majenko Jul 8 '17 at 14:10
  • Looks configurable to I2C / 3-wire SPI / 4-wire SPI depending on the presence / absence of R1-R4. – djones May 10 '19 at 16:46

This page has the answer to your questions. For reference:

Setting up SPI/I2C Connection with GMS096A OLED Module

Being a new entry to the market, only limited resources are available on this small piece of miracle (GMS096A). I2C/SPI configuration always demands helpful resources as in any case. For the SPI setup, the module comes in 4 wire SPI configuration by default and to make it work with the arduinos you can use these libraries from Adafruit.

For the I2C setup it demands a little bit of work on the module. Actually it was one of our customers who shared these simple configuration steps with us, start with resoldering the resistor from position R3 to R1 and then short the R8 resistor with some solder tin (0 Ohm resistor). The R6 and R7 pullup resistors are already soldered, nothing to do there. Once done, the module is ready for I2C communication! The CS Pin is not necessarily needed, so just connect it to GND. The DC Pin selects the address. For standard address wire it to GND. The RES-pin needs a low pulse at startup and high voltage during operation (as in SPI mode), a 100nF capacitor to GND and a 10k res to VCC would be ideal!

Your module might differ sightly. But you should be able to figure it out from there. The pulse on the RES-pin needed at startup took me a while to figure out!


Yes, it works IIC as described above, with my Arduino MEGA. You can also connect RST Pin at Arduino RESET signal, so no need of extra R and C components


That is a SPI interface. Often the CS is missing, but you seem to have that pin. I suggest to start with the software PCI mode of the U8Glib.

This is the best explanation that I can find: Github: SSD1306 based OLED connected to Arduino

Would you consider using the newer U8g2 library ?
It is easier to use with Arduino boards that have more memory. But it has also the same mode for low memory usage, just like the U8Glib.


Is it possible to control my OLED via 4 pins and use U8Glib to simplify my project by making use of the example code i found?

i'm sure somewhere there is an i2c->spi bridge. if not, you can always code your arduino to behave like one.

short of that, you can simply code to control the board via spi.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.