sparkfun / SparkFun_ICM-20948_ArduinoLibrary

Arduino support for ICM_20948 w/ portable C backbone
Other
168 stars 72 forks source link

Arduino Nano Initialization of the sensor returned: Data Underflow #111

Closed Ryam-20151-2 closed 1 year ago

Ryam-20151-2 commented 1 year ago

Subject of the issue

Using an Arduino Nano with the ICM-20948, trying example 1, everything compiles and writes to the board, but the error "Initialization of the sensor returned: Data Underflow" is repeated in the terminal.

Your workbench

Steps to reproduce

Set up Arduino IDE with example 1, set AD0_val = 0 compile and run

Expected behaviour

It should run the example

Actual behaviour

it repeats the error message

PaulZC commented 1 year ago

Hi @Ryam-20151-2 ,

This is usually a sign that you are not using the correct I2C/SPI pins - or the correct I2C address.

Can you please post a photo of the connections between the Nano and the 20948 board. Or post a list of your connections (jumper wires). We need to know if you are using SPI or I2C, and which pins you are using.

Thank you, Paul

Ryam-20151-2 commented 1 year ago

I see, I am using I2C, since I am using the Nano AD0_VAL should be 0 correct? I am using pins A4 and A5 on the nano. I attached both a schematic and photo of the board (sorry for poor quality, other boards are soldered in already). Any things I can test to see if its the wiring or my setup of the library that's incorrect?

Thank you wiring PXL_20230216_035601023

Ryam-20151-2 commented 1 year ago

haha, it seems setting AD0_VAL to 86 did the trick, thanks for the help

PaulZC commented 1 year ago

Hi @Ryam-20151-2 ,

Thanks for the update. Glad that's working for you.

Just to be clear, I guess you set AD0_VAL to 0 - which sets the I2C address to 0x68 ?

Another Nano user reported that same issue. Strange. I don't really understand why you need to do that on the Nano. There must be something slightly strange about the pin voltages - the Nano is a 5V board - and/or the pull-up resistances on the Adafruit ICM20948 board. Anyway, it's working so I'm not going to worry about it too much...! ;-)

Best wishes, Paul