Kit Operation | www.ti.com |
If the command is sent with no problem, the returning byte [0] should be the same as the sent one logically or'd with 0x20 - in the second example above (fast mode), the returning packet should be:
[0]0x32
[1]0x80
[2]0x02
[3]0x01
[4]0x45
[5]0xA0
If for some reason the interface fails (for example, the I2C device does not acknowledge), it would come back as:
[0]0x52
[1]0x80
[2]0x02
[3]0x01
[4]0x45
[5]0xA0
If the request is malformed, that is, the interface byte (byte [0]) takes on a value which is not described above, the return packet would be:
[0]0x93
[1]0x80
[2]0x02
[3]0x01
[4]0x45
[5]0xA0
Examples above used writes. Reading is similar:
Read two bytes from device starting at register 1 of an I2C device with address A0:
[0]0x01
[1]0x80
[2]0x02
[3]0x01
The return packet should be
[0]0x21
[1]0x80
[2]0x02
[3]0x01
[4]0x45
[5]0xA0
assuming that the values we wrote above starting at Register 5 were actually written to the device.
24 |
Submit Documentation Feedback