AnsweredAssumed Answered

LPS25HB unexpected behavior when FIFO is active

Question asked by Singed on Jul 7, 2016
Latest reply on Sep 14, 2017 by Nicolas Deparis
I've encountered a problem with LPS25HB. I'm trying to get maximum precision from this barometer sensor without taking into account power consumption.
 
I've setted up registers in this way and in this order:
CTRL_REG1 0x20 => 0b11000110; // Power on, 25Hz, BDU, reset zero
RES_CONF 0x10 => 0b00001111; // AVG-P 512, AVG-T 64
 
After reading documentation I've tried to enable also FIFO in mean mode to get a more precise reading, in this way and in this order:
FIFO_CTRL 0x2E => 0b11000011; // FIFO Mean mode, 4 moving average
CTRL_REG2 0x21 => 0b01000000; // FIFO Enable

 Conversion that I do from readings are:
 Pressure = ReadedPressure /  4096UL;
Temperature = 42.5 + (ReadedTemperature / 480UL);

Reading are ok if I just initialize CTRL_REG1 and RES_CONF, correct temperature and reasonable pressure readings. But if I try to activate FIFO_CTRL and CTRL_REG2 (in this order, first FIFO_CTRL and after CTRL_REG2 registers), with above bit setup, I
suddenly have very wrong readings from Temperature and less precise values output from pressure. Temperature readings are not only wrong but they act like pressure readings, like if I move my PCB board up and down Temperature increase/decrease and when steady I've an AVG reading of 42°C.
 
Since I'm applying this formula that require temperature:

mimetex.cgi.gif

I want to ask what's wrong with this registers and FIFO.

Also, since I want to use FIFO mean to get less noise from output, I want to ask if it does effectivly reduce noise. Since I've already setted maximum AVG 512 for pressure and 64 for temperature, FIFO mean perform another AVG that can be useful? (I can't tell by myself since I was unable to get FIFO work correctly)

Thank you.

Outcomes