Re: problems with I2c



On 25 Nov 2006 12:21:23 -0800, ddshore@xxxxxxxxx wrote:

Hi,

I'm having some problems using i2c to write to an eeprom, a 24lc515.
Sometimes it'll write to it without any problems, and sometimes it
won't write at all.
The code I am using is this:

void EE_wr_byte(int EE_address, char data)
{
<snip>

I really don't understand what I'm doing wrong. At first I thought it
was a delay issue, so I added some delays between the write and read
cycles, however this does not change anything.

Any help would be appreciated
It is probably a delay issue. Writing 1 bytes takes like 10 msec
because it has to do some erasing internally. Writing multiple bytes
in the same page also takes 10 msec.
Read the part about aknowledge polling in the data***.
If you want to verify this is your problem, add like 10 or 20 msec of
delay after writing 1 byte.

Patrick
.


Quantcast