Hi all piclisters. I wrote some C routines to interface a PIC17C756A (which has a lot of hardware to deal with the I2C byte transfers) to an Atmel AT24C16 EEPROM and at first everithing was fine, because in my application I had to write just a few bytes once in a while. But now I have to completely overwrite the contents of this EEPROM (it is located in a third party module, there are some bytes in this EEPROM that are user avaliable, but now it is time for a firmware upgrade) and my routines does not seem to work at all: I put the new contents of the EEPROM in a "char" array and wrote a "for" loop calling the basic routines that I wrote before; then I wrote another routine that reads back the contents of the EEPROM to check every byte to those in that "char" array, and a breakpoint in the "error found" part of the routine shows me that almost all bytes are wrong - or were not written at all, I should have read and saved the contents of the EEPROM first of all :-(. I have also rewrote the routine to read the byte that was just sent to the EEPROM, and it reads a different value than it was supposed to, even at that moment, with no I2C trafic from the internal processor of this board that could have changed the byte somehow. The datasheet of the AT24C16 says that after a byte write sequence I have to poll the ACK bt after successive sequences of a start condition on the I2C bus and an access to the address of the EEPROM, while this bit is high (NOTACK), I have to wait, but when when it is ready for a new byte, the ACK bit is low, signaling that the EEPROM is ready for a new write cycle. Checking the bus with a digital scope, I can see the write sequence and it is as expected, exactly as the I2C specs, and after the writing I can see the polling, but in just a few of them the processor thinks that it has got an ACK and stops the polling. Considering that I must have some noise, I wrote a 16 ms delay loop (Atmel says that the write sequence takes 10 ms) and even then I still read wrong bytes. Has anyone I2C experience with 17C7XX? Am I missing something? Thanks Francisco -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body