ST意法半导体
直播中

乔婧

7年用户 258经验值
私信 关注
[问答]

LIS3DH如何正确配置INT2以使其工作?

你好!
我试图检测冲突并在INT1上产生中断,并检测运动并在INT2上产生中断。 INT1正常工作,但INT2不起作用。好像我错过了一些东西......
这些是我在寄存器中的值:

CTRL_REG0 = 0x90 //上拉与SDO / SA0断开pinCTRL_REG1 = 0x27 // HR /正常/低功耗模式(10 Hz),Z轴启用,Y轴启用,X轴启用
CTRL_REG2
= 0x01 //在中断时启用AOI功能的高通滤波器2CTRL_REG3 = 0x40 //启用INT1时IA1中断
CTRL_REG4 = 0x88 //输出寄存器直到MSB和LSB读取才会更新,启用高分辨率
CTRL_REG5 = 0x00 //正常模式,FIFO禁用,中断请求未锁存
CTRL_REG6 = 0x28 // INT2引脚使能中断2功能,使能活动中断


INT1_CFG = 0x95 //

和逻辑。启用XLIE,YLIE和ZLIE中断生成.INT1_THS

= 0x32 //阈值(THS)= 50LSBs 15.625mg / LSB = 781.25mgINT1_DURAtiON

= 0x00 //持续时间= 0LSBs(1 / 1Hz)= 0s.//0x78 - > 120s INT2_CFG = 0x95

//


和逻辑。启用XLIE,YLIE和ZLIE中断生成。
INT2_THS

= 0x08 //阈值(THS)= 8LSBs 15.625mg / LSB = 125mgINT2_DURATION

= 0x0A //持续时间= 10LSBs(1 / 1Hz)= 10s
有没有人知道如何正确配置INT2以使其工作?


谢谢!
#int2 #interrupt#lis3dh

以上来自于谷歌翻译


以下为原文




Hello!
I am trying to detect a collision and generate an interrupt on INT1, and also to detect motion and generate an interrupt on INT2. INT1 is working normally, but INT2 does not work. It seems I am missing something...
These are the values I put at registers:


  • CTRL_REG0 = 0x90  // Pull-up disconnected to SDO/SA0 pin
  • CTRL_REG1 = 0x27 // HR / Normal / Low-power mode (10 Hz), Z-axis enabled, Y-axis enabled, X-axis enabled

  • CTRL_REG2
    = 0x01 // High-pass filter enabled for AOI function on interrupt 2
  • CTRL_REG3 = 0x40  // IA1 interrupt on INT1 enabled
  • CTRL_REG4 = 0x88 // Output registers not updated until MSB and LSB reading, high-resolution enabled
  • CTRL_REG5 = 0x00 // Normal mode, FIFO disabled, interrupt request not latched
  • CTRL_REG6 = 0x28 // Interrupt 2 function on INT2 pin enabled, activity interrupt enabled
  • INT1_CFG = 0x95 //


    AND logic. Enable XLIE, YLIE and ZLIE interrupt generation.
  • INT1_THS

    = 0x32 // Threshold (THS) = 50LSBs  15.625mg/LSB = 781.25mg
  • INT1_DURATION

    = 0x00 // Duration = 0LSBs  (1/1Hz) = 0s.//0x78 --> 120s

  • INT2_CFG = 0x95

    //



    AND logic. Enable XLIE, YLIE and ZLIE interrupt generation.
  • INT2_THS

    = 0x08 // Threshold (THS) = 8LSBs  15.625mg/LSB = 125mg
  • INT2_DURATION

    = 0x0A // Duration = 10LSBs  (1/1Hz) = 10s

Does anybody know how to configure INT2 correctly to make it work?


Thanks!
#int2 #interrupt #lis3dh

回帖(1)

曾玲娟

2018-11-21 10:49:13
你能否定义碰撞检测和运动检测的条件?
你的中断生成配置在我看来有点奇怪。
1)以下设置
CTRL_REG2
 = 0x01启用中断发生器的高通滤波器2 2)
INT1_CFG = 0x95,如果所有轴的值都低于阈值,则要产生中断,因为在该中断发生器上使能了高通滤波器,在静止状态下条件为真且触发了中断
3)INT2_CFG = 0x95,
你想要产生中断,如果所有轴的值都低于0.125毫克10秒,这将很难生成,它将是相当长的自由落体:-),中断发生器2的高通滤波器未启用
我想,如果你改变,你会得到预期的行为
CTRL_REG2
 设置为0x02。

以上来自于谷歌翻译


以下为原文




Can you please define the conditions for collision detection and motion detection?
Your interrupt generation configuration seems to me little bit strange.
1) Following settings
CTRL_REG2
= 0x01 enables high pass filter for interrupt generator  not 2 2)
INT1_CFG = 0x95, you want to generate interrupt if the value in all axis is bellow threshold, as the high pass filter is enabled on this interrupt generator, the condition is true in still state and the interrupt is triggered

3) INT2_CFG = 0x95,
you want to generate interrupt if the value in all axis is bellow threshold 0.125mg for 10s which will be very difficult to generate, it would be quite long free fall :-), the high pass filter for interrupt generator 2 is not enabled


I guess, you will get expected behavior if you change
CTRL_REG2
settings to 0x02.
举报

更多回帖

发帖
×
20
完善资料,
赚取积分