Sampling frequency issue
Hello,
I am using an STM32U585CIU6 with LSM6DSOX to sample acceleration values, in order to use it in a project on NanoEdge.
I am facing an issue while trying to sample higher frequencies. My accelerometer is set to operate at 833Hz. By printing the number of measurements taken by LSM on Serial interface, I could manually get the real sampling frequency, which was about 333Hz.
My baudrate is set to 230400 bits/s, and my LSM6DSOX communicates via I2C, which was set to Standard Mode (100KHz). By switching I2C to Fast Mode or Fast Mode Plus, I could measure a new sampling frequency near 500Hz, meaning there is something still limiting the communication speed. I couldn't adjust the baud rate to a higher value because the ioc configuration would automatically adjust it back to 230400, as if that's the limit for some reason.
I'm lastly suspicious of the clock configuration in my project, which are all set at 4MHz (for Cortex System timer, peripherals, and everything else). However, I'm not really sure about which clock frequency I should change among the different options, as I tried to solve a similar problem in the past, but didn't manage to do it back then.
My goal is simply to find out where is the bottleneck, and address this issue so I can use the accelerometer at higher frequencies.
Sincerely,
L.F.
