Hi,
Knowing the Oliver, the author of the great U8glib library is also active on this forum, I hope that this is the right place to ask my question...
I was really happy when I realized that U8glib supports the I2C version of SSD1306 since that allowed me to build the tinyOLED RepRap display controller. It works like a charm on the standard Mega 2560 / RAMPS / Marlin combination.
Since the SSD1306 display works as well on 3.3V, it was also no problem to use the tinyOLED on an Arduino Due with a standard RAMPS modified with Andrews modifications runing Wurstnase's Marlin4Due.
The problem arose only when I added an I2C EEPROM on the tinyOLED's PCB (since the Arduino Due does not have its own EEPROM). While I could access the I2C EEPROM witout problem when not activating the I2C SSD1306 display, as soon as I activated the display, accessing the EEPROM would just give errors...
My first step was to go back to test the same combination on the Arduino Mega, but there the combination EEPROM / SSD1306 worked fine - so the problem seemed to be Due specific...
After analyzing and comparing the two I2C implementations Wire.h (used for the EEPROM) and U8glib (using its own I2C routines) and doing many unsuccessful tests, I finally found that the conflict would be resolved if I removed the '//' from the (3 each) commented out statements "//u8g->pin_list[U8G_PI_SET_A0] = 1;" and "// u8g_i2c_stop();" in file U8glib/utility/u8g_com_arduino_ssd_i2c.c :
$diff u8g_com_arduino_ssd_i2c.c.ori u8g_com_arduino_ssd_i2c.c
125c125
<Â Â Â //u8g->pin_list[U8G_PI_SET_A0] = 1;
---
>Â Â Â u8g->pin_list[U8G_PI_SET_A0] = 1;
130c130
<Â Â Â // u8g_i2c_stop();
---
>Â Â Â u8g_i2c_stop();
134c134
<Â Â Â //u8g->pin_list[U8G_PI_SET_A0] = 1;
---
>Â Â Â u8g->pin_list[U8G_PI_SET_A0] = 1;
146c146
<Â Â Â // u8g_i2c_stop();
---
>Â Â Â u8g_i2c_stop();
150c150
<Â Â Â //u8g->pin_list[U8G_PI_SET_A0] = 1;
---
>Â Â Â u8g->pin_list[U8G_PI_SET_A0] = 1;
163c163
<Â Â Â // u8g_i2c_stop();
---
>Â Â Â u8g_i2c_stop();
With this 6 lines uncommented, the problem seems to have disappeared.
Now to my question: Did anyone else already stumble over this kind of I2C conflict on the Arduino Due? And if yes, is there any simpler way (rather than modifying the source) for using an I2C based U8glib display in conjunction with other I2C devices (such as EEPROM, RTC etc) on the Arduino Due?
Thanks,
Heinz