完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
喜
配置LIS3DSH的状态机后,我无法获得中断。你能给我一些例子吗?我的代码如下: LIS3DSH_Write_Byte(CTRL_REG1,(u8)0x01); //使能SM1,SM1中断路由到INT1 LIS3DSH_Write_Byte(CTRL_REG3,(u8)0x48); //中断信号有效高电平,中断锁定,INT1信号使能 LIS3DSH_Write_Byte(CTRL_REG4,(u8)0x57); //启用X,Y,Z,ODR = 50 Hz。 LIS3DSH_Write_Byte(CTRL_REG5,(u8)0x00); //滤波器带宽800 Hz,+ / - 2g,禁用自检 LIS3DSH_Write_Byte(tiM3_1,(u8)20); // Timer3 1000ms LIS3DSH_Write_Byte(ST1_0,TI3); // SM1状态1 LIS3DSH_Write_Byte(ST1_1,CONT); // SM1状态2 #tech 以上来自于谷歌翻译 以下为原文 hi, I can't get the interrupt after configuring the state machine of LIS3DSH. Could you give me some examples. My code as following: LIS3DSH_Write_Byte(CTRL_REG1, (u8)0x01);//enable SM1, SM1 interrupt routed to INT1 LIS3DSH_Write_Byte(CTRL_REG3, (u8)0x48);//Interrupt signal active HIGH, Interrupt locked, INT1 signal enabled LIS3DSH_Write_Byte(CTRL_REG4, (u8)0x57);//X, Y, Z enabled, ODR = 50 Hz. LIS3DSH_Write_Byte(CTRL_REG5, (u8)0x00);//filter bandwidth 800 Hz, +/-2g, Self-test Disabled LIS3DSH_Write_Byte(TIM3_1, (u8)20);//Timer3 1000ms LIS3DSH_Write_Byte(ST1_0, TI3);//SM1 state 1 LIS3DSH_Write_Byte(ST1_1, CONT);//SM1 state 2 #tech |
|
相关推荐
1个回答
|
|
|
我不记得定时器是否引起了中断,我不这么认为。我记得这个加速度计有一个设置,默认情况下禁用,当达到停止或继续状态时会导致中断,也许你可以启用它,看看当它到达那个状态时是否会弹出中断。看着你:
4.34 此外,您可以通过将数据就绪中断和Fifo设置为流模式或任何其他中断(fifo full等)来检查中断是否实际有效。我个人遇到了一些问题,没有收到断线和中断,但加速度计工作正常。 以上来自于谷歌翻译 以下为原文 I don't remember if the timer caused an interrupt, I don't think so. I recall this accelerometer had a setting, by default disabled, that caused an interrupt when reaching an stop or continue state, maybe you could enable this and see if the interrupt pops when it reaches that state. Looked it for you: 4.34 Also, you could check that the interrupt actually works by setting the Data Ready interrupt and Fifo to stream mode, or any other interrupt (fifo full, etc). I've personally had some problems with broken traces and interrupts not being received but the accelerometer was working ok. |
|
|
|
|
只有小组成员才能发言,加入小组>>
stm32mp157的异核通信的rpmsg_sdb的m4固件和a7驱动该如何编写?
1472 浏览 0 评论
stm32f103用freertos对一个采样率为1kHz的传感器,进行采样,数据出差
1526 浏览 0 评论
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
3674 浏览 1 评论
3864 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
2483 浏览 1 评论
STM32H7打开DCache后,出现了串口接收信息为空的现象,是哪里出了问题?
752浏览 5评论
用NANO STM32F103RBT6的开发板烧录不了是哪里出了问题?
685浏览 5评论
730浏览 5评论
外部中断触发类型为双边沿触发,进入中断回调后有什么办法判断该边沿是上升沿还是下降沿?
977浏览 5评论
STM32L071CBT6低温环境下无法正常工作是什么原因引起的?
780浏览 5评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-15 05:50 , Processed in 2.888078 second(s), Total 73, Slave 57 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
2779