User's Manual

UMXXX
In order to maximize the amount of data stored in the FIFO, the user can enable a lossless
DPCM compression algorithm for the accelerometer and/or the gyroscope data. When
DPCM compression is enabled, it is also possible to select when DPCM is reset by storing
uncompressed data in the FIFO (never, or every 8, 16 or 32 words); this is useful when the
FIFO is used as a circular buffer (Continuous mode, see below) and words may be
overwritten: DPCM decoding of the current data word is possible only if previous data words
can be read from the FIFO, back to the point where an uncompressed data word is stored.
The 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 it is disabled, the compression
buffer will be flushed and the output will be 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 it is enabled, the first output will be the non-compressed data word at time
t-2 (tag “NC_T_2”) so that the decoder has a reference to start decoding; the next outputs
depend on the difference D2 between data word at time t-2 and the previous decoded word,
difference D1 between data word at time t-1 and t-2, and difference D0 between data word
at time t and t-1:
If any difference in D2 exceeds 128LSB on any axis, the uncompressed data word
at time t-2 is written to the FIFO by storing the 16-bits 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 16LSB but is within 128LSB for all axis, a
2x 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 reconstructed by summing
D2 to the previous decoded data word. The data at time t-1 is reconstructed by
summing D1 to the data at time t-2 just reconstructed.
If all differences in D2, D1 and D0 are within 16LSB for all axis, a 3x compression
ratio is applied by storing the 5-bit signed difference to reconstruct 3 data values
for each axis at time t, t-1 and t-2 (D0x D0y D0z and a dummy bit to make 16bits,
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 reconstructed by summing D2 to the
previous decoded data word. The data at time t-1 is reconstructed by summing D1
to the data at time t-2 just reconstructed. The data at time t is reconstructed by
summing D0 to the data at time t-1 just reconstructed.
Interrupts can be generated when the FIFO buffer stores a given number of samples