cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the acceleration sample corresponds to the exact time when the interrupt is triggered?

Kefei Yao
Associate III
Posted on March 09, 2018 at 11:44

The LIS3DH is configured to use INT1 to interrupt the MCU when the acceleration value on any of the 3 axis exceed the threshold that is set by the MCU. Firstly, as my understanding, the LID3DH does not stop sampling acceleration data even if the interrupt is triggered (even in stream-to-fifo mode, it does not stop sampling until the fifo gets full). Is this correct? If it's correct, is there a good way to get the acceleration data corresponds to the exact time when the interrupt is triggered? Thanks.

11 REPLIES 11
Posted on March 23, 2018 at 15:01

It really depends on you application, if you think the interrupt can come quickly after FIFO is flushed you have to take care also the case 2.

Posted on March 26, 2018 at 09:20

Thanks for the reply.

It's not necessarily a different trigger that comes quickly enough can cause case 2. If the original trigger last long enough and the interrupt is latched for that trigger, the trigger will actually cause more than 1 interrupt. Once the first interrupt is unlatched, the second interrupt will come. 

Have your chip design team consider store the trigger index at the fifo buffer in a register? For example, if the data that trigger the interrupt is stored at fifo[11],fifo[12],fifo[13] (duration set to 3) the trigger index is set to 11 in that register. That would be easier for the application to determine the trigger data.