Schmitt-Trigger Inputs and Open-Drain Outputs

Clean up a slow, noisy input with two thresholds. Share one line between many outputs with open drains and a pull-up.

You Will Be Able To

  • Explain why a slow or noisy input makes a plain inverter chatter.
  • Describe how the six-transistor Schmitt trigger gets two thresholds.
  • Build a wired-AND line from open-drain outputs and a pull-up.
  • Choose a pull-up from the rise time, the low level and the current it allows.
Lesson
G9.15
Time
30 min
Runs on
ngspice
Check
5 questions

A sensor drove a slow, slightly noisy line into a counter. The counter counted 3 or 4 for every real event.

TransientA Noisy Ramp into a Plain Inverter and a Schmitt TriggerThe input rises from 0.3 V to 1.5 V in 100 ns, with 60 mV of 200 MHz noise on it.
  • v(in)
  • v(yi), plain inverter
  • v(y), Schmitt trigger
-0.5 V00.5 V1.0 V1.5 V2.0 VVoltage020 ns40 ns60 ns80 ns100 nsTimehalf of the supply-0.5 V00.5 V1.0 V1.5 V2.0 VVoltage050 ns100 nsTimehalf of the supply
  1. Time 40.69 nsv(in) = 833.6 mV · v(yi), plain inverter = 906.1 mV · v(y), Schmitt trigger = 1.802 V

    The input reaches the plain inverter's threshold. Its output starts to fall.

  2. Time 42.17 nsv(in) = 830.2 mV · v(yi), plain inverter = 905.1 mV · v(y), Schmitt trigger = 1.799 V

    A ripple takes the input back below the threshold, and the output rises again.

  3. Time 49.06 nsv(in) = 833.3 mV · v(yi), plain inverter = 899.4 mV · v(y), Schmitt trigger = 1.801 V

    The plain inverter settles after 5 crossings of 0.9 V.

  4. Time 71.64 nsv(in) = 1.213 V · v(yi), plain inverter = 2.55 mV · v(y), Schmitt trigger = 814 mV

    The Schmitt trigger switches only when the input clears its upper threshold, 1.224 V. It crosses 0.9 V once.

Read the plot as a table
Timev(in)v(yi), plain inverterv(y), Schmitt trigger
0 s300 mV1.8 V1.8 V
20 ns540 mV1.799 V1.802 V
40 ns780 mV1.552 V1.802 V
40.69 ns833.6 mV906.1 mV1.802 V
42.17 ns830.2 mV905.1 mV1.799 V
49.06 ns833.3 mV899.4 mV1.801 V
60 ns1.02 V26.74 mV1.804 V
71.64 ns1.213 V2.55 mV814 mV
80 ns1.26 V1.418 mV299.4 µV
100 ns1.5 V109.3 µV280.6 µV

Measured with ngspice 42 on SKY130, 1.8 V. Schmitt trigger all W 1 µm; plain inverter NMOS 1 µm, PMOS 1 µm.

Two Thresholds

A plain inverter has one threshold. An input that lingers near it, or carries noise, crosses it many times.

A Schmitt trigger has two: it switches up at V_T+ and back down at a lower V_T−. Noise smaller than the gap between them cannot make it switch twice.

CircuitInput rising: output switches atInput falling: output switches atHysteresis
Schmitt trigger, all W 1 µm1.224 V0.561 V663 mV
plain inverter, W 1 µm and 1 µm0.833 V0.831 V2 mV

Measured: the lab, a triangle from 0 to 1.8 V in 50 ns and back. Thresholds where the output crosses 0.9 V.

How the Feedback Moves the ThresholdA stack P1, P2, N2, N1 from VDD to ground. N3 and P3 are driven by the output.
  • Device
  • I/O
  • Data
  • Control
