This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Interfacing tm4c123g with imu mpu6050

Other Parts Discussed in Thread: TM4C123GH6PM

I have attached a project for interfacing the tm4c123gh6pm launchpad with imu mpu6050 via i2c

Configurations are as follows:

From data sheets of both launchpad and imu, the configs needed 
Bus rate: 400khz

- Accelerometer data register addresses : from 3B to 40  in hex ( 6 locations of memory for  x,y,z values)

- Temperature data register address: 41 and 42 in hex ( 2 location for temperature)

- Gyro data register addresses:  from 43 to 48 in hex ( 6 locations of memory for values of  x,y,z values )

when I ran th code it's error free, but  it seems the imu seems not operating at all. Is there a problem with my configuration ?

i2c mpu6050.zip

  • Hello Islam,

    How do you know that the code is error free? For sure, you can tell that it is compiling without error and running without causing an exception but this doesn't preclude it from having errors.

    To start, have you confirmed that you are successfully sending/receiving messages on the I2C bus? i.e., when you write to the external device do you receive an ack in return? Can you then read the register back to insure it was indeed written?

    If you are unsure if the IMU MPU6050 is operating, have you checked the power supply for the device? If power is present, do you see any activity coming from the device data pins or is data transmission limited only to a request from the master? Are there any other pins on the device that can be used to confirm it is functioning? If not, are there more IMU MPU6050 devices that you can try to see if the part is perhaps not working completely.