Can MPU9250 output to STM32F4 via SPI?

Firmware/software/electronics/mechanics
Maxzor
Beginner
Posts: 11
Joined: Sun Jan 17, 2016 11:01 am

Can MPU9250 output to STM32F4 via SPI?

Post by Maxzor »

Hello,
topic,
Best regards
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Can MPU9250 output to STM32F4 via SPI?

Post by tobias »

Hi,

As the SPI of the MPU9250 is not routed to the STM32F4 I'm afraid no. May I ask you what you are trying to achieve?
Maxzor
Beginner
Posts: 11
Joined: Sun Jan 17, 2016 11:01 am

Re: Can MPU9250 output to STM32F4 via SPI?

Post by Maxzor »

Was wondering if Raceflight software running 32kHz interrupts from gyro, could be ported on the crazyflie.
At the moment this is the only F4 board I have and I love the project. But with I²C gyro output is capped at 2kHz.
Bad luck, on the Crazyflie 3.0 maybe! :)
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Can MPU9250 output to STM32F4 via SPI?

Post by tobias »

I think it is possible to overclock the I2C buss to 800kHz which could potentially double the data transferring. I'm not sure it will improve the flight dynamics much though?
Maxzor
Beginner
Posts: 11
Joined: Sun Jan 17, 2016 11:01 am

Re: Can MPU9250 output to STM32F4 via SPI?

Post by Maxzor »

It is definitely the land of diminishing returns, but 32kHz appears to reduce aliasing even further and is being quite adopted by the FPV racing professionals!
Ty for information still!
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Can MPU9250 output to STM32F4 via SPI?

Post by tobias »

I thought the MPU9250 could only do 8 kHz output, or maybe it is only the internal bandwidth? Reducing the time from a new sample to motor output could improve the flight dynamics, so high speed data transfer would make sense but how much it will improve is another question, if it is noticeable/measurable at all. We could always make a deck board with a MPU9250 connected to the SPI bus and evaluate/compare ;) .
Maxzor
Beginner
Posts: 11
Joined: Sun Jan 17, 2016 11:01 am

Re: Can MPU9250 output to STM32F4 via SPI?

Post by Maxzor »

Well 8kHz is indeed hat is displayed on the Invensense datasheet but Raceflight guys on RCGroups swear upon their parent's head that they get real 32kHz sampling from it. I guess most of the progress is obtained with higher PWM rates between ESC and motor. Raceflight runs up to 32kHz gyro interrup/fc "looptime" - 32 kHz PWM to ESC - 32kHz harware PWM from ESC to motor. And yes measurement is a big deal.

The testing deck is a nice idea :)
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Can MPU9250 output to STM32F4 via SPI?

Post by tobias »

If we made a testing deck with a MPU9250 SPI would you play with it? ;) Shouldn't take long to but together, it is just that we won't have time to play with it but it might be worth it if someone else did :D
Maxzor
Beginner
Posts: 11
Joined: Sun Jan 17, 2016 11:01 am

Re: Can MPU9250 output to STM32F4 via SPI?

Post by Maxzor »

After overnight thought yes.
I could do the dirty ASM/C job porting Raceflight to it and comparing at home with your very nice updated flight control code.
Left to you to then further measure any significant improvement, since you are miles away from my electromechanical engineering skills :)
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Can MPU9250 output to STM32F4 via SPI?

Post by tobias »

You said it, I'll get to it ;) :D .
I actually have a port of cleanflight running but haven't had time to tune it so it doesn't fly so well. Another reason is that It requires an external RX (CPPM) and the one I got was pretty imprecise making the controls bad. With some time put into it things can change though!
Post Reply