Can I share the same TWI (I2C) instance for two sensors using two paires of I2C signals?

Hi all,

Having problems with two sensors connected to the same paire of I2C signals (SCL and SDA, for ex. Pin 22 and Pin 23), I plan to use two pairs of signals on Pin 22 and Pin 23, and on Pin 19 and Pin 20, but I only have one instance TWI available. Can it be confirmed that I can run the two sensors sequentially by sharing the same TWI (each time I change the configuration with different pins)?

Thanks.

Parents
  • Hi 

    Which SDK version are you planning to use?

    If you use the nrfx_twim driver you can reconfigure one TWIM module to use two different sets of pins, yes, but using nrfx directly might prevent you from using higher level sensor drivers for your I2C sensors. 

    It sounds odd that you are unable to put two I2C slaves on the same bus. Are you using very long wires between the different sensors? 

    Some times it helps to put stronger pullup resistors on the lines, or go to a lower clock frequency. 

    Best regards
    Torbjørn

Reply
  • Hi 

    Which SDK version are you planning to use?

    If you use the nrfx_twim driver you can reconfigure one TWIM module to use two different sets of pins, yes, but using nrfx directly might prevent you from using higher level sensor drivers for your I2C sensors. 

    It sounds odd that you are unable to put two I2C slaves on the same bus. Are you using very long wires between the different sensors? 

    Some times it helps to put stronger pullup resistors on the lines, or go to a lower clock frequency. 

    Best regards
    Torbjørn

Children
Related