How to config RPI3 as slave I2C

nerves
i2c
nerves-tips

#1

Hi everyone, I’m starting a project and I intend to use I2C communication.
What I wanted was for a rpi to get a message without having to start a conversation. I imagined the following situation … a system with multiple masters and they can exchange messages, so I believe I should give them an “slave” address …

Can anybody help me… :confused:


#2

The Raspberry Pi’s only support the master side of the I2C bus unless you manually implement the I2C protocol using the GPIOs. (Please don’t do that.) If you must use I2C, then the common way of implementing this is to connect another wire between the device and an RPi GPIO and call it an interrupt line. When the device wants to send the RPi a message, it toggles the interrupt line. The RPi then makes the I2C request to get the message. Some devices implement a queue to avoid the RPi dropping a message. Both ElixirALE and the soon-to-be-released Circuits.GPIO can send notification messages when an interrupt line changes.

An alternative is to look at UART, CAN or Ethernet since those technologies allow for devices to asynchronously send to each other.


#3

I suspected that rpi does not support being a slave …

Ethernet / Can, I need to add components to the microcontrollers that are interconnected to the bus …(In the system there are some microcontroled modules)

The most friendly solution would be to interrupt, as I am using P82B715 to communicate via cable, I would have to add a way in the cable system … :confused: