I2C Issues using 2 OLED Displays. Create a second I2C Port?

I have 2 I2C OLED Character displays. As far as I know they do not have a way to change the hardware address. I think my best solution is to create a second I2C port on my NANO board. I have read some information about the JeeLib but could not find any samples on using it with 2 I2C Ports. Is there a good way to go about this? Or is there a way to change the address on these displays?

The Displays are these ones
http://www.wide.hk/products.php?product=-IIC-{47}-I2C-1602-OLED-Module-Display-%252d-For-Arduino-{47}-PIC-{47}-AVR-{47}-ARM

Or is there a way to change the address on these displays?

There probably is a way to change the address.

The second picture shows the back of the module where there appear to be some locations that can be jumpered. The resolution isn't high enough to tell for sure. Can you provide a higher resolution photograph of the back?

Don

I am trying to use softi2c and I can get it to work on my mega but not on my nano.But I am not sure how to use the hardware I2C and the Soft I2C at the same time.

Just put an analogue multiplexer like the 4053 on the data and clock lines to the I2C device. Put the pull up resistors onto each device and then you can switch one to the other.

I looked into the multiplexer but I do not want to have to re-etch the board. I am building and instrument cluster for my 69 Mustang and already set it up for LCD's but they were not bright enough. So I decided to convert over to OLED. They look great but I can only get one to work and I really need 2. I think there is a solution without adding more hardware. At Least that is the goal.

These particular displays are the only ones I could find that physically fit my application. I Ordered 2 thinking that I could set the address with jumpers and am fairly sure this is not the case. I think they are based on the SSD1311 Chip. But specs on these displays are horrible at best.

But specs on these displays are horrible at best.

???

The data sheet says pin 4 selects the address, so look at that pin, you will find it is attached to +ve or ground, just swap one of them.

The chip is under the display. I Can not access it to find out which one is pin 4. I guess I could try pulling resistors from the VE and see if the address changes. But that is risky I might just blow it up. Does anyone out there have a schematic of one of these? I have not found one yet.

There were 2 Resistors that looked like they were in the circuit for the CPU (R6 and R8). I Pulled them and tied them to +5 instead of Ground and it did not work. The address was still set to 0x3c. They were 30 Ohm resistors.

There were 2 Resistors that looked like ...........

No, I said pin 4 on that chip not anything else. Do they still work?

Yes they still work. There is no way to get to pin 4 on the controller chip, It is under the glass part of the display. I would have to break the glass to access the chip.

I think there may be some confusion. Are you talking about pin 4 on the SSD1311 Chip. The documentation I have shows pin 51 of the SSD1311 Chip. I did find a Midas display that shows pin 4 to configure the address. I think that is for the display not the chip.

Here is the datasheet I found for the chip.
http://www.midascomponents.co.uk/pdf/ssd1311.pdf

I did find a Midas display that shows pin 4 to configure the address. I think that is for the display not the chip.

Yes the data sheet I was looking at was for the 1602A display.
If you can't get at that pin then you can't change the address.

Is this the software I2C library you used?
http://playground.arduino.cc/Main/SoftwareI2CLibrary

I USED THIS ONE. http://forums.adafruit.com/viewtopic.php?f=25&t=13722 i GOT IT TO FIND THE DISPLAY ON MY MEGA BUT NOT ON MY NANO.

I WILL TRY THE ONE YOU SENT ME THE LINK TO TONIGHT AND SEE IF IT WILL WORK.

I tried this library and it does the same thing. I have the SDA on D Pin 0 (Pin1) and SCL on D Pin 1 (Pin 2). It does not find the Display when scanning the pins.

Console Output

Scanning ...
8-bit 7-bit addr
No I2C device found.
Done

Sketch

// Scan I2C bus for device responses

#define SDA_PORT PORTD
#define SDA_PIN 0
#define SCL_PORT PORTD
#define SCL_PIN 1
#define I2C_TIMEOUT 100
#define I2C_NOINTERRUPT 0
#define I2C_SLOWMODE 0
#define FAC 1
#define I2C_CPUFREQ (F_CPU/FAC)

/* Corresponds to A4/A5 - the hardware I2C pins on Arduinos
#define SDA_PORT PORTC
#define SDA_PIN 4
#define SCL_PORT PORTC
#define SCL_PIN 5
#define I2C_FASTMODE 1
*/

#include <SoftI2CMaster.h>
#include <avr/io.h>

//------------------------------------------------------------------------------
void CPUSlowDown(int fac) {
// slow down processor by a fac
CLKPR = _BV(CLKPCE);
CLKPR = _BV(CLKPS1) | _BV(CLKPS0);
}

void setup(void) {
#if FAC != 1
CPUSlowDown(FAC);
#endif

Serial.begin(9600); // change baudrate to 2400 on terminal when low CPU freq!
Serial.println(F("Intializing ..."));
Serial.print("I2C delay counter: ");
Serial.println(I2C_DELAY_COUNTER);
if (!i2c_init())
Serial.println(F("Initialization error. SDA or SCL are low"));
else
Serial.println(F("...done"));
}

void loop(void)
{
uint8_t add = 0;
int found = false;
Serial.println("Scanning ...");

Serial.println(" 8-bit 7-bit addr");
// try read
do {
if (i2c_start(add | I2C_READ)) {
found = true;
i2c_read(true);
i2c_stop();
Serial.print("Read: 0x");
if (add < 0x0F) Serial.print(0, HEX);
Serial.print(add+I2C_READ, HEX);
Serial.print(" 0x");
if (add>>1 < 0x0F) Serial.print(0, HEX);
Serial.println(add>>1, HEX);
} else i2c_stop();
add += 2;
} while (add);

// try write
add = 0;
do {
if (i2c_start(add | I2C_WRITE)) {
found = true;
i2c_stop();
Serial.print("Write: 0x");
if (add < 0x0F) Serial.print(0, HEX);
Serial.print(add+I2C_WRITE, HEX);
Serial.print(" 0x");
if (add>>1 < 0x0F) Serial.print(0, HEX);
Serial.println(add>>1, HEX);
} else i2c_stop();
i2c_stop();
add += 2;
} while (add);
if (!found) Serial.println(F("No I2C device found."));
Serial.println("Done\n\n");
delay(1000/FAC);
}

Please use code tags when posting code. Read the how to use the forum sticky if you don't know how.

The NANO uses pins A4 & A5 for the I2C bus:- I2C: A4 (SDA) and A5 (SCL).

I will figure out how to use code tags before I post any more code.

I am trying to use the I2C on A4 and A5 Plus add a second I2C Bus to the NANO. That way I can use both displays.

Look for a library called "softI2C". You can use it on any two pins.

I am trying to make it work. I can get it to work on my Mega. But on my Nano it will not work. I have tried setting it up on several different pins and no go. It will either return an error that the pins are held low or it will give a list of all possible address when I use the i2c debug sketch.

Did you put in some external pullup resistors? I2C requires a pullup on both lines, normally 4.7K is used.

The display has them. I can get the address back on the Mega.