0
votes

I am having a strange issue with I2C devices. I have used RTC (DS3231 + 24LC32 EEPROM), 1.3 inch OLED display based on SSH1106 and Si5351 clock gnerator on the same I2C bus. Their respective addresses are 0x68, 0x57, 0x3C and 0x60.

On Arduino, using 5V interface and Vcc for the modules, I2C scanner correctly detected all devices (all of them are 3.3 volt devices and the modules contain low-drop stabilizers and level shift, supposed to work properly at both 5V and 3.3V I2C bus). In i2c_scanner sketch all devices are detected correctly. When I used RTC, U8Glib2 library for OLED and Si5351 setup in one sketch, the display did not initialize, and Si5351A did not produce any signal.

I thought this was due to stack overflow, as the Arduino device has only 2KB RAM and the compiler reported 1980 bytes RAM usage for dynamic variables. When I rewrote the whole sketch to use simplified U8x8 library (does not use RAM buffer for displayed data), I got working program capable to both display necessary information and driving the Si5351A.

Then I took two modules, Si5351 and OLED from the breadboard and connected them to a STM32 board (Blue Pill). Interestingly, i2c_scanner detected OLED (addr 0x3C) before I connected Si5351A. After I connected Si5351, it stopped detecting the OLED :-(

Any idea how this is possible? Expecially, why in AVR version of Wires library it works, but in the STM32 version it does not? And why there seems to be conflict between device with address 0x3C and 0x60 (the latter seems to "override" ACK bit when 0x3C is addressed, which should not be possible if it really is I2C bus...)

Plus, the module PCB of the OLED display indicates its I2C addr should be 0x7E ( 0x3C << 1 ), so there seems to be some mixup between 7-bit and 8-bit addresses.

I was trying to find explanation in various community discussions and tutorials, but to no avail.

I am so confused..

1
No code, no logic analyzer traces - nothing. How can we help you? Read the errata page of the stm32f103 as sometimes some workarounds are needed and do not believe in Arduino libraries.0___________
I don't have logic analyzer :-( Even if I had, how would logic analyzer help? The problem could be that HIGH level on SCL is close to the limit so that Si5351 can "see" LOWs, but the other one cannot. I am seeking answer from someone with practical experience with the same problem. As for code, what would you expect? It's Wires.beginTransmission( addr ); err = Wires.endTransmission(); If both devices are on the bus, 0x60 returns err=0 and 0x3C returns err=2.Jindrich Vavruska

1 Answers

0
votes

May be: 60 in decimal is also 0x3C in hex... You didn't provided all you code so I guess it may happen you wrote 60 instead of 0x60.

Thanks, Amit