Is there an i2c conflict between Si5351 (Etherkit lib) and SSH1106 (u8glib2)?


I am programming a simple signal generator using Si5351 (i2c addr 0x60) and information to be shown on OLED display (1.3 inch, SSH1106, i2c addr). I have successfully used this combination before, about two years ago, except then it was U8glib library and certainly an older version of etherkit Si5351 library.

Now I have a problem. I connect all the hardware with Arduino Nano compatible board (using LGT8F328P chip). When I upload a sketch that only uses Si5351, everything regarding signal generation in Si5351 works as expected. When I use the display and, let's say, Serial communication or RTC module (also i2c), everything works as expected, for instance showing current time etc.

However, when I initialize both the SSH1106 and Si5351, I get no signal from Si5351. It doesn't matter whether I initialize Si5351 before SSH1106 or afterwards. When other modules (RTC) are not present, it does not help.

Do you have similar experience? Any idea what could be the reason? I am also little bit confused that the OLED module PCB indicates its i2c addr should be 0x78 or 0x7A, but detected value is 0x3C, which is also the default in the U8Glib2 if I understand it correctly.

Arduino IDE is configured to use the LGT8F328P board (it would not work otherwise, the Chinese chip has different timing setup than AVR ATmega328P).

Thank you.

The ATmega328P is super reliable and the most used microcontroller for Arduino. It is a fantastic chip that can do many things.

Why are you trying to do the same thing with a clone of that microcontroller ?

Do you have a board with the ATmega328P that you can try ?

Hello, my friend. I think that asking why I use some particular chip is not leading to any solution :wink:

However, to satisfy your curiosity: 1. it was quite cheap on eBay, 2. it has MicroUSB (somehow I am not happy to use many different and at the same time obsolete cables, so I was happy to buy something with a MicroUSB because most other things at my home have this connector, too. 3. LGT8F328P can run on 32 MHz if needed, whereas ATMega328P cannot. 4. this interesting chip can be reconfigured to have 1, 2 or 4K EEPROM by giving up some unneeded program flash memory (seems to be a smart idea as in most cases I hardly use 16K anyway).

I do have a board with AVR, but don't have the cable and cannot buy one as most shops are now closed.

How can we solve a problem with a microcontroller that is "almost" compatible ?

You can show your sketch, maybe there is something that can be improved.

At this moment I can only tell the common things that can go wrong:

Both the SSH1106 and the Si5351 operate at 3.3V. That means you have a 5V I2C bus connected to a 3.3V display and 3.3V clock generator. That is not okay. A level shifter can fix that.

When you search the forum for OLED and the I2C bus, then you find that there are many problems. You are not the only one with problems with connecting a OLED to a I2C bus. Some OLED display are not 100% according to the I2C standard. It is even possible that a OLED disrupts the I2C bus for other devices. For example when trying to use a 5V Arduino board and a 3.3V OLED. Some sellers say that their bare OLED module is compatible with 5V, but they are not.

Can you give a link to both modules ?

The length of the I2C bus can be a total of 50 cm. Never use a flat cable for the I2C bus.

What are your pullup resistors ?

If I remember it correctly, the U8G2 library has three modes. It might use a lot of memory. Try the 8x8 mode, maybe that helps. The biggest change is changing from U8Glib to U8G2, so if you are lucky, that might be the problem.

1 Like