你好,
我设置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 set
ting 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
0