I2C Sensor Read Times compared to Mega ??????

Hi all,

In testing a change a to Corelib for setClock function (see corelibs on GitHub) I decided to test read times of a couple of IMUs (just raw readings) - MPU6050 and the new PropShield from PRJC. Here are the results (all times in milliseconds):

MPU6050:

CPU 100 Mhz 400 Mhz
Mega 0.426 0.178
101 4.28 3.29

PropShield:

CPU 100 Mhz 400 Mhz
Mega 0.047 0.032
101 69 68

Wondering if anyone else has done any other timing tests with the 101 board and if they get similar results.

Merlin513:
Hi all,

In testing a change a to Corelib for setClock function (see corelibs on GitHub) I decided to test read times of a couple of IMUs (just raw readings) - MPU6050 and the new PropShield from PRJC. Here are the results (all times in milliseconds):

MPU6050:

CPU 100 Mhz 400 Mhz
Mega 0.426 0.178
101 4.28 3.29

PropShield:

CPU 100 Mhz 400 Mhz
Mega 0.047 0.032
101 69 68

Wondering if anyone else has done any other timing tests with the 101 board and if they get similar results.

Why is there that much difference?

Have no idea edsa. The only thing that I can think of is that the 101 uses the I2C of other functions or they a mux on board or there is a delay built into the firmware on reads. Don't know that's why I posted this to see if anyone else has any experience with this.

Mike

Merlin513:
Have no idea edsa. The only thing that I can think of is that the 101 uses the I2C of other functions or they a mux on board or there is a delay built into the firmware on reads. Don't know that's why I posted this to see if anyone else has any experience with this.

Mike

I will compare the arduino 101 to an arduino UNO to see if there's any difference.

Thanks edsa. If some else can duplicate/confirm i2c bus issue then I will post it to the 101 corelibs GitHub page as a bug. If its me then I have to figure out wants going on.

Thanks
Mike

Using the following code, I got pretty amazing results.

void loop() {
static byte i = 0;
// put your main code here, to run repeatedly:
long t1 = millis();
lcd.print("This a test " + String(i));
long t2 = millis();
Serial.println("LCD update time : " + String (t2-t1));
delay(1000);
i=i+1;

}

Same LCD (20x4) on both boards; Arduino UNO (16MHz) and Arduino 101 ((32MHz).

The timing results for LCD update :
16MHz UNO : 29 ms +/- 1 (Liquid Crystal_I2C library).
32MHz 101 : 311 ms +/- 3 (Running with I2C_FAST in i2c.c file in wire library.

Thanks,
Pubudu

edsa:
Why is there that much difference?

I put a lot of work into optimizing the library.... but it all depends on a good Wire library.

You may want to check out this issue I have open on the corelibs GitHub: https://github.com/01org/corelibs-arduino101/issues/166

While the issue is on the setClock function for the 101 I got into testing I2C read times with a 6050 and the propshield.

I don't know where the problem, that is why I opened the issue. In another post by pubuducg he changed the a delay in the I2C lib from millis to micros and that seemed to resolve his issue but I do not know what the overall impact would be for other devices.

Mike