SLVAFL2 July 2024 TCA6416A , TCA9555
In a normal push-pull setup, the user can first set the configuration register to be an output then afterwords write to the output register to set the register as an output high or output low. Setting up an open drain configuration is actually very similar.
The following example walks through how to set up using TCA9539 (16-bit IO expander). The command byte table for TCA9539 is provided in Table 2-1 for reference. Examples from this point on can assume TCA9539's device address pins to be tied to Vcc and therefore can have an I2C 7-bit target address of 0x77h. An external pull up resistor can be tied to P07 and P17 to allow for the signal to rise to Vcc, otherwise the toggling can possibly not be visible from a oscilloscope perspective.
Step 2 and step 3 examples show bits P07 and P17 alternate as open drain output low and high impedance while the other pins (Px6-Px0) alternate relative to the 7th bit (if Px7 is high impedance then Px6-Px0 can open drain out lows and if Px7 is open drain output lows then Px6-Px0 can be high impedance).
Command Byte | Register | Power-up default | Comments |
---|---|---|---|
0x00h | Input Port 0 | XXXX XXXX | Not used in this application note |
0x01h | Input Port 1 | XXXX XXXX | Not used in this application note |
0x02h | Output Port 0 | 1111 1111 | Defaults as 1’s, 0 = output low |
0x03h | Output Port 1 | 1111 1111 | Defaults as 1’s, 0 = output low |
0x04h | Polarity Inversion Port 0 | 0000 0000 | Not used in this application note |
0x05h | Polarity Inversion Port 1 | 0000 0000 | Not used in this application note |
0x06h | Configuration Port 0 | 1111 1111 | Defaults as input, 0 = output |
0x07h | Configuration Port 1 | 1111 1111 | Defaults as input, 0 = output |