Hi there,
I've been having a lot of issues with the 9150, I attempting to interface between a C8051F411 and the MPU-9150. I have successfully inmplemented the I2C buss communication and can talk to the device, I can comfortably read and write to most registers however if I read and write to the accel/gyro sensor registers all I get back is zeros.
Obviously my first thought was the sleep mode, however I check and I am deffinatly setting the PWR_MGMT_1 register to 0x02 in my code, and more importantly if I read the register back to check the value I can confirm it has been set correctly.
I set the following registers
SMB_Write_To_Register (REG_PWR_MGMT_1, PWR_MGMT_1_RESET); // resets the chip
for (i=0;i<20000;i++);
SMB_Write_To_Register (PWR_MGMT_1, 0x02);
for (i=0;i<20000;i++);
SMB_Write_To_Register (SMPRT_DIV, 0x07);
SMB_Write_To_Register (CONFIG, 0x00);
SMB_Write_To_Register (GYRO_CONFIG, 0x00);
SMB_Write_To_Register (ACCEL_CONFIG, 0x00);
SMB_Write_To_Register (FF_THR, 0x00);
SMB_Write_To_Register (FF_DUR, 0x00);
SMB_Write_To_Register (MOT_THR, 0x00);
SMB_Write_To_Register (MOT_DUR, 0x00);
SMB_Write_To_Register (ZRMOT_THR, 0x00);
SMB_Write_To_Register (ZRMOT_DUR, 0x00);
SMB_Write_To_Register (FIFO_EN, 0x00);
SMB_Write_To_Register (I2C_MST_CTRL, 0x00);
SMB_Write_To_Register (I2C_SLV0_ADDR, 0x00);
SMB_Write_To_Register (I2C_SLV0_REG, 0x00);
SMB_Write_To_Register (I2C_SLV0_CTRL, 0x00);
SMB_Write_To_Register (I2C_SLV1_ADDR, 0x00);
SMB_Write_To_Register (I2C_SLV1_REG, 0x00);
SMB_Write_To_Register (I2C_SLV1_CTRL, 0x00);
SMB_Write_To_Register (I2C_SLV2_ADDR, 0x00);
SMB_Write_To_Register (I2C_SLV2_REG, 0x00);
SMB_Write_To_Register (I2C_SLV2_CTRL, 0x00);
SMB_Write_To_Register (I2C_SLV3_ADDR, 0x00);
SMB_Write_To_Register (I2C_SLV3_REG, 0x00);
SMB_Write_To_Register (I2C_SLV3_CTRL, 0x00);
SMB_Write_To_Register (I2C_SLV4_ADDR, 0x00);
SMB_Write_To_Register (I2C_SLV4_REG, 0x00);
SMB_Write_To_Register (I2C_SLV4_DO, 0x00);
SMB_Write_To_Register (I2C_SLV4_CTRL, 0x00);
SMB_Write_To_Register (INT_PIN_CFG, 0x00);
SMB_Write_To_Register (INT_ENABLE, 0x00);
SMB_Write_To_Register (I2C_SLV0_DO, 0x00);
SMB_Write_To_Register (I2C_SLV1_DO, 0x00);
SMB_Write_To_Register (I2C_SLV2_DO, 0x00);
SMB_Write_To_Register (I2C_SLV3_DO, 0x00);
SMB_Write_To_Register (I2C_MST_DELAY_CTRL, 0x00);
SMB_Write_To_Register (SIGNAL_PATH_RESET, 0x00);
SMB_Write_To_Register (MOT_DETECT_CTRL, 0x00);
SMB_Write_To_Register (USER_CTRL, 0x00);
SMB_Write_To_Register (PWR_MGMT_2, 0x00);
SMB_Write_To_Register (FIFO_R_W, 0x00);
The logic analyzer I have confirms that everything is getting sent correctly and I am getting acknowleges back from the MPU-9150. I've kinda run out of ideas now as to why it isn't working