完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
早上好,我有点时间试图在我的LIS2DH12加速度计上正确配置设置。
我想在任何或所有轴上发生突然移动时触发中断。 我有一些设置(下面),我正在尝试,但它似乎太敏感,有时会触发中断,当它只是坐在那里没有移动。似乎有太多相互关联的设置,但这就是野兽的本质。有没有人有一些设置可以很好地检测任何/所有轴上的运动?我理解它的方式是阈值是移动量,持续时间是移动发生的时间范围。那么一个短的时间框架和一个大的门槛应该表明突然的运动? 对此的任何帮助都将非常感激 无论如何,这是我目前使用的设置: & sharpdefine ACCL_CTRL_REG1_DEFAULT 0x37 & sharpdefine ACCL_CTRL_REG2_DEFAULT 0x01 & sharpdefine ACCL_CTRL_REG3_DEFAULT 0x06 & sharpdefine ACCL_CTRL_REG4_DEFAULT 0x98 & sharpdefine ACCL_CTRL_REG5_DEFAULT 0x41 & sharpdefine ACCL_CTRL_REG6_DEFAULT 0x20 & sharpdefine ACCL_INT1_CFG_DEFAULT 0x7F & sharpdefine ACCL_INT1_SRC_DEFAULT 0x00 & sharpdefine ACCL_INT1_THS_DEFAULT 0x04 & sharpdefine ACCL_INT1_DUR_DEFAULT 0x00 & sharpdefine ACCL_INT2_CFG_DEFAULT 0x7F & sharpdefine ACCL_INT2_SRC_DEFAULT 0x10 & sharpdefine ACCL_INT2_THS_DEFAULT 0x04 & sharpdefine ACCL_INT2_DUR_DEFAULT 0x00 #加速度计的lis2dh12-配置 以上来自于谷歌翻译 以下为原文 Good morning, I'm having a heck of a time trying to get my configuration settings correct on my LIS2DH12 Accelerometer. I would like it to fire the interrupt when an abrupt movement occurs on any or all axes. I have some settings (below) that I'm trying, but it seems too sensitive and sometimes fires the interrupt when it's just sitting there not moving at all. Seems like there are too many interrelated settings on this, but that's the nature of the beast. Has anybody got some settings that work well to detect movement on any/all axes ? The way I understand it is that Threshold is the amount of movement and Duration is the time frame in which that movement occurs. So a short time frame and a large threshold should indicate an abrupt movement? Any assistance on this would be GREATLY appreciated Anyway, here are the settings I'm currently using: &sharpdefine ACCL_CTRL_REG1_DEFAULT 0x37 &sharpdefine ACCL_CTRL_REG2_DEFAULT 0x01 &sharpdefine ACCL_CTRL_REG3_DEFAULT 0x06 &sharpdefine ACCL_CTRL_REG4_DEFAULT 0x98 &sharpdefine ACCL_CTRL_REG5_DEFAULT 0x41 &sharpdefine ACCL_CTRL_REG6_DEFAULT 0x20 &sharpdefine ACCL_INT1_CFG_DEFAULT 0x7F &sharpdefine ACCL_INT1_SRC_DEFAULT 0x00 &sharpdefine ACCL_INT1_THS_DEFAULT 0x04 &sharpdefine ACCL_INT1_DUR_DEFAULT 0x00 &sharpdefine ACCL_INT2_CFG_DEFAULT 0x7F &sharpdefine ACCL_INT2_SRC_DEFAULT 0x10 &sharpdefine ACCL_INT2_THS_DEFAULT 0x04 &sharpdefine ACCL_INT2_DUR_DEFAULT 0x00 #accelerometer-lis2dh12-configure |
|
相关推荐
5个回答
|
|
以下是您的设置说明:
#define ACCL _CTRL_REG1_DEFAULT 0x37 - ODR = 25Hz,所有轴都启用 #define ACCL_CTRL_REG2_DEFAULT 0x01 - 中断1上的AOI功能的高通滤波器使能。 #define ACCL_CTRL_REG3_DEFAULT 0x06 - INT1引脚上的FIFO水印中断,INT1引脚上的FIFO溢出中断 #define ACCL_CTRL_REG4_DEFAULT 0x98 - BDU启用,FS = 4g,高分辨率 #define ACCL_CTRL_REG5_DEFAULT 0x41 - FIFO使能,INT2引脚使能4D检测 #define ACCL_CTRL_REG6_DEFAULT 0x20 - INT2引脚上的中断2功能使能 #define ACCL_INT1_CFG_DEFAULT 0x7F - 6方向移动识别,启用X,Y,Z UP / DOWN #define ACCL_INT1_SRC_DEFAULT 0x00 #define ACCL_INT1_THS_DEFAULT 0x04 - 阈值 #define ACCL_INT1_DUR_DEFAULT 0x00 - 持续时间 我看到了几个问题。 - 可以启用高通滤波器,但不是必需的。如果启用,请注意您将阈值与增量值进行比较 - FIFO的中断也链接到INT1,因此如果发生中断,则需要检查什么是中断源 - 为什么在INT2上启用4D检测? - 只有中断2链接到特定引脚(不是中断1) - INT1_CFG,INT2_CFG错误,没有意义(请根据需要查看数据表中的正确设置) 正确的中断设置可以是: #define ACCL_INT1_CFG_DEFAULT 0x0A | X或Y高于阈值或0x2A - X或Y或Z高于阈值(必须启用高通滤波器或阈值设置高于1g) #define ACCL_INT1_SRC_DEFAULT 0x00 #define ACCL_INT1_THS_DEFAULT 0x25 - 阈值 #define ACCL_INT1_DUR_DEFAULT 0x00 - 持续时间 您可以微调阈值和持续时间以调整灵敏度。 最好的祝福 米罗斯拉夫 以上来自于谷歌翻译 以下为原文 Here is an explanation of your settings: #define ACCL _CTRL_REG1_DEFAULT 0x37 … ODR=25Hz, All axis enabled #define ACCL_CTRL_REG2_DEFAULT 0x01 … High-pass filter enable for AOI function on Interrupt 1. #define ACCL_CTRL_REG3_DEFAULT 0x06 … FIFO watermark interrupt on INT1 pin, FIFO overrun interrupt on INT1 pin #define ACCL_CTRL_REG4_DEFAULT 0x98 … BDU enabled, FS=4g, High resolution #define ACCL_CTRL_REG5_DEFAULT 0x41 … FIFO enabled, 4D detection is enabled on INT2 pin #define ACCL_CTRL_REG6_DEFAULT 0x20 … Interrupt 2 function enable on INT2 pin #define ACCL_INT1_CFG_DEFAULT 0x7F … 6-direction movement recognition, X,Y,Z UP/DOWN enabled #define ACCL_INT1_SRC_DEFAULT 0x00 #define ACCL_INT1_THS_DEFAULT 0x04 … Threshold #define ACCL_INT1_DUR_DEFAULT 0x00 … Duration I see several problems in it. - Enable High pass filter is possible but not necessary. If enabled be aware that you compare the threshold with delta values - Interrupts from FIFO are also linked to the INT1, so if interrupt occurs you need to check what is the interrupt source - Why you enabled 4D detection on INT2? - Only interrupt 2 is linked to the particular pin (not interrupt 1) - INT1_CFG, INT2_CFG is wrong, it doesn’t make sense (please check datasheet for correct settings according to your needs) The correct interrupt settings can be following: #define ACCL_INT1_CFG_DEFAULT 0x0A …X OR Y Higher than threshold or 0x2A … X OR Y OR Z higher than threshold (high-pass filter must be enabled or threshold set higher than 1g) #define ACCL_INT1_SRC_DEFAULT 0x00 #define ACCL_INT1_THS_DEFAULT 0x25 … Threshold #define ACCL_INT1_DUR_DEFAULT 0x00 … Duration You can fine tune the threshold and duration to adjust the sensitivity. Best regards Miroslav |
|
|
|
我现在使用以下设置,并没有得到任何中断。我的设置有什么问题?
#define ACCL_CTRL_REG1_DEFAULT 0x3F // LPM 25khz #define ACCL_CTRL_REG3_DEFAULT 0x40 // AOI1 INT1 #define ACCL_INT1_CFG_DEFAULT 0x2A // X或Y或Z运动 #define ACCL_INT1_SRC_DEFAULT 0x00 //来源 #define ACCL_INT1_THS_DEFAULT 0x25 //“Threshold #define ACCL_INT1_DUR_DEFAULT 0x00 // - 持续时间 另外,我不能为我的生活找出下表所说的内容: 表64. INT2_THS描述 THS [6:0]中断2阈值。默认值:000 0000 1 LSb = 16 mg @ FS = 2 g 1 LSb = 32 mg @ FS = 4 g 1 LSb = 62 mg @ FS = 8 g 1 LSb = 186 mg @ FS = 16 g 以上来自于谷歌翻译 以下为原文 I’m using the following settings now and am not getting any interrupts. What is wrong with my settings? #define ACCL_CTRL_REG1_DEFAULT 0x3F //LPM 25khz #define ACCL_CTRL_REG3_DEFAULT 0x40 //AOI1 INT1 #define ACCL_INT1_CFG_DEFAULT 0x2A // X OR Y OR Z Movement #define ACCL_INT1_SRC_DEFAULT 0x00 //… Source #define ACCL_INT1_THS_DEFAULT 0x25 //… Threshold #define ACCL_INT1_DUR_DEFAULT 0x00 //… Duration Also, I cannot for the life of me figure out what the following Table says: Table 64. INT2_THS description THS[6:0] Interrupt 2 threshold. Default value: 000 0000 1 LSb = 16 mg @ FS = 2 g 1 LSb = 32 mg @ FS = 4 g 1 LSb = 62 mg @ FS = 8 g 1 LSb = 186 mg @ FS = 16 g |
|
|
|
该表描述了如何计算特定范围的阈值。
在你的情况下: #define ACCL_INT1_THS_DEFAULT 0x25 //“Threshold 如果使用2g范围阈值= 0x25 * 16mg = 592mg 如果使用4g范围阈值= 0x25 * 32mg = 1184mg â€| 您没有指定您使用的范围。如果使用2g比中断总是会被重力触发,因为阈值只有592mg。 最好的祝福。 米罗斯拉夫 以上来自于谷歌翻译 以下为原文 The table describe how to calculate threshold value for certain range. In your case: #define ACCL_INT1_THS_DEFAULT 0x25 //… Threshold If you use 2g range threshold = 0x25 * 16mg = 592mg If you use 4g range threshold = 0x25 * 32mg = 1184mg … You didn’t specify the range which you use. If you use 2g than the interrupt will be always triggered by the gravity, because the threshold is only 592mg. Best regards. Miroslav |
|
|
|
似乎我得到了很多部分答案。请假装我不知道这个加速度计是如何工作的,并为我提供了正确的值。不是2或3,而是我需要在加速度计的所有寄存器上设置的所有值,以便在我移动它时触发中断1。我还没看到火。我确信这些设置对于那些设计这个东西的人来说很有意义,但是在这一点上令我感到困惑。需要设置哪些CTRL寄存器,以及需要设置哪些INT1寄存器以及哪些值。我想拿起传感器并摇晃它并让dang中断火。这需要花费大量时间才能弄明白。互联网上没有关于实际适用于此传感器的设置的示例。它甚至可以工作,还是只读取值。中断真的开火吗?也许我的加速计有缺陷,或没有正确焊接..我正要去尝试其他人的加速度计,以便我有一些文件和实际工作设置的例子可以让这个爆炸的事情做我需要它做什么。
想要非常简单的行为。我想要低功耗模式。我希望数据在25hz读取。如果检测到突然的X,Y或Z移动,我想要触发中断。这需要花费10分钟才能搞清楚,但我已经连续工作了几个星期,它仍然不会发出中断...... 请不要参考任何其他示例或设置,只是假装您是从头开始编写此代码。实现上述结果需要哪些设置? 对不起,我不耐烦了,但这真让我疯了...... 以上来自于谷歌翻译 以下为原文 It seems that I'm getting lots of partial answers. Please pretend that I have no clue how this accelerometer works and provide me with the proper values. Not 2 or 3 of them, but ALL OF THE VALUES I need to set on all registers of the accelerometer in order to make it fire Interrupt 1 when I move it around. I have yet to see it fire. I'm sure that the settings make sense to those who designed the thing, but it is baffling me at this point. What CTRL registers need to be set, and what INT1 registers need to be set, and to what values. I want to pick up the sensor and shake it and have the dang interrupt fire. This is taking a rediculous amount of time to figure out. There are no examples on the internet with settings that actually work for this sensor. Does it even work, or is it only to read values. Does the interrupt actually fire? Maybe my Accelerometer is defective, or not properly soldered.. I'm at the point where I'm going to go try somebody else's accelerometer so that I will have some documentation and examples of actual working settings that can get this blasted thing to do what I need it to do. Very simple behavior is wanted. I want low power mode. I want data to be read at 25hz. I want an interrupt to fire if abrupt X, Y, or Z movement is detected. This should take 10 minutes to figure out, but I've been working on it off and on for weeks and it still wont fire an interrupt... Please do not refer to any other examples or settings, just pretend you are writing this from scratch. What are the settings necessary to achieve the results above? I'm sorry I'm coming off as impatient, but this is truly making me crazy... |
|
|
|
这让我很疯狂,我也遇到了与LSM303D相同的问题
以上来自于谷歌翻译 以下为原文 This is making me crazy as well I am having the same problem with the LSM303D |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2593 浏览 1 评论
3197 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1772 浏览 1 评论
3595 浏览 6 评论
5975 浏览 21 评论
927浏览 4评论
1303浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
569浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
1290浏览 3评论
1343浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-11 02:23 , Processed in 0.911313 second(s), Total 56, Slave 50 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号