2017-02-20 08:55 AM
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.2017-02-20 01:10 PM
Can you please provide your complete sensor settings? I can check it.
2017-02-20 11:24 PM
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
2017-02-21 02:15 AM
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.
2017-02-22 12:16 AM
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
2017-02-28 03:45 AM
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....
2017-03-09 01:13 AM
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
2017-03-10 02:30 AM
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.
Here is an example, showing functional interrupts.
2017-03-10 08:32 AM
Thank you very much, I will try it the sooner I can
2017-03-15 03:22 AM
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