0
\$\begingroup\$

What is the difference between reading the FIFO registers(FIFO_DATA_OUT_L,FIFO_DATA_OUT_H) and Sensor output registers(OUTX_L_XL to OUTZ_H_XL) both are same?which is recommended to get the raw data from the sensor

\$\endgroup\$
0
\$\begingroup\$

Reading the sensor output registers (OUTX_L_XL .. OUTZ_H_XL) gives you the most recent sensor readings. Reading the FIFO can give you data that occurred in the past. By using the FIFO, you can set up the chip to automatically sample and store data in the FIFO, at the rate you want (e.g. 52 Hz, 104 Hz, 208 Hz, ...) and you don't need to bother your MCU to continuously poll the LSM6DS3. Only at some point you may bulk-transfer all samples to your MCU. This saves CPU time and possibly power. Both are viable methods of reading the LSM6DS3 - depends on your application.

If your MCU does other tasks besides polling the LSM6DS3, it may be better to use the FIFO method, as it ensures you won't miss any data and your MCU will be less involved in communication with the LSM6DS3.

\$\endgroup\$
  • \$\begingroup\$ Thank you for the reply.When FIFO_CTRL5 register will comes into picture? 1)If I use Output registers(X,Y,Z) to read the data what are all the settings required? 2)If I use FIFO output registers to read the data what will be the settings and what is the recommended FIFO ODR value if the ODR(Accelerometer only) is 104Hz. \$\endgroup\$ – Ganesh Mar 7 '18 at 13:31
  • \$\begingroup\$ 1) You can take a look in the LSM6 Arduino library as a good, working reference on how to set up the device; 2) You'll probably want to use the same ODR for both the accelerometer (CTRL1_XL) and the FIFO (FIFO_CTRL5). \$\endgroup\$ – anrieff Mar 7 '18 at 22:24
  • \$\begingroup\$ Please clarify wether reading the data is proper or not Generating the interrupt for every 1sec on FTH(Accelerometer ODR 104Hz and FIFO ODR 104Hz).means in 1 sec I will get 312samples(X 104samples Y 104samples and Z 104samples). If I read all 309 samples (since it is not recommended to read the full data,so leaving one set of data) how many bytes will store in FIFO_DATA_OUT_L and how many in FIFO_DATA_OUT_H.[Contd..] \$\endgroup\$ – Ganesh Mar 8 '18 at 10:09
  • \$\begingroup\$ [Contd..]If I want to get 1st X sample do I need to read the first byte of FIFO_DATA_OUT_L and first byte of FIFO_DATA_OUT_H and combining them after shifting MSB ?If not how can I get raw XYZ data by reading these registers FIFO_DATA_OUT_L and FIFO_DATA_OUT_H.Please do update me with an example \$\endgroup\$ – Ganesh Mar 8 '18 at 10:10
  • \$\begingroup\$ Reading the FIFO is as simple as reading FIFO_DATA_OUT_L, then FIFO_DATA_OUT_H - this gives you one complete word when you combine them. You keep reading this way until you get the number of words needed. E.g. for accelerometer ODR 104, without gyro, this means 104 * 3 words per second. \$\endgroup\$ – anrieff Mar 8 '18 at 11:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.