LM6S3TR device FIFO pattern incorrect
Hi there!
I'm having issues with my LSM6DS3TR device FIFO. I am trying to read and process all values stored in the FIFO by the accelerometer every interval using I2C. I am doing this by:
1) Retrieving number of unread messages in FIFO at addresses 3Ah and 3Bh.
2) For every unread message:
2.1) Reading the pattern in address 3Ch and 3Dh.
2.2) Reading the value of the FIFO in addresses 3Eh and 3Fh.
2.3) Processing and storing value retrieved from value as x, y or z axis.
I assume the pattern will tell me which axis the FIFO value relates to? I am only using the accelerometer, so I assume pattern = 0 is x axis, 1 is y axis and 2 is z axis? However, the pattern seems to be corrupted when I leave the program running long enough and will no longer align with the axis; for example- sometimes it will show pattern 0 but the value will be for y or z axis, pattern 1 but the value is for the x or z... etc...
Further details about the settings of the LSM6DS3TR device:
- I am using only the Accelerometer.
- The FIFO mode is set to continuous and ODR is set to 104Hz.
- The accelerometer ODR is set to 104Hz with no decimation.
- The BDU and IF_INC bits are set to 1 in CTRL3_C.
Does anyone possibly have a solution to this? Thanks in advance.
