完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,
我设置H3LIS331DL加速度计在超过编程阈值时触发中断时遇到麻烦。我可以将器件配置为在INT1和INT2焊盘上准备好新数据时触发中断(用示波器确认)。但是,阈值中断永远不会触发。 我使用了以下配置: - 低功耗模式@ 10Hz,X / Y / Z轴使能:0b1100 0111用CTRL_REG1写入 - 没有高通滤波器 - 没有睡眠唤醒功能 - INT2焊盘上的阈值中断,中断未锁存 - > CTRL_REG3 = 0 - 满量程范围+ -100g,块数据更新:0b1000 0000用CTRL_REG4写入 - 或3轴中断的组合:用INT2_CFG写入的0b0010 1010 - 阈值设定为~2g(49mg / LSB @ + -100g) - > 0b0010 1000用INT2_THS编写 - 没有最短持续时间 不同的参数很好地写入传感器(读取它们和示波器测量)。 通过这种配置,我在静止时读取INT2_SRC中的0b0001 0101(阈值下的X / Y / Z),但摇动它不会改变。 由于阈值是在7位上定义的,我假设,在这种情况下,低于阈值低于-2g并且不低于2g,这是正确的(那么为什么我在INT2_SRC中设置了“低于阈值”标志)? 将阈值降低到1g并摇动传感器会产生相同的结果,不会触发中断。 有人能告诉我在哪里弄乱了这个传感器的配置吗? 干杯 以上来自于谷歌翻译 以下为原文 Hello, I have troubles setting the H3LIS331DL accelerometer to trigger an interrupt when a programmed threshold is crossed. I can configure the device to trigger an interrupt when new data is ready on both INT1 and INT2 pad (confirmed with an oscilloscope). However, the threshold interrupt never fires. I used the following configuration : - Low power mode @ 10Hz, X/Y/Z axis enable : 0b1100 0111 written in CTRL_REG1 - No high pass filter - No sleep to wake function - Threshold interrupt on INT2 pad, interrupt not latched -->CTRL_REG3 = 0 - Full scale range +-100g, block data update : 0b1000 0000 written in CTRL_REG4 - OR combination of interrupt on the 3 axis : 0b0010 1010 written in INT2_CFG - Threshold value set to ~2g (49mg/LSB @ +-100g) --> 0b0010 1000 written in INT2_THS - No minimum duration The different parameters are well written to the sensor (reading them back and oscilloscope measurement). With this configuration, I read 0b0001 0101 in INT2_SRC (X/Y/Z under threshold) at rest, but shaking it doesn t change. Since the threshold is defined on 7bits, I assume, that lower than threshold is lower than -2g in this case and not lower than 2g, is this correct (so why do I have 'lower than threshold' flags set in INT2_SRC)? Decreasing the threshold to 1g and shaking the sensor give the same result, no interrupt are triggered. Can someone tell me where I messed the configuration of this sensor please? Cheers |
|
相关推荐
1个回答
|
|
你好,
我认为,问题在于阈值设置。我认为,你的假设不正确。 阈值定义为7位,满量程= 100g,1LSB为100g / 128 = 0.781g。因此,要将阈值设置为2g,INT2_THS值应为0x03。 请注意典型的零克水平,即1克。对于低阈值,可以在没有任何移动的情况下触发中断(1g重力+ ~1g零-g级别)。 我检查了你的配置,除了 INT2_THS设置 。如果我设置INT2_THS = 0x05,当我强烈震动传感器时会触发中断。 以上来自于谷歌翻译 以下为原文 Hello, I think, the problem is in threshold setting. I think, your assumption is not correct. The threshold is defined on 7bits, for full scale = 100g, the 1LSB will be 100g/128 = 0.781g. So to set the threshold to 2g the INT2_THS value should be 0x03. Please be aware of the typical zero-g level which is 1g. For a low threshold the interrupt can be triggered without any movement (1g of gravity + ~1g of zero-g level). I have checked your configuration and it works fine except the INT2_THS setting . If I set the INT2_THS = 0x05, the interrupt is triggered when I strongly shake with the sensor. |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2642 浏览 1 评论
3208 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1783 浏览 1 评论
3611 浏览 6 评论
5988 浏览 21 评论
939浏览 4评论
1316浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
584浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
1303浏览 3评论
1360浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-24 10:55 , Processed in 0.990037 second(s), Total 79, Slave 62 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号