AnsweredAssumed Answered

LSM303D FIFO operation

Question asked by Roussos.Giannis.001 on Feb 13, 2015
Latest reply on Feb 25, 2015 by Roussos.Giannis.001
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

Outcomes