This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Write fails but Read successful in EEPROM using I2C protocol

Hello there I have almost completed coding interfacing with EEPROM - AT24C04 using I2C protocol,But using this I am able to perform a "READ" operation but not a WRITE.

To reconfirm the working of my Microcontroller Kit,I am using a similar kind of program( found on this forum ) for interfacing the EEPROM using I2C and this program works!!.

This program that I found can do both READ/WRITE....

But when I burn my program on the MC ..it cannot write but it can read the values stored at addresses 0x000,0x001,0x002 using the program found on this forum.

I have checked for the WP(write protect pin) and its alright - connected to ground.

Its strange ..but I coded it all by myself referring the datasheets and timimg diagrams etc..After debugging for almost a week I am unable to find that kind of deceptive error.

If my programs can READ data from EEPROM then its as good as saying that my program can write data to EEPROM because the READ operation requires a DUMMY WRITE and then we would then read the byte from EERPOM.

Can someone let me know as to what mistake I am making ...I could not paste the whole project code I coded since this site doesn't allow more than 7000 characters in one post.

Please take a look at this link http://pastebin.com/fzV9R6hzfor my complete project code.

I have also included the Source code found on the forum for reference since it works for both READ & WRITE

Thanks and regards

Parents Reply Children
  • I indeed involved other people and they too have beemn pondering about what might have gone wrong ..because they too can't figure out
    or maybe did not have the time to extract the significant parts from a "project".

    I am trying to get it worked for the past 8 days or so
    if you, day one, had extracted the EEPROM code into a simple program and published it, you would have been up and running a week ago. Your unwillingness to help those that may be willing to help you only hurts you

    btw you keep saying there is no difference between the write before read and a write there is a difference: if your code can wirie one byte, but not multiple bytes, read will work, write will not

    Erik