English
Language : 

LSM303AGR Datasheet, PDF (31/68 Pages) STMicroelectronics – ultra-low-power 3D accelerometer and 3D magnetometer
LSM303AGR
Functionality
4.4.3
An overrun interrupt can be enabled, I1_OVERRUN = '1' in the CTRL_REG3_A (22h)
register, in order to be raised when the FIFO stops collecting data. When the overrun
interrupt occurs, the first data has been overwritten and the FIFO stops collecting data from
the input channels.
After the last read it is necessary to exit Bypass mode in order to reset the FIFO content.
After this reset command, it is possible to restart FIFO mode just by selecting the FIFO
mode configuration (FM[1:0] bits) in register FIFO_CTRL_REG_A (2Eh).
Stream mode
In Stream mode the FIFO continues filling data from the X, Y, and Z accelerometer channels
until the buffer is full (a set of 32 samples stored) at which point the FIFO buffer index
restarts from the beginning and older data is replaced by the current data. The oldest values
continue to be overwritten until a read operation frees the FIFO slots.
An overrun interrupt can be enabled, I_XL_OVERRUN = '1' in the CTRL_REG3_A (22h)
register, in order to read the entire contents of the FIFO at once. If, in the application, it is
mandatory not to lose data and it is not possible to read at least one sample for each axis
within one ODR period, a watermark interrupt can be enabled in order to read partially the
FIFO and leave memory slots free for incoming data.
Setting the FTH [4:0] bit in the FIFO_CTRL_REG_A (2Eh) register to an N value, the
number of X, Y and Z data samples that should be read at the rise of the watermark interrupt
is up to (N+1).
Figure 8. Stream mode
4.4.4
Stream-to-FIFO mode
In Stream-to-FIFO mode, data from the X, Y and Z accelerometer channels are collected in
a combination of Stream mode and FIFO mode. The FIFO buffer starts operating in Stream
mode and switches to FIFO mode when the selected interrupt occurs.
DocID027765 Rev 5
31/68
68