Hi
I have bought MPU9150's from distributor CDI. After successful prototyping, I incorporated MPU9150’s into my boards. Some of them are working fine. I have problem with few of them.
Problem 1: Configuration problem for 3 MPU9150’s.
Problem 2: Sensor readings problem with 6 MPU9150’s.
For these sensors, the MPU9150’s package Marking Specification shows:
Line 3: D2N055-J1
Line 4: E1 1249 E
From the reference given in the datasheet, Line 3 is Lot traceability code (D2N055-J1).
Line 4 contains Foundry code (E), Package Vendor Code(1), Year Code(12), Work Week(49), Rev Code(E).
Problem 1:
The code is available at https://github.com/Harinadha/STM32_MPU9150eMPL. This code works fine for others too.
For these MPU9150’s, the mpu_init function returns value -1 (please look in inv_mpu.c).
int mpu_init(struct int_param_s *int_param)
{
unsigned char data[6], rev;
memset(data, 0, 6);
/* Reset device. */
data[0] = BIT_RESET;
if (i2c_write(st.hw->addr, st.reg->pwr_mgmt_1, 1, data))
return -1;
delay_ms(100);
/* Wake up chip. */
data[0] = 0x00;
if (i2c_write(st.hw->addr, st.reg->pwr_mgmt_1, 1, data))
return -1;
#if defined MPU6050
/* Check product revision. */
if (i2c_read(st.hw->addr, st.reg->accel_offs, 6, data))
return -1;
rev = ((data[5] & 0x01) << 2) | ((data[3] & 0x01) << 1) |
(data[1] & 0x01);
if (rev) {
/* Congrats, these parts are better. */
if (rev == 1)
st.chip_cfg.accel_half = 1;
else if (rev == 2)
st.chip_cfg.accel_half = 0;
else {
//log_e("Unsupported software product rev %d.n", rev);
return -1;
}
} else {
if (i2c_read(st.hw->addr, st.reg->prod_id, 1, data))
return -1;
rev = data[0] & 0x0F;
if (!rev) {
//log_e("Product ID read as 0 indicates device is either "
// "incompatible or an MPU3050.n");
return -1;
} else if (rev == 4) {
//log_i("Half sensitivity part found.n");
st.chip_cfg.accel_half = 1;
} else
st.chip_cfg.accel_half = 0;
}
For these silicon’s after reading the product revision, array data contains all zeros for the 3 sensors.
0x00, 0x00, 0x00, 0x00, 0x00, 0x00
Then this function returns -1 by the following if statement.
if (!rev) {
//log_e("Product ID read as 0 indicates device is either "
// "incompatible or an MPU3050.n");
return -1;
}
For one of the MPU9150 which is fully working, array data contains:
0xF5, 0xE8, 0x00, 0xA5, 0x05, 0x66
Please tell us what kind of information these 6 bytes hold? How to interpret them?
If I comment out this rev related code & do the self-test, the test fails ( returns 0).
Problem 2:
There is no problem in configuring these MPU9150’s. I read the data upon the INT interrupt. Z-axis of accelerometer data is constant (not varying) & x-axis gyro data is constant (not varying). Also, after visualizing the DMP quaternion on a PC client, I see the cube is not rotating about x-axis.
I'm stuck with these problems having my firmware ready for the boards.
Please reply soon.
Thank you