T
I C
o
n
fid
e
n
tial
–
N
D
A
R
e
s
tr
ictio
n
s
TCA9554 - I
2
C GPIO Expander
5
TCA9554 - I
2
C GPIO Expander
The TCA9554 GPIO expander is used to enable the DRV2605L device. Because the multi-driver board
has the ability to control up to 8 haptic drivers, the TCA9554 device is able to control the enable lines of
the DRV2605L device through I
2
C and free up GPIO pin space on the MSP430F5510 device for other
peripherals. The pseudo code listed in
shows how the TCA9554 device is used as an output
configuration.
Table 2. TCA9554 Output Configuration Pseudo Code
OPERATION
DESCRIPTION
I2C_SetSlaveAddr(TCA9554_SLAVE_ADDR)
//set slave address
I2C_WriteSingleByte(0x03, ~(bit_set_for_output))
//configure as output port
I2C_WriteSingleByte(0x01, output_bits)
//output values
The TCA9554 device is configured completely through I
2
C commands. The expander must be configured
as an output port for the corresponding drivers (8 drivers). The output port command register is 0x03.
Each bit of the 8-bit value represents the 8 output ports of the device. A value of zero in each bit
corresponds to an output configuration. The variable,
bit_set_for_output
, has the respective bits set as
outputs. When the output port is configured, register 0x03 does not need to be accessed unless those
ports will be used as some other port function. After the ports are configured as outputs, a write command
to register 0x01 is used to set the value of the output to either 0 or 1. The default values for outputs are
initialized to 0. See the TCA9554 data sheet,
, for more information on the TCA9554 device.
5.1
I
2
C Register Value Examples
The following examples listed in
and
show exact I
2
C transactions with slave addresses,
registers, and values to enable one DRV2605L device and to enable three or more DRV2605L devices.
Table 3. TCA9554 I
2
C Transaction for Enabling driver 1
Slave Address (7-bit)
Register
Value
Description
I
2
C Action
Configures IO expander for output port at
1
Write
0x20
0x03
0xFE
channel 1
2
Write
0x20
0x01
0x01
Sends a high signal to output channel 1
Table 4. TCA9554 I
2
C Transaction for Enabling drivers 1, 4, 5, and 8
Slave Address (7-bit)
Register
Value
Description
I
2
C Action
Configures IO expander for output port at
1
Write
0x20
0x03
0x66
channel 1, 4, 5, and (corresponds to drivers
1, 4, 5, 8).
Sends a high signal to output channel 1, 4,
2
Write
0x20
0x01
0x99
5, and (corresponds to drivers 1, 4, 5, 8).
6
TCA9548A - I
2
C Switch
The DRV2605LEVM-MD is designed for multi-driver applications. The TCA9548A I
2
C switch was used to
independently setup haptic drivers and play the waveforms simultaneously. The pseudo code listed in
allows the user to verify proper operation of the I
2
C switch and communication with the DRV2605L
device.
Table 5. TCA9548A Operation Pseudo Code
OPERATION
DESCRIPTION
I2C_SetSlaveAddr(TCA9548_SLAVE_ADDR)
//set slave address
I2C_WriteSingleByte(driver_position)
//channel selection
9
SLOU400 – September 2014
DRV2605L Multi-Driver ERM, LRA Haptic Driver Evaluation Kit User’s Guide
Copyright © 2014, Texas Instruments Incorporated