ICM-20948 Returning "Wrong ID"

Hi there! I’m running the “Example 1- Basics” code to test out my 9DOF IMU Breakout ICM-20948, but all it returns is “Initialization of the sensor returned: Wrong ID. Trying again…”.

Has anyone else had this issue and fixed it? I’m fairly new at this and not even sure where to start…

I’m running it on an Adafruit Feather M0 Basic Proto atsamd21

Thank you!

Hi! Welcome.

Can you share the details of your interface? Are you using I2C or SPI? The first thing to ensure would be that the pins are correctly connected

If you are using I2C: Since the Adafruit Feather M0 Basic Proto atsamd21 does not have a Qwiic connector there is a chance that you have swapped some pins around. You could try a few more Qwiic sensors (or other I2C sensors with example code) and see if they work. If those work while the ICM-20948 does not then the search will continue.

If you are using SPI the same idea applies but it just might be a little more of a hassle to swap in another sensor to test. Do you have the right Chip Select (CS, SS, etc) pin selected in code?

Hi,

I am also encountering this output.

I am using SparkFun 9DoF IMU (ICM-20948) Breakout and not able to get the SPI interface to work with UNO.

Uno to SPI Breakout Pins

Gnd - Gnd

3.3 - VIN; Tried 1V8-5V5 same

MOSI - 11

SCLK - 13

MISO - 12

CS - 2

Example 1

When I uncomment these lines(see below)

#define SERIAL_PORT Serial

#define SPI_PORT SPI // Your desired SPI port. Used only when “USE_SPI” is defined

#define CS_PIN 2 // Which pin you connect CS to. Used only when “USE_SPI” is defined

I get this repeating output.

21:12:05.431 → Initialization of the sensor returned: Wrong ID

21:12:05.431 → Trying again…

Can you tell what I am doing wrong. When I set it up for I2C it works as expected.

If you’re using SPI, there’s only onle line you need to change in the sketch.

The line, which says the below by default:

//#define USE_SPI // Uncomment this to use SPI

Needs to be changed too:

#define USE_SPI // Uncomment this to use SPI

Leave the other lines as they were originally and you should start seeing data once uploading the sketch.

Attached is a copy of the code I’m using that works for me with the connections listed in the code.

Example1_Basics_SPI.zip (1.85 KB)

MrBlue, have you modified the address jumper on your board? When you use I2C what is AD0_VAL set to? When the address jumper is closed SPI operation will not work. So if the example works for you when AD0_VAL is 0 then that might be your problem.

I am using SPI as advised by the website https://www.sparkfun.com/products/15182

“Note: Unfortunately, the TXS0108 level shifter doesn’t play nicely with I2C thanks to ‘smart’ internal pullup resistors. It still works great in SPI mode - however currently we don’t have SW support for the “I2C master” functionality.”

I’ve tried it with 3 different boards on 2 different computers and have had the same (+ more) problems-- “Wrong ID”

If others have had good luck getting I2C to work, maybe I’ll try that instead…

I got this to work in SPI without modifying anything on the chip. I did follow TS-Chris’s advice on only

making the one change in the code to get SPI to work in the download example.

I did use a different wiring configuration than I originally posted. It does sometimes take a couple of startups to

get data streaming solid. I have 5 of these chips all working. I have Audrino IDE

SparkFun 9DoF IMU Breakout - IMC20948 - Audrino Library by SparkFun Electronics Version 1.1.1 INSTALLED

Qwiic 9Dof IMU SPI side to Uno

VIN - 5v

CS - 2

MISO - 12

SCLK - 13

MOSI - 11

GND - GND (the one next to pin 13 on UNO)

Thank you everyone for the responses.