ext_slave_descr and salve data acquisition

By alvaro_canivell , 24 October 2011

Dear InvenSense,

I'm using MPU6050 with an HMC5883L connected on the secondary i2c.
HMC5883L is completely controlled by MPU6050, which takes care to read compass data out of the device.

Magnetic field X, Z and Y are respectively stored in the following registers of HMC5883L:
0x03 - X MSB
0x04 - X LSB
0x05 - Z MSB
0x06 - Z LSB
0x07 - Y MSB
0x08 - Y LSB

each register is 8 bits long.
In code documentation i have found:
/* @read_reg: starting register address to retrieve data. */
/ * @read_len: length in bytes of the sensor data. Typically 6. */

So when I initialize the structure ext_slave_descr I set:

read_reg = 0x03
read_len = 6

But with this configuration when I use "inv_get_compass_data" to read comapss data, only X value is updated continuously, meanwhile Y and Z are kept to a constant value, which seems to me the first value read.

Using following configuration:
read_reg = 0x01
read_len = 9

(which is the same used for ak8975) all three values X,Y and Z are updated continuously, but values seems not to be correct.

Could anybody please explain this correct configuration?
Thanks for any suggestion.
Paolo.

phpbb Topic ID
13884