cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with reading MPU-6500 by STM32

Carneol108
Associate

Hi!

I have a problem with reading data from MPU-6500 gyroscope/accelerometer (Arduino-module GY-6500/GY-9250). I am using the I2C protocol. When reading the WHO_AM_I_REG register ( with address = 0x75 ) I always get the number 0x70, although all publications say it should be 0x68. According to the document "MPU-6000 and MPU-6050 Register Map and Descriptions", Rev. 4.2: "The default value of the register is 0x68".

To read the register I use the function: HAL_I2C_Mem_Read(&hi2c1, (uint16_t)(0x68<<1), (uint16_t)0x75, i2C_MEMADD_SIZE_8BIT, (uint8_t *)res, 1, 1000). The variable "res" always returns with the number 0x70 instead of 0x68. There were attempts on STM32F091, STM32L152, STM32F722 controllers (on Nucleo boards). The pull-up resistors are 4.7k ohms. Exchange rate 100k and 400k - the result is the same. Checking the exchange observation of signals SCL, SDA by a logic analyzer shows that on the bus I2C write / read occur without errors.

What am I doing wrong? Maybe Arduino-modules based on MPU-6500 use non-standard firmware of these chips?

Help me, please.

Alex

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

> I have a problem with reading data from MPU-6500 gyroscope/accelerometer (Arduino-module GY-6500/GY-9250). I am using the I2C protocol. When reading the WHO_AM_I_REG register ( with address = 0x75 ) I always get the number 0x70, although all publications say it should be 0x68. According to the document "MPU-6000 and MPU-6050 Register Map and Descriptions", Rev. 4.2: "The default value of the register is 0x68".

Mind the part names. There are several with similar numbers, but they are different parts. MPU-6000 and MPU-6050 documents shouldn't be used for the MPU-6500.

The MPU-6500 has a WHO_AM_I of 0x70, which is what you're reading, so all is well.

https://invensense.tdk.com/wp-content/uploads/2015/02/MPU-6500-Register-Map2.pdf

TDK_0-1709484406220.png

 

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

1 REPLY 1
TDK
Guru

> I have a problem with reading data from MPU-6500 gyroscope/accelerometer (Arduino-module GY-6500/GY-9250). I am using the I2C protocol. When reading the WHO_AM_I_REG register ( with address = 0x75 ) I always get the number 0x70, although all publications say it should be 0x68. According to the document "MPU-6000 and MPU-6050 Register Map and Descriptions", Rev. 4.2: "The default value of the register is 0x68".

Mind the part names. There are several with similar numbers, but they are different parts. MPU-6000 and MPU-6050 documents shouldn't be used for the MPU-6500.

The MPU-6500 has a WHO_AM_I of 0x70, which is what you're reading, so all is well.

https://invensense.tdk.com/wp-content/uploads/2015/02/MPU-6500-Register-Map2.pdf

TDK_0-1709484406220.png

 

If you feel a post has answered your question, please click "Accept as Solution".