ST意法半导体
直播中

余少虹

7年用户 182经验值
私信 关注
[问答]

LSM303DLHC加速度计数据寄存器左对齐吗?

你好

我按如下方式配置了LSM303DLHC加速度计。
CTRL_REG1_A,带有0x77 // 400hz数据
CTRL_REG4_A与0x00 //小端
并开始从OUT___A寄存器读取数据。

但我可以找到一些东西,发现下部的半字节一直都是零
OUT___A,OUT___A,OUT___A寄存器。

那么LSM303 12bit中的数据左对齐还是我遗漏了什么?

注意:在数据表中我发现它是16位,但在某些驱动程序样本中,数据寄存器的值被组合并右移4位(我假设这是为了补偿左对齐数据)

问候
HPC

#lsm303dlhc-data-format#lsm303dlhc

以上来自于谷歌翻译


以下为原文




Hi

I configured the LSM303DLHC accelerometer as follows.
CTRL_REG1_A with 0x77  //400hz data
CTRL_REG4_A with 0x00 //Little endian
And started reading the data from the OUT___A registers.

But I could find something that the lower nibble was found to be zero all the time in the
OUT___A, OUT___A, OUT___A registers.

So is the data in LSM303 12bit left justified or am I missing something?

Note: In datasheet i found it is 16bit but in some driver samples the values of the data registers are combined and right shifted by 4 bits (I assume this is to compensate the left justified data)

Regards
HpC
  
#lsm303dlhc-data-format #lsm303dlhc

回帖(3)

毛玲燕

2019-6-10 09:12:09
也许LSM303DLH的规格在这个问题上更具信息性。

以上来自于谷歌翻译


以下为原文





maybe spec of LSM303DLH is more informative regarding that issue.
举报

余少虹

2019-6-10 09:20:57
谢谢
 
 但我已经完成了规范,但没有提到这个问题......

以上来自于谷歌翻译


以下为原文







Thanks

But I have gone through the spec, but nothing is mentioned threre regarding this...
举报

王桂荣

2019-6-10 09:33:07
是的,他们左对齐16位宽。您还可以通过查看输出并使用重力作为参考来验证这一点。例如,如果您设置范围为+ -2G(默认值),您将看到当您使加速度计水平时,您将在Z轴上读取大约16k(+ - 取决于哪一端向上)并关闭在另外2个轴上为0。 + - 32k将是满量程,如果左对齐,1G是半满量程。

以上来自于谷歌翻译


以下为原文





Yes, they are left justified 16 bits wide.  You can also verify this by looking at your output and using gravity as a reference.  For example, if you set the range for +-2G (the default) you will see that when you have the accelerometer horizontal you will have a reading of about 16k (+- depending on which end is up) on the Z axis and close to 0 on the other 2 axes.  +- 32k would be Full Scale if left justified and 1G is half full scale.
举报

更多回帖

发帖
×
20
完善资料,
赚取积分