Skip to content

Test: Wires and buses (high-Z, I2C, SPI and I3C)

Buses & Wires

Wires and Buses: High-Z, I2C, SPI and I3C

Before any protocol: what can an output pin do?

Every bus is a wire shared by pins, so it starts with what a pin can do. A push-pull output has two transistors: one connects the wire to VDD, the other to ground, so it drives hard both ways. An open-drain output has only the one to ground: it can pull the wire low or let it go. High impedance (high-Z, or tri-state) means both are off and the pin is, electrically, hardly there. A wire that nothing drives floats unless a pull-up resistor holds it high. Set the two devices sharing this wire and watch the voltage, the current, and what an input would read.

Challenge: Build a shared line where either device can signal and no combination of outputs can do any damage.

Push-pull

Two transistors: one to VDD, one to ground. Drives hard both ways; two of them disagreeing is a short circuit.

Open-drain

Only the transistor to ground. Pulls low or lets go; a pull-up resistor supplies the high. Any device may pull low: a wired-AND.

High impedance

Both transistors off: the pin hardly touches the wire. With nothing else driving and no pull-up, the wire floats.

VDD 3.3 VGNDDevice Apush-pull, 1high sidelow sideDevice Bhigh impedancehigh sidelow side3.30 Vinput reads: 1
← Start here

Device A

Output

Device B

Pull-up

Wire

3.30 V

Current

0.0 mA

An input reads

1

Driven high by a push-pull output.

The transistors are modelled as 25 Ω when on, a typical value; real pins are rated for about 10 to 20 mA. A floating input can also make the input buffer itself draw current as it hovers between levels, which is why unused pins are tied or pulled.