How the feedback moves the thresholdA stack P1, P2, N2, N1 from VDD to ground. N3 and P3 are driven by the output. device P1 and P2 upper stack io Output y device N2 and N1 lower stack device N3 on while y = 1: liftsthe node between N2and N1 device P3 on while y = 0: pullsthe node between P1and P2 down gategate
  1. device N2 and N1lower stack
  2. device N3on while y = 1: lifts the node between N2 and N1
  3. io Output y
    • N2 and N1
    • gate → N3
    • gate → P3
  4. device P1 and P2upper stack
    • Output y
  5. device P3on while y = 0: pulls the node between P1 and P2 down
  1. Input rising, y = 1

    N3 is on and holds the node under N2 high. N2's source sits above ground, so the input must rise further before N2 conducts: up to 1.224 V.

  2. Input falling, y = 0

    Now P3 is on and pulls the node above P2 towards ground. The input must fall further before P2 conducts: down to 0.561 V.

  3. Sizing

    Stronger feedback devices widen the gap; a stronger stack narrows it. Problem G9.15.1 sizes them for a given window.

Read the diagram as text
  • P1 and P2: upper stack
  • Output y
  • N2 and N1: lower stack
  • N3: on while y = 1: lifts the node between N2 and N1
  • P3: on while y = 0: pulls the node between P1 and P2 down
  • P1 and P2 → Output y
  • Output y → N2 and N1
  • Output y → N3: gate
  • Output y → P3: gate

Positive feedback: the output moves the threshold away from the input, so a switch, once made, is held.

Open-Drain Outputs and Wired-AND

An open-drain output has only its NMOS. It can pull a line low, or let go. A pull-up resistor makes the line high when every output has let go.

Connect several open-drain outputs to one line. The line is high only if all of them let go: a wired-AND of their inverted inputs. I2C, interrupt lines and reset lines work this way.

TransientA 50 pF Line Rising Through Three Pull-UpsThe NMOS lets go at 1 µs. The pull-up then charges the line.
  • v(l0), 1 kΩ
  • v(l1), 4.7 kΩ
  • v(l2), 10 kΩ
00.5 V1.0 V1.5 V2.0 VVoltage00.5 µs1.0 µs1.5 µs2.0 µs2.5 µs3.0 µs3.5 µs4.0 µsTime90 %10 %00.5 V1.0 V1.5 V2.0 VVoltage01 µs2 µs3 µs4 µsTime90 %10 %
  1. Time 1 µsv(l0), 1 kΩ = 69.01 mV · v(l1), 4.7 kΩ = 14.38 mV · v(l2), 10 kΩ = 6.64 mV

    The driver lets go. Each line rises as an RC charge: no transistor helps.

  2. Time 1.113 µsv(l0), 1 kΩ = 1.62 V · v(l1), 4.7 kΩ = 696.7 mV · v(l2), 10 kΩ = 369.7 mV

    With 1 kΩ the line passes 90 % after 113 ns.

  3. Time 2.15 µsv(l0), 1 kΩ = 1.8 V · v(l1), 4.7 kΩ = 1.787 V · v(l2), 10 kΩ = 1.62 V

    With 10 kΩ it takes 1150 ns.

Read the plot as a table
Timev(l0), 1 kΩv(l1), 4.7 kΩv(l2), 10 kΩ
0 s68.66 mV14.46 mV6.786 mV
500 ns68.66 mV14.46 mV6.786 mV
1 µs68.66 mV14.46 mV6.786 mV
1 µs69.01 mV14.38 mV6.64 mV
1.113 µs1.62 V696.7 mV369.7 mV
1.5 µs1.8 V1.587 V1.14 V
2 µs1.8 V1.775 V1.557 V
2.15 µs1.8 V1.787 V1.62 V
2.5 µs1.8 V1.797 V1.711 V
3 µs1.8 V1.8 V1.767 V
3.5 µs1.8 V1.8 V1.788 V
4 µs1.8 V1.8 V1.796 V

Measured with ngspice 42 on SKY130, 1.8 V. Pull-down NMOS W 20 µm.

Pull-upR × CRise, 10 to 90 %Low levelCurrent while low
1 kΩ50 ns110 ns69 mV1.80 mA
4.7 kΩ235 ns516 ns14 mV0.38 mA
10 kΩ500 ns1099 ns7 mV0.18 mA

Measured rise and low level; R × C and 1.8 V / R are arithmetic.

