为什么stm32模拟iic挂载两个MPU6050得到的地址都是一样的?

2019-07-14 15:25发布

两个MPU地址线一个接地一个接3.3v,无论将地址改为0x68还是0x69,通过IIC访问,返回的器件地址都是0x68
1.png
2.png
3.png
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
6条回答
秦小姐9048
1楼-- · 2019-07-14 21:28
通过iic读地址寄存器MPU_DRIVE_ID_REG,打印两个返回的地址值res,都是0x68
richips
2楼-- · 2019-07-15 01:55
怎么确定读的是哪一个从机,如果地址相同的话?
YOYOOO
3楼-- · 2019-07-15 07:00
地址不是不同嘛,一个68一个69,分开发送试试
blueshine
4楼-- · 2019-07-15 10:20
 精彩回答 2  元偷偷看……
szj0213
5楼-- · 2019-07-15 12:48
从机地址应该由从机决定,由从机的硬件连接决定,可以看下手册,:  The slave address of the MPU-60X0 is b110100X which is 7 bits long. The LSB bit of the 7 bit address is determined by the logic level on pin AD0. This allows two MPU-60X0s to be connected to the same I2C bus.
When used in this configuration, the address of the one of the devices should be b1101000 (pin AD0 is logic
low) and the address of the other should be b1101001 (pin AD0 is logic high).
你软件上写0x68  0x69是没有作用的,只能由从机自己决定。
新星之火12138
6楼-- · 2019-07-15 12:53
数据手册上有说明,不管AD0接高还是低,读出来的都是0x68。who am i寄存器的第0bit和第7bit是强制为0,1bit--6bit是固定的110100,所以两个器件读出来都是0110 1000(0x68)。要理解这个值只是表示"我是MPU6050",并不能区分是哪个MPU6050。只能通过从机地址0xD0或0xD2来区分是哪个MPU6050

一周热门 更多>