LSM303DLHC - FIFO in trigger mode

Am I reading the LSM303DLHC data sheet correctly ?

If I wish to use the FIFO in Trigger mode, I can set it to trigger when any Accelerometer axis value is over a set threshold OR under a set threshold - BUT NOT both active at the same time ?

In other words, if I want to use FIFO mode, and trigger upon X axis being < -20 OR > 80 … I am out of luck ?

I read somewhere that the trigger threshold value is used with an ABS function so, I could set the threshold value to 40, and it would trigger when the X axis is < -40 or > +40 … is that correct ?

Thank you for “manufacturer product support” - I wish ST was as responsive as people here :slight_smile:

I see the LIS3DH is a much better source of information.

I see now that I may not be able to use the FIFO as I wished.

I wanted to have a very high ODR so I might capture events that were very short duration. I thought I’d set high ODR, and stream to FIFO mode, program a threshold, and then wait. When an event over the threshold occurred, I’d begin reading the FIFO - to get an idea what happed 30 cycles before the trigger.

I see I’d need to read the FIFO entirely in the period of one ODR - impossible with even I2c of 400 kHz.

Hi, accny.

What you stated in your first post matches my understanding of how triggering works. We’ve also noticed that the info in the ST datasheets can sometimes be scattered or lacking, and that it is occasionally useful to look at documents for related sensors (like you did for the LIS3DH) for better explanations of how some features work.

I haven’t tried using the FIFO much. Why would you need to read the entire FIFO within one ODR period?

- Kevin

Hi Kevin,

I believe I miss-interpreted the app note explanation.

It said on page 49 “It is suggested to read all FIFO slots in a multiple byte reading of 196 bytes (6 output registers by 32 slots) faster than 1*ODR.”

I now believe that means you have to do that if you do NOT want to loose ANY data readings.

I believe I can set the threshold to whatever, enable the FIFO in Stream-to-FIFO mode, and wait for the trigger event. It will automatically switch to FIFO mode at that point (and likely be filled by then). It would have stopped filling the FIFO, and I can take as long as I want to retrieve the FIFO data, transmit it to my PC via a “slow” serial link (115200 baud), then set up the device to do the same thing.

I’d be happy getting the 30 readings just before the trigger event(s).

I wish I could just set it to the ODR of 5376 hz, and get every single XYZ reading. That just isn’t possible when I am running a two chip circuit (max232 and 80x51) at 29 mhz, and transmitting at 115200 baud. So, the FIFO option is the next best thing.

Thanks again !

That sounds reasonable. Let us know if it ends up working for you!

- Kevin