完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
我目前正在使用LIS3DH来获取一些加速度数据。目前我的操作模式是首先在旁路模式下初始化器件并配置剩余的参数,然后在需要时将器件重新配置为FIFO模式,在此模式下轮询DRDY信号,直到我的样本总数为止,然后我将设备重新置于旁路模式。
我注意到当我按照上面的过程进行单次读取然后在某个时刻返回以执行另一次读取时,我获得了重复值。这使我重新评估了我的操作方法。 回到AN3308我注意到我可以将电源模式切换为断电。如果我使用I1_ZYXDA位(应该在配置ODR之前设置)来设置DRDY信号,如果我在关闭器件之前禁用FIFO_EN(CTRL_REG5),则会产生以下结果? 要么 有没有更好的方法来实现我想要的功能? 提前致谢! #lis3dh #config#an3308 以上来自于谷歌翻译 以下为原文 I am currently using the LIS3DH to obtain some acceleration data. Currently my mode of operation is to first initialise the device in Bypass mode and to configure the remainder of the parameters, then when required the device is re-configured into FIFO mode where I poll the DRDY signal until my total number of samples have been taken, then I put the device back into Bypass mode. I have noticed that when I follow the above process for a single read and then return at some point later to perform another single read I obtain a repeated value. This has led me to re-evaluate my method of operation. Going back to AN3308 I have noticed that I can instead switch the power mode to power down. This brings about the following, if I am using the I1_ZYXDA bit (which is supposed to be set before configuring the ODR) to set the DRDY signal should I be disabling FIFO_EN (CTRL_REG5) prior to powering the device down? OR Is there a better way to go about achieving my desired functionality? Thanks in advance! #lis3dh #config #an3308 |
|
相关推荐
2个回答
|
|
|
对不起,但我不清楚你想要什么功能,能否请你更多地说明。
我只有两个评论: - 您可以使用FIFO阈值中断,当一定数量的样本存储在FIFO中时将触发中断(而不是轮询DRDY信号并自行计算样本数) - 在数据读取之前,应检查STATUS_REG中的ZYXDA位,以避免多次读取相同的输出值 以上来自于谷歌翻译 以下为原文 I'm sorry but it is not clear to me what is you desired functionality, can you please descibe it more. I have just a two comments: - you can use FIFO threshold interrupt which will trigger the interrupt when certain number of samples is stored in FIFO (instead of polling DRDY signal and counting the number of samples by yourself) - you should check ZYXDA bit in STATUS_REG before data reading to avoid multiple reading of the same output value |
|
|
|
|
|
谢谢您的回复。
简而言之,我正在为我的MCU加电并使用我想要的参数初始化加速度计,然后将其置于断电模式。然后,当提示MCU将加速度计置于活动状态(设置ODR值)并等待INT1上的ZYXDA拉高然后读取,然后在放入加速度计之前重复所需的样本总数进入省电模式。我没有使用FIFO功能,因为MCU在此期间无需处理,因此在INT1线上。 我写入器件的过程和每个寄存器的值如下: TEMP_CFG_REG = 0xC0 //启用温度传感器和ADC CTRL_REG2 = 0 //无过滤要求 CTRL_REG4 = 0 // Fs = 2g,8位分辨率 CTRL_REG6 = 0 //中断极性高电平有效 FIFO_CTRL_REG = 0x80 //流模式,INT1上触发中断 CTRL_REG3 = 0x10 // ZYXDA_ENCTRL_REG5 = 0 // FIFO禁用 CTRL_REG1 = 0x4F // 50Hz,8位分辨率,XYZ轴'启用 以上来自于谷歌翻译 以下为原文 Thank you for your reply. In brief, I am powering up my MCU and initialising the accelerometer with my desired parameters and then putting it into power down mode. Then when prompted the MCU puts the accelerometer into an active state (sets the ODR value) and waits for the ZYXDA on INT1 to be pulled high and then takes a reading, this is then repeated for the total number of required samples before putting the accelerometer into Power Down mode. I am not using the FIFO functionality as the MCU has nothing to process in the meantime and therefore pends on the INT1 line. My process for writing to the device and each registers value is as follows: TEMP_CFG_REG = 0xC0 // Temperature sensor and ADC enabled CTRL_REG2 = 0 // No filtering requirements CTRL_REG4 = 0 // Fs = 2g, 8 Bit Resolution CTRL_REG6 = 0 // Interrupt Polarity Active High FIFO_CTRL_REG = 0x80 // Stream mode, interrupt triggered on INT1 CTRL_REG3 = 0x10 // ZYXDA_ENCTRL_REG5 = 0 // FIFO Disabled CTRL_REG1 = 0x4F // 50Hz, 8 Bit resolution, XYZ axis' enabled |
|
|
|
|
只有小组成员才能发言,加入小组>>
stm32mp157的异核通信的rpmsg_sdb的m4固件和a7驱动该如何编写?
1472 浏览 0 评论
stm32f103用freertos对一个采样率为1kHz的传感器,进行采样,数据出差
1524 浏览 0 评论
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
3674 浏览 1 评论
3864 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
2483 浏览 1 评论
STM32H7打开DCache后,出现了串口接收信息为空的现象,是哪里出了问题?
752浏览 5评论
用NANO STM32F103RBT6的开发板烧录不了是哪里出了问题?
685浏览 5评论
730浏览 5评论
外部中断触发类型为双边沿触发,进入中断回调后有什么办法判断该边沿是上升沿还是下降沿?
976浏览 5评论
STM32L071CBT6低温环境下无法正常工作是什么原因引起的?
779浏览 5评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-14 23:04 , Processed in 0.870592 second(s), Total 72, Slave 55 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1838