0

LSM6DSO32 library slow
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

LSM6DSO32 library slow

by Simon88 on Thu Jul 29, 2021 4:39 pm

Hi all,

I'am playing with an LSM6DSO32 with an SAMD21 and I use Adafruit library for LSM6DSO32 https://github.com/adafruit/Adafruit_LSM6DS but it's verry slow I have 3ms delay for this line of code :
Code: Select all | TOGGLE FULL SIZE
SerialUSB.println(millis());
dso32.getEvent(&accel_dso, &gyro_dso, &temp_dso);
SerialUSB.println(millis()); //3ms here just to read register and do some math....

this is huge no ?? Is it notmal ? My sensor is set to 416Hz data rate by
Code: Select all | TOGGLE FULL SIZE
LSM6DS_RATE_416_HZ
mask.
So I can't run my code up to 333Hz because in each loop iteration I have a minimum of 3ms just for getEvent...

Edit : for information I set my i2c to high speed with
Code: Select all | TOGGLE FULL SIZE
Wire.setClock(400000UL);

Simon88
 
Posts: 5
Joined: Wed Mar 24, 2021 2:40 pm

Re: LSM6DSO32 library slow

by Simon88 on Fri Jul 30, 2021 3:14 am

EDIT : I searched and I found the line where is "slow", in _read file LSM6DSO32.cpp
Code: Select all | TOGGLE FULL SIZE
  SerialUSB.println(millis());
  uint8_t buffer[14];
  data_reg.read(buffer, 14);
  SerialUSB.println(millis());


So here I have 2-3ms just for read register.... Is it normal?

Simon88
 
Posts: 5
Joined: Wed Mar 24, 2021 2:40 pm

Please be positive and constructive with your questions and comments.


cron