cancel
Showing results for 
Search instead for 
Did you mean: 

LIS2DH Accelerometer Interrupts

Cesco Gar
Associate II
Posted on February 20, 2017 at 17:55

Hi,

I have a problem to make interrupts (INT1 exactly) work with my LIS2DH12 Accelerometer.

What I am trying to do is to make the int1 trigger when there is a Y-axis high event (or low event).

I have setted all the required Registers for INT1 but it seems it is not working and I have even tried to look with an oscilloscope to see if it is doing something, but the results are still negative.

I have read some posts before making this one but the answers weren't helpful for me.

Can someone write down how they setted theirs interrupt registers to make them work correctly?

Some additional information:

1- I don't need the HPCF so I have deactivated it (I think it is deactivated by default, if I remember correctly)

2- The REGs I have changed are: CTRL_REG3, CTRL_REG4, INT1_CFG, INT1_THS, INT1_DUR

3- The temp and XYZ-axis are working correctly

Thank you for the help

#lis2dh

Note: this post was migrated and contained many threaded conversations, some content may be missing.
17 REPLIES 17
Miroslav BATEK
ST Employee
Posted on February 20, 2017 at 22:10

Can you please provide your complete sensor settings? I can check it.

Cesco Gar
Associate II
Posted on February 21, 2017 at 08:24

The actual settings are like this in my Initialization:

REG_1     0x7F

REG_2     0x00

REG_3     0x40

REG_4     0x80    (BDU activated for the temperature data)

REG_5     0x00    

REG_6     0x00

REFERENCE     0x00

INT1_THS     0x0F

INT1_DUR    0x01

INT1_CFG    0x04

And I activate the temperature device, but I think it doesn't influence interrupts. I will write it down in case it is necessary

Posted on February 21, 2017 at 10:15

I don't see any issue in your settings, I replicated it and the interrupt is working fine.

Can you please check your interrupt connection. I suppose the INT1 pin is connected to some MCU. Can you please check the MCUs pin is configured as input, so there is no collision.

Cesco Gar
Associate II
Posted on February 22, 2017 at 09:16

I have soldered a wire on the MCU (to make sure I don't miss the signal) and the interrupt pin of the PIC is setted as input correctly. I am pretty confused.

Anyway, thank you in advance for the help

Posted on February 28, 2017 at 11:45

Now I have another problem, the temperature device stopped working without advice, when I ask to it the temeprature data it gives me back 0x00 as H and 0xFF as L. I haven't re-soldered the PCB and i haven't done any modification to the PCB/hardware. I am starting to lose hope....

Cesco Gar
Associate II
Posted on March 09, 2017 at 10:13

Since we had problems with the INT1 pin, we decided to use the INT2 pin to send interrupts to the PIC. Can you please tell me an INT2 registers configuration of the accelerometer that you are sure it's going to work?

We need that when we move a little the board where it is soldered the accelerometer, it will trigger the interrupt on the INT2 Pin.

P.S.: I tested the interrupt routine on the PIC to make sure that it is working when triggered, so now it is only an accelerometer settings problem.

Thank you very much for the help, I hope that this thread isn't going to be ignored

Posted on March 10, 2017 at 10:30

Please see below configuration of LIS2DH. The registers related to INT2 and Interrupt generator are highlighted.

Please adjust the threshold and duration parameters according to you needs.

0690X00000606WqQAI.png

Here is an example, showing functional interrupts.

0690X00000606XPQAY.png
Posted on March 10, 2017 at 16:32

Thank you very much, I will try it the sooner I can 

Posted on March 15, 2017 at 10:22

I tried your settings and the interrupts are working now.

I have some other questions:

1- In the INT2_CFG register: the XHIE bit, in the description there is written that the interrupt generation happens on X-axis high event. The meaning of this is that the interrupt triggers from active-high and goes low or that the interrupt triggers when there is a reading higher than the Threshold setted?

2- In the CTRL_REG6 register: the H_LACTIVE bit, interrupt active-high means that the interrupt pin is normally high and goes low on an int event?

Thank you for your patience and for the help