How to Access the AK8963 via I2C?

By joana , 28 January 2016

Hello,

I am trying to read the WAI register from the AK8663 magnetometer inside the MPU9250 but I get 0x00 instead of the expected 0x48. I know my I2C functions work because I can successfully read back a 0x71 from the WAI register in the MPU9250. This is my code:

uint8_t who;

i2cWrite(MPU9250_ADDRESS, USER_CTRL, 0x00);

i2cWrite(MPU9250_ADDRESS, INT_PIN_CFG, 0x02);

i2cWrite(MPU9250_ADDRESS, INT_ENABLE, 0x01);

i2cWrite(AK8963_ADDRESS, AK8963_CNTL1, 0x02);

SysCtlDelay(5000000);

who = i2cRead (AK8963_ADDRESS ,WHO_AM_I_AK8963);

UARTprintf("%02X\n", who);

I am using 0x0C as the address of the magnetometer. Even with bypass module enabled I can't access the AK8963 directly, can anyone help me?

Thanks for your time.

phpbb Topic ID
33002