esp32-i2c-mpu6050 icon indicating copy to clipboard operation
esp32-i2c-mpu6050 copied to clipboard

Only two sensors on the same chip with different I2C port number???

Open rtek1000 opened this issue 7 years ago • 3 comments
trafficstars

README.md ESP32 I2C MPU6050 driver for esp-idf

It uses hardware I2C port. So you can at most connect two sensors on the same chip with different I2C port number.

Datasheet says:

Auxiliary I2C Serial Interface The MPU-60X0 has an auxiliary I2C bus for communicating to an off-chip 3-Axis digital output magnetometer or other sensors. This bus has two operating modes:

  • I2C Master Mode: The MPU-60X0 acts as a master to any external sensors connected to the auxiliary I2C bus
  • Pass-Through Mode: The MPU-60X0 directly connects the primary and auxiliary I2C buses together, allowing the system processor to directly communicate with any external sensors.

rtek1000 avatar May 23 '18 15:05 rtek1000

Well... I just ported the code from the driver of another chip. ESP32 only has two hardware I2C ports. In theory one I2C master can connect to any number of I2C slaves as long as their addresses are different. Also, putting MPU6050 in master mode is also a idea worth trying.

imxieyi avatar May 24 '18 06:05 imxieyi

Yes, it would be great to have a library that can work with the auxiliary I2C port, although it is something simple I did not find any example of using this auxiliary port.

rtek1000 avatar May 24 '18 20:05 rtek1000

Is there an example with the MPU operating with a DS3231 or DS1307?

The DS1307 has the same address as the MPU, so it is interesting to use the auxiliary I2C port.

rtek1000 avatar May 24 '18 20:05 rtek1000