C710 of 57
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

C7 · Lesson 10 · Tri-state and open-drain outputs

Letting several chips share one wire

An ordinary CMOS output always drives its wire: high or low. Connect two such outputs to one wire and, sooner or later, one drives high while the other drives low, and a large current flows from the supply through both to ground. Buses that several chips share need outputs that can step aside. There are two ways to do it: an output that can turn both its transistors off, and one that only ever pulls down.

Play

  • The curve is an open-drain bus line rising after the last device lets go: a pull-up resistor charges the bus capacitance.
  • Raise the resistor or the capacitance and the edge slows. The marked readout is the 30% to 70% rise time that bus standards specify.
  • A smaller resistor speeds the edge, but every device pulling low must then sink more current.

Predict

Two tri-state drivers on a 3.3 V bus are enabled at once by mistake; one drives high and the other low. Each has 50 Ω of on-resistance. What happens?

Name it

Tri-state outputs

A tri-state driver has an enable: enabled, it drives 0 or 1 like any output; disabled, both its transistors are off and the output floats in a high-impedance state (Z). Several drivers can share a bus if exactly one is enabled at a time. If none is enabled the bus floats, so it's usually held by a weak pull-up or a bus keeper; if two are enabled with different values, they fight, with a current of VDDRon1+Ron2.

Open-drain outputs

An open-drain (or open-collector) output has only the pull-down transistor. It can pull the wire low or let go; a pull-up resistor Rp returns it high. Any device pulling low wins, so the line computes the AND of all the devices' outputs, a wired-AND, and there's never contention. Shared interrupt lines, resets and the I²C bus use it.

Choosing the pull-up

When the last device lets go, the line rises as an RC charge, from 30% to 70% of VDD in

tr=RpCbusln⁡73=0.847RpCbus.

A bus standard caps tr, which caps Rp. Each device must also be able to pull the line below its VOL while sinking the pull-up's current, which sets a minimum:

Rp≥VDD−VOLIOL.

A smaller Rp gives faster edges but more current and power whenever the line is low.

Worked example

An I²C bus on 3.3 V has 400 pF of capacitance, a 1 µs rise-time limit, and devices that can sink 3 mA at 0.4 V. What pull-up resistors are allowed?

Show the solution
  1. Rise-time limit. Rp≤1μs0.847×400pF=2.95kΩ
  2. Sink-current limit. Rp≥3.3−0.43mA=967Ω
  3. Pick a value. Any value between, such as 2.2 kΩ, works.
  4. The faster mode. At 200 pF and a 300 ns limit, the maximum drops to 1.77 kΩ, so heavily loaded fast buses need stronger pull-ups or current-source drivers.

Answer anything from 967 Ω to 2.95 kΩ, such as 2.2 kΩ.

Worked example

Three devices share an open-drain interrupt line with a pull-up. Device A outputs 1, B outputs 0, C outputs 1. What does the line read, and what if B lets go?

Show the solution
  1. B pulls the line low. B's transistor is on, so the line reads 0: 1⋅0⋅1=0 a wired-AND.
  2. B lets go. No device pulls low, and the pull-up returns the line to 1.
  3. Read it as an interrupt. Read as an active-low interrupt, the line says "someone needs service" whenever any device pulls it, which is exactly what a shared interrupt needs.

Answer the line reads 0, and returns to 1 when B lets go.

Worked example

How much does the contention in the predict cost, and how much does a pull-up of 2.2 kΩ on 3.3 V cost while a device holds the line low?

Show the solution
  1. Contention. 33 mA flows, and the power is P=3.32100=0.11W split between the two fighting outputs.
  2. The pull-up. While the line is low, I=3.3−0.42200=1.3mA flows, about 4 mW.
  3. Compare. The open-drain bus spends a little power continuously in exchange for never fighting.

Answer contention costs 0.11 W (33 mA); the pull-up costs about 4 mW (1.3 mA) while the line is held low.

Check

Two enabled tri-state drivers on a 3.3 V bus fight: one with 20 Ω drives high, the other with 80 Ω drives low.

(a)

What current flows?

Write units the way you normally would: 1.5 mA, 1500 µA and 0.0015 A are the same answer.

(b)

What voltage does the bus sit at?

Check

An open-drain bus on 3.3 V has 100 pF, a 1 µs rise-time limit, and devices that sink 20 mA at 0.4 V.

(a)

What's the largest pull-up?

Write units the way you normally would: 1.5 kΩ, 1500 Ω and 0.0015 MΩ are the same answer.

(b)

What's the smallest?

Check

Three open-drain outputs A, B and C share a line with a pull-up. Write the line's value.

Write AND as · or & (or just AB), OR as +, XOR as ⊕, and NOT as ¬ or a trailing ': A·B + C' works.

Check

What's the 30% to 70% rise time of an open-drain line with a 2.2 kΩ pull-up and 50 pF?

Write units the way you normally would: 1.5 ns, 1500 ps and 0.0015 µs are the same answer.

Check

Several chips share a bus where any of them may need to signal a fault at any moment, without coordination. Which output type should drive it?

Check

Write pullup_range(V, C, tr, Vol, Iol) returning (Rmin, Rmax) in ohms for an open-drain bus: the smallest pull-up the drivers can overcome and the largest that meets the 30% to 70% rise time tr.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Explain why

Why can't two ordinary CMOS outputs share a wire, while two open-drain outputs can?

Practice

Keep practicing

5 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.