Skip to main content
aybala5
Associate III
May 31, 2014
Question

STM32F4 - MPU-6050 cannot communicate ...

  • May 31, 2014
  • 3 replies
  • 1197 views
Posted on May 31, 2014 at 21:37

Hello Friends,

I bought stm32f4 discv. board and also

http://www.aliexpress.com/item/1-pcs-MPU-6050-Module-3-Axis-Gyroscope-Accelerometer-Module-for-Arduino-MPU-6050-Worldwide-FreeShipping/1361575363.html

board but i havent get it worked yet; my 3 different codes hangs  at  same code line

 while(!I2C_CheckEvent(MPU6050_I2C, I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED));

I simply use 4 wire :

VCC -->3V

GND -->GND

SCL--> PB6

SDA-->PB9

can someone help me thnks.

Mustafa
    This topic has been closed for replies.

    3 replies

    Tesla DeLorean
    Guru
    May 31, 2014
    Posted on May 31, 2014 at 22:01

    can someone help me thnks.

    Be sure that the I2C slave address is correct. The 7-bit address goes in the high-order 7-bits of the byte.

    Check you get an ACK signal with a scope or logic analyzer.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    aybala5
    aybala5Author
    Associate III
    May 31, 2014
    Posted on May 31, 2014 at 22:14

    Thank you Mr Clive.,

    How can i be sure for the slave adrees of the cheap aliexpress product i send email to seller but not sure whether he can send me correct information.

    Like many i used library;

    #define MPU6050_ADDRESS_AD0_LOW     0x68 // address pin low (GND), default for InvenSense evaluation board

    #define MPU6050_ADDRESS_AD0_HIGH    0x69 // address pin high (VCC)

    #define MPU6050_DEFAULT_ADDRESS     (MPU6050_ADDRESS_AD0_LOW<<1)

     

    and guessed 0x68 , i have no logic analyzer or event a multimeter.

    Find many code but all stuckt at same line. Dont know how to progress ...

    Tesla DeLorean
    Guru
    May 31, 2014
    Posted on May 31, 2014 at 23:48

    I don't see a schematic, so will assume AD0 has that 4K7 pull down, and SDA/SCL have the 2K2 pull-up.

    Looks to have an LDO, consider finding the 3V3 supply on the the DISCO, or the 5V one.

    The address as sent by the STM32 should be (0x68 << 1), I don't see enough code to confirm that.

    You'd want to make sure the pins you have used are not conflicted on the STM32F4-DISCO

    Make sure the I2C clocks are running.

    You can look at the signals, you can look at the code.

    http://www.google.com/search?q=gy-521

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..