Arduino IDE does not recognize MPU6050 initialized by Wire.h

Development environment specific, Arduino, Eclipse, VS2013, Em::Blocks etc
Post Reply
narendra.desilva
Posts: 9
Joined: Tue Dec 10, 2024 12:33 am

Arduino IDE does not recognize MPU6050 initialized by Wire.h

Post by narendra.desilva »

Hi
I am trying to read MPU6050 using STM32duino. I got the MPU SCL, SDA connected to PB6 and PB7 of my STM32F407VG DiyMore Black Board.

STM32F407VGT6_diymore-pins2.jpg
STM32F407VGT6_diymore-pins2.jpg (10.35 KiB) Viewed 680 times

First I tried to scan the address using the I2C scanner in the Examples under Wire.

It does not detect MPU6050. There is no problem with my MPU6050 breakout as it communicates well with Arduino Uno. Can somebody help me to get this issue settled.


Regards
by GonzoG » Sun Dec 15, 2024 1:43 pm
If you're using DIYMORE f407VGT variant, it won't work on PB6 and PB7 as default I2C pins are PB8, PB9. Same for F407Vx variant.
in variants\STM32F4xx\F407V(E-G)T_F417V(E-G)T\variant_DIYMORE_F407VGT.h

Code: Select all

// I2C Definitions
#ifndef PIN_WIRE_SDA
  #define PIN_WIRE_SDA          PB9
#endif
#ifndef PIN_WIRE_SCL
  #define PIN_WIRE_SCL          PB8
#endif
Go to full post
fpiSTM
Posts: 1944
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 108
Location: Le Mans
Contact:

Re: Arduino IDE does not recognize MPU6050 initialized by Wire.h

Post by fpiSTM »

Add pull up resistors on each I2C lines.
GonzoG
Posts: 491
Joined: Wed Jan 15, 2020 11:30 am
Answers: 36
Location: Prudnik, Poland

Re: Arduino IDE does not recognize MPU6050 initialized by Wire.h

Post by GonzoG »

If you're using DIYMORE f407VGT variant, it won't work on PB6 and PB7 as default I2C pins are PB8, PB9. Same for F407Vx variant.
in variants\STM32F4xx\F407V(E-G)T_F417V(E-G)T\variant_DIYMORE_F407VGT.h

Code: Select all

// I2C Definitions
#ifndef PIN_WIRE_SDA
  #define PIN_WIRE_SDA          PB9
#endif
#ifndef PIN_WIRE_SCL
  #define PIN_WIRE_SCL          PB8
#endif
Last edited by GonzoG on Mon Dec 16, 2024 9:44 am, edited 1 time in total.
narendra.desilva
Posts: 9
Joined: Tue Dec 10, 2024 12:33 am

Re: Arduino IDE does not recognize MPU6050 initialized by Wire.h

Post by narendra.desilva »

Gonzog and all

The transfer of the connections to PB8 and PB9 sorted out the matter. Thanks a lot again. It is really great to have support of this level. The pinout I of the diyMore board am using is as attached.
DIY-More-STM32F407VGT6_3.jpg
DIY-More-STM32F407VGT6_3.jpg (93.82 KiB) Viewed 627 times
I am not sure whether this document is not correct. Please share the correct one if you have it.

Thanks again for the prompt help.

Regards
Post Reply

Return to “IDE's”