cancel
Showing results for 
Search instead for 
Did you mean: 

LIS3DH configuration setting for INT2

Rajeev Piyare
Associate III

I have seen that this query has been asked previously but there was no answer to it.

Therefore, I am raising the issue again here as follows:

Currently, I am using INT1 for free fall detection which is already outlined in the AN3308 application note. Together with this, I would like to use INT2 pin for shock detection.

So my question is what would be the sequence of settings to correctly configure LIS3DH INT2 for doing so. For shock detection, the idea is to do an interrupt where X || Y || Z (Logical OR) have a large acceleration signal for a certain amount of time (let's say over 5 or 10s).

Some parameter values would be really helpful for starter.

Thanks....

1 REPLY 1
Rajeev Piyare
Associate III

After digging into the data sheet and the application note, I came up with the following parameter values. In particular, the SW routine that configures the device to detect shock events and to signal them is the following: 

1. Write 77h into CTRL_REG1            // Turn on the sensor, enable X, Y, and Z with ODR = 400Hz
2. Write 09h into CTRL_REG2           // High-pass filter enabled
3. Write 40h into CTRL_REG3           // Interrupt activity 1 driven to INT2 pad
4. Write 00h into CTRL_REG4           //FS=±2g
5. Write 02h into CTRL_REG5           // Interrupt 2 pin latched
6. Write 16h into INT2_THS           // Set shock threshold = 350 mg
7. Write 03h into INT2_DURATION // Set minimum event duration
8. Write 2Ah into INT2_CFG             // Configure shock recognition: OR logic with high XYZ amplitude
9. Poll INT2 pad; if INT2=0 then go to 10  // Poll INT2 pin 
10.(Shock event has occurred; insert code here)
11. Read INT2_SRC register             // Clear interrupt request
12. Go to 9

However, I still need a confirmation if the following parameters are correct. How to set INT2_DURATION for like 5 or 10s window?

Thanks