All i know is what the data sheet says, and it says there is a page size of 32 bytes.
Ok. I looked at the datasheet. If you're signaling at 100kHz, the time you're getting is only just enough for communications. So, the response you get is immediate. The datasheet explicitly says that the input gets disabled during the write cycle. From that, I would conclude that it is most likely a bug in your program and it either doesn't pull ACK at all, or pulls it incorrectly.
Well, there would have to be a bug in the Wire library then because that is what my program really uses to communicate.
I did not write the Wire library, but it is used for a lot of I2C devices like the 1602 LCD display. It seems to work on everything i've used it for.
I don't know what is the Wire library, but I do know that any software may have bugs. Could be a bug in the library. Could be a bug in the code which uses the library. Could be a bug in time measurements. Or perhaps the chip is not AT24C32, but some newer pin-compatible replacement. Any of these seems more likely than a fundamental flaw in the datasheet.
or else the EEPROM is much faster under certain conditions. One of these conditions might be when it is brand new, as this one is.
I think the write cycle uses some sort of internal oscillator to time the write. The oscillator is probably not very accurate which should produce variance in timing between parts (for example, when I was testing write speed with PICs, I found that internally timed operations vary by about 10% between chips). So I guess it can change a little with age, and definitely will change with temperature. But I don't think there could be many-fold difference.
If you write the whole chip with random values without any extra delays between bytes, then read it back and compare, you will see whether you have some sort of bug in the code or not.
I would also read the markings on the chip, just to make sure it is what they say it is.
Do you have a digital scope?
Capture the data and clock signals.
If you only have a analog scope, then put the CPU in a write for ever loop. Set a pin high, write, set pin low, inc pointers, jump to start. Then using scope or frequency counter measure the frequency of the pin. (don't use your CPU to count time)
ALSO
If you write the same information all the time, it might take "no" time. If you write a 3F on top of 3F the memory might signal back done very fast. If you use different data every time it will be slower. (maybe)
When I used one of these chips, I remember having to resend the control byte with the write bit set and the chip will acknowledge only when the write cycle is over. This would, of course, mean altering the write byte routine.
Edit in the datasheet http://www.atmel.com/images/doc0336.pdf ACKNOWLEDGE POLLING is at the bottom of page 9.
Mike.
This way you only ever block read / write...
Funny thing too, before i found out there was an I2C library for the Arduino i write my own mini library to work with an external ADC unit. If i used my own library i would be done by now
I find this a lot though in programming for various things, like Windows too. It seems easier to write something myself than to fool with code that is already written but doesnt quite do the job yet. Seems to take longer trying to understand someone else's code than to just write it myself.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?