ICM-20948 Magnetometer Read Issue

By robert_parr , 29 August 2018

Hi
I have an ICM-20948 on my PCB and I am collecting raw data from the accelerometer absolutely fine over the SPI.

However when using the in built I2C master to read the magnetometer I don't get any data back.

I am configuring the I2C_MST_CTRL register with the recommended value of 7 in the clock config bits.

I am configuring the USR_CTRL register to take a value of 0x20 to enable the I2C master.

Then when I want to write using the slave 4 (I thought this would be easier to debug as it has the transaction complete flag) I follow the following sequence:

1. Disable the salve by writing 0 to the I2C_SLV4_CTRL register
2. Set the device Ored with the the read or write flag in the I2C_SLV4_ADDRR register
3. Set the address to read / write in the I2C_SLV4_REG register
4. Set any data to to written to the I2C_SLV4_DO register
5. Enable the salve by writing the top bit of the I2C_SLV4_CTRL register

I then poll the I2C_MST_STATUS register in bank 0 but never see the transaction complete flag get set.
If I just timeout and check the DI register for SLV4 it always contains 0.

Any ideas what I am missing to make it work?
I have tried to follow the example code for other architectures and believe I'm following all the required steps but I can't find anything I'm missing.

phpbb Topic ID
37054