I2C-OLED-Startup Issue

Hi,

I hope this is the right place to put my question :slight_smile: (My first post at all).

my problem is not very easy to describe, but i'll try.

As the topic says its all about the I2C OLED 128x64 Display (SSD1306). There is the very nice library by adafuit, but since I need PCINT it does not work for me (as far as I could see, when I tried it out).
I found the u8glib which does not affect the PCINT. So far so good, but I need a very short cycletime and this library lets the cycletime literally explode (just reffering to my own sketch of course).
That was the point when I copied the display-part of the MultiWii firmware from "LCD.cpp". Everything within the "#if defined(OLED_I2C_128x64)" . Its basic, but very fast and quiet easy to understand. It works very well for my stuff.

But now to the interesting part:
I'll describe a scenario that makes the problem obvious, I hope.

1 Uploading an example-sketch of any of the library mentioned above (adafriut, u8glib)
2 display works fine
3 DON'T disconnect the usb connection (power supply)
4 Upload my sketch
5 Works fine
6 Diconnect power supply
7 reconnect to power
8 code runs without a problem, but display shows nothing/stays off

-so you can see, that only if i leave the display powered on, it works properly with my sketch but as soon as I disconnect it from 5V it doesn't

9 uploading my sketch with the following lines, it works perfectly and reliable:

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

So... to me it seems that there is some kind of "start command" or anything like that to tell the display to start up.

Now, if it is as simple as it seems to me, I would love ( and I need) to save the memory that is used by the library, I don't even use.

If somebody knows anything about that, I would be more than happy to learn from you, so please, help me with this.

kind regards

Fabian

PS: unfortunately i can't show you my code. That would exceed the 9000 chars.

F_4metz:
PS: unfortunately i can't show you my code. That would exceed the 9000 chars.

Do a cut down program to demo the problem your having as you should only need the display part of it or attach it to your post.
Also link to the MultiWii code and other libraries to make life a bit easier for people helping you and to ensure they are looking at/testing with the same libraries/code you have.

well, sorry, from my point of view it seemed all clear :wink:

also, the 9000 chars are just the display part :wink:

here is the MultiWii 2.3 download page:
https://code.google.com/p/multiwii/

U8glib:
https://code.google.com/p/u8glib/

Adafruit_SSD1306:

here is a little code thats extracted from my original one (hope it works (it should), i dont have a dispay here at the mom):

Dropbox

I guess thats not the best programming style you have ever seen :wink:

btw. thanks for your prompt respond

Is this post relevant to your problem?

Thank you very much Riva. You know how to make people happy :wink:

Just for curriousity, did you even look at my links or have I just been too stupid to google? :wink:

Anyways, thats exactly what I was looking for the whole time.

regards

F_4metz:
Just for curriousity, did you even look at my links or have I just been too stupid to google? :wink:

I used the MultiWii link to grab there software and also looked at your dropbox example code. Then went google hunting for info on 128x64 implementation and it pulled up the forum link.