GY-521 Unable to set PWR_MGMT_1 register - can't disable SLEEP mode
The PWR_MGMT_1 register should always be set the last after all the register configurations like that:



void MPU9150_Init_awake_SensorRegister(unsigned int MasterI2C_BaseAddress)

{

WriteByte_to_SlaveRegister(MasterI2C_BaseAddress,RA_GYRO_CONFIG,0x08);
WriteByte_to_SlaveRegister(MasterI2C_BaseAddress,RA_ACCEL_CONFIG,0x10);
WriteByte_to_SlaveRegister(MasterI2C_BaseAddress,RA_USER_CTRL,0x00);
WriteByte_to_SlaveRegister(MasterI2C_BaseAddress,RA_PWR_MGMT_1,0x09);

}




I used 0x09 instead of 0x01 to disable the temperature sensor cuz I don't need it.
By the way, I just tried that and it works so far; I still need to experiment with it however.