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

Configuring two sensor on same i2c bus in Zephyr RTOS

I have a sensor board with two sensor on same i2c bus connected to NRF52840. I am running nrf connect sdk (1.4.2). Both sensors give data independently, however when I merge it to a single code calling all necessary functions it initiate the both; channel_get calls only one sensor and unable to setup channel for the other. 

Is there any guide to properly configure two i2c sensors mounted on the same bus, having different addresses (BME280 and BMG160)? 

Parents
  • Were you able to get this solved?
    I find it surprising that any "I2C for dummies" document out there will show that one of the main features of an I2C bus is the possibility of using multiple devices in the same lines, simply using different addresses. And yet, this basic concept is not covered by any of the examples, and I see many posters having trouble to get things working properly sharing an I2C bus with more than one device using Zephyr. Particularly for the nRF5x chips, which are quite limited in I2C communication ports, this feature should be the second example in the book of their I2C sample codes!

Reply
  • Were you able to get this solved?
    I find it surprising that any "I2C for dummies" document out there will show that one of the main features of an I2C bus is the possibility of using multiple devices in the same lines, simply using different addresses. And yet, this basic concept is not covered by any of the examples, and I see many posters having trouble to get things working properly sharing an I2C bus with more than one device using Zephyr. Particularly for the nRF5x chips, which are quite limited in I2C communication ports, this feature should be the second example in the book of their I2C sample codes!

Children
No Data
Related