This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

INVENSENSE ICM-20948

I want to use 9 axis motion sensor and I am planning to use INVENSENSE ICM-20948 for this. I know that all the sensors can interface with I2C protocol but the problem is I want to use in SPI protocol but don't know whether magnetometer  in this chip works on SPI or not? I know that  accelerometer and gyroscope can be interface with SPI protocol.

  • Hi, I know this as asked a while ago, but there is still very little information on how to get the icm20948 magnetometer working in SPI mode. So thought I'd write this to clarify. The magnetometer can be written to and read from in SPI mode. The sequence for this is as follows.

    1. Write to the USER_CTRL register, setting I2C_MST_EN

    2. Write to I2C_MST_CTRL, setting the bus speed 400KHz and to stop between read

    3. Write to I2C_MST_DELAY_CTRL, enabling delay odr for the slave you wish the mag to be represented by(the following instructions will assume 0.

    4. Write to I2C_SLV0_ADDR to write mode, and slave address to the magnetometer (0x0C)

    5. Write to I2C_SLV0_REG, setting the address to be written as the address of CTRL2 in the magnetometer

    6. Populate ICM20948_I2C_SLV0_DO with the desired control setting

    7.  Write to ICM20948_I2C_SLV0_CTRL,  enabling the mag and setting the grouping and bytes to be read

    8. Switch I2C_SLV0_ADDR to read mode and I2C_SLV0_REG to HXL

    9. EXT_SLV_SENS_DATA_(00 to 06) will now be populated with HXL to ST2. It should be noted that reading ST2 is necessary as this automatically triggers the data to update in the axis registers.

    10. Additionally, FIFO_EN_1 can be set to write slv(magnetometer) data to the FIFO

  • Hi, I'm trying to use icm 20948 with nrf52 by spi.

    I read the file in the eMD-SmartMotion-ICM20948-1.1.0-MP

    but the example is for others system not for nrf, so i am too new to hook it up.

    Do you have some experice to share?

    What kind of protocal do you use to control icm20948, it seems you didn't use spi?

    Thanks.

Related