STMicroelectronics / STMems_Standard_C_drivers

Platform-independent drivers for STMicroelectronics MEMS motion and environmental sensors, based on standard C programming language.
BSD 3-Clause "New" or "Revised" License
705 stars 517 forks source link

lsm6dsv16x: timestamp #168

Open nicogou opened 2 weeks ago

nicogou commented 2 weeks ago

Device part numbers

lsm6dsv16x (at least, didn't check the others)

Type of bug

examples/lsm6dsv16x_fifo_irq.c (at least)

Describe the bug

When receiving a timestamp via FIFO, the printed value is in LSB, not ms as suggested by the message. In order to convert LSB to milliseconds, one needs to multiply the received value by 21.75µs (see table 127 of the datasheet). It looks like there is a lsm6dsv16x_from_lsb_to_nsec function which converts the received timestamp to nanoseconds.

BeSeeTek commented 2 weeks ago

@nicogou regarding timing, be aware that the sensors odr is quite inaccurate and deviaties in the order of whole % from the nominal value, as common for MEMS Imus. So use the external synchronisation when ever possible.