Two SSD1306 connected together

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
idoran
 
Posts: 7
Joined: Tue Sep 02, 2014 6:22 am

Two SSD1306 connected together

Post by idoran »

Hello,
I've connect two SSD1306 to Arduino. They are both connected using I2C and answer the same I2C address.
During development they work fine, everything I sent to the OLED was display on both screen at the same time.

Now, when I connect the Arduino to external power source, without downloading the code to it, it only initialize and display on one screen while the other show snow (black and white dots scatter).

If I connect the Arduino to USB, without downloading the code, the result is the same and only one screen works. If I open the serial monitor it seem to reset the Arduino and then both of the screens work together.

How can I cause both of the screens to work together?

Thank you,
Ido.

User avatar
adafruit_support_bill
 
Posts: 88136
Joined: Sat Feb 07, 2009 10:11 am

Re: Two SSD1306 connected together

Post by adafruit_support_bill »

It sounds like the second screen is needing the reset. What happens if you manually reset the Arduino when using an external power source.?

User avatar
idoran
 
Posts: 7
Joined: Tue Sep 02, 2014 6:22 am

Re: Two SSD1306 connected together

Post by idoran »

When I press the reset button on the Arudino then only one screen works. It is the same as just disconnecting and connecting the external power source.
Only when I download new software (even though it the exact same software) both screens works.

I even try to connect the SA0 of one screen to the ground which change it's I2C address to 3C (the other is 3D) and send commands to both screens one after the other, but this didn't work either. The behavior was exactly the same as both screen using the same address.

Any ideas? I'm open to any suggestion.

Thank you,
Ido.

User avatar
adafruit_support_bill
 
Posts: 88136
Joined: Sat Feb 07, 2009 10:11 am

Re: Two SSD1306 connected together

Post by adafruit_support_bill »

What happens if you connect just one display (the one that is not resetting). Does it work reliably without the other display connected?

User avatar
idoran
 
Posts: 7
Joined: Tue Sep 02, 2014 6:22 am

Re: Two SSD1306 connected together

Post by idoran »

I haven't try that yet, I'll post update once I will.

What is the snow on the screen means? It get power but not been reset?
Also both screen share the same RESET pin, can that be the problem?

Thank you,
Ido.

User avatar
adafruit_support_bill
 
Posts: 88136
Joined: Sat Feb 07, 2009 10:11 am

Re: Two SSD1306 connected together

Post by adafruit_support_bill »

I am guessing a bit that it is reset related. Since both scenarios you describe where it works (download and connecting Serial Monitor) will trigger a reset on most Arduinos. Which Arduino processor are you using?

If you post photos of your soldering and connections to the displays, we'll see if we can spot anything suspicious there.

User avatar
idoran
 
Posts: 7
Joined: Tue Sep 02, 2014 6:22 am

Re: Two SSD1306 connected together

Post by idoran »

Here is the photo.
I've try different Arduino and different LCD screens.
It looks like it is pretty random which screen works, it is not always the same one.
Attachments
ArduinoPrototype.JPG
ArduinoPrototype.JPG (397.51 KiB) Viewed 682 times

User avatar
adafruit_support_bill
 
Posts: 88136
Joined: Sat Feb 07, 2009 10:11 am

Re: Two SSD1306 connected together

Post by adafruit_support_bill »

Does it reliably work if you only have one connected?

User avatar
idoran
 
Posts: 7
Joined: Tue Sep 02, 2014 6:22 am

Re: Two SSD1306 connected together

Post by idoran »

I didn't test that enough to say for sure.
Tomorrow I'll disconnect the two screens and try it with only one screen.

Just to make sure I'll say it again, when I connect the Arduino via USB and open the Serial Monitor in Arduino editor both eyes always works - hope it can lead to a solution.

Thank you,
Ido.

User avatar
adafruit_support_bill
 
Posts: 88136
Joined: Sat Feb 07, 2009 10:11 am

Re: Two SSD1306 connected together

Post by adafruit_support_bill »

Opening a serial port will reset your UNO. Why that behaves different than pressing the reset button I do not know.
It is hard to trace all the wires in your photo. What pin do you have reset connected to? Post the code you are using.

User avatar
idoran
 
Posts: 7
Joined: Tue Sep 02, 2014 6:22 am

Re: Two SSD1306 connected together

Post by idoran »

The RESET is connected to pin 0 on the Arduino Uno.

This is part of the code, I'll make tomorrow smallest version of the code that repro the problem if this will not be enough to find the problem.

Code: Select all

#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define OLED_RESET 0
Adafruit_SSD1306 displayL(OLED_RESET);
Adafruit_SSD1306 displayR(OLED_RESET);

void setup()   {                
  Serial.begin(115200);

  // by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
  displayL.begin(SSD1306_SWITCHCAPVCC, 0x3D, false);  // initialize with the I2C addr 0x3D (for the 128x64)
  displayR.begin(SSD1306_SWITCHCAPVCC, 0x3C, false);  // initialize with the I2C addr 0x3C (for the 128x64)
  // init done
  
  // Show image buffer on the display hardware.
  // Since the buffer is intialized with an Adafruit splashscreen
  // internally, this will display the splashscreen.
  displayL.display();
  displayR.display();
  delay(1000);

  // Clear the buffer.
  displayL.clearDisplay();
  displayR.clearDisplay();

  Serial.println("ready");
}

void loop() {
  animateIdle();
  delay(1);
}

void animateIdle()
{
  if (idle_curr_frame <  30 * IDLE_DELAY[idle_index])
  {
    idle_curr_frame++;
  }
  else
  {
    idle_index = ((idle_index + 1) % IDLE_DELAY_COUNT);
    idle_curr_frame = 0;
    
    drawIdle();
  }
}

void drawIdle() {
  Serial.println("drawIdle");
  int idle_frame_index = idle_index % IDLE_FRMAE_COUNT;

  int x = 0, y = 0;
  displayL.drawBitmap(x, y, idles[idle_frame_index], FRAME_WIDTH, FRAME_HEIGHT, WHITE);
  displayR.drawBitmap(x, y, idles[idle_frame_index], FRAME_WIDTH, FRAME_HEIGHT, WHITE);
  displayL.display();
  displayR.display();
  //delay(2);
  displayL.drawBitmap(x, y, idles[idle_frame_index], FRAME_WIDTH, FRAME_HEIGHT, BLACK);
  displayR.drawBitmap(x, y, idles[idle_frame_index], FRAME_WIDTH, FRAME_HEIGHT, BLACK);
}

User avatar
adafruit_support_bill
 
Posts: 88136
Joined: Sat Feb 07, 2009 10:11 am

Re: Two SSD1306 connected together

Post by adafruit_support_bill »

The RESET is connected to pin 0 on the Arduino Uno.
Pin 0 is the Rx pin on the UNO. When you connect the serial monitor, it tries to communicate on that pin. Try using a different pin for reset.

User avatar
idoran
 
Posts: 7
Joined: Tue Sep 02, 2014 6:22 am

Re: Two SSD1306 connected together

Post by idoran »

IT IS WORKING :)

we've change the RESET pin to pin 3 (instead of 0) and now everything works.
It even works when the two screens use the same I2C address of 0x3D.

Thank you very much for the support,
Ido.

User avatar
adafruit_support_bill
 
Posts: 88136
Joined: Sat Feb 07, 2009 10:11 am

Re: Two SSD1306 connected together

Post by adafruit_support_bill »

Great! We're happy to help.

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”