Speed Up I2C Communication

Finally got my Adafruit 10dof IMU to communicate with my Arduino Due via I2C. For now, I configured the system to read 3 accel and 3 gyro signals. I was very surprised to find how slow the readings are: 1700 microseconds for 6 channels. This is very slow compared to 252 microseconds for analog readings on the Due. Is it possible to speed up the I2C communication? The Wire.h library has a variable called "TWI_CLOCK". Is this the key?

Hi randomvibe,

Yep. The default value is 100000 (for 100kHz).
I have never tried the following but I think that if you change the value to 400000 you should speed it up to 400kHz. Regards,

p

This is the Due, its different, you can call this function:

Wire.setClock(400000) ;

Thanks @MarkT. Wire.setClock() did the trick.

Unfortunately the Adafruit 10-DOF accel only outputs 12-bit resolution at best. 10-bit is default. At least the gyro does output at 16-bit resolution.

MarkT:
This is the Due, its different, you can call this function:

Wire.setClock(400000) ;

@MarkT this line works but I can't find it anywhere. I spent more than 3 hours to change my i2c speed to 400,000kHz.