-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Achieving Stable 100Hz I2C Readings from MPU9250 #526
Comments
Thanks |
Thank you! |
That rate is not feasible with this app |
I was able to achieve a telemetry rate close to 100Hz by following these steps:
Thank you very much for your code and your assistance! |
Hi, thank you so much for the amazing code!
I'm running this code on a Xiao ESP32-S3 Sense board and trying to read data from the MPU9250 (accelerometer and gyro) at a stable rate of 100Hz while also recording AVI and streaming via a web GUI.
Configuration:
MPU9250 I2C Pins: I've connected the MPU9250 to I2C pins 5 and 6 and modified the shared I2C pins in the code accordingly.
CSV Structure: I modified the CSV structure to accommodate additional fields for the accelerometer and gyro data.
Changes Made to Achieve Higher Sample Rate:
sampleInterval
from 1000 to 1.setting.fifo_sample_rate = FIFO_SAMPLE_RATE::SMPL_1000HZ;
while (!mpu9250.update() && millis() - mpuWait < SENSOR_TIMEOUT) delay(10);
Wire.setClock(400000);
#define TELEM_PRI 7
Issue: Despite these modifications, the reading rates are inconsistent, sometimes dropping below 100Hz and at other times exceeding it.
Request for Suggestions: Do you have any suggestions for achieving stable 100Hz readings from the MPU9250? Any tips on further optimizing the code or managing task priorities would be greatly appreciated.
Thank you in advance for your help!
Best,
Om
The text was updated successfully, but these errors were encountered: