ST意法半导体
直播中

彭逸晨

8年用户 162经验值
私信 关注
[问答]

INT1_THS如何在LIS3DH传感器上缩放?

我尝试将LIS3DH用作老年人安全装置中的跌倒传感器。
我想使用比仅使用自由落体中断更精细的检测方法,因此我尝试将跌落定义为自由落体中断,然后是活动或“唤醒”中断。

对于自由落体,一切都按预期工作。我将寄存器设置如下:
写(0x25):0x02 //将高电平有效变为低电平有效
写(0x20):0x57 //使能100Hz的所有轴
写(0x22):0x40 //在INT1上使能中断
写(0x23):0x00 // fs 2g
写(0x24):0x08 //锁存中断
写(0x33):0x02 //持续时间20ms
写(0x32):0x1f //阈值16mg * 31 = 496mg
写(0x30):0x95 //和x,y,z低事件的AND

收到中断后,我将配置更改为以下内容:
写(0x20):0x57 //使能100Hz的所有轴
写(0x22):0x40 //在INT1上使能中断
写(0x23):0x20 // fs - 10:±8 g
写(0x24):0x08 //锁存中断
写(0x33):0x01 //持续时间10ms
写(0x32):0x20 // 1 LSb = 62 mg @ FS =±8 g - >阈值62mg * 32 = 1984mg
写(0x30):0x2a // x,y,z高事件的OR

我遇到的问题是,显然Treshold寄存器的规模不是62mg / LSB而是32mg / LSB,因为如果稍微超过1g而不是预期的2g,我会得到一个中断。
如果我将阈值设置为0x41 * 32mg = 2080mg,如果加速度超过2g,我只会得到中断。

我某处有错误的假设吗?或者我配置错了什么?

谢谢你的帮助。

以上来自于谷歌翻译


以下为原文

I try to use the LIS3DH as a fall sensor in an security device for elderly people.
I want to use a more elaborate detection method than just using the free fall interrupt and therefore I try to define a fall as first a free fall interrupt and then an activity or "wake-up" interrupt.

For the freefall everything works as expected. I set up the registers as follows:
Write (0x25): 0x02//Change active high to active low
Write (0x20): 0x57//Enable all axis with 100Hz
Write (0x22): 0x40//Enable Interrupt on INT1
Write (0x23): 0x00//fs 2g
Write (0x24): 0x08//Latch interrupt
Write (0x33): 0x02//Duration 20ms
Write (0x32): 0x1f //Threshold 16mg * 31 = 496mg
Write (0x30): 0x95//AND of x,y,z low events

After I receive the Interrupt I then change the configuration to the following:
Write (0x20): 0x57//Enable all axis with 100Hz
Write (0x22): 0x40//Enable Interrupt on INT1
Write (0x23): 0x20//fs - 10: ±8 g
Write (0x24): 0x08//Latch interrupt
Write (0x33): 0x01//Duration 10ms
Write (0x32): 0x20//1 LSb = 62 mg @ FS = ±8 g -> Threshold 62mg * 32 = 1984mg
Write (0x30): 0x2a//OR of x,y,z high events

The problem I experience is that apparently the scale of the treshold register is not 62mg/LSB but 32mg/LSB as I get an interrupt if 1g is slightly exceeded and not 2g as expected.
If I set the threshold to 0x41 * 32mg = 2080mg I only get the interrupt if the acceleration exceeds 2g.

Do I have a false assumption somewhere? Or am I configuring something wrong?

Thanks for your help.

回帖(2)

曾玲娟

2019-2-12 06:50:08
配置正确,阈值为62mg / LSB,因此在您的情况下,阈值实际为2g。
你怎么知道中断是由1g触发的?

以上来自于谷歌翻译


以下为原文

The configuration is correct and the threshold is 62mg/LSB, so in your case the threshold is really 2g.
How do you know the interrupt is triggered by 1g?
举报

彭逸晨

2019-2-12 07:03:10
我循环了acc_data并打印出每个轴上的测量加速度。
但我再次进行了测试,现在发现加速度确实超过了2g。
因此,数据输出可能以前太慢而无法捕获触发加速度。
 
谢谢您的回复。

以上来自于谷歌翻译


以下为原文

I looped over the acc_data and printed out the measured accelerations on each axis.
But I ran the test again and now found that indeed the acceleration exceeds 2g.
So probably the data output was previously too slow to capture the triggering acceleration.

Thank you for your reply.
举报

更多回帖

发帖
×
20
完善资料,
赚取积分