![ST LPS25H Application Note Download Page 17](http://html1.mh-extra.com/html/st/lps25h/lps25h_application-note_1355424017.webp)
DocID025978 Rev 1
17/26
AN4450
Using FIFO modes
26
5 Using
FIFO
modes
5.1
Effective use of the FIFO
The LPS25H embeds a 32-slot x 24 bit FIFO for pressure data coming from the registers
that normally feed PRESS_OUT (@ 0x28/0x29/0x2A). It allows lower frequency of serial
bus transactions and provides more time to collect all measurements taken.
The FIFO buffer is enabled by setting FIFO_EN to 1 (bit[6] in CTRL_REG2) and can work in
4 different main modes: Bypass Mode, FIFO Mode, Stream Mode and FIFO Mean Mode.
Each mode is selected by the 3 FIFO_MODE bits in FIFO_CTRL register.
Watermark level (P1_WTM), FIFO_empty (P1_EMPTY), FIFO_full (P1_Overrun) or
DATA_Ready (P1_DRDY) events can be enabled (in register CTRL_REG4 (0x23)) to
generate dedicated interrupts on the INT1 pin (provided that bit[1:0] of register CTRL_REG3
(0x22) are configured “00” to select Data Signal).
When FIFO is enabled temperature data must be read separately from pressure data. The
temperature readout is always referred to the last pressure data in the FIFO, as no FIFO is
available for temperature data. The register auto-increment “rounding” is then different
depending on FIFO_EN status, as shown in the picture below.
Figure 8. Auto-increment rounding depending on FIFO_EN
To switch FIFO on/off, the bypass mode must be used. Switching the FIFO on/off only using
the FIFO_en bit of register CTRL_REG2 would cause a wrong FIFO behavior.
5.1.1
Accessing the FIFO data
FIFO data is read through PRESS_OUT registers (0x28/0x29/0x2A). When FIFO is in
stream, trigger (i.e. state change on trigger) or FIFO mode, a read operation to the
PRESS_OUT registers provides the data stored in the FIFO. When in FIFO mean mode it is
not possible to read the data in the buffer, only the final averaged value will be available in
PRESS_OUT registers at the end of the process done with the selected speed (see
Each time data is read from the FIFO, the oldest entry is placed in the PRESS_OUT
registers and both single read and multiple read operations can be used.