完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我一直在寻找LIS3DH加速度计的数据表和AN3308,希望能找到解释和扩展数据的清晰简洁的解释。
到目前为止,我已经看到(VALUE)*(FS / 2 ^ BIT_RESOLUtiON)直观有意义,但与数据表中提到的灵敏度缩放器不对应: 低功率模式:{2g = 16mg /位,4g = 32mg /位,8g = 64mg /位,16g = 192mg /位}正常功率模式:{2g = 4mg /位,4g = 8mg /位,8g = 16mg /数字,16g = 148mg /数字} 高功率模式:{2g = 1mg /位,4g = 2mg /位,8g = 4mg /位,16g = 12mg /位} 除此之外,我看到有些人说FIFO缓冲区只能达到10位分辨率,这再次与数据表的内容相矛盾。 为了更好地理解我使用AN3308的过程,表8加速数据示例。我研究了+ 350mg和-350mg的例子,他们按预期工作: -350mg = 0xEA2h - >反转 - > 0x15Dh - > +1 - > 0x15Eh = {256 + 64 + 16 + 8 + 4 + 2} x -1 = -350 x 1mg = -350mg 350mg = 350×1mg = 350mg 然而,当使用+ 1g和-1g示例时,这种方法会分崩离析。鉴于数据保持左对齐,我认为值应该是: -1g =(-1)/ 1mg = -1000 = 0xC18h但是它给出为0xC00h,即-1024。 + 1g = 1 / 1mg = 1000 = 0x4E8h但是它给出为0x040h,这是64.为了使它全部关闭我已经看到注释表明所需要的是寄存器的移位与位分辨率相关然后简单乘以缩放器,但肯定是两个补码格式,这将导致所有值变为正值,因为MSB现在已经失去了位置? 有没有人对这个过程有任何明确的指示? #lis3dh #data-scaling#lis3dh-data-format #data-intepretation 以上来自于谷歌翻译 以下为原文 I have been looking over the datasheet and AN3308 for the LIS3DH Accelerometer in the hope that I can find a clear and concise explanation of how to interpret and scale the data. So far I have seen (VALUE)*(FS/2^BIT_RESOLUTION) which intuitively makes sense but doesn't correspond to the sensitivity scalers mentioned in the datasheet: Low Power Mode: { 2g = 16mg/digit, 4g = 32mg/digit, 8g = 64mg/digit, 16g = 192mg/digit }Normal Power Mode: { 2g = 4mg/digit, 4g = 8mg/digit, 8g = 16mg/digit, 16g = 148mg/digit } High Power Mode: { 2g = 1mg/digit, 4g = 2mg/digit, 8g = 4mg/digit, 16g = 12mg/digit } Additionally to this I have seen some people state that the FIFO buffer is only capable of 10 bit resolution, which again contradicts the contents of the datasheets. In an attempt to better understand the process I have been working with AN3308 Table 8 Example of Acceleration Data. I worked on the +350mg and -350mg examples and they worked as expected: -350mg = 0xEA2h -> invert -> 0x15Dh -> +1 -> 0x15Eh = {256 + 64 + 16 + 8 + 4 + 2} x -1 = -350 x 1mg = -350mg 350mg = 350 x 1mg = 350mg However this approach falls apart when working with the +1g and -1g examples. Given the data is held left aligned in two's complement I would have thought the values should have been: -1g = (-1) / 1mg = -1000 = 0xC18h BUT it is given as 0xC00h which is -1024. +1g = 1 / 1mg = 1000 = 0x4E8h BUT it is given as 0x040h which is 64.To top it all off I have seen comments which suggest all that is needed is a shift of the register to correlate with the bit resolution and then simply multiply by the scaler, but surely in two's complement format this will result in all values becoming positive because the MSB has now lost its place? Has anyone got any clear instructions on the process? #lis3dh #data-scaling #lis3dh-data-format #data-intepretation |
|
相关推荐
5个回答
|
|
x值由以下公式给出:
int16_t X; X = OUT_X_H&lt;&lt; 8 | OUT_X_L; 如果放2g刻度,2g将是32767; 因此,如果您想要g中的值,您可以: 2 * X / 32767; 如果你的比例是16克: 16 * X / 32767; 以上来自于谷歌翻译 以下为原文 The x value is given by this formula : int16_t X; X = OUT_X_H << 8 | OUT_X_L; If you put a 2g scale, 2g will be 32767; So if you want the value in g you do : 2*X/32767; if your scale is 16g : 16*X/32767; |
|
|
|
1.描述原始数据与加速度之间的关系的值(g)是灵敏度。您可以在表4中找到所有完整比例和模式的值。
输出值在输出16位寄存器中左对齐,因此您必须首先根据所选模式(8,10,12位)右移值。 2. FIFO仅存储10位值,参见数据表中的第3.6章 3. AN3308表8中的转换是正确的,也许1.024到1g的舍入可能会产生误导。你在下面的一行中犯了一个错误' + 1g = 1 / 1mg = 1000 = 0x4E8h但是它给出为0x040h,即64. 表中的值是0x4000。输出为12位(高分辨率),因此您可以将其移位4位(或除以16),您将得到0x400,即1024。 4.转换可以在C中非常简单地完成,例如使用以下代码: 以上来自于谷歌翻译 以下为原文 1. The value which describes relation between raw data and acceleration in g is sensitivity. You can find the values in Table 4 for all full scales and modes. The output value is left justified in the output 16 bit register, so you have to first shift the value right according to selected mode (8, 10, 12 bit). 2. The FIFO stores only 10 bits values see chapter 3.6 in datasheet 3. The conversion in the table 8 in AN3308 is correct, maybe the rounding 1.024 to 1g can be misleading. You made one mistake in the following line ' +1g = 1 / 1mg = 1000 = 0x4E8h BUT it is given as 0x040h which is 64.' The value in the table is 0x4000. The output is 12 bit (high-resolution) so you can shift it by 4 bits (or divide by 16) and you will get 0x400 which is 1024. 4. The conversion can be done very simply in C using for example following code: |
|
|
|
哦,我明白了,看来你的应用笔记的旧版本有错误。
请下载最新版本 http://www.st.com/content/ccc/resource/technical/document/application_note/77/ed/e7/e1/28/5a/45/d6/CD00290365.pdf/files/CD00290365.pdf/jcr:内容/翻译/ en.CD00290365.pdf 表已被修复。 以上来自于谷歌翻译 以下为原文 Oh, I see, it seems you have old version of the application note with the error. Please download the latest version of http://www.st.com/content/ccc/resource/technical/document/application_note/77/ed/e7/e1/28/5a/45/d6/CD00290365.pdf/files/CD00290365.pdf/jcr:content/translations/en.CD00290365.pdf where the table has been fixed. |
|
|
|
感谢Miroslav的回复。
这很好地符合我对这个过程的理解! 好吧,我没有意识到这一点,当我查看之前帖子中提到的部分时,它似乎没有相关性。 如果是这样,那么我不确定我理解。当我们解释±350mg的值时,值给出如下: + 350mg:0x15E0h,对于12位分辨率,我们可以丢弃读取0x0h以获得0x15Eh。 -350mg:0xEA20h再次我们可以缓解LSB给出0xEA2hSo为什么0x0400h变为0x4000h? 感谢您澄清数据也已四舍五入以获得±1g,这在文档中可能值得注意。 感谢您的时间和意见。 以上来自于谷歌翻译 以下为原文 Thank you for your reply Miroslav. 1. Good this aligns with what my understanding of what the process was! 2. Okay I was unaware of this, it didn't seem to correlate when I looked into the sections mentioned by previous posts. 3. If that is the case then I am not sure I understand. When we interpret the values for the ±350mg the values are given as: +350mg: 0x15E0h and for the 12 bit resolution we can drop the read 0x0h to obtain 0x15Eh. -350mg: 0xEA20h and again we can mitigate the LSB to give 0xEA2hSo why does 0x0400h become 0x4000h? Thank you for clarifying that the data has also been rounded to obtain ±1g, this may be worth noting in the documentation. Thank you for your time and comments. |
|
|
|
那就是把它包起来!
非常感谢您的帮助! 以上来自于谷歌翻译 以下为原文 That about wraps it up then! Thank you very much for your help! |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2662 浏览 1 评论
3220 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1792 浏览 1 评论
3621 浏览 6 评论
6001 浏览 21 评论
948浏览 4评论
1320浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
594浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
1313浏览 3评论
1371浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-1 13:24 , Processed in 1.225043 second(s), Total 87, Slave 70 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号