AnsweredAssumed Answered

Best Approach Using the LIS3DSH Accelerometer?

Question asked by Terence D on May 27, 2018
Latest reply on May 29, 2018 by Miroslav B

Hi, I'm using an LIS3DSH in a case where I want to periodically (say once every 50 milliseconds) get the most recent X,Y,Z position of the accelerometer and perform a calculation.


My current approach is to just set a timer on my MCU to interrupt every 50 milliseconds.  During this interrupt routine I simply query the OUT_X, OUT_Y and OUT_Z registers of the LIS3DSH and then immediately perform my calculations.


I've configured the block data update value (in register CTRL_REG4) on the LIS3DSH to "continuous" and I'm not using the FIFO feature either (FIFO_CTRL = "Bypass mode: FIFO turned off").  Additionally, I've configured the output data rate (in register CTRL_REG4) to 100 Hz.  


Am I correct to believe this will result in the OUT_X, OUT_Y and OUT_Z register values continually being updated with the very latest accelerometer position data every 10 milliseconds?


If so, this would make a worst case scenario of the X, Y, Z position data being 10 milliseconds old when performing my calculation, which is within my requirements.


I'd very much appreciate any feedback on my above approach being incorrect or less than optimal in any way.  Thanks.