cancel
Showing results for 
Search instead for 
Did you mean: 

LIS2DH12: 6d movement detection

Madhusudhan K
Associate

I'm using LIS2DH12 and trying to implement 6d movement detection.

Below is my present flow on startup.

  1. Set ODR to 25Hz in CTRL_REG1
  2. Enable i1_ia1 in CTRL_REG3
  3. Set full scale to 2g in CTRL_REG4
  4. Set aoi to 0 and remaining bits to 1 in INT1_CFG
  5. Set threshold to 0x10 in INT1_THS
  6. Set duration to 0x06 in INT1_DURATION

But the interrupt is not getting generated when there is a movement.

2 REPLIES 2
Eleon BORLINI
ST Employee

Hi @Madhusudhan K​ , try with the indications in the LIS2DH12 app note (AN5005 p. 28). Are you interested in 6D position or in 6D movement recognition? You can btw try with this pseudocode:

1. Write 57h into CTRL_REG1 // Turn on the sensor, enable X, Y, and Z // ODR = 100 Hz
2. Write 00h into CTRL_REG2 // High-pass filter disabled
3. Write 40h into CTRL_REG3 // Interrupt activity 1 driven to INT1 pad
4. Write 00h into CTRL_REG4 // FS = ±2 g
5. Write 08h into CTRL_REG5 // Interrupt 1 pin latched
6. Write 21h into INT1_THS // Set 6D movement threshold = 515mg (higher than yours at 250mg)
7. Write 03h into INT1_DURATION // Set minimum event duration (lower than yours)
8. Write 4Ah into INT1_CFG // Configure 6D movement recognition on the X and Y-axis
9. Poll INT1 pad; if INT1 = 0 then go to 10 // Poll INT1 pin waiting for the free-fall event
10. (6D movement recognition event has occurred; insert your code here) // Event handling
11. Read INT1_SRC register // Clear interrupt request
12. Go to 9

Regards

Madhusudhan K
Associate

Hi,

I'm looking for 6D movement recognition.

I have tried your flow but I'm not getting any interrupt on the INT1 pin.