Skip to main content
CBret.1
Visitor II
March 4, 2023
Question

I'm getting some weird I2C behavior with a GY-87 (MPU6050, HMC5883L, and BMP180 sensor)

  • March 4, 2023
  • 1 reply
  • 1170 views

Whats happening is when I probe the WHO_AM_I register on the MPU6050 I am getting a weird response of 0x72 instead of 0x68. This does not happen on a generic MPU6050 only board. Any ideas? the code in question is simply "HAL_I2C_Mem_Read (&hi2c1, MPU6050_ADDR,WHO_AM_I_REG,1, &check, 1, 1000);" returning the weird value.... :( Any ideas? (I believe I have the I2C set up correctly on my STM32F411CEU6 (Black pill)).

This topic has been closed for replies.

1 reply

waclawek.jan
Super User
March 4, 2023

How is this STM32-related?

Check return value from calling Cube/HAL function.

Observe data on pins using logic analyzer to exclude error in Cube/HAL or its usage.

Check if the symbols you are using (MPU6050_ADDR, WHO_AM_I_REG) have the value you expect.

JW