Have found a curious issue which the community might be interested in. Hopefully am not repeating prior findings.
Photon running system firmware 0.4.4. Application communicates with two I2C slave devices:
- “A” is OLED display being communicated with via Adafruit_SSD1306 library
- “B” is a home grown receiver of data
Devices “A” and “B” work a.okay individually within the application when only one of them is used between resets.
Problems occur when both devices are enabled for use: Sending data “BBBBB” to device “B”, “BBBBB” is correctly received by the device. Next, sending data “AAAAA” to device “A”, “AAAAA” is correctly received by the device (which in this case, is displayed).
PROBLEM is, data “BBBBB” is transferred again to device “B”.
The workaround was to first empty (?) the I2C buffer (selecting device “B”) prior to transferring data to device “A” by doing this:
Wire.beginTransmission(DEVICE_B_I2C_BASE_ADDRESS);
Wire.endTransmission(true);
Would anyone like to comment on this unexpected behaviour?
Thanks - @UMD