• 发文章

  • 发资料

  • 发帖

  • 提问

  • 发视频

创作活动
0
登录后你可以
  • 下载海量资料
  • 学习在线课程
  • 观看技术视频
  • 写文章/发帖/加入社区
返回

电子发烧友 电子发烧友

  • 全文搜索
    • 全文搜索
    • 标题搜索
  • 全部时间
    • 全部时间
    • 1小时内
    • 1天内
    • 1周内
    • 1个月内
  • 默认排序
    • 默认排序
    • 按时间排序
  • 全部板块
    • 全部板块
大家还在搜
  • 如何使用HTPIC PICC编译器编写?

    project: a controller for my railway model .In my old projects i left ceck the flag on "

    2019-03-21 14:24

  • 光立方求修改

    ,0x89,0xf9,0x00,0xff,0x81,0x81,0xff,0x00,0xff,0x09,0x09,0x09,0x01,0x0,0x01,0x01,0xff,0x01,0x01,0x00};/*railway

    2013-11-11 16:20

  • 怎么实现CSD在GSM-R手持终端的设计?

    CSD在GSM-R手持终端有什么功能?怎么实现CSD在GSM-R手持终端的设计?

    2021-05-28 06:45

  • 怎么用LIS2DH检测运动

    大家好,我正在使用LIS2DH作为运动传感器,我正在使用运动检测的嵌入功能来驱动我的MCU的状态机。操作很简单,但我对传感器有些麻烦。如果持续时间是最小5秒,我想检测一个动作,如果持续时间是5秒,我想检测动作结束。所以我使用带有INT1输出的IA1功能进行检测运动。并且IA2具有INT2输出功能,用于运动结束检测。两个INT输出都可以通过检测,但我有非稳定的操作。有时INT1切换到原因,有时它是INT2 .....因此,如果您手持传感器,则在5秒后INT1输出为高电平。如果将传感器放在地板上,则在5秒后INT2输出为高电平。样本为1Hz,范围为2G。设置高过滤器。INT1_CFG设置为X,Y,Z或OR条件下的高电平检测INT2_CFG设置为低电平 检测X,Y,Z。或者条件INT1_duration& INT2_duration设置为0x05,以便有5秒的时间检测。INT1_threshold& INT2_threshold设置为0x02,以便具有高灵敏度。低于LIS2DH的设置:status_t LIS2DH_Init(void) { SPI1_Initialize(); CS_LIS1_SetHigh(); CS_LIS2_SetHigh(); LIS2DH_WriteReg(LIS2DH1,LIS3DH_CTRL_REG1,0x1F); LIS2DH_WriteReg(LIS2DH1,LIS3DH_CTRL_REG2,0x03); LIS2DH_WriteReg(LIS2DH1,LIS3DH_CTRL_REG3,0x40); LIS2DH_WriteReg(LIS2DH1,LIS3DH_CTRL_REG4,0x80); LIS2DH_WriteReg(LIS2DH1,LIS3DH_CTRL_REG5,0x00); LIS2DH_WriteReg(LIS2DH1,LIS3DH_CTRL_REG6,0x20); //开始检测 LIS2DH_WriteReg(LIS2DH1,LIS3DH_INT1_CFG,0×02); LIS2DH_WriteReg(LIS2DH1,LIS3DH_INT1_THS,0×02); LIS2DH_WriteReg(LIS2DH1,LIS3DH_INT1_DURATION,0×05); //停止检测 LIS2DH_WriteReg(LIS2DH1,LIS3DH_INT2_CFG,0×15); LIS2DH_WriteReg(LIS2DH1,LIS3DH_INT2_THS,0×02); LIS2DH_WriteReg(LIS2DH1,LIS3DH_INT2_DURATION,0×05); 返回MEMS_SUCCESS;你能帮忙理解和解决这个问题吗?非常感谢您的支持。维尔弗里德以上来自于谷歌翻译以下为原文 HI everybody,I'm working with the LIS2DH for a motion sensor, and I'm using the embbeded functions of motion detection for drive the state machine of my MCU.The operation is simple, but I have some trouble with the sensor.I want to detect a movement if the duration is min 5sec, and I want to detect End of movement if the duration is 5sec.So I use the IA1 funtion with INT1 output for detection movement.And IA2 function with INT2 output for End of movement detection.Both INT output are OK with the detection, but I have non stable operation. Sometimes the INT1 toggles witout reason, sometime it's INT2.....So if you run with the sensor in your hand, the INT1 output is high after 5sec. And if you put the sensor on the floor, the INT2 output is high after 5sec.Sample is 1Hz ,Range is 2G.High filter is set.INT1_CFG is set to High level detection on X, Y , Z.OR conditionINT2_CFG is set to Low level detection on X, Y , Z.OR conditionINT1_duration & INT2_duration are set to 0x05 in order to have 5sec of time detection.INT1_threshold & INT2_threshold are set to 0x02, in order to have high sensivity.Below the setting of the LIS2DH:status_t LIS2DH_Init(void) { SPI1_Initialize(); CS_LIS1_SetHigh(); CS_LIS2_SetHigh(); LIS2DH_WriteReg(LIS2DH1,LIS3DH_CTRL_REG1,0x1F); LIS2DH_WriteReg(LIS2DH1,LIS3DH_CTRL_REG2,0x03); LIS2DH_WriteReg(LIS2DH1,LIS3DH_CTRL_REG3,0x40); LIS2DH_WriteReg(LIS2DH1,LIS3DH_CTRL_REG4,0x80); LIS2DH_WriteReg(LIS2DH1,LIS3DH_CTRL_REG5,0x00); LIS2DH_WriteReg(LIS2DH1,LIS3DH_CTRL_REG6,0x20); //START detection LIS2DH_WriteReg(LIS2DH1,LIS3DH_INT1_CFG,0x02); LIS2DH_WriteReg(LIS2DH1,LIS3DH_INT1_THS,0x02); LIS2DH_WriteReg(LIS2DH1,LIS3DH_INT1_DURATION,0x05); //STOP detection LIS2DH_WriteReg(LIS2DH1,LIS3DH_INT2_CFG,0x15); LIS2DH_WriteReg(LIS2DH1,LIS3DH_INT2_THS,0x02); LIS2DH_WriteReg(LIS2DH1,LIS3DH_INT2_DURATION,0x05); return MEMS_SUCCESS; }Could you please help to understant and solve this problème?Thanks a lot for your support.wilfried

    2019-03-15 07:29