ssd1306 128x64 i2c module, odd lines are blank.

Hello Folks!

I bought a stock SSD1306 128x64 i2c 0,96" oled module. Following the instructions using u8glib and creating a "hello world" print. Hello world appairs in the oled display, but every second line are blank and text, text is chopped.

I tried all kind of libraries that can be installed using arduino ide, acrobotic ssd1306 adafruit gfx adafruit ssd1306 u8g2 u8glib

I followed the instructions to pick 128x64 and i2c, in all of them. In some cases u had to uncommon in header files and in other cases you needed to do something differently. I tried their examples, all working except that every second line was missing.

I start to think the standard adafruit oled module is broken, because not all libraries could be broken. I will return to shop and by a new module and also some different module to see if it helps.

I saw on internet many people sharing the same problem, but there was no working solution. I tried all of them I could find, also tried to set 128x32 resolution, but the oled did not light up at all with those settings, it was black. It is insane that one need to spend almost two days for this.

I also struggled with i2c address, 128x64 modules were claimed in som files to have 3d and 128x32 3c. I2C scan showed mine had 3C. Yet 128x32 did not work, only 128x64 with this blank odd lines.

The modules comes from "Kjell and Company", they sell kits and also a book, much of the book material is based on arduino libraries, like u8glib and their recommended 0.96" 128x64 i2c oled module, yet it did not work.... so here we are, fully stuck.

Anyone who have any solution that works, or should I assume the device is defect ?

Please post a link to the actual display, making sure that the link has an accurate photo of the pcb.

This applies to any questions about Chinese boards. If you provide a clickable link, more people will try it.

@psteen Will it work with u8g2? So every 2nd line is missed with this constructor: U8G2_SSD1306_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0) correct? My question is, will U8G2_SSD1306_128X32_UNIVISION_1_HW_I2C u8g2(U8G2_R0) work without missing lines (of course size will not fit...)

I think your display has just a different hardware setup.

Oliver

Hi

I have created a beta release for u8g2 (v2.20.3). Download here: https://github.com/olikraus/U8g2_Arduino. Install via "add library zip" menu in the Arduino IDE.

U8g2 now contains the new constructor "U8G2_SSD1306_128X64_ALT0_1_HW_I2C" which may solve this problem.

Oliver

david_prentice: Please post a link to the actual display, making sure that the link has an accurate photo of the pcb.

This applies to any questions about Chinese boards. If you provide a clickable link, more people will try it.

Hello !

Here is a link of what I purchased: https://www.kjell.com/se/sortiment/el-verktyg/elektronik/optokomponenter/led-lcd-displayer/luxorparts-oled-display-for-arduino-0-96--p87945

(Warning! site is in Swedish, but just click on the pictures to get them bigger)

olikraus: @psteen Will it work with u8g2? So every 2nd line is missed with this constructor: U8G2_SSD1306_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0) correct? My question is, will U8G2_SSD1306_128X32_UNIVISION_1_HW_I2C u8g2(U8G2_R0) work without missing lines (of course size will not fit...)

I think your display has just a different hardware setup.

Oliver

The display then becomes black.

olikraus: Hi

I have created a beta release for u8g2 (v2.20.3). Download here: https://github.com/olikraus/U8g2_Arduino. Install via "add library zip" menu in the Arduino IDE.

U8g2 now contains the new constructor "U8G2_SSD1306_128X64_ALT0_1_HW_I2C" which may solve this problem.

Oliver

Thanks for the swift update, but it did not solve the every second line problem. But there is a difference, text and graphics appairs with double size, stretched out vertically, and is not chopped off every second line. But every second line is still black, so it looks like a close up of an old TV picture.

Are there any differences between U8G2_SSD1306_128X64_ALT0_1_HW_I2C and U8G2_SSD1306_128X64_NONAME_1_HW_I2C?

Both have the skip line problem?

Can you provide pictures how HelloWorld will look like with both constructors?

Oliver

psteen: Hello !

Here is a link of what I purchased: https://www.kjell.com/se/sortiment/el-verktyg/elektronik/optokomponenter/led-lcd-displayer/luxorparts-oled-display-for-arduino-0-96--p87945

(Warning! site is in Swedish, but just click on the pictures to get them bigger)

The screen is 128x64. It is an I2C device with (7-bit) Slave Address 0x3C (8-bit=0x78) There is no RESET pin. You have to rely on power-on reset. It has pullups on SDA, SCL. It looks as if it should ACK correctly. i.e. D2 is connected to SDA. I do not have this particular board. Many other people do. They can confirm/deny my eyesight/guesswork.

