Hello all,
Slightly lost with how to communicate with the Magnetometer - is it Slave 0 ? Slave 1 ? Both ?
I've downloaded the code hosted by Invensense but still cannot communicate with the magnetometer (accel and gyro are fine). I'm simply trying to read the who am I of the AK09916.
All comms is over SPI.
Currently I read the ICM20948 who am I. This is valid so I reset the ICM then set the clock source (set bit 0 in pwr mgmt 1 reg).
All I2C_SLV_CTRL registers are then cleared.
Bit 4 of I2C_MST_CTRL register so there is a stop between reads.
Finally bit 5 of USER_CTRL is set to enable the I/F.
So in order to read the who am I of the AK device, I assume I need to set the SLV0_ADDR to 0x8C, the SLV0_REG to 0x09, and SLV0_CTRL to 0x81. Then I set I2C_MST_EN in USER_CTRL and read EXT_SLV_SENS_DATA_00. This ALWAYS returns 0.