完善资料让更多小伙伴认识你,还能领取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. |
|
|
|
|
只有小组成员才能发言,加入小组>>
stm32mp157的异核通信的rpmsg_sdb的m4固件和a7驱动该如何编写?
1469 浏览 0 评论
stm32f103用freertos对一个采样率为1kHz的传感器,进行采样,数据出差
1521 浏览 0 评论
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
3668 浏览 1 评论
3860 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
2477 浏览 1 评论
STM32H7打开DCache后,出现了串口接收信息为空的现象,是哪里出了问题?
748浏览 5评论
用NANO STM32F103RBT6的开发板烧录不了是哪里出了问题?
680浏览 5评论
727浏览 5评论
外部中断触发类型为双边沿触发,进入中断回调后有什么办法判断该边沿是上升沿还是下降沿?
968浏览 5评论
STM32L071CBT6低温环境下无法正常工作是什么原因引起的?
771浏览 5评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-12 03:51 , Processed in 1.690491 second(s), Total 73, Slave 56 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1747