adafruit / Adafruit_ICM20X

Arduino library for ICM20X
Other
14 stars 23 forks source link

Magnetometer not accessible via SPI? #13

Open caternuson opened 3 years ago

caternuson commented 3 years ago

Re this thread: https://forums.adafruit.com/viewtopic.php?f=51&t=182699

caternuson commented 3 years ago

Was able to recreate this issue. Everything works via I2C, but magnetometer returns all 0's with SPI.

This appears to be a known "feature" of this sesnor.

Here's the block diagram for the ICM20948 from the datasheet:

image

Note that the magnetometer is unique in that it is attached to the auxiliary I2C bus. The datasheet also mentions there being a limitation in accessing the auxiliary I2C bus when using SPI mode:

image

The trick seems to be to configure the serial interface to be "I2C Master Mode" (vs. "Pass-Through Mode"): image

The exact details on what this means are still being determined.