Skip to main content
Visitor II
March 12, 2018
Question

H3LIS331DL interrupt inconsistancy

  • March 12, 2018
  • 1 reply
  • 1285 views
Posted on March 12, 2018 at 23:50

Hi,

I am working on a project where we are using the H3LIS331DL accelerometer.

I am trying to understand what is happening with the interrupts, because I see some inconsistant behaviour.

I got the following samples sampled at 400Hz with a max range of 200g. The threshold is set to 2, which should correspond to a value of 512 in the data registers ((2/128)*32768). I have the latched option enabled and configured INT1 for the threshold interrupt and enabled the high pass filter for data and interrupt generation.

X:288       Y:416    Z:-1648  (INT1 NOT active)

X:

-272     

Y:

-144    

Z:

400   

(

INT1 active

)

X:

32        

Y:

-64      

Z:

576   

(

INT1 active

)

The 1st sample has no interrupt, but the 2nd and 3th do have the interrupt active, why is that? I expected the 1st and the 3th sample to generate an interrupt, not the 2nd.

Secondly I noticed some other data i could not wrap my head around. Here a 4 sample, sampled in succession:

X:464

     Y:

256

Z:

-2144    

(

INT1 NOT active

)

X:

-224

    Y:

-80

Z:

192      

(

INT1 NOT active

)

X:

-96

     Y:

-80

Z:

496       

(

INT1 NOT active

)

X:

-16

     Y:

32

  

Z:

528       

(

INT1 NOT active

)

None of these sample values generated an interrupt!! I expected -2144 and 528 to give me an interrupt.

In the same set of samples I also have the following samples:

X:

32

     Y:

16

  

Z:

0         

 (

INT1 NOT active

)

X:

96

     Y:

160

Z:

-400   

(

INT1 active

)

X:

-96

    Y:

-32

Z:

176      

(

INT1 active

)

X:

-80

     Y:

-32

Z:

256   

 (

INT1 NOT active

)

Interrupt was activated, but the data did never reach the threshold!

Can anyone explain this?

Edit:

After investigating the INT1_SRC value in more detail I sometimes saw the ZH, XH or YH bit set, but the IA was not.

can anyone please explain what is happening?

I have interrupts enabled for a high events on all axis.

Thank you.

    This topic has been closed for replies.

    1 reply

    ST Employee
    March 16, 2018
    Posted on March 16, 2018 at 10:19

    Please provide your exact sensor configuration (register + value).

    Visitor II
    March 16, 2018
    Posted on March 16, 2018 at 14:51

    WHO_AM_I : Read only

    CTRL_REG1 : 0x37

    - normal mode.

    - 400Hz.

    - X, Y and Z axis enabled.

    CTRL_REG2 : 0x14

    - High-pass filter normal mode.

    - data from internal filter sent to output register.

    - High-pass filter enabled for interrupt 1 source.

    CTRL_REG3 : 0x04

    - Interrupt request latched on INT1_SRC register

    CTRL_REG4 : 0x90

    - 200g full scale selection

    - output registers not updated between MSB and LSB reading

    CTRL_REG5 : 0x00

    - Sleep-to-wake function is disabled

    HP_FILTER_RESET : Read only

    REFERENCE : 0x00

    STATUS_REG : Read only

    OUT_X_L

     

    : Read only

    OUT_X_H

     

    : Read only

    OUT_Y_L

     

    : Read only

    OUT_Y_H

     

    : Read only

    OUT_Z_L

     

    : Read only

    OUT_Z_H

     

    : Read only

    INT1_CFG : 0x2A

    - OR combination of interrupts

    - Enable interrupt generation on X, Y and Z high events

    INT1_SRC : Read only

    INT1_THS : 0x02

    INT1_DURATION : 0x00

    INT2_CFG : 0x00

    INT2_SRC : Read only

    INT2_THS : 0x00

    INT2_DURATION : 0x00

    edit 19-3-18:

    fixed CTRL_REG2 configuration typo.

    ST Employee
    March 19, 2018
    Posted on March 19, 2018 at 15:59

    OK, I see the problem.

    In the configuration CTRL_REG2 : 0x18 you enabled the high pass filter for interrupt  2 source, but then you configured interrupt one (INT1_CFG : 0x2A, INT1_THS : 0x02). So the data without high pass filter are compered with the threshold in the interrupt 1.

    0690X0000060AAAQA2.png

    You should set the CTRL_REG2 to 0x14.