cancel
Showing results for 
Search instead for 
Did you mean: 

LSM6DSOX FIFO ping pong buffer

Rturo
Associate II

Hi,

Can the LSM6DSOX sensor FIFO be utilized as a ping pong buffer? And if it is possible, how can I do that?

1 REPLY 1
Federica Bossi
ST Employee

Hi @Rturo ,

If by Ping Pong Buffer, you are referring to the sensor capability to write data to the FIFO while you access it and read data, yes, this is possible. You can control the ODR at which sensor data is batched to the FIFO and you can read the FIFO with the MCU at your own defined rate. To have a precise reading, you can use interrupts that are triggered for example when a specific number of samples are stored in the memory (Watermark) or when the FIFO is full. 

For example, if you want to read a sample as soon as its written, you can set the watermark to 1 and set the corresponding trigger.

An example that you can follow to achieve this is:  STMems_Standard_C_drivers/lsm6dsox_STdC/examples/lsm6dsox_fifo.c at master · STMicroelectronics/STMems_Standard_C_drivers · GitHub

Hope this helps!

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.