完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,先生,
我正在使用带有I2C接口的ST加速计传感器LIS3DH(适配器板STEVAL-MKI105V1)。 我现在可以阅读寄存器了 。但是对于没有默认值的寄存器,例如, OUT_X_L(0x28), OUT_ X _H(0x29), OUT_Y_L (0x2A), OUT_Y_H (0x2B访问), OUT_Z_L (0x2c上), OUT_Z_H (0x2D), 读取的值全为零。 我的问题: 1.如何获得没有默认值的寄存器的正确加速度计值?在读取寄存器之前需要的任何配置? 2.“AN3308”第4章写入寄存器的启动顺序,但应写入什么值?你能帮忙建议吗? 谢谢, 阿娜李 以上来自于谷歌翻译 以下为原文 Hi Sir, I am using ST accelerometer Sensor LIS3DH (adapter board STEVAL-MKI105V1) with I2C interface. I can now read the registers . But for the registers which doesn't have default value, for example, OUT_X_L (0x28), OUT_ X _H (0x29), OUT_Y_L (0x2A), OUT_Y_H (0x2B), OUT_Z_L (0x2C), OUT_Z_H (0x2D), the value read are all zero. My questions: 1. How to get the correct accelerometer value for the registers which doesn't have default value? Any configurations needed before reading the registers? 2. “AN3308â€� chapter 4 Startup sequence to write the registers, but what values should be written? Could you help to advice? Thanks, Arna Lee |
|
相关推荐
6个回答
|
|
你好
Batek.Miroslav 感谢您的评论。 我试着配置 CTRL_REG1 然后读取OUT_X_ / OUT_Y_ / OUT_Z_,例如OUT_Y _L,但即使我没有移动它,我也有不同/变化的价值。这是正常的吗?如果有什么不对的话,你能不能查看我的日志? 非常感谢。 ---日志--- 开始... 致电LIS3DH_GetWHO_AM_I 读LIS3DH_WHO_AM_I(0x0F)寄存器:0x33 --- UART2 RX HEX:--- 7E 20 03 33 20 4E Cal_Checksum:0x4E 调用HAL_I2C_Mem_Read 读I2C器件地址:0x33,寄存器地址0x20,响应:0x57 --- UART2 RX HEX:--- 7E 20 04 33 2A 43 Cal_Checksum:0x43 调用HAL_I2C_Mem_Read 读I2C器件地址:0x33,寄存器地址0x2A,响应:0x00 --- UART2 RX HEX:--- 7E 20 04 33 2A 43 Cal_Checksum:0x43 调用HAL_I2C_Mem_Read 读I2C器件地址:0x33,寄存器地址0x2A,响应:0x00 --- UART2 RX HEX:--- 7E 20 04 33 2A 43 Cal_Checksum:0x43 调用HAL_I2C_Mem_Read 读I2C器件地址:0x33,寄存器地址0x2A,响应:0x00 --- UART2 RX HEX:--- 7E 20 04 33 2A 43 Cal_Checksum:0x43 调用HAL_I2C_Mem_Read 读I2C器件地址:0x33,寄存器地址0x2A,响应:0x80 --- UART2 RX HEX:--- 7E 20 04 33 2A 43 Cal_Checksum:0x43 调用HAL_I2C_Mem_Read 读I2C器件地址:0x33,寄存器地址0x2A,响应:0x80 --- UART2 RX HEX:--- 7E 20 04 33 2A 43 Cal_Checksum:0x43 调用HAL_I2C_Mem_Read 读I2C器件地址:0x33,寄存器地址0x2A,响应:0x00 --- UART2 RX HEX:--- 7E 20 04 33 2A 43 Cal_Checksum:0x43 调用HAL_I2C_Mem_Read 读I2C器件地址:0x33,寄存器地址0x2A,响应:0x00 --- UART2 RX HEX:--- 7E 20 04 33 2A 43 Cal_Checksum:0x43 调用HAL_I2C_Mem_Read 读I2C器件地址:0x33,寄存器地址0x2A,响应:0x40 --- UART2 RX HEX:--- 7E 20 04 33 2A 43 Cal_Checksum:0x43 调用HAL_I2C_Mem_Read 读I2C器件地址:0x33,寄存器地址0x2A,响应:0xC0 --- UART2 RX HEX:--- 7E 20 04 33 2A 43 Cal_Checksum:0x43 调用HAL_I2C_Mem_Read 读I2C器件地址:0x33,寄存器地址0x2A,响应:0x40 --- UART2 RX HEX:--- 7E 20 04 33 2A 43 Cal_Checksum:0x43 调用HAL_I2C_Mem_Read 读I2C器件地址:0x33,寄存器地址0x2A,响应:0x00 --- UART2 RX HEX:--- 7E 20 04 33 2A 43 Cal_Checksum:0x43 调用HAL_I2C_Mem_Read 读I2C器件地址:0x33,寄存器地址0x2A,响应:0x00 --- UART2 RX HEX:--- 7E 20 04 33 2A 43 Cal_Checksum:0x43 调用HAL_I2C_Mem_Read 读I2C器件地址:0x33,寄存器地址0x2A,响应:0x00 --- UART2 RX HEX:--- 7E 20 04 33 2A 43 Cal_Checksum:0x43 调用HAL_I2C_Mem_Read 读I2C器件地址:0x33,寄存器地址0x2A,响应:0x40 --- UART2 RX HEX:--- 7E 20 04 33 2A 43 Cal_Checksum:0x43 调用HAL_I2C_Mem_Read 读I2C器件地址:0x33,寄存器地址0x2A,响应:0xC0 --- UART2 RX HEX:--- 7E 20 04 33 2A 43 Cal_Checksum:0x43 调用HAL_I2C_Mem_Read 读I2C器件地址:0x33,寄存器地址0x2A,响应:0x40 --- UART2 RX HEX:--- 7E 20 04 33 2A 43 Cal_Checksum:0x43 调用HAL_I2C_Mem_Read 读I2C器件地址:0x33,寄存器地址0x2A,响应:0x00 --- UART2 RX HEX:--- 7E 20 04 33 2A 43 Cal_Checksum:0x43 调用HAL_I2C_Mem_Read 读I2C器件地址:0x33,寄存器地址0x2A,响应:0x00 --- UART2 RX HEX:--- 7E 20 04 33 2A 43 Cal_Checksum:0x43 调用HAL_I2C_Mem_Read 读I2C器件地址:0x33,寄存器地址0x2A,响应:0x00 --- UART2 RX HEX:--- 7E 20 04 33 2A 43 Cal_Checksum:0x43 调用HAL_I2C_Mem_Read 读I2C器件地址:0x33,寄存器地址0x2A,响应:0x00 --- UART2 RX HEX:--- 7E 20 04 33 2A 43 Cal_Checksum:0x43 调用HAL_I2C_Mem_Read 读I2C器件地址:0x33,寄存器地址0x2A,响应:0x00 --- UART2 RX HEX:--- 7E 20 04 33 2A 43 Cal_Checksum:0x43 调用HAL_I2C_Mem_Read 读I2C器件地址:0x33,寄存器地址0x2A,响应:0x80 --- UART2 RX HEX:--- 7E 20 04 33 2A 43 Cal_Checksum:0x43 调用HAL_I2C_Mem_Read 读I2C器件地址:0x33,寄存器地址0x2A,响应:0x00 --- UART2 RX HEX:--- 7E 20 04 33 2A 43 Cal_Checksum:0x43 调用HAL_I2C_Mem_Read 读I2C器件地址:0x33,寄存器地址0x2A,响应:0x40 --- UART2 RX HEX:--- 7E 20 04 33 2A 43 Cal_Checksum:0x43 调用HAL_I2C_Mem_Read 读I2C器件地址:0x33,寄存器地址0x2A,响应:0xC0 --- 谢谢, 阿娜李 注意:原始帖子包含大量线程对话,只能迁移到第9级 以上来自于谷歌翻译 以下为原文 Hello Batek.Miroslav Thank you for the comment. I tried to configure CTRL_REG1 then read OUT_X_/OUT_Y_/OUT_Z_, for example, OUT_Y _L, but I got different/changing value even though I didn't move it. It is normal?Could you be kindly to review my log if anything wrong? Thanks a lot. --- Logs --- START... call LIS3DH_GetWHO_AM_I read LIS3DH_WHO_AM_I(0x0F) reg: 0x33--- UART2 RX HEX: --- 7E 20 03 33 20 4E Cal_Checksum: 0x4E call HAL_I2C_Mem_Read Read I2C device addr: 0x33, register addr 0x20, Response: 0x57--- UART2 RX HEX: --- 7E 20 04 33 2A 43 Cal_Checksum: 0x43 call HAL_I2C_Mem_Read Read I2C device addr: 0x33, register addr 0x2A, Response: 0x00--- UART2 RX HEX: --- 7E 20 04 33 2A 43 Cal_Checksum: 0x43 call HAL_I2C_Mem_Read Read I2C device addr: 0x33, register addr 0x2A, Response: 0x00--- UART2 RX HEX: --- 7E 20 04 33 2A 43 Cal_Checksum: 0x43 call HAL_I2C_Mem_Read Read I2C device addr: 0x33, register addr 0x2A, Response: 0x00--- UART2 RX HEX: --- 7E 20 04 33 2A 43 Cal_Checksum: 0x43 call HAL_I2C_Mem_Read Read I2C device addr: 0x33, register addr 0x2A, Response: 0x80--- UART2 RX HEX: --- 7E 20 04 33 2A 43 Cal_Checksum: 0x43 call HAL_I2C_Mem_Read Read I2C device addr: 0x33, register addr 0x2A, Response: 0x80--- UART2 RX HEX: --- 7E 20 04 33 2A 43 Cal_Checksum: 0x43 call HAL_I2C_Mem_Read Read I2C device addr: 0x33, register addr 0x2A, Response: 0x00--- UART2 RX HEX: --- 7E 20 04 33 2A 43 Cal_Checksum: 0x43 call HAL_I2C_Mem_Read Read I2C device addr: 0x33, register addr 0x2A, Response: 0x00--- UART2 RX HEX: --- 7E 20 04 33 2A 43 Cal_Checksum: 0x43 call HAL_I2C_Mem_Read Read I2C device addr: 0x33, register addr 0x2A, Response: 0x40--- UART2 RX HEX: --- 7E 20 04 33 2A 43 Cal_Checksum: 0x43 call HAL_I2C_Mem_Read Read I2C device addr: 0x33, register addr 0x2A, Response: 0xC0--- UART2 RX HEX: --- 7E 20 04 33 2A 43 Cal_Checksum: 0x43 call HAL_I2C_Mem_Read Read I2C device addr: 0x33, register addr 0x2A, Response: 0x40--- UART2 RX HEX: --- 7E 20 04 33 2A 43 Cal_Checksum: 0x43 call HAL_I2C_Mem_Read Read I2C device addr: 0x33, register addr 0x2A, Response: 0x00--- UART2 RX HEX: --- 7E 20 04 33 2A 43 Cal_Checksum: 0x43 call HAL_I2C_Mem_Read Read I2C device addr: 0x33, register addr 0x2A, Response: 0x00--- UART2 RX HEX: --- 7E 20 04 33 2A 43 Cal_Checksum: 0x43 call HAL_I2C_Mem_Read Read I2C device addr: 0x33, register addr 0x2A, Response: 0x00--- UART2 RX HEX: --- 7E 20 04 33 2A 43 Cal_Checksum: 0x43 call HAL_I2C_Mem_Read Read I2C device addr: 0x33, register addr 0x2A, Response: 0x40--- UART2 RX HEX: --- 7E 20 04 33 2A 43 Cal_Checksum: 0x43 call HAL_I2C_Mem_Read Read I2C device addr: 0x33, register addr 0x2A, Response: 0xC0--- UART2 RX HEX: --- 7E 20 04 33 2A 43 Cal_Checksum: 0x43 call HAL_I2C_Mem_Read Read I2C device addr: 0x33, register addr 0x2A, Response: 0x40--- UART2 RX HEX: --- 7E 20 04 33 2A 43 Cal_Checksum: 0x43 call HAL_I2C_Mem_Read Read I2C device addr: 0x33, register addr 0x2A, Response: 0x00--- UART2 RX HEX: --- 7E 20 04 33 2A 43 Cal_Checksum: 0x43 call HAL_I2C_Mem_Read Read I2C device addr: 0x33, register addr 0x2A, Response: 0x00--- UART2 RX HEX: --- 7E 20 04 33 2A 43 Cal_Checksum: 0x43 call HAL_I2C_Mem_Read Read I2C device addr: 0x33, register addr 0x2A, Response: 0x00--- UART2 RX HEX: --- 7E 20 04 33 2A 43 Cal_Checksum: 0x43 call HAL_I2C_Mem_Read Read I2C device addr: 0x33, register addr 0x2A, Response: 0x00--- UART2 RX HEX: --- 7E 20 04 33 2A 43 Cal_Checksum: 0x43 call HAL_I2C_Mem_Read Read I2C device addr: 0x33, register addr 0x2A, Response: 0x00--- UART2 RX HEX: --- 7E 20 04 33 2A 43 Cal_Checksum: 0x43 call HAL_I2C_Mem_Read Read I2C device addr: 0x33, register addr 0x2A, Response: 0x80--- UART2 RX HEX: --- 7E 20 04 33 2A 43 Cal_Checksum: 0x43 call HAL_I2C_Mem_Read Read I2C device addr: 0x33, register addr 0x2A, Response: 0x00--- UART2 RX HEX: --- 7E 20 04 33 2A 43 Cal_Checksum: 0x43 call HAL_I2C_Mem_Read Read I2C device addr: 0x33, register addr 0x2A, Response: 0x40--- UART2 RX HEX: --- 7E 20 04 33 2A 43 Cal_Checksum: 0x43 call HAL_I2C_Mem_Read Read I2C device addr: 0x33, register addr 0x2A, Response: 0xC0--- Thanks, Arna Lee Note: the original post contained a large number of threaded conversations and was only able to be migrated to the 9th level |
|
|
|
绝对正常,传感器本身或环境振动会产生一些小噪音。
以上来自于谷歌翻译 以下为原文 It is absolutly normal, there is always some small noise, caused by the sensor itself or by vibration of the enviroment. |
|
|
|
你好,先生,
我很困惑。 我把传感器放在桌子上。但看起来XYZ数据变化有点大? 在使用XYZ寄存器/数据之前是否需要配置任何其他寄存器? ************************************** 开始... 致电LIS3DH_GetWHO_AM_I 读取LIS3DH_WHO_AM_I(0x0F)寄存器:0x33 --- UART2 RX HEX:--- 7E 20 03 33 20 4E Cal_Checksum:0x4E 调用HAL_I2C_Mem_Read 读I2C器件地址:0x33,寄存器地址0x20,响应:0x57 --- UART2 RX HEX:--- 7E 24 01 5B Cal_Checksum:0x5B X = -128 Y = -1856 Z = -16064 --- UART2 RX HEX:--- 7E 24 01 5B Cal_Checksum:0x5B X = -128 Y = -1664 Z = -16000 --- UART2 RX HEX:--- 7E 24 01 5B Cal_Checksum:0x5B X = -704 Y = -1536 Z = -16192 ************************************** 谢谢, ARNA 以上来自于谷歌翻译 以下为原文 Hi Sir, I am confused. I just keep the sensor on the desk. But it looks like the XYZ data change a little big? Any other register needed to be configured before using XYZ register/data? ************************************** START... call LIS3DH_GetWHO_AM_I read LIS3DH_WHO_AM_I(0x0F) reg: 0x33 --- UART2 RX HEX: --- 7E 20 03 33 20 4E Cal_Checksum: 0x4E call HAL_I2C_Mem_Read Read I2C device addr: 0x33, register addr 0x20, Response: 0x57 --- UART2 RX HEX: --- 7E 24 01 5B Cal_Checksum: 0x5B X= -128 Y= -1856 Z=-16064 --- UART2 RX HEX: --- 7E 24 01 5B Cal_Checksum: 0x5B X= -128 Y= -1664 Z=-16000 --- UART2 RX HEX: --- 7E 24 01 5B Cal_Checksum: 0x5B X= -704 Y= -1536 Z=-16192 ************************************** Thanks, Arna |
|
|
|
如果你将数据转换成g单位,我会帮助你,你会发现变化很小并且是由噪音引起的。
这取决于您使用的模式,根据模式,输出在16位输出寄存器中调整为8,10,12位。 以上来自于谷歌翻译 以下为原文 I would help if you convert the data into g unit, you would see the change is small and is caused by noise. It depends which mode you are using, according to the mode the output is 8, 10, 12 bit left adjusted in 16 bit output register. |
|
|
|
你好Miroslav,
感谢您的答复。 这让我更清楚地理解。 顺便说一句,怎么样 将原始XYZ数据转换为g单位? 任何参考? 谢谢, ARNA 以上来自于谷歌翻译 以下为原文 Hi Miroslav, Thank you for the reply. It makes me more clear to understand. BTW, how to convert the raw XYZ data into g unit? Any reference? Thanks, Arna |
|
|
|
你好,
以下是数据表中的一节: 如果选择范围,则可以获得灵敏度。 输出寄存器以第二补码格式存储带符号的数字。 大卫 以上来自于谷歌翻译 以下为原文 Hello, Here is a section from the datasheet: If you select a range, this gives you sensitivity. The output registers store a signed number in a second complement format. David |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
1408 浏览 1 评论
2058 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1507 浏览 1 评论
2803 浏览 6 评论
5186 浏览 21 评论
351浏览 4评论
503浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
276浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
561浏览 3评论
479浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-4-20 09:54 , Processed in 0.688221 second(s), Total 48, Slave 43 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号