完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,
我正在研究一些运动检测产品。 选择LIS2HH12作为运动检测器。我们想在中断模式下使用它。 不幸的是,我们没有在INT1引脚上获得任何信号,用o观察 scilloscope 。真可惜T_T.My的配置顺序如下,您能帮忙提一些建议吗? //启动检查SPI总线 GSENSOR :: LIS2HH_set_mode:WHO_AM_I = 41 [spi] //重置芯片 GSENSOR :: LIS2HH_set_mode:RESET //读取regs以检查重置状态 GSENSOR :: LIS2HH_set_mode:STATUS = FF [spi] GSENSOR :: LIS2HH_set_mode:CTRL5 = 00 [spi] // setup GSENSOR :: LIS2HH_set_mode:CTRL1 = 3F [spi] GSENSOR :: LIS2HH_set_mode:CTRL2 = 00 [spi] GSENSOR :: LIS2HH_set_mode:CTRL3 = 09 [spi] GSENSOR :: LIS2HH_set_mode:CTRL4 = 04 [spi] GSENSOR :: LIS2HH_set_mode:CTRL5 = 00 [spi] GSENSOR :: LIS2HH_set_mode:CTRL7 = 0C [spi] //检查 GSENSOR :: LIS2HH_set_mode:STATUS = FF [spi] GSENSOR :: LIS2HH_set_mode:INT_SRC1 = 25 [spi] GSENSOR :: LIS2HH_set_mode:INT_SRC2 = 00 [spi] GSENSOR :: LIS2HH_set_mode:STATUS = FF GSENSOR :: LIS2HH_set_mode:val [0] = -437,x = -26.657000 mg GSENSOR :: LIS2HH_set_mode:val [1] = -169,y = -10.309000 mg GSENSOR :: LIS2HH_set_mode:val [2] = -16427,z =-1002.047000mg♯♯ #interrupt-driven#lis2hh12 以上来自于谷歌翻译 以下为原文 Hi, I am working on some motion detection product. LIS2HH12 is chosen as the motion detector. We want to use it in interrupt mode. Unfortunately, we failed to get any signal on INT1 pin, observing by an o scilloscope . What a shame T_T.My configuration sequence is as follow, could you please help to give some advice? // startup checking SPI bus GSENSOR::LIS2HH_set_mode: WHO_AM_I = 41 [spi] // reset the chip GSENSOR::LIS2HH_set_mode: RESET // read regs to check reset status GSENSOR::LIS2HH_set_mode: STATUS = FF [spi] GSENSOR::LIS2HH_set_mode: CTRL5 = 00 [spi]// setup GSENSOR::LIS2HH_set_mode: CTRL1 = 3F [spi] GSENSOR::LIS2HH_set_mode: CTRL2 = 00 [spi] GSENSOR::LIS2HH_set_mode: CTRL3 = 09 [spi] GSENSOR::LIS2HH_set_mode: CTRL4 = 04 [spi] GSENSOR::LIS2HH_set_mode: CTRL5 = 00 [spi] GSENSOR::LIS2HH_set_mode: CTRL7 = 0C [spi] // check GSENSOR::LIS2HH_set_mode: STATUS = FF [spi] GSENSOR::LIS2HH_set_mode: INT_SRC1 = 25 [spi] GSENSOR::LIS2HH_set_mode: INT_SRC2 = 00 [spi] GSENSOR::LIS2HH_set_mode: STATUS = FF GSENSOR::LIS2HH_set_mode: val[0] = -437, x = -26.657000 mg GSENSOR::LIS2HH_set_mode: val[1] = -169, y = -10.309000 mg GSENSOR::LIS2HH_set_mode: val[2] = -16427, z = -1002.047000 mg♯♯ #interrupt-driven #lis2hh12 |
|
相关推荐
1个回答
|
|
对您的评论配置:
- GSENSOR :: LIS2HH_set_mode:CTRL3 = 09 [spi] ...使能INT1引脚上的中断发生器1和DRDY(不好混合两个信号) - GSENSOR :: LIS2HH_set_mode:CTRL7 = 0C [spi] ...在INT2中启用中断发生器1和FIFO为空(为什么???) - 缺少中断发生器配置IG_CFG1,IG_THS_X1,IG_THS_Y1,IG_THS_Z1,IG_DUR1 所以我建议从以下配置开始: CTRL1 = 0x3F // 100Hz,X,Y,Z使能,BDU使能 CTRL2 = 0x02 //为中断发生器1启用高通滤波器。要检测运动,只需要改变加速度。 CTRL3 = 0x08 //在INT1中启用中断发生器 CTRL4 = 0x04 CTRL5 = 0x00 CTRL7 = 0x00 IG_CFG1 = 0x2A //中断条件X或Y或Z高于阈值 IG_THS_X1 = IG_THS_Y1 = IG_THS_Z1 = 0x0D //将阈值设置为100mg(根据需要调整) IG_DUR1 = 0x0A //将持续时间设置为100ms(根据需要调整) 以上来自于谷歌翻译 以下为原文 Comments to you configuration: - GSENSOR::LIS2HH_set_mode: CTRL3 = 09 [spi] ... enables Interrupt generator 1 and DRDY on pin INT1 (not good to mix the two signals) - GSENSOR::LIS2HH_set_mode: CTRL7 = 0C [spi] ... enables Interrupt generator 1 and FIFO empty in INT2 (why ???) - Missing interrupt generator configuration IG_CFG1, IG_THS_X1, IG_THS_Y1, IG_THS_Z1, IG_DUR1 So I recommend to start with following configuration: CTRL1 = 0x3F // 100Hz, X,Y,Z enable, BDU enable CTRL2 = 0x02 // High pass filter enabled for Interrupt generator 1. To detect a motion only change in acceleration is needed. CTRL3 = 0x08 // Enable interrupt generator in INT1 CTRL4 = 0x04 CTRL5 = 0x00 CTRL7 = 0x00 IG_CFG1 = 0x2A // Interrupt condition X or Y or Z is above threshold IG_THS_X1 = IG_THS_Y1 = IG_THS_Z1 = 0x0D // Set the threshold to 100mg (adjust according to you needs) IG_DUR1 = 0x0A // Set duration to 100ms (adjust according to you needs) |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2732 浏览 1 评论
3241 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1810 浏览 1 评论
3650 浏览 6 评论
6038 浏览 21 评论
1339浏览 4评论
200浏览 3评论
对H747I-DISCO写程序时将CN2的st-link复用为usart1,再次烧录时无法检测到stlink怎么解决?
350浏览 2评论
STM32G474RE芯片只是串口发个数据就发烫严重是怎么回事?
442浏览 2评论
STM32处理增量式编码器Z信号如何判断中断是正转的还是反向转的?
273浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-23 16:14 , Processed in 1.254894 second(s), Total 75, Slave 59 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号