ssd1325 OLED with u8glib only shows garbage. Please help!

I'm trying to hook up a atmega328pu with arduino bootloader to a new haven oled display (NHD-2.7-12864UCY3).
The library I use to talk with the LCD is u8glib. It says in the documentation that my OLED is supported. However i'm only able to make it display gibberish.

The url below is the datasheet of the display i'm using.

The table below is how I hooked up the oled to my atmega328.

OLED - ATMEGA 328
1 VSS - GND
2 VDD - 3.3v
3 NC - NC
4 D/C - pin 15
5 VSS - GND
6 VSS - GND
7 SCLK - SCK / pin 19
8 SDIN - MOSI / pin 17
9 NC - NC
10 VSS - GND
11 VSS - GND
12 VSS - GND
13 VSS - GND
14 VSS - GND
15 NC - NC
16 RES - 3.3v with a 10k resistor in between
17 CS - SS / pin 16
18 NC - NC
19 BS2 - GND
20 BS1 - GND

To make it a little more clear i created this schematic.

I'm using the u8g Helloworld sketch and I tried the following constructor calls.

U8GLIB_NHD27OLED_BW u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
U8GLIB_NHD27OLED_2X_BW u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
U8GLIB_NHD27OLED_GR u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
U8GLIB_NHD27OLED_2X_GR u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9

No matter what option I try always the same gibberish :frowning:

I hope i have supplied enough information!

I am a little bit confused by our pin numbers. For example:

7 SCLK - arduino(SCK / pin 19 / d13)

What does pin 19 / d13 mean? Did you use the pin, which is labeld with "13" on your board?

There are two more issues:

  • You might need to connect reset line to a GPIO port and assign the pin number as fifth argument to u8glib.
  • You did not mention the Arduino Board: 5V boards (like the Uno) require a level shifter between the Arduino and the OLED

Oliver

Sorry I can understand that may be a bit confusing. Im not using a actual arduino board. I hooked it up to a ATmega328 directly.
The dx pins corresponds to the pin numbers used inside the actual scheme. I will modify the table and remove those pin numbers.

I will try to draw my schematic its quite simple.

The schematic below is how i hooked it all up.

I hope this will make it a bit more clear. I am using a fdti friend to give it power and to program it.

I suggest to connect C2 not to DTR, but to GND directly. There is no need to control the reset input of the OLED.

Is your board "Arduino" compatible? Maybe you can measure the signals on the output lines, to check if your wiring is correct.

Oliver

Hey thanks for your suggestion. I have actually tried that and the thing that completely baffles me is that after that I am no longer able to program the chip. Arduino IDE responds with :

avrdude: stk500_recv(): programmer is not responding

If I connect the RST of the oled to the DTR I am able to program the board again. Im beginning to wonder if my OLED is broken :frowning:

My board is off course arduino compatible its nothing fancy just the bare essentials.

I guess you need to fix the programming part first. The reset input line of the OLED should not be connected to the programming part. Maybe just pulling DTR high with a 10K resistor will help.

Oliver

Thanks Oliver. I bought a real arduino board and got it working in no time! There is still some distortion on the screen but i seem to be on the right track :slight_smile: