0,96" SH1106 Display does not work with U8glib

Hi guys,
i`m new to arduino and not the best when it comes to programming at all.

I have an Arduino Nano 328P board (http://2.bp.blogspot.com/-_M5HsO7r1dM/UGqw8xi2zUI/AAAAAAAAR5c/O-Q5qzO1mJQ/s1600/arduino+pinout.png)

and a cheap 4Pin SPI 0,96" OLED Display

i`ve connected it like this:

NANO DISPLAY
D13 - D1
D12 - DC
D11 - D0
D10 - CS

and the RST Pin to VCC.

I installed the U8glib and i`ve used the example code from the tutorial to print “Hello World” on the screen but it does not work. Does someone see an obvoius mistake, or could my display be broken?

_180131TestDisplay.ino (653 Bytes)

Blaukomma:
Hi guys,
i`m new to arduino and not the best when it comes to programming at all.

I have an Arduino Nano 328P board (http://2.bp.blogspot.com/-_M5HsO7r1dM/UGqw8xi2zUI/AAAAAAAAR5c/O-Q5qzO1mJQ/s1600/arduino+pinout.png)

and a cheap 4Pin SPI 0,96" OLED Display

0,96" OLED Display SPI 128x64 7 Pin Modul Arduino Raspberry Pi Weiß | eBay

i`ve connected it like this:

NANO DISPLAY
D13 - D1
D12 - DC
D11 - D0
D10 - CS

and the RST Pin to VCC.

I installed the U8glib and i`ve used the example code from the tutorial to print "Hello World" on the screen but it does not work. Does someone see an obvoius mistake, or could my display be broken?

In looking at the link for the display that you have given there are

The Display has 7 Pins which depending on which photograph you look at are labelled.
1 Grn Gnd
2 VDD VCC
3 SCK D0
4 SDA D1
5 RES RES
6 DC DC
7 CS CS

Your connections are incorrect.

Nano D13 goes to Display pin 3 SCK/D0
Nano D11 goes to Display pin 4 SDA/D1
Nano D10 goes to Display pin 7 CS/CS

That is the best I can do without a datasheet for the display.

I have a 2.4" OLED (SSD1309) that I tried unsuccessfully pulling the RST pin high by hard wire, however when wired RST to the processor and used U8g's optional constructor's reset parameter, it works great.

Not sure if this is permitted with U8g library for SH1106, but it is permitted with u8g2..... There is an optional parameter for RST pin in the constructor statement.

U8GLIB_SH1106_128X64 u8g(13, 12, 10, 11, 8);  // SW SPI Com: SCK(D1), MOSI(D0), CS(CS) , A0(DC), RST(D8)

You might give that a try, or test it with U8g2 library.

@artisticforge: Thanks, i changed my pins. i didn`t saw the second picture and used the wiring description of a tutorial which seems to use the same display.

@borland Thank you for your suggestions. I tried it with an additional Reset connection. The u8glib does support the reset pin but i still dont see anything on the display. Maybe ive killed it accidentally..

Next step is to try it with the u8g2 libary and if this still does not work i will try it with another nano board.

Thank you guys!

Hi guys, i finally hat success using the Adafruit libary. Just copied the example and it works fine. Even if this was for an SSD1306 controller.

But now i have a new problem. With the code for showing a logo and some measurement results, the measurement itself and controlling the multiplexer i reach over 90% of the nanos storage and Adruino warns me that it could get unstable.

Can you recommend me a controller which fits into my project ( 4 Sensors, a multiplexer, lots of buttons and leds and a display to show the results) which is small in size (should be soldered onto a pcb and fit in an 80x100mm case) ?

Thanks for your help!
Kai

Blaukomma:
But now i have a new problem. With the code for showing a logo and some measurement results, the measurement itself and controlling the multiplexer i reach over 90% of the nanos storage and Adruino warns me that it could get unstable.

Then still u8g2 page buffer mode might be an option. If Adafruit GFX works, then also u8g2 should work without problem.

Oliver