How to communicate through I2C with ICM-30630 as a slave?

By jolienbr , 1 February 2017

Hello!

I'm having some issues with I2C communication in the firefly development kit (ICM-30630).

I want to use the ICM-30630 in an application where I would have to communicate with the sensor through I2C, where the ICM-30630 is the slave.
For now, I’m using the firefly development kit with the ICM-30630 on a shield plugged into the Arduino ZERO, and I’m using an Arduino UNO as the master. However, I can’t seem to retrieve any data from the ICM-30630. I will later explain the details of my set up.

I read the ICM-30630 can communicate either through SPI or I2C with an external processor, not both at the same time. I know that, when using the Embedded MotionDriver 30630 for FireFly Arduino Kit, the arduino zero communicates with the ICM-30630 through SPI. I wonder if SPI is the default setting and somehow I have to configure the ICM-30630 to communicate through I2C instead of SPI?
If this is not the case, you may find a mistake in my set up below:

According to the ICM-30630 shield hardware guide, the SDA of the ICM-30630 is connected to pin ~11 of the arduino zero through resistor R52, and the SCL is connected to pin ~13 of the arduino through resistor R50. I connected these pins to the SDA and SCL pin of the arduino UNO.

Furthermore, the ICM-30630 shield hardware guide indicates that AD0 is connected to pin ~12 of the arduino through resistor R51. I connected this to the ground to achieve the slave address 0x6A.

I also connected the grounds of the ICM-30630 shield and the arduino UNO.

Next, I used this Arduino sketch for the master arduino UNO:

#include <Wire.h>
int ICMAddress= 0x6A;
void setup() {
Wire.begin();
Serial.begin(9600);
}
void loop() {
Wire.requestFrom(ICMAddress, 1); //Here I also tried other numbers instead of 1, until 7
while(Wire.available())
{ char c = Wire.read();
Serial.print(c);}
int a;
a=Wire.available();
Serial.print(a);
delay(100);
}
If the communication would have succeeded, the serial print of 'c' should give an output, but it didn’t. 'a' represents the number of bytes that can be retrieved through the communication, but the value of a is zero, so no bytes are transferred.

So, to conclude, I would like to know the proper way to communicate through I2C with the ICM-30630.

Thanks!
Jolien

phpbb Topic ID
36083