I've had some problems like this. Reading the I2C spec of the 24xxx EEPROM, I noticed that you cannot read the recently stored value immediately after a write cycle to the E2PROM, you have to keep sending its address over the I2C buss until it signals an ACK, then it is ready for another operation (it can accept a burst write, it has a buffer - don't remember its size - so you may send several bytes at once, but you'll have to wait much more time till it gets available again). I have also noticed that the ACK is very important to get to know if the EEPROM is really "understanding" what was sent to it, so if you get a NOACK, send the data again. Edward Cooper wrote: > Hi > > If someone could help me here, I'm trying to get I2C up and running > using a 24LC256 and a 16F877, I've put some code together mainly > chopped bits of other peoples code! However it doesn't work, when I > read the data back from the EEPROM all I get is 1's, now in the data > sheet when reading you are meant to issue a start command send the > control byte address high and low byte and then issue another start. > It won't let me do this (it gets stuck) so I issue a restart instead > however this doesn't seem to work. > > Basically Im asking what is the difference between these two different > commands!? > > Thanks for any help > > Ed Cooper > > -- > http://www.piclist.com hint: PICList Posts must start with ONE topic: > [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads > > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.