OLED display noise issue + U8glib

Hi,

I was wondering if anyone has an idea what I'm missing or doing wrong.

I have one of one of those display running with an ATmega328p:

0.96" OLED blue /yellow color

It is a red board with Keyes OLED Automation written on it.

It is working fine with the standard I2C U8glib constructor for the SSD1306 controller (ACK and FAST Option).

However I have the issue that if the whole circuit has been off for a couple of hours then the display would show random pixel noise on turn on and it would be stuck in that configuration (cycling power doesn't help).

I found that the display itself is from Solomon Systech and that the reset pin is connected to the display's power via a bridge (labeled R4) on the display board. After disconnecting the bridge and connecting a wire to the reset pin the display would only turn on if the pin is held high and the noise can be cleared by unplugging the reset pin and putting it back to high and resetting the ATmega.

I've tried mimicking this behavior with a digital pin on the ATmega however the display would not turn on when using a pullup against the supply voltage and a high state pin. It would also not reset when pulling the pin low. It really only does clear when unplugging the reset pin.

I've tried a couple of resistors in the range from a few 100 Ohms to 0.5 MOhm for a pullup.

So VCC -> R_pullup -> digital Pin + display_reset only works if the digital pin is configured as INPUT - but then the display doesn't reset it only 'works' i.e. turns on.

I'm using a battery pack (2xAA) and a step-up converter to get 3.3 V to supply the whole circuit.

There is only a DS18B20, a tactile switch (for resetting the ATmega) + pullup in the circuit as other components.

I'm stuck at the moment and anything I would try from now on would be a guessing game and was hoping anyone can point me in the right direction.

Thanks and Cheers, Alex

Calling u8g.begin() will reinit the display. Maybe you can try

  delay(1000);
  u8g.begin();

in the setup() procedure.

Oliver

Hi Oliver,

thank you. This unfortunately didn't help.

However manually pulling reset to ground with the tactile switch and resetting the ATMega with the same switch works for now.

Thanks and Cheers, Alex

Hi,

just for completeness, as I believe I’ve reached a solution.

To make the display (as stated in the original post) compatible with this solution the display board needs to be modified.

R4 should be removed and a wire should be attached to either the pad on the flex-cable side of the R4 connection or directly to pin 14 on the flex-cable.

This is then the reset connection.

Then I’ve connected this to PD5 on the ATMega328P and added the following code which should force the display in reset on turn on and should be called in the setup() routine.

Note: I’m using the C-constructor as the C++ one wouldn’t build and I didn’t have time/mood to investigate that further.

For whatever reason the display wouldn’t turn on if the pin was active high. Only when making the pin an input with pullup enabled it worked (chances are I am missing something but as this works now and I have the minimum amount of components this is fine enough for me).

Maybe this is useful to others too.

void resetDisplay()
{
  DDRD |= (1<<DDD5); //set PD5 as output
  PORTD |= (1<<PIND5); //set PD5 high
  delay(10);
  PORTD &= ~(1<<PIND5); //set PD5 low
  delay(200);  
  DDRD &= ~(1<<DDD5); //set PD5 as Input
  PORTD |= (1<<PIND5); // enable pullup
  delay(10);
  u8g_setup();
}

void u8g_setup(void)
{
  u8g_InitI2C(&u8g, &u8g_dev_ssd1306_128x64_i2c, U8G_I2C_OPT_FAST);
}

Hi,

Thank you, you made me save a lot of time. I'd like to find before this thread. But there is an application that does not need this solution. See here https://www.youtube.com/watch?v=TuNkt4jA84A

RST pin is tied up to vcc by a capacitor (I suppose) also if it's marked as R4... Why this difference? It seems as a product discontinuity.

Marco

Hi EUmega,

I have the exact same OLED as you.
Nevertheless, the solution you provided does not work for me.

Is there any more steps to do, apart from the code ?

It worked for me to disconnect manually the vcc of the oled, then plug it again, and cycle power of the board. Unfortunately, as i’m working on an embedded application, i can’t afford to manually unplug and replug.

Can the fact that i have 2 others i2c devices on my arduino be a problem ?

Thanks for your time,

EDIT: I found that if you connect a LED between +5V of the Arduino and the Vcc of the oled, it works just fine.

Isigo

Read this thread (click!). In reply 22 i communicated the solution i found for this problem. I've been playing with some OLED modules by CRIUS, but this could have been very well been produced with other brands stamped on it.

Read the entire 7 page thread, it has a lot of interesting info.