MPU6050 development on ARM STM32f103RB

A month ago i started working on developing a device using MEMS motion sensors with the following features:

  • AHRS( Attitude and Heading Reference System) for 3D rotation( Quaternion, Euler angles& Rotation matrix)
  • Raw & calibrated sensor measurements
  • Powerful 72MHz ARM Microcontroller STM32F103xB (Later STM32F103xE)
  • Using FreeRTOS
  • DFU(Device Firmware Upgrade) capability
  • Sensors: at present MPU6050, HMC5883L
  • Communication: USB 2.0 & Bluetooth

I have Olimex STM32-P103 bord which has STM32F103RBT6 micro. So far i finished

  • USB CDC Class Virtual Com port driver.
  • Streaming data to UART Bluetooth module.
  • MPU6050 I2C has been tested ( need to improve & optimize ).

I was testing my I2C code, It took too much time. Unfortunately It was very hard to figure out what was happening to my I2C code written for MPU6050 with the old oscilloscope i’m using could not help me to solve. After posting my problem in ST Forum, a few people suggested after days. Meanwhile i started testing my MPU6050 breakout board from Sparkfun on Arduino pro mini. Initially it didn’t work. I communicated with Jeff( a nice guy). I desoldered & soldered the connections, checked for continuity, voltage levels etc. It worked finally. So, now after making sure I’m back onto my Olimex STM32-P103 board to test I2C code. No luck.  After digging out, I fixed it. It was the 7-bit address problem. MPU6050 I2C address is 0x68. But in STM32, i have to use the 1-bit left shifted address(0xD0) of this.

Below is the connection diagram.

I’m working on MPU6050 I2C optimized library development for ARM STM32F103x.


Get every new post delivered to your Inbox.

Join 34 other followers