Go Down

Topic: Problem with SSD1306 LCD and U8glib (Read 82912 times) previous topic - next topic

lalitvijay

can you please elaborate on this.

I tried using all the functions ow working library with u8glib but nothing worked out.


lalitvijay

Tried to mix the u8glib example code with working code.
Nothing happend!

Looking for some elaborated view

MAS3

There's a quite large thread about this display.
I posted some solutions which still work today: here (click !) and here.

Did you see that thread and test the solutions in there ?
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

lalitvijay

Used pull up circuit with SDA and SCL by connecting  4.7k resistor across each with Vcc and voila it worked with u8glib ( U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NO_ACK);   // Display which does not send ACK ).

RoterFux

Hi!

I've got a very strange problem!

I've just manage to run my SSD1306 with an Arduino Nano v3 and the
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NO_ACK) setting, but the displayed content is mirrored from right to left. (Image if requested)

I am almost a noob, so please don't judge too hard, but what could be the problem?

greetings from austria

olikraus

Nice finding. Please post a picture. Where did you buy the OLED?

Can you also post a picture after changing line 96 in u8g_dev_ssd1306_128x64.c from
Code: [Select]
  0x0c8, /* c0: scan dir normal, c8: reverse */

to
Code: [Select]
  0x0c0, /* c0: scan dir normal, c8: reverse */
?

Oliver

RoterFux

#81
Jun 19, 2015, 01:27 am Last Edit: Jun 19, 2015, 01:39 am by RoterFux
thx for the quick reply

I noticed that it might be some loose contact or something, because it's also flickering very often and the content get messed up too. but I double checked all contacts ...changed the wiring, the mirroring happens less often but now... See the pic... so I'm not sure whats happening.

Also if I try to display the simplest animation on the display (text updates) nothing happens, or all get messed up again.

I bought it at amazon: http://tinyurl.com/qgun3j9 but the german shop (http://tinyurl.com/pmrpw6l)
but its basically the same hardware.... I guess.

This pic shows the "Hello World" text and in theory it should move to the right for one pixel ever second but than...

I've changed the code but with no effect.

olikraus

Hi

What exactly has been printed on the OLED? Is it the unmodified HelloWorld example?
What to do mean be loose contact? Will the display be correct sometimes?

What is your exact constructor? Did you modify the correct source?

Grüße,
Oliver

RoterFux

#83
Jun 19, 2015, 07:35 am Last Edit: Jun 19, 2015, 07:37 am by RoterFux
It is the Hello World example but with Hello in Line 1 and World in Line 2.
I have removed all animation stuff.

It displays the correct output after a reset for about 1 seconds. Then it changes to e.g. this or mirrors parts of the text or flips it upside down... Everything you can imagine.


RoterFux

#84
Jun 19, 2015, 10:06 am Last Edit: Jun 19, 2015, 10:08 am by RoterFux
Sorry for the double-post but here is a Video of the unmodified example code and it's output

maybe I'm too much of a noob for it... I don't know

olikraus

Hi

You should add pullup resistors (Any value between 1K and 10K is possible) to both of the data lines (this is required for proper I2C/TWI operation).
If the display accepts 3V to 5V power supply it my be worth to try to change the power supply.

Oliver

RoterFux


RoterFux

#87
Jun 22, 2015, 10:00 am Last Edit: Jun 22, 2015, 01:40 pm by RoterFux
It works with the pull up resistor for most of the times. It just returns to the messed up display with the GraphicsTest Example. And there especially from the triangles scene on...

elecopper

Hey guys,

I thought I'd give this a go with the Arduino Due and I'm happy to confirm that v1.17 and v1.18 work well.
With this display: http://www.ebay.de/itm/181287662115?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649

Though I am having trouble running two displays at once.
Everything runs great when I first upload the sketch, the screens can be addressed fine and work 100%. But when I unplug and plug it in again, only one screens fires up.
The only way to get both screens to work again at that point is to upload again or press the reset button. Then they work fine again.

Here's some code.

Code: [Select]
#include <Wire.h>

#include "U8glib.h"
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NO_ACK);

extern uint8_t I2C_SLA;

int m = 0;
int n = 10;

void setup()
{

}

void loop()
{
  draw_display_one();
  draw_display_two();

  delay(1000);

  m++;
  n++;
}


void draw_display_one()
{
  I2C_SLA = 0x07A;

  u8g.firstPage();
  do
  {
    u8g.setFont(u8g_font_osr26);
    u8g.setPrintPos(23, 57);
    u8g.print(m);
  }
  while (u8g.nextPage());
}

void draw_display_two()
{
  I2C_SLA = 0x078;

  u8g.firstPage();
  do
  {
    u8g.setFont(u8g_font_osr26);
    u8g.setPrintPos(23, 57);
    u8g.print(n);
  }
  while (u8g.nextPage());
}



The order I call draw_display_one() and draw_display_two() determines which screen will work and won't work when I disconnect and reconnect power.

Any thoughts?

olikraus

Hi

I think it is better to have two different u8g objects:

Code: [Select]
U8GLIB_SSD1306_128X64 u8g1(U8G_I2C_OPT_NO_ACK);
U8GLIB_SSD1306_128X64 u8g2(U8G_I2C_OPT_NO_ACK);


Also do something like this during setup():

Code: [Select]
I2C_SLA = 0x078;
u8g1.begin();
I2C_SLA = 0x07A;
u8g1.begin();


Note, that you still need to assign the I2C address.

Oliver

Go Up