Hello,
I am new to ARM boards. Recently, I purchased Nucleo board STM32F446
and MPU 9250.
MPU 9250 is capable of sampling gyroscope at 8kHz.
First, I was trying with arduino, bit it is not fast enough, and I got
an advice that ARM board would be able to handle that speed.
Obviously, sensor has to be connected to SPI (higher speed than I2C).
Now I have hardware, and it completely stopped at programming.
I understand that I have 2 big problems:
- reading every value that comes from the sensor before the register is rewritten.
After asking around I got the advice, that I should use data ready interrupts and then
read data, but I have no idea how to do that.
- send the data that I read to some kind of storage (there is no huge RAM to just declare
big enough vector of variables and store there for, say 5 min. I have to send the read data through usb
to pc. If I use printf it is way too slow. I got the advice to use SLIP binary protocol, but again, I don't
know how to do that.
Until now, I found program that reads mpu9250 via SPI, but I don't know if it uses data interrupts.
https://developer.mbed.org/users/kylongmu/code/MPU9250_SPI/
I managed to connect board and sensor, and I get values from it using this program, but not fast enough.
If I only read values and not print them (just print one char every 1000 readings, I get that
it reads 1000 sets of 3 gyro values every 92 ms, which is over the max 8 MHz sampling rate of gyro.
I will be extremely grateful for any help you can give me, or maybe
just point me to the source, where I could find some useful information about my problems.
Best regards!
Jernej
Hello,
I am new to ARM boards. Recently, I purchased Nucleo board STM32F446 and MPU 9250.
MPU 9250 is capable of sampling gyroscope at 8kHz. First, I was trying with arduino, bit it is not fast enough, and I got an advice that ARM board would be able to handle that speed. Obviously, sensor has to be connected to SPI (higher speed than I2C).
Now I have hardware, and it completely stopped at programming. I understand that I have 2 big problems: - reading every value that comes from the sensor before the register is rewritten. After asking around I got the advice, that I should use data ready interrupts and then read data, but I have no idea how to do that.
- send the data that I read to some kind of storage (there is no huge RAM to just declare big enough vector of variables and store there for, say 5 min. I have to send the read data through usb to pc. If I use printf it is way too slow. I got the advice to use SLIP binary protocol, but again, I don't know how to do that.
Until now, I found program that reads mpu9250 via SPI, but I don't know if it uses data interrupts. https://developer.mbed.org/users/kylongmu/code/MPU9250_SPI/ I managed to connect board and sensor, and I get values from it using this program, but not fast enough. If I only read values and not print them (just print one char every 1000 readings, I get that it reads 1000 sets of 3 gyro values every 92 ms, which is over the max 8 MHz sampling rate of gyro.
I will be extremely grateful for any help you can give me, or maybe just point me to the source, where I could find some useful information about my problems.
Best regards!
Jernej