I’m currently trying to sample IMU readings from the XIAO nRF52840 Sense at 1600Hz. I notice from the schematics that the internal IMU (LSM6DS3TR-C) is internally connected to I2C protocol. The IMU documentation provided by ST (Documentation) mentions that the IMU is capable of 1.66KHz ODR for the Gyroscope and the Accelerometer.
Could someone please point in the direction of sampling the IMU values at the said frequency? I’m assuming I should be modifying the LSM6DS3TR-C registers to enable high-performance mode and setting the sampling rate for the task.
That would work perfectly. Thanks a ton @msfujino. Would you also know of any test cases to verify that LSM6DS3TR-C is working at the specified specs and is not being bottlenecked by the XIAO?
Once again, thanks a million @msfujino. This is really helpful. Just to confirm the interpretation of your results, the XIAO/Arduino IDE does seem to be a bottleneck. 1 sample set (of 6 values) is ~ 2000uS (including max read enable time). Hence the ODR of 1600 sample sets would be 1600*2000 = 3.2sec. Do you have any tips on reducing this?
The following functions can be used to save time by reading the data consecutively.
readRegisterRegion(uint8_t* outputPointer, uint8_t offset, uint8_t length)