From 3c42c8f7fab5c9d7fbeaec52071f8130da081f90 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Mon, 10 Jul 2017 10:38:06 -1000 Subject: [PATCH] mpu9520:Use maximum clock rate The MPU9250 and MPU6500 buth support 1 Mhz and 20 Mhz. Buy upping the clocc we will get the maximum clock rate the driver supports that is <= 20 Mhz. This will boost the FMUv4Pro SPI speed to 11.25 Mhz (it was half that) --- src/drivers/mpu9250/mpu9250_spi.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/drivers/mpu9250/mpu9250_spi.cpp b/src/drivers/mpu9250/mpu9250_spi.cpp index 3b1e1ba5ea..45395599c8 100644 --- a/src/drivers/mpu9250/mpu9250_spi.cpp +++ b/src/drivers/mpu9250/mpu9250_spi.cpp @@ -74,12 +74,16 @@ /* - The MPU9250 can only handle high SPI bus speeds on the sensor and - interrupt status registers. All other registers have a maximum 1MHz - SPI speed + * The MPU9250 can only handle high SPI bus speeds of 20Mhz on the sensor and + * interrupt status registers. All other registers have a maximum 1MHz + * SPI speed + * + * The Actual Value will be rounded down by the spi driver. + * for a 168Mhz CPU this will be 10.5 Mhz and for a 180 Mhz CPU + * it will be 11.250 Mhz */ #define MPU9250_LOW_SPI_BUS_SPEED 1000*1000 -#define MPU9250_HIGH_SPI_BUS_SPEED 11*1000*1000 /* will be rounded to 10.4 MHz, within margins for MPU9250 */ +#define MPU9250_HIGH_SPI_BUS_SPEED 20*1000*1000 device::Device *MPU9250_SPI_interface(int bus, bool external_bus);