cancel
Showing results for 
Search instead for 
Did you mean: 

LSM6DSL: FIFO mode pattern and timestamp & temperature

jb
Associate II

Hi, I am new in Embedded software. I am doing a research and trying to extract the data from the LSM6DSL using FIFO mode.

I have set the fifo, gyro, accel's ODR to 833Hz with no decimation factor.

No threshold

Disable 3rd and 4th data set

Enable rounding status

High performance mode

gyro full scale 1000 dps

Accel full scale 8g

Enable BDU,IF_INC (Trying to reset software reset before config but it CAN NOT BE RESET for some reason)

FIFO only has Accel and gyro data

For now, I am only trying to get the Gx,Gy,Gz and XLx, XLy, XLz in a correct pattern. The values I read looks reasonable, but the order is wrong. I am trying to check the pattern by reading the 10 bit data from fifo_status3 and fifo_status4. However, the pattern is kept increasing from 0 to 1016 and I do not know what that means exactly. Could anyone help me explain what that pattern mean? I have read https://www.st.com/content/ccc/resource/technical/document/application_note/group0/26/07/3f/bf/12/55/47/62/DM00402563/files/DM00402563.pdf/jcr:content/translations/en.DM00402563.pdf 8.5, but I still do not understand.

I am also trying to get the timestamp and temperature from the FIFO. According to the datasheet, they are both stored in the 4th FIFO data set. However, it seems I can only get one or the other, is there a way to get both temperature and timestamp?

To access the 4th fifo dataset, I turn off the 3rd Fifo data set(No data store in the third dataset) and set 4th FIFO data set's ODR to 833Hz. Is it correct that the next data after the accel z axis would be the value on the 4th FIFO data set?

This is the pattern I use to read the FIFO

while(totaldata>0):

omx = readfifo(FIFO_DATA_OUT_H, FIFO_DATA_OUT_L)

  omy = readfifo(FIFO_DATA_OUT_H, FIFO_DATA_OUT_L)

                   omz = readfifo(FIFO_DATA_OUT_H, FIFO_DATA_OUT_L)

                   ax = readfifo(FIFO_DATA_OUT_H, FIFO_DATA_OUT_L)

                   ay = readfifo(FIFO_DATA_OUT_H, FIFO_DATA_OUT_L)

                   az = readfifo(FIFO_DATA_OUT_H, FIFO_DATA_OUT_L)

 #temp = readtemp(i) # not using for now

totaldata = totaldata-6

And I have attached the output doc in this post.

I am stucked here for a long time, any help will be appreciated. Thank you for your patient.

0 REPLIES 0