完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好
我的目标是使用两个INT引脚在一个将用于汽车的设备中生成两个中断。检测到汽车碰撞时会拉动INT2,汽车移动时会拉动INT1。 这是我的初始设置: CTRL_REG1 = 0x27 // 10Hz,正常功耗模式,ZXY使能 CTRL_REG2 = 0x01 // INT1的HP过滤器 CTRL_REG3 = 0x40 // IA1启用 CTRL_REG4 = 0x90 // 4g | BDU CTRL_REG5 = 0x0A //锁存在INT1和INT2上 CTRL_REG6 = 0x22 //低电平有效INT2启用 INT2_THS = 0x6D //~3500mg INT2_DURAtiON = 0x00 // 0.1 * 0s INT2_CFG = 0x2A // OR,X,Y,Z高于阈值 INT1_THS = 0x02 // INT1_DURATION = 0x03 // INT1_CFG = 0x2A // 通常,运动检测部分工作正常(感谢Miroslav)。我担心碰撞检测部分。阈值非常高(我不希望它在路上的每个碰撞中断)但是当没有应用高速加速时它仍然有时会中断。这是非常罕见但仍然会发生。 如果您对此有任何意见,我将不胜感激。 以上来自于谷歌翻译 以下为原文 Hello all My goal is to use two INT pins to generate two interrupts in a device which will be used in a car. INT2 will be pulled when a crash of the car is detected and INT1 when the car moves. Here is my init setting: CTRL_REG1 = 0x27 //10Hz, normal power mode, ZXY enable CTRL_REG2 = 0x01 // HP filter for INT1 CTRL_REG3 = 0x40 //IA1 enable CTRL_REG4 = 0x90 //4g | BDU CTRL_REG5 = 0x0A //latch on INT1 and INT2 CTRL_REG6 = 0x22 //active low & INT2 enable INT2_THS = 0x6D //~3500mg INT2_DURATION = 0x00 // 0.1*0s INT2_CFG = 0x2A //OR, X,Y,Z higher than threshold INT1_THS = 0x02 // INT1_DURATION = 0x03 // INT1_CFG = 0x2A // Generally, the motion detection part works fine (thanks to Miroslav). I am concerned about the crash detection part.The threshold is quite high (I don't want it to interrupt on every bump on the road) but it still sometimes interrupts when no hight acceleration is applied. It is very rare but still occurs. If you have any inputs to this I'll appreciate. |
|
相关推荐
4个回答
|
|
我认为阈值取决于传感器的位置和安装的刚度。
我不是汽车专家,但我认为3.5g的阈值不是很高,这个峰值可以在标准操作期间产生。 请注意有专属 http://www.st.com/content/st_com/en/products/mems-and-sensors/automotive-sensors.html?querycriteria=productId=SC1946 和加速度计,用于满量程100g或200g的空气回流。 以上来自于谷歌翻译 以下为原文 I think the threshold depends on the sensor location and stiffness of the mounting. I'm not expert on automotive but I think the threshold 3.5g is not so high, this peak value can be generated during standard operation. Please be aware there are dedicated http://www.st.com/content/st_com/en/products/mems-and-sensors/automotive-sensors.html?querycriteria=productId=SC1946 and accelerometer for airbacks which have full scale 100g or 200g. |
|
|
|
|
|
|
|
我想回到这个问题,因为我仍然在努力。
我修改了配置,看起来像这样: CTRL_REG1 = 0x27 // 10Hz,正常功耗模式,ZXY使能 CTRL_REG2 = 0x01 // INT1的HP过滤器 CTRL_REG3 = 0x40 // IA1启用 CTRL_REG4 = 0xB0 // 16g | BDU CTRL_REG5 = 0x0A //锁存在INT1和INT2上 CTRL_REG6 = 0x22 //低电平有效INT2启用 INT2_THS = 0x7F //最大值 INT2_DURATION = 0x00 // 0.1 * 0s INT2_CFG = 0x2A // OR,X,Y,Z高于阈值 INT1_THS = 0x01 // 186mg * 1 ????? INT1_DURATION = 0x03 //0.1s * 3 INT1_CFG = 0x2A // 现在,当阈值设置为186mg时,满量程16g,即使设备保持原位,它也会不断中断!将它改为372mg有帮助但对我来说太过分了。在满量程为8g且阈值为128mg之前,我没有这样的问题。这种行为可能是什么原因? 以上来自于谷歌翻译 以下为原文 I would like to go back to this question since I still struggle with it. I modified the configuration so it looks like this: CTRL_REG1 = 0x27 //10Hz, normal power mode, ZXY enable CTRL_REG2 = 0x01 // HP filter for INT1 CTRL_REG3 = 0x40 //IA1 enable CTRL_REG4 = 0xB0 //16g | BDU CTRL_REG5 = 0x0A //latch on INT1 and INT2 CTRL_REG6 = 0x22 //active low & INT2 enable INT2_THS = 0x7F //max INT2_DURATION = 0x00 // 0.1*0s INT2_CFG = 0x2A //OR, X,Y,Z higher than threshold INT1_THS = 0x01 //186mg * 1????? INT1_DURATION = 0x03 //0.1s * 3 INT1_CFG = 0x2A // Now with full scale 16g when the threshold is set to 186mg it constantly interrupts, even when the device remains in place! Changing it to 372mg helps but it is too much for me. Before when full scale was 8g and the threshold value was 128mg I didn't have such problems. What might be a reason of such behavior? |
|
|
|
这种行为的原因很可能是传感器的偏移。
以上来自于谷歌翻译 以下为原文 The reason of this behavior is most probably offset of the sensor. |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2711 浏览 1 评论
3235 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1807 浏览 1 评论
3643 浏览 6 评论
6030 浏览 21 评论
1332浏览 4评论
206浏览 3评论
194浏览 3评论
对H747I-DISCO写程序时将CN2的st-link复用为usart1,再次烧录时无法检测到stlink怎么解决?
348浏览 2评论
STM32G474RE芯片只是串口发个数据就发烫严重是怎么回事?
440浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-18 18:51 , Processed in 1.251411 second(s), Total 85, Slave 68 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号