This is a question in relation to USB transmissions crash my software GUI.

I posted this question separately so that I could clarify my question separate from the other one.

I have the same operating code here and I would like to ask: How can we estimate the EEPROM read time from I2C communication running at 100kHz?

main()
{
usbinit(); // usb initialization
while(1)
{
}
}


I trust reading a chunk of data from EEPROM won't do any damage than doing adc_conversions and calculations.

I don't want a precise time duration. But I trust read will occur quite fast rather than write that will take 5ms minimum.

I could not find any EEPROM read time though is it because it depends upon baud rate of communication (I2C here @ 100kbps).

I would love to have your thoughts and information in regards to this problem.

-
Start conditions, stop conditions, address bits, operation bits, data bits. Add those up and divide by the bit rate (since reads are essentially zero-latency at that frequency). – Ignacio Vazquez-Abrams Feb 22 '14 at 7:02

You could calculate it by reading the EEPROM datasheet and adding up the time take to transfer all the bits as Ignacio Vazquez-Abrams suggested in a comment. Because you've already selected a device and have it working though you might find it easier just to measure it. Normally I'd do something like the following and use a scope to measure it:

// Take an I/O pin high
// Take the I/O pin low


If you don't have a scope you could enclose the reading in a loop and maybe turn a LED on and off with something like this:

uint32_t i;
// Turn on LED
for (i=0; i < 100000; i++)
// Turn off LED


Depending on how many bits are transfers the second piece of code will probably take something like 30 seconds or so which you should be able to measure reasonably accurately with a stopwatch and then divide by 100,000.

Both those methods will introduce some error because of the time to toggle an I/O line and in the latter case the the loop delays, but I think for your purposes they should be near enough and you might find it easier than trying to calculate it exactly.

-

Actual read time on a SEEPROM is basically instantaneous (one clock cycle, like a serial RAM). You want to measure the data transfer time over the I2C bus, which is a different question, and you have an answer to that.

Write takes longer because a much slower process (Fowler-Nordheim tunneling) is used to erase and then write floating transistor gates at the the target location(s). The write time is milliseconds rather than nanoseconds.

That's why the data sheet doesn't spec read times separately.

-