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

Does nRF52840 support multi-master TWI (I2C)?

The nRF52840 supports 2 Master/Slave instances.

Is it possible to configure the nRF52840 as a Master when connected to an I2C bus that has another Master present?

  • Datasheet  says "This TWIM is only able to operate as a single master on the TWI bus. Multi-master bus configuration is not supported." (page 427). Two master may lead to unpredictable results.

  • Hi,

    Thank you for the quick response.

    I did see that statement but took it to only apply to the circuit diagram shown - hence the term "This TWIM … ".

    Elsewhere the datasheet shows that the nRF52 supports two TWI instances where one can be a slave and one a master.

    I don't think that they could both be enabled if mapped to the same pins, but could I not map them to different pins and connect those to the same bus?

  • could I not map them to different pins and connect those to the same bus?

    You could - but what would be the point?

    Multi-Master would still not be supported.

  • You definitely can map two masters to different pins and connect to the same bus, but there is no guarantee it will work. Master peripheral may fail/glitch in case of unexpected transmission on the bus.

    There is special way to handle multi-master mode in full I2C specification, but for simplicity it is not supported on Nordic devices,

  • Okay thank you.

1 2