I2C Spy is pretty spiffy. Is there a way to see the source code without installing it? I don't see it available for the LPC55xx. I don't want to monitor the bus, I want to tell if a device it at a specific address.
According to the I2C spec, Section 3.1.17, Device ID:
The Device ID field (see Figure 20) is an optional 3-byte read-only (24 bits) word giving the following information:
• Twelve bits with the manufacturer name, unique per manufacturer (for example, NXP)
• Nine bits with the part identification, assigned by manufacturer (for example, PCA9698)
• Three bits with the die revision, assigned by manufacturer (for example, RevX)
The Device ID is read-only, hard-wired in the device and can be accessed as follows:
1. START condition
2. The controller sends the Reserved Device ID I2C-bus address followed by the R/W bit set to ‘0’ (write): ‘1111 1000’.
3. The controller sends the I2C-bus target address of the target device it must identify. The LSB is a ‘Don’t care’ value. Only one device must acknowledge this byte (the one that has the I2C-bus target address).
4. The controller sends a Re-START condition.
Remark: A STOP condition followed by a START condition resets the target state machine and the Device ID Read cannot be performed. Also, a STOP condition or a Re-START condition followed by an access to another target device resets the target state machine and the Device ID Read cannot be performed.
5. The controller sends the Reserved Device ID I2C-bus address followed by the R/W bit set to ‘1’ (read): ‘1111 1001’.
6. The Device ID Read can be done, starting with the 12 manufacturer bits (first byte + four MSBs of the second byte), followed by the nine part identification bits (four LSBs of the second byte + five MSBs of the third byte), and then the three die revision bits (three LSBs of the third byte).
7. The controller ends the reading sequence by NACKing the last byte, thus resetting the target device state machine and allowing the controller to send the STOP condition. Remark: The reading of the Device ID can be stopped anytime by sending a NACK.
If the controller continues to ACK the bytes after the third byte, the target rolls back to the first byte and keeps sending the Device ID sequence until a NACK has been detected.
I don't see the built-in drivers supporting this type of transaction, which is a write, re-start, then read. Do you know of an example of this?