2023-10-05 06:38 AM
Hi Team,
I am testing in LSM6DSL and I have a problem with accelerometer data reading.
I am getting 12.73 read/sec while setting 80ms as a timeout in application and getting accurate accelerometer values. If I decrease the timeout less than 80ms, it will increase the data read/sec value but few of the accelerometer axes values goes missing. I wanted to know the maximum read/sec of accelerometer data and is there any method where I can get greater read/sec data without missing the accelerometer values.
Thanks & Regards,
Afeefah Fathima
2023-10-05 09:26 AM
The output data rate is configurable up to 6.66 kHz.
You can program the INT pin to signal when data is available to be read out.
2023-10-16 10:57 PM
Hello Team,
I am trying to read accelerometer data by setting frequency from 0x10 to 0xA0, when frequency reaches 0x80(1.66KHz) at this condition i2c write is failing and there will be a halt. I am able to read data at frequency=0x80(1.66KHz) when Low Pass Filter(LPF2_XL_EN) is disabled with halt at 0x90.
Without performing the above scenario If I try to set frequency=0x90/0xA0 only then the axes values are read but only with 376reads/sec.
Why there is halt at higher frequency and also I wanted to read data >400 reads/sec, Do you have any information regarding this?
Thanks & Regards,
Afeefah Fathima
2023-10-17 02:17 PM
Unclear what "a halt" entails.
The CPU can only run so fast. Would recommend you look at how long your particular I2C transaction takes and how much additional time your boards needs to due running other stuff in between. A logic analyzer on the SDA/SCL lines may be illustrative and informative.
SPI access will be faster than I2C in general.
2023-10-17 10:25 PM
@TDK "Unclear what "a halt" entails."
i.e. I2C is hanging at frequency=0x90 (3.33KHz) when I try to write to that particular register.
2023-10-18 06:22 AM - edited 2023-10-18 06:23 AM
You haven't clarified anything, you've just replaced "halt" with "hang". How does the I2C hang? Does the function return with an error code? If so, which one? Does it remain in a loop somewhere? If so, where and why exactly?
2023-10-18 10:32 PM
Hi @TDK ,
No the function doesn't return an error code. It will remain in loop. It is hanging before the pclose(fp) whenever frequency reaches to high i.e after 0x80 (1.66KHz). Please find the attached screenshot.