So you should use a constructor for 128x64, 0x3C with no RST pin.

David.

david_prentice: The screen is 128x64. It is an I2C device with (7-bit) Slave Address 0x3C (8-bit=0x78) There is no RESET pin. You have to rely on power-on reset. It has pullups on SDA, SCL. It looks as if it should ACK correctly. i.e. D2 is connected to SDA. I do not have this particular board. Many other people do. They can confirm/deny my eyesight/guesswork.

So you should use a constructor for 128x64, 0x3C with no RST pin.

David.

I confirm it. It communicates flawlessly on 0x3C, and it also works together with other devices I tried on the i2c bus. i2c scan finds it in a blink. The "snowflake test" works, except the odd blank lines.

olikraus: Are there any differences between U8G2_SSD1306_128X64_ALT0_1_HW_I2C and U8G2_SSD1306_128X64_NONAME_1_HW_I2C?

Both have the skip line problem?

Can you provide pictures how HelloWorld will look like with both constructors?

Oliver

Here are pictures using the two constructors, the pictures filenames reflect each constructor from "hello world" example:

http://student.ing-steen.se/arduino/

Thanks, looks indeed strange.

Can you post the code for your Helloworld? Especially: Which font did you use? Somehow I does not look like the default HelloWorld.ino.

One more question: Can you post a picture of the u8g2logo example with the ALT0 constructor?

Oliver

olikraus:
Thanks, looks indeed strange.

Can you post the code for your Helloworld? Especially: Which font did you use? Somehow I does not look like the default HelloWorld.ino.

One more question: Can you post a picture of the u8g2logo example with the ALT0 constructor?

Oliver

The u8g2logo:

Here is the code:

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

#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif

//U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(/* reset=/ U8X8_PIN_NONE);
U8X8_SSD1306_128X64_ALT0_HW_I2C u8x8(/
reset=*/ U8X8_PIN_NONE); // same as the NONAME variant, but may solve the “every 2nd line skipped” problem

void setup(void)
{
/* U8g2 Project: SSD1306 Test Board */
//pinMode(10, OUTPUT);
//pinMode(9, OUTPUT);
//digitalWrite(10, 0);
//digitalWrite(9, 0);

/* U8g2 Project: KS0108 Test Board */
//pinMode(16, OUTPUT);
//digitalWrite(16, 0);

u8x8.begin();
u8x8.setPowerSave(0);

}

void loop(void)
{
u8x8.setFont(u8x8_font_chroma48medium8_r);
u8x8.drawString(0,0,“Hello World!”);
u8x8.refreshDisplay(); // only required for SSD1606/7
delay(2000);
}

Thanks for the u8g2 logo picture. I think the display is brocken: The second half of the internal display RAM does not work. Your display should work correctly with U8G2_SSD1306_128X64_NONAME_1_HW_I2C constructor, but it doesn't.

Yet I still have some doubts: Are you sure it is a 128x64 display? It looks more like 96x48 version.

Oliver

olikraus: Thanks for the u8g2 logo picture. I think the display is brocken: The second half of the internal display RAM does not work. Your display should work correctly with U8G2_SSD1306_128X64_NONAME_1_HW_I2C constructor, but it doesn't.

Yet I still have some doubts: Are you sure it is a 128x64 display? It looks more like 96x48 version.

Oliver

I tried 96x48 and other resolutions, either black or heavily wrapped around texts. Like you, I suspected it was broken. I will go for a new display and be back in one and a half hour with the result.

psteen: I tried 96x48 and other resolutions, either black or heavily wrapped around texts. Like you, I suspected it was broken. I will go for a new display and be back in one and a half hour with the result.

Ok, I got a new oled display of exactly the same type. Unfortunately the result is the same, no difference. So, now what ?

psteen: Ok, I got a new oled display of exactly the same type. Unfortunately the result is the same, no difference. So, now what ?

UPDATE!

I changed back the constructor to U8X8_SSD1306_128X64_NONAME_HW u8x8(/* reset=*/ U8X8_PIN_NONE); And recompiled my application, now it works as it should!

I tried to change back to the oled display that I suspected to be broken, and now confirms it is broken ot works differently than the other exactly same working device! Device broken!

Thank you all very much for your effort supporting me with this issue.