Hello everyone, ı want to use 4 mpu6050 with 1 stm32. My question; How ı use multi slave with one i2c channel from stm32-nucleo-f401re ?
..
..
One. More. Time.
There is an address pin on the MPU-6050. Ground the "AD0" pin on one board and tie it to VCC on the other board. Look at the data sheet to see what the two addresses are. Connect those two boards to one I2C bus. Then repeat that on the 3rd and 4th boards and connect them to a second I2C port.
Or - get an I2C MUX (for example, https://www.adafruit.com/product/2717), connect that mux to the I2C port, then connect the 4 sensors to the 4 ports on the mux. You may need to add pull-up resistors on the mux ports - check the data sheet/schematic to see.
Or - as @Community member mentioned, each I2C port is usually available on more than one set of pins on the STM32. By re-configuring the GPIO pins and their "alternate function" mapping, you can have a single I2C port on multiple pairs of pins (but only one pair at a time).
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.