This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Multimaster I2C communication

I'm working on a design featuring two different MCUs. I'm looking to use the nRF52840 as one of them. I need both processors to be able to send each other messages and ideally interrupt each other.

I was thinking of using Multimaster I2C. Is this supported on the nRF52840? Is there some other way to establish a bidirectional communication channel other than two separate I2C buses?

Thanks Slight smile

Parents
  • I am not sure to fully understand what you want to do exactly.  If just to transfer data between 2 MCUs, there are many ways.  I2C (Master/Slave), SPI (Master/Slave) or UART.  Multimaster means 2 MCU in master mode trying to access the peripherals on the same bus not for talking to each other. 

  • Well, no. I2C is a bus topology, where "master" is the device that first started driving the clock (if there was no contention) or the device that won arbitration (if there was contention for the bus) and every other device is a slave. And these terms are only valid for the duration of one transaction. Multi-Master simply means there are multiple devices that can initiate transfers on the bus, and there's no reason the sometimes-masters can't talk to each other, if they have assigned addresses.

    The correct answer is that Nordic's "TWI" peripheral is not actually I2C multimaster compatible.

    EDIT: Sorry, I assumed the response was from a Nordic employee.

Reply
  • Well, no. I2C is a bus topology, where "master" is the device that first started driving the clock (if there was no contention) or the device that won arbitration (if there was contention for the bus) and every other device is a slave. And these terms are only valid for the duration of one transaction. Multi-Master simply means there are multiple devices that can initiate transfers on the bus, and there's no reason the sometimes-masters can't talk to each other, if they have assigned addresses.

    The correct answer is that Nordic's "TWI" peripheral is not actually I2C multimaster compatible.

    EDIT: Sorry, I assumed the response was from a Nordic employee.

Children
  • Hi Jostikas, that is correct. In hardware context you enable either TWI slave or TWI master which are two different peripherals.

    However, it is possible to switch between TWI master and TWI slave peripherals during software runtime. So the TWI slave can be configured as the default peripheral, and then switch to TWI master if data should be read or written on the bus. This will have to be implemented in software and would probably not be robust against collisions on the bus.

Related