8 years, 7 months ago.

OLED display wont turn on

Hi,

I am working with the Adafruit 0.96" 128X64 OLED display board interfaced to my mbed LPC1768. I tried working with the code library to run the I2C display but my display wont turn on at all.

My connections between mbed and adafruit board are as follows: - P9 - Data - P10 - CLK - P27 - RST

Plus I have connected a 5V and GND to the VIn and GND of the Adafruit board from a power supply. I am powering my mbed board at VIN and GND using the same supply. I have verified the 5V supply with a multimeter, plus connections should be correct as I can see a 3.3 V on the 3V3 pin on the OLED board which means that it is receiving correct input voltage at VIN.

I have loaded the code by importing the GFX library and copying the example code on the page as it is in my main.cpp. I only see LED1 on mbed toggling, but the OLED is completely blank (black screen, nothing happening). I tried working with a lower I2C frequency as well (changed to 200000 in I2CPreInit function), but still nothing.

What could be going wrong for me? Any ideas will be really helpful

Thanks and Regards Nishant

Question relating to:

A derived version of the BSD licensed Adafrut GFX library for the SSD1306 controller for an OLED 128x32 or 128x64 display using SPI or I2C. display, I2C, OLED, SPI, SSD1306

I do not understand where to connect my reset pin, my oled just has the vcc, gnd, sda, scl pins. help

posted by Juan Pablo Gonzalez Daza 20 Apr 2017

3 Answers

8 years, 7 months ago.

Hi Nishat, for me 0x78 is the right I2C-Address! Defined as SSD_I2C_ADDRESS in Adafruit_SSD1306.h

PullUps are required on I2C bus in any case! Perhaps you will try out another pin for Reset? I've tryed '(PinName)NULL' but it kills the system after a few calls !?

I do not have your Processor but for NUCLEO-F401RE:

Open a terminal and try:

#include "mbed.h"
#include "Adafruit_SSD1306.h"

I2C myI2C(I2C_SDA,I2C_SCL);
Adafruit_SSD1306_I2c myGUI(myI2C,D13,0x78,64,128);

int main(){

 myGUI.begin(); 
 wait_ms(2000); // 2 s for Logo to be displayed

//this will scan the i2c bus and print deviceaddresses to terminal
  for (int i=0; i<=254; i=i+2) {
    if (myI2C.write(i, NULL, 0) ==0) printf("I2C device detected at address=%2.2X\n\r", i);
   }  

 while(1){ }
 }

will showup Adafruit Logo.If the display stays dark you might see its Address detected in the for loop (if I2C works!)

Quote:

Also have a look to Adafruit_GFX_Config.h

Uncomment all but //////#define NO_SPLASH_ADAFRUIT

Accepted Answer

Thanks a lot for your valuable inputs. I observed that just changing the slave address to 0x7A worked for me. However, I cant seem to understand why exactly that happened. Do you have any comments on this

posted by Nishant Bhaskar 17 Oct 2015

The SSD1306 has a selectable address, either 0x78 or 0x7A. If pin 15 is high then 0x7A else 0x78. This pin is also used as the 'DC' pin in SPI mode and can be used to select address in I2C mode. Usually this pin has a pull up, hence 0x7A. Modules with fewer pins not supporting SPI, either hard wire the address or allow selection on the PCB.

posted by malcolm lear 17 Oct 2015
8 years, 7 months ago.

Look at Adafruit_SSD1306.h : the default is 128x32 ....did you provide the correct parameters ?

Hi Robert,

Yes I have changed the parameters during the constructor call for gOled2 object creation. Basically in main.cpp wrote this line

Adafruit_SSD1306_I2c gOled2(gI2C,p27,0x78,64,128);

Thanks and Regards Nishant

posted by Nishant Bhaskar 16 Oct 2015
8 years, 7 months ago.

Hi Nishant, Try 0x7a as the i2c address. Assuming you have the 8 pin display, ensure the 2 links on the back are bridged to place it into I2C mode. Also I've found this display requires pullup resistors from both SDA (Data) and SCL (Clk) to VCC. 1.8k resistors are best, but anything from 1k8 to 4.7k will do the job. Malcolm

posted by malcolm lear 16 Oct 2015

Thanks a lot for your input. Just changing address to 0x7A worked for me

posted by Nishant Bhaskar 17 Oct 2015