完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我正在使用LSM9DS0有线与I2C通信。芯片似乎能够识别它的被寻址,ACK字节,响应读取等,但问题是它总是发回相同的字节。例如:我尝试按以下顺序配置设备:
0xD4 0x20 0x7F 0x04 0x08 0x00 0x40 其中D4是陀螺仪地址,20是起始寄存器。然后,我执行5个字节的读取,以确保设备配置为我希望它,但只接收5个0x40实例。该模式似乎是写入寄存器的最后一个字节只是由芯片反复重复。唯一的例外是读取按预期响应的WHO_AM_I寄存器。 有没有其他人有这个问题或有任何想法可能会出错? #I2C-lsm9ds0 以上来自于谷歌翻译 以下为原文 I'm using a LSM9DS0 wired to communicate with I2C. The chip seems to recognize when its being addressed, ACKs bytes, responds to reads, etc. but the problem is it always sends the same byte back. For example: I attempt to configure the device through the following sequence: 0xD4 0x20 0x7F 0x04 0x08 0x00 0x40 where D4 is the gyro address and 20 is the starting register. I then perform a read of 5 bytes to ensure that the device is configured as I want it to be but receive only five instances of 0x40. The pattern seems to be that the last byte written to a register is simply repeated over and over by the chip. The only exception is when reading the WHO_AM_I registers which respond as expected. Has anyone else had this problem or have any ideas as to what might be going wrong? #i2c-lsm9ds0 |
|
相关推荐
1个回答
|
|
事实证明,默认情况下不启用自动寄存器地址增量,我需要将寄存器地址与0x80进行按位OR运算,以使多字节事务处理起作用。这就是为什么使用WHO_AM_I寄存器的单字节事务工作正常,而多字节事务失败。
以上来自于谷歌翻译 以下为原文 Turns out that automatic register address increment is not enabled by default and I needed to bitwise OR my register address with 0x80 in order to get multi-byte transactions to work. This is why single byte transactions with the WHO_AM_I register worked fine while multi-byte transactions failed. |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2617 浏览 1 评论
3203 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1776 浏览 1 评论
3602 浏览 6 评论
5981 浏览 21 评论
931浏览 4评论
1308浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
576浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
1296浏览 3评论
1350浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-19 12:25 , Processed in 1.087558 second(s), Total 79, Slave 62 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号