I2C device not detected only when SPI device is connected

I'm using an ESP8266 from Waveshare (universal e-paper driver), with a Sparkfun battery babysitter. I'm finding that when an e-paper screen is connected to the ESP8266 via SPI connections (ribbon cable) - then the battery babysitter is not detectable over I2C, the moment the e-paper screen is disconnected then the I2C device is detectable again. I'm finding this result by running the I2C scanner code, found here: Arduino Playground - I2cScanner

It's not clear to me how connecting one device can prevent another device from being read when they're using different protocols and different connections. Any help would be greatly appreciated.

What all pins are used by the SPI display? What pins are used by I2C?

The SPI display is using pins:
CS: 15
RST: 5
DC: 4
BUSY: 16

The I2C device is using:
SDA: 4
SCL: 5

So there is crossover on 5 and 4 but given that I2C is a bus should they not be able to share?

Hi,
SPI and I2C are totally different bus systems.
They require separate pin assignments.

Tom.... :smiley: :+1: :coffee: :australia:

Thanks @TomGeorge, can I just move my I2C device along to two unused pins?

Hi,
I am not familiar with the ESP8266.
You might be worth googling .

esp8266 SPI I2C

Tom... :smiley: :+1: :coffee: :australia:

1 Like

No.

With the ESP8266 you can pick your I2C pins. You specify the pins that you want to use in the begin function.
Wire.begin(SDA_PIN, SCL_PIN);

1 Like

Excellent, thanks @groundFungus

Just a small update to this thread for future readers now that I've got it working.
In addition to adding the function Wire.begin(SDA_PIN, SCL_PIN) I also needed to update the variants.h file for the ESP8266 module and set the new SDA and SCL pins there too. The variants.h file is located on the Arduino15 folder, here on a mac: /Users/{username}/Library/Arduino15

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.