> I know that a slave device requires a unique address and I think that I > understand the process of reading and writing data to and from a device; > however, I have a bit of confusion concerning whether an address is > required. > > If a slave device has an address of 5, is this address the first item > written to the I2C bus? What distinguishes the address of the device from > the address within the device? I don't know what you mean by "address of the device" as apposed to "address within the device". Each IIC bus slave has a unique 7 bit (can also be 11 bit, but this would be unusual in small systems) address. The lines are wiggled in unique ways to start a message and to end a message. All slaves watch for these and therefore know when messages start. The first byte of all messages is sent by the master, and contains the address of the slave that is supposed to react to the message. So again all slaves know when a new message starts and who is being addressed. After the first byte, all slaves except the one that was addressed ignore the message. The addressed slave responds with an ACK. If no slave was addressed then the bus lines are left floating during the ACK bit, which is the NACK condition. If the master gets an ACK it can continue with the message. If it gets a NACK, then it knows nobody is listening and terminates the message. The special slave address of 0 is the "general call" address. This is for broadcast messages. ******************************************************************** Olin Lathrop, embedded systems consultant in Littleton Massachusetts (978) 742-9014, olin@embedinc.com, http://www.embedinc.com -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.