Did anyone test I2C @ 800KHz ?

I've been doing a few experiments with using EEPROM (24LC512) and an RTC (DS3231) over I2C.
Both the EEPROM and RTC worked when I set TWBR = 2; which equals a speed of 800KHz.
used eeprom lib from - I2C EEPROM Class on playground - Libraries - Arduino Forum - and a not published RTC lib

The performance of the EEPROM improved compared with 400 KHz, definitely not a factor 2, still almost 20% for writing and 30% for reading. And because I2C @800 KHz disables interrupts shorter a system might be more responsive or miss less pulses etc.

I did not measure timing yet for the RTC, but I expect similar gains. Might do that later today.

Did not check the signals with a Scope or Logic Analyzer yet. The clock and EEPROM were both connected on breadboard and worked without flaw for a few hundred calls (RTC) and a few thousand calls for the EEPROM.. OK that is not really much but if it was really unstable I expect it should have failed.

Question:
Did anyone do experiments with higher I2C baud rates and if so, what are your experiences?

I think the title you put on this thread is out by three orders of magnitude.
A speed of 800KHz is the highest I have ever got out of the Arduino, faster speeds did not work.

:blush: :blush: :blush:
Sorry, I'll fix the title.

Interesting experiment given that the rated max I2C freq for 24LC256 and DS3231 are both 400kHz. I've not tried anything faster than 400kHz. Did a couple very quick and crude benchmarks between 100kHz and 400kHz and was fairly unimpressed with the improvement in throughput. Not that I expected a whole lot, certainly not 4X but I might have expected 2X or thereabouts, but IIRC I didn't even see that. Can't remember whether I even did write as well as read. I may have done write only, in which case the write latency is no doubt constant, so that may account for the majority of the time. 24FC256 is rated at 1MHz, I may have a couple but haven't tried to push 'em.

Fixed the title...

In the mean time I made some measurements for the performance of the RTC - DS3231
1000 calls to READ a tmElements_t tm; struct, (7 fields) timing in micros()

TWBR: 72 == 100 KHz TIME: 1059700
TWBR: 12 == 400 KHz TIME: 358392 == 2.9x faster (compared to 100 KHz)
TWBR: 2 == 800 KHz TIME: 240924 == 4.4x faster (compared to 100 KHz)

1000 calls to WRITE a tmElements_t tm; struct, (7 fields) timing in micros()

TWBR: 72 == 100 KHz TIME: 1305608
TWBR: 12 == 400 KHz TIME: 466528 == 2.8x
TWBR: 2 == 800 KHz TIME: 327408 == 3.9x

So one gets extra throughput by using 800 KHz but not as substantial as the gain from 100 -> 400.

Interesting experiment given that the rated max I2C freq for 24LC256 and DS3231 are both 400kHz. I've not tried anything faster than 400kHz.
...
24FC256 is rated at 1MHz, I may have a couple but haven't tried to push 'em.

Hi Jack,
Think these ratings are conservative, really critical might be the pull up resistors.

TWBR=0 (1Mhz) failed several times on the address,
TWBR=1 (888KHz) skipped as it an odd frequency

so with TWBR=2 (800KHz) is promising when performance is critical.
And as you say better consider the 24FC256 (1MHz) when this speed is needed .

I2C processing overhead with arduino is huge, try 1MHz speed with other MCU :slight_smile:

So one gets extra throughput by using 800 KHz but not as substantial as the gain from 100 -> 400

Yes you would expect that because the overheads in the transfer remain the same. As the transfer speed gets faster the overhead becomes the dominant factor and in the end becomes the limiting factor. By that I mean suppose you data too zero time to transfer, with everything else going on you would still not get an infinitely fast transfer speed.

To clarify what I said earlier, I tried running a 1MHz rated I2C device at 1MHz but it would not work, the 800KHz was the fastest I could get it to go at.

Thanks for the explanation, It confirms my thoughts about it. Did you have any negative experiences with 800 KHz?
regards,
Rob

Did you have any negative experiences with 800 KHz

No that's what I used for the EEPROM storage on this project:-
http://arduino.cc/forum/index.php/topic,96588.0.html
Which you have commented on already. :slight_smile: