3 I2C bus with nRF52832

We are evaluating nRF52832 for our next product. One of the requirement for us is to interface 3 set of sensors with nRF52832 over I2C.

Because our sensors can't share the I2C Bus, we need separate I2C Bus for for each sensor. 

As per datasheet of nRF52832, it supports 2xI2C. Is there a way that we can connect 3 sensors on 3 separate I2C bus?

Any example or document should be helpful.

Thanks!

  • Hi,

    Unfortunately that is not possible. Since the nrf52832 only has two TWI(M) instances, it can only have two sensors enabled at the same time. The nRF5340 is the only BLE chip we have that can support more than 2 TWI instances.

    Kind Regards,

    Swathy

  • Thanks Swathy for the reply.

    Can we use 1 I2C instance for 1 Sensor  as at a time and change the SDA/SCL lines at runtime?

    Something like:

    Connect sensors to different GPIOs for SDA-SCL.

    Instantiate the I2C for first sensor with for first set of GPIOs, finish the transaction.

    Instantiate the I2C for second sensor with for first set of GPIOs, finish the transaction.

    Instantiate the I2C for third sensor with for first set of GPIOs, finish the transaction.

    To do this we need to change the SDA/SCL lines at run time, I don't see an option to do it in 1.8.0 SDK.

  • Hi,

    It should be possible to reconfigure the pins during runtime. You need to use the nrfx_twi(m) driver for this. Kindly take a look at this ticket (the same would work with TWI as long as the previous transfer is done before changing pins.)

    Regards,

    Swathy

Related