AnsweredAssumed Answered

LIS3DH interrupts again

Question asked by Rob Meades on Jul 4, 2018
Latest reply on Jul 6, 2018 by Rob Meades

I intend to use the LIS3DH as a very low power activity detector but have had no success in getting its interrupt output to behave in my application: I can make it stay always on or always off but never does it react to motion.

 

To retain my sanity, I have gone back to the application note and written code which does exactly what the application note (section 6.3.3) says but I can't make that work either: I can see the X/Y/Z values changing but the IA bit in INT1_SRC is never set, no matter how violently I shake the chip (which is on an STEVAL-MKI105V1 board attached via I2C).  What am I doing wrong? Help!

 

My code (in mbed-os, running on an STM32F437VG) is attached to this post, its output is below:

Read I_AM_LIS3DH (0x0f): 0x33.
Write CTRL_REG1 (0x20): 0x57.
Write CTRL_REG2 (0x21): 0x09.
Write CTRL_REG3 (0x22): 0x40.
Write CTRL_REG4 (0x23): 0x00.
Write CTRL_REG5 (0x24): 0x08.
Write INT1_THS (0x32): 0x10.
Write INT1_DURATION (0x33): 0x00.
Read REFERENCE (0x26): 0x00.
Write INT1_CFG (0x34): 0x2a.
Read INT1_SRC (0x31): 0x00.
Read X 64 Y 64 Z 65472.
Read INT1_SRC (0x31): 0x00.
Read X 65472 Y 65472 Z 0.
Read INT1_SRC (0x31): 0x00.
Read X 64 Y 0 Z 65472.
Read INT1_SRC (0x31): 0x00.
Read X 0 Y 65472 Z 0.
Read INT1_SRC (0x31): 0x00.
Read X 0 Y 0 Z 65472.
Read INT1_SRC (0x31): 0x00.
Read X 0 Y 64 Z 65472.
Read INT1_SRC (0x31): 0x00.
Read X 0 Y 65408 Z 0.
Read INT1_SRC (0x31): 0x00.
Read X 65472 Y 0 Z 0.
Read INT1_SRC (0x31): 0x00.
Read X 65408 Y 0 Z 65472.
Read INT1_SRC (0x31): 0x00.
...
Read X 0 Y 64960 Z 1088.
Read INT1_SRC (0x31): 0x00.
Read X 1088 Y 2496 Z 65088.
Read INT1_SRC (0x31): 0x00.
Read X 1216 Y 64832 Z 63808.
Read INT1_SRC (0x31): 0x00.
Read X 1408 Y 1280 Z 63424.
Read INT1_SRC (0x31): 0x00.
Read X 1792 Y 4608 Z 63168.
Read INT1_SRC (0x31): 0x00.
Read X 65472 Y 0 Z 64320.
Read INT1_SRC (0x31): 0x00.
Read X 256 Y 768 Z 1600.
Read INT1_SRC (0x31): 0x00.
Read X 1792 Y 3520 Z 2688.
Read INT1_SRC (0x31): 0x00.
Read X 128 Y 1216 Z 64576.
Read INT1_SRC (0x31): 0x00.
...

Rob

Attachments

Outcomes