[SOLVED]I2C2 issue
Posted: Sun Dec 01, 2013 7:49 am
Hi,
I'm developing a mini quadcopter using crazyflie firmware.
The hardware is same:
CPU: STM32F103CB
Sensor: MPU6050
The FreeRTOS is working and I can run LED sequence normally.
Motor PWM driver is working.
But MPU6050 I2C communication driver has some issue. (I have used GPIO to simulate I2C and can get right data, so the HW is OK)
My MPU6050 is connected to I2C2(PB10, PB11) which is different from crazyflie orginal design. And AD0 is connected to GND.
So I modify function "imu6Init":
And function "mpu6050Init":
The issue is I2C2 can not get any valid data from MPU6050. "mpu6050GetDeviceID" get all 0
So anyone know if the I2C2 driver in crazyflie firmware can work? And if I omit someting to config?
HMC5883 and MS5661 are removed from the code.
Thanks.
--------------------------------------------------------------------------
I2C2 driver not ready in source code:
1 Add I2C2 event interrupt handler
2 Add Handler to ISR
3 Init I2C2 event interrupt
I'm developing a mini quadcopter using crazyflie firmware.
The hardware is same:
CPU: STM32F103CB
Sensor: MPU6050
The FreeRTOS is working and I can run LED sequence normally.
Motor PWM driver is working.
But MPU6050 I2C communication driver has some issue. (I have used GPIO to simulate I2C and can get right data, so the HW is OK)
My MPU6050 is connected to I2C2(PB10, PB11) which is different from crazyflie orginal design. And AD0 is connected to GND.
So I modify function "imu6Init":
Code: Select all
i2cdevInit(I2C2);
mpu6050Init(I2C2);
Code: Select all
devAddr = MPU6050_ADDRESS_AD0_LOW;
So anyone know if the I2C2 driver in crazyflie firmware can work? And if I omit someting to config?
HMC5883 and MS5661 are removed from the code.
Code: Select all
//#define IMU_ENABLE_MAG_HMC5883
//#define IMU_ENABLE_PRESSURE_MS5611
//#define IMU_MPU6050_DLPF_256HZ
Code: Select all
mpu6050SetI2CBypassEnabled(FALSE);
--------------------------------------------------------------------------
I2C2 driver not ready in source code:
1 Add I2C2 event interrupt handler
2 Add Handler to ISR
3 Init I2C2 event interrupt