sparkfun / SparkFun_Qwiic_OLED_Arduino_Library

Arduino Library for SparkFun's OLED Qwiic (I²C) boards
https://docs.sparkfun.com/SparkFun_Qwiic_OLED_Arduino_Library/introduction/
Other
6 stars 7 forks source link

Communications fault in library with multiple I2C devices on the same bus #10

Closed mattborja closed 9 months ago

mattborja commented 10 months ago

Hi,

I'm noticing an issue in this library (but I don't know where) when I have both the ATECC508A and SparkFun Qwiic OLED Display (128x32) hooked up on the same I2C bus. I have these connected in series using the Qwiic connectors.

Artemis RedBoard -> ATECC508A -> OLED Display (128x32).

Seems most read operations on the ATECC508A are okay. I can also issue the SHA command (opcode 0x47, p1=0x00, p2=0x0000) which comes back fine (status code 0x00). But when I try to finalize the SHA over string abc (opcode 0x47, p1=0x02, p2=0x0003), I get an error (fault code 0x03, "Command properly received but length, opcode, or param illegal. Command must be modified before resending."). I notice also if I swap the two devices, I get different fault codes.

Leaving the OLED display connected, but not calling .begin(), I'm seeing the SHA End command on the ATECC508A device works perfectly fine.

Thinking it might have been the pull-ups, I severed the traces on the OLED, and even tried lowering the bus speed, but to no avail. Ultimately, I swapped out the library for https://github.com/adafruit/Adafruit_SSD1306 and I'm now finding the issue to be resolved under that library instead.

Anyways, leaving this issue here as the latest test showing a working scenario seems to indicate there's an issue in the library itself at this point. But I'm already pretty deep into ATECC508A, I can't get into debugging this one at this time.

Thanks.

PaulZC commented 9 months ago

Hi Matt (@mattborja ),

I suspect you are seeing the issue described in section 1.2.3 in this Microchip document:

image

Closing - because I believe this is an issue with the ATECC508A, not our library.

Best wishes, Paul

PaulZC commented 9 months ago

I suspect the Adafruit SSD1306 library defaults to 400kHz and so works around this issue.