Hello all,
I currently have the MPU-6050 Evaluation Board and for the most part it seems to be working fine. I can have my microcontroller talk to the MPU-6050 and receive both Gyro and Acc. data. I can also talk to the AK8975 on the board by setting the I2C on the MPU-6050 to passthrough mode. When doing this the AK8975 seems to be working fine.
My problem is trying to get the MPU-6050 to read the AK8975 data on its own so that I do not need to go into passthrough mode everytime I want magnetometer data. Has anyone got this to work? If so, can you tell me the steps involved? I have the register maps and spec sheets so think I should be doing everything right but I guess not. This is what I am currently doing:
//Set Mag data reg in MPU
I2C_Write(MPU,MPU6050_RA_I2C_SLV0_REG,REG_MAG_X_L);
//Set Mag Slave Address
I2C_Write(MPU, MPU6050_RA_I2C_SLV0_ADDR,(0x80 | MAG>>1));
//Tell how many bytes to read from MAG
I2C_Write_Bit(MPU,I2C_SLV0_CTRL,6,0,4);
//Enable Slave_0 (enable reading of MAG)
I2C_Write_Bit(MPU,I2C_SLV0_CTRL,1,7,1);
When reading the MPU data I do a burst read of 20 bytes starting at the ACCEL_XOUT_H register. After reading I go into passthrough mode to ask the AK8975 to get a new measurement, wait at least 10ms, then do another burst read of the MPU data registers. I generally just get all 0's for the AK8975 data stored in EXT_SENS_DATA_00 through EXT_SENS_DATA_05.
I have worked with the IMU-3000 quiet a bit and never had such a problem having to automatically read an Accelerometer. Any help would be great!
- Log in to post comments
phpbb Topic ID
13956