TCA9555 — sixteen digital inputs and outputs¶
Supported
A driver ships with inoCORE. This part can be used today.
What it does¶
Adds sixteen digital pins over two wires. On a board where the display and the buses have already eaten the general-purpose pins — which is most boards with a large display — this is how you get buttons, lamps and relay drives back.
Each of the sixteen is an input or an output, set per pin.
Parameters¶
| Pins | 16, each an input or an output |
| Interface | I²C |
Bus and addressing¶
I²C, addresses 0x20–0x27, chosen by three address pins. Eight of them on one bus is 128 pins, which is well past the point where the wiring becomes the problem.
Wiring¶
Power, ground, SDA and SCL, plus the address pins tied high or low. An output drives a load to ground far better than it drives one to the supply — for a relay or a lamp, switch the low side, or use a transistor.
In a project¶
peripherals:
- { type: TCA9555, name: io1, bus: i2c, addr: 0x20 }
tags:
- name: start_button
datatype: bool
source: { periph: { chip: io1, pin: 3 } }
The direction of each pin is set on the chip's page in the editor, where the pin table binds each pin to a tag.
Traps¶
| Trap | What to do |
|---|---|
| Expecting an interrupt-fast input | The pins are read over I²C once per cycle, so a pulse shorter than a cycle can be missed. A pushbutton is fine; a pulse counter is not. |
| An address that collides | 0x20–0x27 is a busy neighbourhood — several common parts live there. Check what else is on the bus first. |