The rise takes about 2.2 R C, as for any RC charging from 10 % to 90 %. Choose R from the rise time you need. Then check that every driver can sink 1.8 V / R and still reach a valid low.

Lines Nobody Drives, and Lines Everybody Drives

Only open-drain (or tri-state) outputs may share a line. Two push-pull outputs that disagree short the supply through their transistors.

An open CMOS input is a z to a simulator and an unknown voltage in silicon. Tie it to a rail, as lesson G9.14 said.

Asked in interviews
  1. What is hysteresis in a Schmitt trigger?

    Two switching thresholds: a higher one for a rising input and a lower one for a falling input. Noise smaller than the gap cannot make the output switch back and forth.

  2. Why does I2C use open-drain outputs?

    Any device can pull a line low and none can drive it high, so devices never fight. The pull-up makes the line high when all let go, which also allows clock stretching and arbitration.

  3. How do you choose a pull-up resistor?

    Its upper limit comes from the rise time: about 2.2 R C for 10 to 90 %. Its lower limit comes from the current each driver can sink while still reaching a valid low level.

Try It

vtp and vtm are the two thresholds of the Schmitt trigger: 1.224 V and 0.561 V.

vi_up and vi_dn belong to the plain inverter: 0.833 V and 0.831 V, almost the same.

Change the widths of the feedback devices SN3 and SP3 to 0.42 µm and run. The window narrows.

SPICEngspice 42 · simulator service
Edit the netlist, then run it
Expected measurements: vtp = 1.224012e+00 vtm = 5.606323e-01 vi_up = 8.331922e-01 vi_dn = 8.310643e-01

Check Yourself

Predict the outputThe wired-AND program with its pull-up removed. Predict the exact line.
module tb;
  reg a = 0, b = 0;            // each driver pulls the line low when its input is 1
  wire line;
  nmos da (line, 1'b0, a);     // open-drain driver A
  nmos db (line, 1'b0, b);     // open-drain driver B
  initial begin
    for (int i = 0; i < 4; i++) begin
      {a, b} = i;
      #1 $write("%b", line);
    end
    $display("");
  end
endmodule
ConceptWhat does the feedback of a Schmitt trigger do?
ConceptWhy is the 10 to 90 % rise time of an open-drain line about 2.2 R C?
ConceptA designer halves the pull-up on a line. What changes?
ConceptWhy may two push-pull outputs not share a line?

Common Mistakes

Wrong Feed a slow sensor or a long cable straight into a plain gate.

Near its threshold the gate follows every ripple. On the noisy ramp of the figure the plain inverter switched 5 times; the Schmitt trigger switched once.

Fix Use a Schmitt-trigger input wherever an edge can be slow or noisy.

Wrong Leave out the pull-up because some device will pull the line low anyway.

When every open-drain output is off, nothing drives the line. It floats and reads z at switch level, and in silicon it drifts.

Fix Every open-drain line needs exactly one pull-up to the supply of its receivers.

Wrong Choose the largest pull-up to save power.

A 10 kΩ pull-up on 50 pF took 1099 ns to rise from 10 % to 90 %, against 110 ns for 1 kΩ.

Fix Pick the largest resistor that still meets the rise time: R ≤ t_rise / (2.2 C) for 10 to 90 %.

Wrong Choose the smallest pull-up to get a fast edge.

The pull-down must sink 1.8 V / R. With 1 kΩ the line low sat at 69 mV, against 7 mV with 10 kΩ.

Fix Check that the strongest pull-up still lets every driver reach a valid low level within its rated current.

Remember

  • A Schmitt trigger has two thresholds, V_T+ and V_T−; noise smaller than the gap cannot make it chatter.
  • In the six-transistor version the output switches feedback devices that move the threshold.
  • Open-drain outputs only pull low. With one pull-up, several of them form a wired-AND.
  • The pull-up sets a slow RC rise of about 2.2 R C, 10 to 90 %. It also draws current while the line is low.
  • No pull-up gives a floating line; two push-pull drivers give a fight.

Practice

Report a problem with this page