Nucleo Board and MPU 9240 high speed gyro values

22 Apr 2016

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

26 Apr 2016

Do you realize that you can up the baud rate between PC and the ST board?

pc.baud(115200);//Set baudrate here.

At 115200 baud this would give you approx. 19000 readings per second (6 bytes per reading). Could even up it a bit more.

12 Jul 2016

Hi..i am new user here as well as i am also new user of ARM boards. Recently i started working on FPGA. i don't have much experience but as per my knowledge in your case the problem is only of baud rate. It causes the improper synchronization between the PC and the board. So go for the proper baud rate calculation and set it accordingly as per the requirement.

http://www.7pcb.ca/PCB-Assembly-services/