8.5 Programming
The TS3USBCA4 can be controlled using I2C. The SCL and SDA terminals are used for I2C clock and I2C data respectively.
Table 5. TS3USBCA4 I2C Slave Address
ADDR |
Bit 7 (MSB) |
Bit 6 |
Bit 5 |
Bit 4 |
Bit 3 |
Bit 2 |
Bit 1 |
Bit 0 (W/R) |
ADDR0 |
1 |
0 |
1 |
1 |
1 |
0 |
0 |
0/1 |
ADDR1 |
1 |
0 |
1 |
1 |
1 |
0 |
1 |
0/1 |
The following procedure should be followed to write to TS3USBCA4 I2C registers:
- The master initiates a write operation by generating a start condition (S), followed by the TS3USBCA4 7-bit address and a zero-value “W/R” bit to indicate a write cycle
- The TS3USBCA4 acknowledges the address cycle.
- The master presents the sub-address (I2C register within TS3USBCA4) to be written, consisting of one byte of data, MSB-first.
- The TS3USBCA4 acknowledges the sub-address cycle.
- The master presents the first byte of data to be written to the I2C register.
- The TS3USBCA4 acknowledges the byte transfer.
- The master may continue presenting additional bytes of data to be written, with each byte transfer completing with an acknowledge from the TS3USBCA4.
- The master terminates the write operation by generating a stop condition (P).
The following procedure should be followed to read the TS3USBCA4 I2C registers:
- The master initiates a read operation by generating a start condition (S), followed by the TS3USBCA4 7-bit address and a one-value “W/R” bit to indicate a read cycle
- The TS3USBCA4 acknowledges the address cycle.
- The TS3USBCA4 transmit the contents of the memory registers MSB-first starting at register 00h or last read sub-address+1. If a write to the I2C.register occurred prior to the read, then the TS3USBCA4 shall start at the sub-address specified in the write.
- The TS3USBCA4 shall wait for either an acknowledge (ACK) or a not-acknowledge (NACK) from the master after each byte transfer; the I2C master acknowledges reception of each data byte transfer.
- If an ACK is received, the TS3USBCA4 transmits the next byte of data.
- The master terminates the read operation by generating a stop condition (P).
The following procedure should be followed for setting a starting sub-address for I2C reads:
- The master initiates a write operation by generating a start condition (S), followed by the TS3USBCA4 7-bit address and a zero-value “W/R” bit to indicate a write cycle.
- The TS3USBCA4 acknowledges the address cycle.
- The master presents the sub-address (I2C register within TS3USBCA4) to be written, consisting of one byte of data, MSB-first.
- The TS3USBCA4 acknowledges the sub-address cycle.
- The master terminates the write operation by generating a stop condition (P).
NOTE
Upon reset, the TS3USBCA4 sub-address is always set to 0x00. The TS3USBCA4 increments the sub-address by one after each successful read or write transaction, so that the next read transaction that does not explicitly specify the sub-address will start from the next register.