English
Language : 

TCA6408A-Q1 Datasheet, PDF (21/40 Pages) Texas Instruments – Low-Voltage 8-Bit I2C and SMBus I/O Expander With Interrupt Output
www.ti.com
TCA6408A-Q1
SCPS234 – SEPTEMBER 2016
Programming (continued)
Registers are locations in the memory of the slave which contain information, whether it be the configuration
information or some sampled data to send back to the master. The master must write information to these
registers in order to instruct the slave device to perform a task.
While it is common to have registers in I2C slaves, note that not all slave devices will have registers. Some
devices are simple and contain only 1 register, which may be written to directly by sending the register data
immediately after the slave address, instead of addressing a register. An example of a single-register device is
an 8-bit I2C switch, which is controlled via I2C commands. Since it has 1 bit to enable or disable a channel, there
is only 1 register needed, and the master merely writes the register data after the slave address, skipping the
register number.
8.5.2.1 Writes
To write on the I2C bus, the master sends a START condition on the bus with the address of the slave, as well
as the last bit (the R/W bit) set to 0, which signifies a write. After the slave sends the acknowledge bit, the master
then sends the register address of the register to which it wishes to write. The slave will acknowledge again,
letting the master know it is ready. After this, the master starts sending the register data to the slave until the
master has sent all the data necessary (which is sometimes only a single byte), and the master terminates the
transmission with a STOP condition.
Figure 25 and Figure 26 show an example of writing a single byte to a slave register.
Master controls SDA line
Slave controls SDA line
Write to one register in a device
Device (Slave) Address (7 bits)
Register Address N (8 bits)
Data Byte to Register N (8 bits)
S
0
1
0
0
0
0
AD
DR
0
A B7 B6 B5 B4 B3 B2 B1 B0 A D7 D6 D5 D4 D3 D2 D1 D0 A
P
START
R/W=0 ACK
ACK
Figure 25. Write to Register
ACK STOP
<br/>
Master controls SDA line
Slave controls SDA line
Device (Slave) Address (7 bits)
Register Address 0x02 (8 bits) Data Byte to Register 0x02 (8 bits)
S
0
1
0
0
0
0
AD
DR
0
A
0
0
0
0
0
0
1
0
A D7 D6 D5 D4 D3 D2 D1 D0 A
P
START
R/W=0 ACK
ACK
Figure 26. Write to the Polarity Inversion Register
ACK STOP
Copyright © 2016, Texas Instruments Incorporated
Product Folder Links: TCA6408A-Q1
Submit Documentation Feedback
21