cancel
Showing results for 
Search instead for 
Did you mean: 

LPS331AP averaging algorithm

vech2001
Associate II

Hello.

Concerning LPS331AP's RES_CONF register and its AVGT/AVGP bits: what is the frequency the corresponding internal averaging is being performed? Does it depend on selected output data rate? How is the averaging applied when the device is in one-shot mode?

4 REPLIES 4
Eleon BORLINI
ST Employee

​Hi, the AVGPx and the AVGTx refer to the number of averages internally performed on the data samples. It's a parameter independent from the ODR, which states the data rate (regardless the internal conversion and the related averages). In one shot mode the data changes at the ODR frequency. Btw, consider that the internal clock references work above 40kHz, so you can select a true 256 avg with 25Hz ODR, but for an environmental parameter such frequencies are far above the variation rate of the parameter itself. Regards

vech2001
Associate II

Thank you. Hence the further question: can I assume that when I'm in the one-shot mode and the device always stays in POWER UP state, the actual data are being continuously sampled internally and the one-shot query gives me back the result of the last N-samples averaging, according to AVGT/AVGP settings? Or, on contrary, averaging only works for fixed ODRs while with one-shot requests data are given out "as is", without any averaging and it is impossible to apply any internal averaging to it in that case?

Missed the button, please reply the answer below.

Eleon BORLINI
ST Employee

​Hi, as for the ds, the ONE_SHOT bit is used to start a new conversion when ODR1-ODR0 bits in CTRL_REG1 are set to “000�?. In this situation a single acquisition of temperature and pressure is started when ONE_SHOT bit is set to ‘1’. At the end of conversion the new data are available in the output registers, the STAUS_REG[0] and STAUS_REG[1] bits are set to ‘1’ and the ONE_SHOT bit comes back to ‘0’ by hardware. The number of average on pressure is 128 samples and the number of average temperature is 64 samples (always running at the internal frequency). Regards