I2C EEPROM Read/Write

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

I2C EEPROM Read/Write

1,262 次查看
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.

标记 (3)
0 项奖励
4 回复数

1,178 次查看
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:

1,178 次查看
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 项奖励

1,178 次查看
myke_predko
Senior Contributor III

Good news - thanx for letting me know.

myke

0 项奖励

1,178 次查看
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 项奖励