
Each FSM has the following features:
•3 different 8-bit masks to allow tests on positive and negative values of X, Y, Z and V.
• 3 different thresholds and 1 programmable hysteresis value that is automatically added to or subtracted from
the selected threshold based on the test condition.
• 4 different counters/timers to manage event durations.
2.3.1.4 LSM6DSO smart FIFO buffer
The LSM6DSO accelerometer has a first-in first-out (FIFO) data buffer that can store up to 3 KB of data, or 512
words of 7 bytes each (1 tag byte plus 6 data bytes). The tag drives the decoding and includes a parity bit for
validation, while the data can derive from any combination of accelerometer, gyroscope, up to 4 external sensors,
embedded temperature sensor, timestamp counter and pedometer step counter. The data rates can be set
independently for each source.
For the accelerometer, you can choose to store high-pass filtered data, slope detection filter data, low-pass
filtered data or unfiltered data plus an optional offset (independent for each axis). The low and high-pass filters
are configurable.
For the gyroscope, you can enable a first optional high-pass filter, and a second optional and programmable low-
pass filter.
To maximize the amount of data stored in the FIFO, you can enable an adaptive lossless delta pulse-coded-
modulation (DPCM) compression algorithm for the accelerometer and the gyroscope data. When the difference
between consecutive data words is small, instead of sending a new data word (16 bits/axis), only the difference
with respect to the previous is sent (8 bits = 2:1 compression or 5 bits/axis = 3:1 compression).
When DPCM compression is enabled, it is also possible to select when DPCM is reset by storing uncompressed
data in the FIFO: never, every 8, 16 or 32 words. This is useful when the FIFO is used as a circular buffer
(Continuous mode) and words may be overwritten, as the decoder can only work if previous data words can be
traced back to an uncompressed data word for reference.
DPCM compression works on 3 data words (sampled at time t, t-1 and t-2) and introduces a latency of 2 data
words. The compression factor depends on the difference between a data word and the previous data word.
• When DPCM is disabled, the compression buffer is flushed and the output is the non-compressed data word
at time t-2, then data word at time t-1 and data words at current time t thereafter (tag “NC_T_2”, “NC_T_1”,
and “NC”).
• When DPCM is enabled, the first output is the non-compressed data word at time t-2 (tag “NC_T_2”), used
as the reference to start decoding. Subsequent outputs depend on D2 (difference between data word at t-2
and previous decoded word), D1 (difference between data word at t-1 and t-2), and D0 (difference between
data word at t and t-1):
– If any difference in D2 exceeds 128 LSB on any axis:
◦ the uncompressed data word at time t-2 is written to the FIFO by storing the 16-bit signed value of
each axis (low and high bytes for X, Y and Z: XL XH YL YH ZL ZH, for a total of 6 bytes)
◦ tag NC_T_2
– If any difference in D2 and D1 exceeds 16 LSB, but is within 128 LSB for all axes:
◦ a 2:1 compression ratio is applied by storing the 8-bit signed difference to reconstruct 2 data
values for each axis at time t-1 and t-2 (D1x D1y D1z, then D2x D2y D2z, for a total of 6 bytes)
◦ tag 2xC
◦ the data at time t-2 is derived by summing D2 to the previously decoded data word
◦ the data at time t-1 is derived by summing D1 to the data at time t-2 just derived
– If all differences in D2, D1 and D0 are within 16LSB for all axis:
◦ a 3:1 compression ratio is applied by storing the 5-bit signed difference to derive 3 data values for
each axis at time t, t-1 and t-2 (D0x D0y D0z and a dummy bit to make 16 bits, then D1x D1y D1z
and a dummy bit, then D2x D2y D2z and a dummy bit, for a total of 6 bytes)
◦ tag 3xC
◦ the data at time t-2 is derived by summing D2 to the previous decoded data word
◦ the data at time t-1 is derived by summing D1 to the data at time t-2 just derived
◦ the data at time t is derived by summing D0 to the data at time t-1 just derived
Interrupts can be generated when the FIFO buffer stores a given number of samples (FIFO threshold level), or
when it is full, or when it overflows (overrun). The FIFO can work in the following modes:
UM2501
Inertial MEMS sensors
UM2501 - Rev 3 page 10/44