完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好,
我正在玩IKS01A2板上的LSM6DSL传感器。 我正在尝试使用FIFO来记录和缓冲加速度计和陀螺仪数据。 加速度计工作正常,直接读取陀螺仪寄存器可以得到合理的数据,但是所有3个轴的FIFO中的陀螺仪数据总是* 0x7FFF(即int16_t的MAX_INT)。 我已经搜索了数据表和LSM6DSM应用说明,但无法找到可能发生这种情况的原因。 我尝试了大量的各种设置,结果没有差异,目前正在使用: X_ODR = G_ODR = FIFO_ODR = 416Hz 加速度计和陀螺仪的抽取= 1(无抽取)。 典型的FIFO读数看起来像这样: ... 从FIFO获得模式0值32767(0x7fff),包含6个字(空= 0 smartfull = 0溢出= 0水印= 0) 从FIFO中获得具有5个字的模式1值32767(0x7fff)(空= 0 smartfull = 0溢出= 0水印= 0) 从FIFO获得具有4个字的模式2值32767(0x7fff)(空= 0 smartfull = 0溢出= 0水印= 0) 从FIFO获得具有3个字的模式3值64348(0xfb5c)(空= 0 smartfull = 0溢出= 0水印= 0) 从FIFO获得具有2个字的模式4值812(0x032c)(空= 0 smartfull = 0溢出= 0水印= 0) 从FIFO中获得具有1个字的模式5值17048(0x4298)(空= 0 smartfull = 0溢出= 0水印= 0) 最后一个包: 0x7fff(Gx:286.7112°/ s) 0x7fff(Gy:286.7112°/ s) 0x7fff(Gz:286.7112°/ s) 0xfb5c(Xx:-0.0724 G) 0x032c(Xy:0.0495 G) 0x4298(Xz:1.0399 G) X_FS 2.0000G G_FS 245.0000°/ s G_direct:-1.067°/ s -2.406°/ s 1.566°/ s 以上来自于谷歌翻译 以下为原文 Hi all, I'm playing with the LSM6DSL sensor on the IKS01A2 board. I'm trying to use the FIFO to record and buffer accelerometer and gyro data. The accelerometer works fine and reading the gyro registers directly gives sensible data, however the gyro data in the FIFO for all 3 axes is *always* 0x7FFF (ie MAX_INT for int16_t). I have scoured the datasheet and the LSM6DSM application note and can't find any indication of why this might be happening. I've tried a huge amount of various settings, with no difference in outcome, currently using: X_ODR = G_ODR = FIFO_ODR = 416Hz Decimation = 1 (no decimation) for both accelerometer and gyro. Typical FIFO readout looks something like this: ... Got pattern 0 value 32767 (0x7fff) from FIFO with 6 words (empty=0 smartfull=0 overrun=0 watermark=0) Got pattern 1 value 32767 (0x7fff) from FIFO with 5 words (empty=0 smartfull=0 overrun=0 watermark=0) Got pattern 2 value 32767 (0x7fff) from FIFO with 4 words (empty=0 smartfull=0 overrun=0 watermark=0) Got pattern 3 value 64348 (0xfb5c) from FIFO with 3 words (empty=0 smartfull=0 overrun=0 watermark=0) Got pattern 4 value 812 (0x032c) from FIFO with 2 words (empty=0 smartfull=0 overrun=0 watermark=0) Got pattern 5 value 17048 (0x4298) from FIFO with 1 words (empty=0 smartfull=0 overrun=0 watermark=0) Last packet: 0x7fff (Gx: 286.7112 °/s) 0x7fff (Gy: 286.7112 °/s) 0x7fff (Gz: 286.7112 °/s) 0xfb5c (Xx: -0.0724 G) 0x032c (Xy: 0.0495 G) 0x4298 (Xz: 1.0399 G) X_FS 2.0000G G_FS 245.0000°/s G_direct: -1.067°/s -2.406°/s 1.566°/s |
|
相关推荐
3个回答
|
|
你好迈克尔,
请参阅中的示例代码 ( http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-expansion-software/x-cube-mems-xt1.html )适用于NUCLEO-F401RE和NUCLEO-L476RG板的封装。您可以将设置与正确工作示例中的设置进行比较。 感谢你并致以真诚的问候, 切赫 以上来自于谷歌翻译 以下为原文 Hello Michael, please refer to the '' example code in the ( http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-expansion-software/x-cube-mems-xt1.html ) package suitable for NUCLEO-F401RE and NUCLEO-L476RG boards. You can compare your settings with the settings in correctly working example. Thank you and best regards, Petr |
|
|
|
这似乎是由于将INACT_EN设置为0x00(禁用不活动)或0x01(仅保留陀螺仪)以外的任何内容
数据表说唤醒将重新激活陀螺仪,但它似乎以这样一种方式唤醒,它不能再为FIFO供电。 到目前为止,我发现恢复正常功能的唯一方法(在设置INACT_EN> 1之后)是执行powercycle或系统+内存重置(将0x81写入CTRL3_C)。没有存储器复位的系统复位没有帮助。 据推测,空闲模式正在翻转一些让陀螺仪感到不安的旗帜?也许我必须转储所有寄存器并将它们区分开来以找出明天发生的事情。 以上来自于谷歌翻译 以下为原文 It seems to be caused by setting INACT_EN to anything other than 0x00 (inactivity disabled) or 0x01 (leave gyro alone) The datasheet says that wakeup will re-activate the gyro but it appears that it wakes up in such a way that it can no longer feed the FIFO. So far, the only way I've found to restore normal functionality (after setting INACT_EN > 1) is to do either a powercycle, or a system+memory reset (write 0x81 to CTRL3_C). A system reset without memory reset doesn't help. Presumably the idle mode is flipping some flag somewhere that's upsetting the gyro? Perhaps I'll have to dump all the registers and diff them to find out what's happening tomorrow. |
|
|
|
陀螺工作LSM6DSL寄存器地图转储:
0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x04 0x09 0x00 0x24 0x00 0x00 0x28 0x00 0x6a 0x0010 0x40 0x40 0x44 0x00 0x00 0x00 0x00 0x00 0xe0 0x00 0x00 0x10 0x00 0x20 0x07 0xc1 0x0020 0x7c 0xf9 0x5c 0x00 0x05 0xff 0xbf 0x00 0x47 0xfd 0x38 0x01 0x79 0x43 0x00 0x00 0x0030 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xe0 0x04 0x00 0xf3 0x01 0x0040 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0050 0x00 0x00 0x00 0x00 0x84 0x84 0x00 0x00 0xae 0xae 0x06 0x06 0x00 0x00 0x00 0x00 0x0060 0x00 0x00 0x00 0x00 0x00 0x07 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0070 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00Gyro Broken LSM6DSL寄存器映射转储: 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x04 0x09 0x00 0x24 0x00 0x00 0x28 0x00 0x6a 0x0010 0x40 0x40 0x44 0x00 0x00 0x00 0x00 0x00 0xe0 0x00 0x00 0x10 0x00 0x20 0x05 0xc1 0x0020 0x8c 0xf9 0x62 0x00 0x04 0xff 0xc4 0x00 0x19 0xfd 0x61 0x01 0xea 0x42 0x00 0x00 0x0030 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x94 0x02 0x00 0x00 0xff 0x7f 0x0040 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0050 0x00 0x00 0x00 0x00 0x84 0x84 0x00 0x00 0xce 0xce 0x06 0x06 0x00 0x00 0x00 0x00 0x0060 0x00 0x00 0x00 0x00 0x00 0xa0 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0070 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00据我所知,唯一的区别是预期会从一个转储更改为下一个转储的值,而TAP_CFG(0x58)在工作转储中为0xAE和损坏的转储中的0xCE。 请注意,在“坏”转储中的0x3E-0x3F处,所描述的问题是可见的 - 使用INACT_EN> 1,FIFO中的Gyro数据包读取为0x7FFF,但各个OUT_G寄存器(0x22-0x27)在两个转储中读取都很好。 如果重要的话,这些转储是通过读取8个16字节块来生成的,依赖于自动前进(0x12 = 0x44 / CTRL3_C:IF_INC = 1),这似乎偶尔会出现一些奇怪的数字 - 例如地址0x54,0x55(值没有意义),0x59(似乎是0x58的重复,因为值没有意义),0x65(在数据表中列为保留地址,但读取非零并在每次读取时更改) 以上来自于谷歌翻译 以下为原文 Gyro Working LSM6DSL Register Map Dump: 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x04 0x09 0x00 0x24 0x00 0x00 0x28 0x00 0x6a 0x0010 0x40 0x40 0x44 0x00 0x00 0x00 0x00 0x00 0xe0 0x00 0x00 0x10 0x00 0x20 0x07 0xc1 0x0020 0x7c 0xf9 0x5c 0x00 0x05 0xff 0xbf 0x00 0x47 0xfd 0x38 0x01 0x79 0x43 0x00 0x00 0x0030 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xe0 0x04 0x00 0xf3 0x01 0x0040 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0050 0x00 0x00 0x00 0x00 0x84 0x84 0x00 0x00 0xae 0xae 0x06 0x06 0x00 0x00 0x00 0x00 0x0060 0x00 0x00 0x00 0x00 0x00 0x07 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0070 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00Gyro Broken LSM6DSL Register Map Dump: 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x04 0x09 0x00 0x24 0x00 0x00 0x28 0x00 0x6a 0x0010 0x40 0x40 0x44 0x00 0x00 0x00 0x00 0x00 0xe0 0x00 0x00 0x10 0x00 0x20 0x05 0xc1 0x0020 0x8c 0xf9 0x62 0x00 0x04 0xff 0xc4 0x00 0x19 0xfd 0x61 0x01 0xea 0x42 0x00 0x00 0x0030 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x94 0x02 0x00 0x00 0xff 0x7f 0x0040 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0050 0x00 0x00 0x00 0x00 0x84 0x84 0x00 0x00 0xce 0xce 0x06 0x06 0x00 0x00 0x00 0x00 0x0060 0x00 0x00 0x00 0x00 0x00 0xa0 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0070 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00As far as I can tell, the only differences are values expected to change from one dump to the next, and TAP_CFG (0x58) which is 0xAE in the working dump and 0xCE in the broken dump. Note that at 0x3E-0x3F in the 'bad' dump, the described issue is visible - with INACT_EN > 1, the Gyro packet in the FIFO reads as 0x7FFF, yet the various OUT_G registers (0x22-0x27) read just fine in both dumps. In case it matters, these dumps were generated by reading 8 lots of 16 byte blocks, relying on auto-advance (0x12=0x44 / CTRL3_C:IF_INC=1) which seems to turn up some strange numbers occasionally - eg addresses 0x54, 0x55 (values don't make sense), 0x59 (seems to be a repeat of 0x58 as value doesn't make sense), 0x65 (listed in datasheet as reserved address, but reads non-zero and changes every time it's read) |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2779 浏览 1 评论
3251 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1824 浏览 1 评论
3667 浏览 6 评论
6062 浏览 21 评论
1347浏览 4评论
对H747I-DISCO写程序时将CN2的st-link复用为usart1,再次烧录时无法检测到stlink怎么解决?
373浏览 2评论
STM32G474RE芯片只是串口发个数据就发烫严重是怎么回事?
467浏览 2评论
STM32处理增量式编码器Z信号如何判断中断是正转的还是反向转的?
292浏览 2评论
使用STM32F407VET6的USB2.0功能,发现ctl后芯片无数据返回,是什么原因可能导致的呢?
214浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-1-11 06:48 , Processed in 1.050261 second(s), Total 49, Slave 43 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号