Page 1 of 1

STM32F407 Disc: Problem with I2C in MPU9205

Posted: Fri Apr 20, 2018 6:34 am
by nikhiledutech
Hello,

I have just started using this MPU9250 module from Peter Hinch. I have connected MPU9250 to I2C interface and used i2c.scan() it gives me [104, 119].

I am facing problem in the following line.

imu = MPU9250('1')

It throws an error of I2C(1) doesn't exist. But i can use I2C(1).

Re: STM32F407 Disc: Problem with I2C in MPU9205

Posted: Fri Apr 20, 2018 9:54 am
by pythoncoder
The preferred way of using these drivers is to pass an initialised I2C object. This enables the bus to be shared with other devices.

If you do pass a string, the string is target-dependent. On a Pyboard it should be 'X' or 'Y' being the sides of a Pyboard but your target may expect something different. At the REPL learn how to instantiate an I2C. Then either do it in code and pass the I2C instance, or pass the string you used at the REPL and the driver will instantiate it for you.

I'm puzzled at the addresses you report. An MPU9250 should be on 104, 12 (the latter being the magnetometer). Your 119 suggests a different chip which won't work with this driver. You may be able to get accel and gyro measurements only by using the MPU6050 driver.

Re: STM32F407 Disc: Problem with I2C in MPU9250

Posted: Mon Apr 23, 2018 8:45 am
by nikhiledutech
Hey,

I have MPU-9250 at addr 0x68 and BMP280 at addr 0x77 (119) in my IMU10DOF module.
x = I2C(1, I2C.MASTER, baudrate = 115200)
imu = MPU9250(x)
it gives me error of Invalid I2C instance.
And from terminal if use x.scan it give me address of [104,119].


How to solve this issue ?