I need to run two IMUs ( MPU 9250 x 2 or MPU 6050 x 2 ) on a Blue Pill (STM32F103C8T6 dev board)
I tried the options of using independent I2C ports, but i am having an issue as outlined here : http://stm32duinoforum.com/forum/viewtopic.php?f=2&t=4303
Since either I2C1 or I2C2 works, I thought I'd connect the 2nd IMU on SPI ports of the Blue Pill
I am using the following code that works fine on an Arduino UNO: https://github.com/brianc118/MPU9250
I used the Slave Select pin 10 on the UNO
I need to port it to the Blue pill , I'm trying the following... it DOESN'T work
MOSI on PB5
MISO on PB4
SCLK on PB3
SS on PC13 ( in SPI.h it says the default SS pin is PC13 or PA4, tried both ).
I ran the same code as the UNO with the above pin changes, it doesn't work... what am I doing wrong ???
portion of the code is
Code: Select all
#include
#include "MPU9250.h"
#define SPI_CLOCK 8000000 // 8MHz clock works.
#define SS_PIN PA4 // Slave select pin
MPU9250 mpu(SPI_CLOCK, SS_PIN);
void setup() {
Serial1.begin(115200);
pinMode(SS_PIN, OUTPUT);
SPI.begin();
mpu.init(true);
there are Lib issues as outlined here http://stm32duinoforum.com/forum/viewtopic.php?t=82
What aspects of the my code and wiring need to be changed ?
Thanks in advance!