>when I read the data back from the EEPROM all I get is 1's Despite a lot of talk about the bus, if you get all 1's then you are reading 1's from the data line and so it really is in a high state. So you best bet is to check for the ack like the others have said. >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) Does it get stuck at the control byte high, low, or at the "another start"? It make a difference...I'll bet you get stuck in a "read", which you didn't mention. >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!? >Ed Cooper I noticed no one answered your question. There is no actual command called a restart. There is one called a repeated start. You have two choices: - you can issue a STOP followed (real quick) by a START - you issue a START by itself. This is the Repeated Start. The intent is that you can keep talking to your device without anything else getting control of the i2c bus. Note that you send the device address again (in order to switch from write to read) after the START. By repeating the start, you get to resend the address and since nobody saw a STOP they are still waiting their turn on the bus. I believe this is the right way. I say this because I saw a paper that stated the STOP/START was the way to do it. I think the "real quick" qualification constitutes wishful thinking and that it's really asking for a race condition. In the end, it is the slave chip that determines what will work and what will not; if they don't follow the spec (or interpret it differently) then they would have to be programmed in a "different" manner. I suspect the EEPROM would work with either method; I wrote some code using a Repeated start and that worked fine in my case. Verify that ACK. Barry -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.