完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,
我正在使用以下寄存器设置来配置LIS2DH12以在INT1引脚上产生FIFO水印中断,但是INT1引脚始终保持低电平,我不确定我缺少什么。 INT1直接连接到设置为输入的MCU GPIO引脚。 以下是我目前使用的寄存器设置: //启用BDU,CTRL_REG4 = 0x80 LIS2DH12_SetBDU(LIS2DH12_ENABLE); //设置为正常功耗模式,10位ACC数据,CTRL_REG1 = 0x00,CTRL_REG4 = 0x80 LIS2DH12_SetMode(LIS2DH12_NORMAL); //满量程选择,CTRL_REG4 = 0x80 LIS2DH12_SetFullScale(LIS2DH12_FULLSCALE_2); //启用轴,CTRL_REG1 = 0x07 LIS2DH12_SetAxesEnabled(LIS2DH12_X_ENABLE | LIS2DH12_Y_ENABLE | LIS2DH12_Z_ENABLE); //将ODR设置为1Hz, CTRL_REG1 = 0x17 LIS2DH12_SetODR(LIS2DH12_ODR_1Hz); //将FIFO水印设置为24,FIFO_CTRL_REG = 0x18 LIS2DH12_SetWaterMark( 24 ); //在INT1上设置Fifo水印中断,CTRL_REG3 = 0x04 LIS2DH12_Setint1Pin( LIS2DH12_WTM_ON_INT1_ENABLE ); //中断1锁存使能,CTRL_REG5 = 0x08 LIS2DH12_Int1LatchEnable(LIS2DH12_ENABLE); //启用fifo模式, CTRL_REG5 = 0x48 ,FIFO_CTRL_REG = 0x58 LIS2DH12_FIFOModeEnable(LIS2DH12_FIFO_MODE); 几秒钟后,我读取了FIFO_SRC_REG寄存器,FSS [4:0]字段正在计数, 最后是FIFO_SRC_REG = 0xDF的值。因此我认为FIFO工作正常, 但是我无法获得INT1的FIFO水印中断。 一个 关于如何正确配置中断的建议将不胜感激。 谢谢。 #incelegrometer-lis2dh12-configure#lis2dh12 #no-interrupt 以上来自于谷歌翻译 以下为原文 Hello, I am using following resister setting to config the LIS2DH12 to generate FIFO watermark interrupt on INT1 pin, however the INT1 pin always stays LOW, I am not sure what I am missing. INT1 is connect directly to the MCU GPIO pin which set to input. Here are the register settings I'm currently using: //Enable BDU, CTRL_REG4 = 0x80 LIS2DH12_SetBDU(LIS2DH12_ENABLE ); // Set to normal power mode, 10bit ACC data, CTRL_REG1 = 0x00, CTRL_REG4 = 0x80 LIS2DH12_SetMode(LIS2DH12_NORMAL ); // Full scale selection, CTRL_REG4 = 0x80 LIS2DH12_SetFullScale(LIS2DH12_FULLSCALE_2); // Enable axes, CTRL_REG1 = 0x07 LIS2DH12_SetAxesEnabled(LIS2DH12_X_ENABLE | LIS2DH12_Y_ENABLE | LIS2DH12_Z_ENABLE); // set ODR to 1Hz, CTRL_REG1 = 0x17 LIS2DH12_SetODR(LIS2DH12_ODR_1Hz); // set FIFO watermark to 24, FIFO_CTRL_REG = 0x18 LIS2DH12_SetWaterMark( 24 ); // set Fifo watermark interrupt on INT1, CTRL_REG3 = 0x04 LIS2DH12_SetInt1Pin( LIS2DH12_WTM_ON_INT1_ENABLE ); // Interrupt 1 Latch enable, CTRL_REG5 = 0x08 LIS2DH12_Int1LatchEnable(LIS2DH12_ENABLE); // enable fifo mode, CTRL_REG5 = 0x48 , FIFO_CTRL_REG = 0x58 LIS2DH12_FIFOModeEnable(LIS2DH12_FIFO_MODE); After few seconds, I read the FIFO_SRC_REG register, the FSS[4:0] field is counting up, and finally the value of FIFO_SRC_REG = 0xDF. Therefore I think FIFO is working, however I cannot get the FIFO watermark interrupt for INT1. A ny suggestion on how to configure the interrupt correctly would be greatly appreciated. Thank you. #accelerometer-lis2dh12-configure #lis2dh12 #no-interrupt |
|
相关推荐
2个回答
|
|
你好,
有谁可以帮我看看上面的注册设置? 我想在INT1上配置fifo水印中断。 但 INT1引脚始终保持低电平。 非常感谢你。 以上来自于谷歌翻译 以下为原文 Hello, Could anyone please help me to take a look the above register setting? I want to config the fifo watermark interrupt on INT1. but the INT1 pin always stays LOW. Thank you very much. |
|
|
|
米罗斯拉夫,
是的,我用范围检查了INT1上的级别,它始终保持低位。 由于寄存器配置正确(通过回读确认),所以我认为问题可能是由于PCB或MCU造成的。 非常感谢您的帮助。 以上来自于谷歌翻译 以下为原文 Miroslav, Yes, I checked the level on INT1 with scope, it always stays low. Since the register configuration is correct (confirmed by read back) , so I think the problem may due to the PCB or MCU. Thank you very much for your help. |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2574 浏览 1 评论
3192 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1761 浏览 1 评论
3587 浏览 6 评论
5965 浏览 21 评论
922浏览 4评论
1296浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
561浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
1284浏览 3评论
1336浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-5 05:54 , Processed in 0.888940 second(s), Total 48, Slave 41 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号