I2C EEPROM Read/Write

cancel
Showing results for 
Search instead for 
Did you mean: 

I2C EEPROM Read/Write

468 Views
LArmstrong1985
Contributor III

Hi,

I've some problem with an I2C EEPROM (24LC64T).

If I do single Read/Write of one byte / page all works well.

If I try do due consecutive Read or Write I notice some malfunctions with writing the bytes in the wrong position.

Even introducing delays between one writing and another respecting the times indicated in the datasheet (I also tried with very large delays beyond 10ms) the problem remains.

What am I doing wrong?

Must the delay be by chance between the address byte and the data byte?

I am attaching the examples that I have used. They are for a custom board with the k22 microcontroller but can also be used on other micro.

Tags (3)
0 Kudos
4 Replies

385 Views
LArmstrong1985
Contributor III

Hi Myke,

thanks but I should have solved it. 

From what I have seen you must always wait 5 ms after an operation and as regards writing a page you must always write from a multiple address of a page itself (in my case 32 bytes) otherwise it does not increase the internal counter but starts overwriting the same page.

I hope it will be useful to others too :smileyhappy:

385 Views
mjbcswitzerland
Specialist V

Fabio

is specified as 5ms but can be shorter. The best way to handle it is by using the acknowledgement method advised by the chip manufacturer.

pastedImage_1.png

Regards

Mark

[uTasker project developer for Kinetis and i.MX RT]

0 Kudos

385 Views
myke_predko
Senior Contributor III

Good news - thanx for letting me know.

myke

0 Kudos

385 Views
myke_predko
Senior Contributor III

Hi Fabio,

Have you scoped the lines?  I'm wondering if you have marginal signals which are not being read by the EEPROM as intended.

myke

0 Kudos