cancel
Showing results for 
Search instead for 
Did you mean: 

LSM303D FIFO operation

giannisroussos0
Associate II
Posted on February 13, 2015 at 12:54

Hi, I am developing an application using the LSM303D connected via SPI to continuously log the acceleration. I want to use the embedded FIFO to minimise the processor load but cannot find the correct configuration. The datasheet is not very clear about FIFO operation, e.g. the maximum FIFO depth is not stated.

I have set up the LSM303D as follows:

CTRL0 = 0x60;

CTRL1 = 0x3F;

CTRL2 = 0xD8;

CTRL3 = 0x80;

CTRL4 = 0x01;

CTRL5 = 0x03;

CTRL6 = 0x20;

CTRL7 = 0x02;

FIFO_CTRL = 0x29;

During initialisation I stop acceleration and magnetometer functions, set up the device as above and then restart only acceleration sampling.

What I see is that while all measurements are stopped, the STATUS_A is 0x08, i.e. a new X,Y,Z data set is available, no matter how fast I readback the acceleration values. Then, after I re-enable the accelerometer, STATUS_A becomes 0xFF but no INT2 trigger is detected.

Is there an example code or procedure for correct FIFO operation? None of the software libraries for the LSM303 family I have found use  the FIFO (some do not use interrupts at all).

Thank you in advance,

Giannis

#lsm303d
1 REPLY 1
giannisroussos0
Associate II
Posted on February 25, 2015 at 15:43

I made a request to ST online support and ST support informed that the LSM303D integrates the

LSM303D integrates the ''LIS3DSH'' accelerometer and suggested I read chapter 10 of http://www.st.com/st-web-ui/static/active/en/resource/technical/document/application_note/DM00026768.pdf

From the datasheet the two devices seem to have many differences, however FIFO operation seems to be similar. The

LIS3DSH

document is much more detailed and using this I managed to get the FIFO working after all.

Hope this helps other people looking for the same information, because ST documentation is not very good on this aspect.