123 Main Street, New York, NY 10001

Programmable-Hysteresis Comparator: Independent VTH+/VTH−

← Back to:Comparators & Schmitt Triggers

Programmable-hysteresis comparators turn noisy, slow, real-world signals into clean digital edges by setting reliable switching thresholds. This page shows how to calculate VTH+/VTH−, choose R/I/DAC approaches, and verify on the PCB so the threshold behavior matches the design.

What this page solves (Programmable hysteresis for clean switching)

Programmable hysteresis turns a noisy or slow-moving analog signal into a clean digital edge by using two switching points: VTH+ (rising threshold) and VTH− (falling threshold). This prevents chatter, false triggers, and multi-toggling near the threshold, while keeping thresholds computable, repeatable, and manufacturable.

Typical symptoms
  • Slow ramps or drifting signals cause multiple output toggles around the threshold.
  • EMI / long wires inject ripple, producing random false trips and unstable edges.
  • Threshold behavior changes across boards or temperature because the design lacks a threshold error budget.
Root-cause chain (why chatter happens)
Slow slope keeps the input near the decision point for a long time → noise/EMI ripple repeatedly crosses a single threshold → the comparator has no state memory → output toggles multiple times. Hysteresis fixes this by separating the rising and falling thresholds.
What “programmable hysteresis” means (3 levels)
  1. Programmable width: VHYS = VTH+ − VTH− can be tuned (R / I / DAC).
  2. Programmable placement: the center threshold can be moved (divider / VREF / DAC).
  3. Independent thresholds: VTH+ and VTH− can be set asymmetric when rising and falling decisions require different limits.
Fit / Not-fit boundary (quick decision)
Scenario Hard indicator Recommended move Not fit / redirect
Slow ramps (battery/NTC/RC) Input lingers near threshold Set VHYS from measured noise (2–5× ripple)
Long wires / industrial inputs EMI ripple + bounce near threshold Hysteresis + small RC + layout/protection hooks
Precision thresholds / compliance windows Absolute VTH error must be budgeted Small VHYS + offset/drift + Ibias×R budget If true window logic dominates, see “Window Comparator” page
ns-class timing / ToF sampling gates Edge jitter / latch timing is the KPI Use hysteresis only as a helper, not the main design lever For jitter/latched chains, see “High-Speed / Latched Comparator”
30-second checklist (pass/fail)
  • Observed multi-toggling near the threshold → hysteresis is required.
  • Ramp is slow (lingers at VTH) → VHYS must scale up with noise ripple.
  • Source impedance is high (tens of kΩ+) → Ibias×R and leakage can dominate VTH error.
  • Long wires / EMI present → hysteresis must be paired with small RC + protection/layout.
  • Rising/falling decisions need different limits → independent VTH+ / VTH− is a requirement.
Slow ramp with noise: multiple toggles without hysteresis vs single toggle with hysteresis Two-panel diagram. Left shows a noisy slow ramp crossing a single threshold and causing multiple toggles. Right shows VTH+ and VTH− hysteresis window producing a single stable toggle. No hysteresis With hysteresis VTH noise ripple multiple toggles VTH+ VTH−

Comparator hysteresis building blocks (R feedback vs current injection vs DAC/REF)

Programmable hysteresis is implemented through three practical routes. Each route shifts the same outcome (VTH+ and VTH−), but the dominant error sources, power cost, and calibration options differ. This section separates the routes and provides an execution-ready selection guide.

Three routes (what changes, what dominates)
1) Resistor positive feedback (Rfb)
  • Best for: lowest BOM, fixed hysteresis, most general purpose designs.
  • What is programmable: VHYS and threshold placement via R ratios.
  • Dominant pitfalls: Ibias×Rsource, leakage on high-impedance nodes, real Vout_H/Vout_L levels.
2) Current injection (Ihys pin / external current)
  • Best for: dynamic tuning (MCU-controlled), nano-power wake thresholds, linear VHYS control.
  • What is programmable: VHYS by adjusting I (often independent of divider ratio).
  • Dominant pitfalls: current-source drift, bias/leak coupling, injected noise on the hysteresis node.
3) DAC / reference participation (threshold generator)
  • Best for: manufacturable programmable thresholds, independent VTH+ and VTH−, trimming/guardband.
  • What is programmable: threshold placement and asymmetry; hysteresis can be fixed or also programmable.
  • Dominant pitfalls: Vref/DAC noise, reference TC, coupling from digital updates into the threshold node.
Route selection (execution-ready)
Goal Pick Hard condition Primary trade-off / watch item
Lowest cost, fixed behavior R feedback No need for runtime tuning Ibias×R, leakage, real output swing
MCU adaptive hysteresis (field tuning) Current injection A controllable Ihys source is available I drift and coupling noise on the hysteresis node
Independent VTH+ / VTH− (asymmetric) DAC / REF Separate threshold generation is required Vref/DAC noise, update coupling, TC budget
Ultra-low-power wake thresholds Current injection Divider current must be minimized Leakage and bias currents can dominate at nA scale
Common mix-ups (and the fix)
  • Assuming rail output levels: compute VTH using actual Vout_H/Vout_L (including load and pull-up), not ideal rails.
  • Using MΩ dividers “for low power”: leakage and contamination shift VTH; reduce impedance or add guarding/coating.
  • Changing pull-up to “speed up” OD outputs: rise time improves but current noise and ground bounce can worsen toggling; validate at the threshold node.
  • Injecting hysteresis current from a noisy digital domain: filter/decouple the Ihys path; keep injection routing short and away from fast edges.
  • Using a logic Schmitt gate when thresholds must be accurate: gate thresholds are not precision-trimmable; use comparator + designed VTH budget instead.
Comparator hysteresis implementation routes: R feedback, current injection, and DAC/reference threshold generation Three-column block diagram comparing resistor feedback, hysteresis current injection, and DAC/reference participation. Each column shows Vin, comparator core, threshold/hysteresis module, and digital output. R feedback (Rfb) Current injection (Ihys) DAC / REF Vin Comparator core Rfb VTH+ / VTH− Digital out Vin Comparator core Ihys ΔV via I Digital out Iup Idn Vin Comparator core DAC / REF VTH+ / VTH− Digital out

The threshold model (derive VTH+ and VTH− that you can actually use)

A programmable-hysteresis design is only “real” when VTH+ and VTH− can be computed from a clear model using real-world values (actual output swing, source resistance, bias currents, and reference noise). This section defines a unified symbol set and a minimal formula set that stays valid on real boards.

Unified symbols (use the same names across the page)
Symbol Meaning Where it comes from
Vin Input signal to be thresholded Sensor / front-end output
Vref Comparator reference (decision level at the other input) Internal ref / divider / DAC / buffered ref
Vout_H / Vout_L Actual output high/low levels under load Data sheet IOH/IOL conditions or measurement
Rin Input resistor into the hysteresis summing node Design choice (power vs bias/leak sensitivity)
Rf Positive feedback resistor (from output into the summing node) Design choice (sets hysteresis via ratio)
β Feedback weight at the summing node β = Rin / (Rin + Rf)
VHYS Hysteresis width VHYS = VTH+ − VTH−
Minimal formula set (usable on real boards)
Summing-node model
The hysteresis input node is a weighted mix of the input and the output:
Vnode = (1 − β)·Vin + β·Vout
β = Rin / (Rin + Rf)
Switching condition
A threshold event happens when the summing node equals the reference at the comparator input.
Vnode = Vref ⇒ Vin = (Vref − β·Vout) / (1 − β)
Equivalent: Vin = Vref + (Rin/Rf)·(Vref − Vout)
Upper / lower thresholds
  • Upper threshold (VTH+): input rising, output is still low → use Vout = Vout_L.
  • Lower threshold (VTH−): input falling, output is still high → use Vout = Vout_H.
VTH+ = Vref + (Rin/Rf)·(Vref − Vout_L)
VTH− = Vref + (Rin/Rf)·(Vref − Vout_H)
VHYS = VTH+ − VTH− = (Rin/Rf)·(Vout_H − Vout_L)
Why VTH+ and VTH− are not perfectly symmetric in practice
1) Source resistance changes the effective ratio
Any series resistance (sensor output impedance, protection resistor, RC filter resistor) adds to Rin, which changes β and therefore both thresholds. Use Rin,eff = Rin + Rs in all calculations.
Replace Rin → Rin,eff = Rin + Rs
2) Input bias and leakage create hidden threshold shifts
Bias currents and board leakage convert the input-node Thevenin resistance into a voltage error. As resistor values increase, this term often becomes dominant. A first-order check uses the node resistance:
Req ≈ Rin || Rf ⇒ ΔVnode ≈ (Ibias + Ileak) · Req
Threshold error scales up by ~1/(1 − β)
3) Reference noise becomes edge jitter on slow ramps
Even if VTH is correct on average, noise on the reference or at the input node moves the crossing instant. On slow ramps, the dominant symptom is timing jitter:
tjitter ≈ Vnoise / (dVin/dt)
This is why a design can “look stable” on fast edges but still chatter on slow or drifting signals unless VHYS is sized from measured noise.
Hysteresis transfer curve with VTH+ and VTH− and a compact variable dictionary Left: transfer curve showing output high/low states and the two switching thresholds for rising and falling input. Right: compact table listing key variables used in the threshold model. Transfer curve (hysteresis) Vin Vout Vout_H Vout_L VTH− VTH+ VHYS Variable dictionary Vin input Vref reference Rin input R Rf feedback R β Rin/(Rin+Rf) VTH+/− thresholds VHYS VTH+−VTH−

Resistor-feedback design (classic positive feedback, step-by-step)

This section converts requirements into resistor values using the model above. The workflow is built for real boards: actual output levels, source resistance, and bias/leakage are treated as first-class inputs.

Step-by-step design flow (from specs to Rin / Rf)
  1. Define thresholds. Choose VTH+ and VTH−, or define Vcenter and VHYS. Set VHYS from measured ripple: start with VHYS ≥ 2–5× noise_pk for slow ramps.
  2. Lock real output levels. Determine Vout_H and Vout_L under the intended load (OD pull-up, logic input, cable). Threshold math must use these real values.
  3. Pick a resistor scale. Choose Req ≈ Rin||Rf low enough that bias/leakage stays below the threshold budget. Larger resistors save current but amplify Ibias×Req and contamination leakage.
  4. Solve the ratio (Rin/Rf). Use either VHYS or one threshold:
    Rin/Rf = VHYS / (Vout_H − Vout_L)
    Then verify both VTH+ and VTH− using Vout_L and Vout_H
  5. Re-check with real non-idealities. Replace Rin → Rin+Rs, apply bias/leak estimates, and verify thresholds across temperature and tolerance. If the design fails, adjust resistor scale (Req), VHYS, or the reference strategy.
Mandatory sanity checks (avoid the common failures)
  • Output swing check: recalc VTH+ with Vout_L and VTH− with Vout_H at the real load (including OD pull-up).
  • Source impedance check: recalc with Rin,eff = Rin + Rs(min/max). Threshold drift here is often larger than resistor tolerance.
  • Bias/leak check: ensure (Ibias + Ileak)·Req remains well below the allowed threshold error after scaling by ~1/(1−β).
  • Noise-to-chatter check: if Vin slope is slow, verify VHYS still exceeds the effective ripple at the input node after coupling/filters.
Numeric example (generic; no part number dependency)
Given: Vref = 1.20 V, Vout_H = 3.30 V, Vout_L = 0 V. Target hysteresis width VHYS = 0.30 V (for slow ramp + ripple).
Rin/Rf = VHYS / (Vout_H − Vout_L) = 0.30 / 3.30 ≈ 0.0909
Choose Rin = 100 kΩ ⇒ Rf ≈ 100 kΩ / 0.0909 ≈ 1.10 MΩ
Verify thresholds using real output states:
VTH+ = Vref + (Rin/Rf)·(Vref − Vout_L) = 1.20 + 0.0909·(1.20 − 0) ≈ 1.309 V
VTH− = Vref + (Rin/Rf)·(Vref − Vout_H) = 1.20 + 0.0909·(1.20 − 3.30) ≈ 1.009 V
This yields ~0.30 V hysteresis centered near Vref. If the center threshold needs to move, adjust Vref (or the reference/DAC strategy) while keeping the same Rin/Rf ratio for VHYS.
Two quick “real board” checks
  • OD pull-up impact: if Vout_H drops under load (or rises slowly), recompute VTH− and validate with scope.
  • Series resistor impact: if Rs = 10 kΩ in front of Rin, use Rin,eff = 110 kΩ and recompute both thresholds.
Classic resistor-feedback programmable hysteresis comparator: Rin and Rf set VTH+ and VTH− Block-style schematic showing Vin feeding a summing node through Rin, positive feedback from Vout through Rf, comparator core comparing to Vref, and labels for Vout_H/Vout_L and VTH+/VTH−. Vin Vnode Rin Comparator core + Vref reference Vout Vout_H Vout_L Rf VTH+ / VTH−

Current-injection / programmable hysteresis pins (Ihys, external current source)

Current-injection hysteresis uses a programmable current (Ihys) to shift the effective switching thresholds. Compared with resistor-only feedback, the hysteresis width is typically more linear vs control input, offers wider adjustment range, and is easier to digitally control (sleep/wake policies, environment-dependent noise, or dynamic debounce).

Why current-injection hysteresis is attractive
  • Linear knob: VHYS scales approximately with Ihys times the effective node resistance.
  • Wide dynamic range: a small current change can create a large threshold shift without large resistor changes.
  • Digital control fit: firmware can adjust hysteresis based on mode (startup, normal run, fault handling, deep sleep).
  • Low-power wake-up: very small Ihys can maintain a stable threshold with minimal static current.
Usable model: Ihys → threshold shift

Treat the injection point as a summing node. The injected current produces a node-voltage offset set by the node’s effective Thevenin resistance:

ΔVnode ≈ Ihys · R_equiv
R_equiv = effective resistance seen by the injection node (includes dividers + source resistance)

The resulting threshold shift depends on where the current is injected (input node vs reference node) and on the comparator’s threshold definition. For design work, treat that mapping as a topology factor k (typically near unity):

ΔVTH ≈ k · Ihys · R_equiv
Use k as a measured/validated coefficient if the injection point is internal or undocumented.
Temperature drift: what actually moves the thresholds
1) Ihys drift and quantization
Current sources drift with temperature and supply, and digital control (DAC/PWM) introduces finite step size. Threshold stability depends on the worst-case Ihys variation, not the typical value.
2) R_equiv drift (divider TC + source-R variation)
The node resistance includes external resistors and any series source resistance. Tolerance and TC directly scale the Ihys-to-threshold gain.
3) Control-noise coupling into the threshold node
If Ihys is driven by MCU updates, edges and ripple can appear as threshold jitter. Filtering and update policies matter more than headline “accuracy.”
Ihys design checklist (practical, testable)
  • Ihys range: verify Ihys(min/max, temp) spans the required VHYS range with margin.
  • R_equiv bounds: compute R_equiv(min/max) including divider tolerance and source resistance (Rs) variation.
  • Noise filtering: add a low-pass path (or buffered drive) so Ihys control ripple does not appear as threshold jitter.
  • Update policy: avoid updating Ihys near the switching region; update only in a safe state or away from thresholds.
  • Power-up defaults: choose a default Ihys state that prevents false wake-up/fault triggers during startup ramps.
  • Leakage robustness: if R_equiv is high, validate humidity/contamination leakage by measuring threshold drift on worst-case boards.
Quick sizing: choose Ihys so that VHYS_target ≈ (Iup − Idn) · R_equiv
Validate the approximation by measurement if the injection point is internal or not fully documented.
Current-injection hysteresis (Iup/Idn) shifting VTH+ and VTH− Block diagram with comparator, a summing node, and a programmable current module injecting Iup and Idn into the input node to separate rising and falling thresholds. Vin Vnode Comparator core + Vref reference Vout Ihys module Iup / Idn Iup Idn VTH+ / VTH−

Make VTH+ / VTH− independent (two thresholds, not just “one threshold + hysteresis”)

Independent thresholds are the core value of programmable hysteresis: VTH+ and VTH− can be set separately to match asymmetric safety margins, window rules, or direction-dependent system behavior. This is different from traditional hysteresis where both thresholds are tightly bound to a single knob.

When independent thresholds are a hard requirement
  • Window rules: entering and exiting a valid region must use different margins to prevent chatter.
  • Asymmetric safety margins: trip must be conservative while release can be relaxed (or the opposite).
  • Direction-dependent behavior: mechanical backlash, thermal drift direction, or biased shaping requires different switch points.
Three practical ways to decouple VTH+ and VTH−
Approach A: dual references + state select (Vref_high / Vref_low)
Use one reference while output is low (sets VTH+), and a different reference while output is high (sets VTH−). This delivers strong absolute control and reduces dependence on output swing.
Watch: reference switching transients must be isolated from the threshold node.
Approach B: DAC-controlled reference + fixed hysteresis
Keep a small fixed hysteresis for chatter immunity, and move the reference with a DAC after each state change. This creates two independent targets while maintaining a predictable minimum VHYS.
Watch: update only away from the switching region to avoid self-triggering.
Approach C: separate current injections (Iup / Idn)
Use one injection current for rising decisions (Iup → VTH+), and a different current for falling decisions (Idn → VTH−). This offers a wide and power-efficient control range in current domain.
Watch: current-source noise and drift directly translate into threshold error unless filtered and budgeted.
Comparison: choosing the right independent-threshold strategy
Decision field A: Dual refs B: DAC ref C: Iup/Idn
Complexity / BOM More refs + select DAC + update logic Current sources + filters
Absolute accuracy Strong (ref-driven) Depends on DAC/ref Depends on I+R_equiv
Glitch / transient risk Ref switch coupling DAC update coupling I ripple coupling
Low-power fit Good if refs are low-Iq Depends on DAC mode Strong for wake-up
Calibration friendliness Ref trim friendly Best for field tuning Needs I/R verification
Independent VTH+ and VTH− using a threshold generator (DAC/refs/Iup/Idn) Block diagram showing a Threshold Generator module producing two separate outputs VTH+ and VTH− to drive a comparator decision path, with internal sources labeled DAC/REF, Vref_high/low, and Iup/Idn. Comparator core + Vin Threshold Generator DAC/REF Vref_high/low state select Iup / Idn (current domain) VTH+ VTH− Vout

Error budget (offset, bias, leakage, tolerance, reference noise → threshold error)

Threshold accuracy is rarely limited by a single headline spec. The practical approach is to convert every contributor into an equivalent threshold voltage error (ΔVTH), then identify the dominant term and apply the most effective suppression lever.

Unify everything as an equivalent threshold error
ΔVTH_total ≈ Σ |ΔVTH,i|
Use worst-case (corner) values for guardband decisions. Validate unknown topology factors by measurement.
Systematic (DC) terms: the most common root causes
Offset and drift (Vos, drift)
Input-referred offset directly shifts the switching points.
ΔVTH,Vos ≈ ±Vos(max over temperature)
Suppress: lower Vos/drift device, add guardband, or calibrate if the system allows.
Bias current × source resistance (Ibias × Rsource)
High-impedance dividers and series resistors convert input bias current into a node offset that moves the effective thresholds.
ΔVnode ≈ Ibias(max) · R_equiv
Suppress: reduce divider impedance, reduce Rs, choose lower Ibias across temperature, or buffer the node.
Leakage (humidity, contamination, PCB surface paths)
Leakage behaves like an invisible resistor that drags the threshold node. It is often intermittent and strongly environment-dependent.
Suppress: lower node impedance, improve cleanliness, add conformal coating, keep high-impedance nodes away from connectors, use guard rings where applicable.
Component spread and reference noise: drift and jitter at the switching point
Resistor tolerance / TC → threshold movement
Divider ratios and feedback factors translate tolerance and temperature coefficient into a predictable threshold shift.
ΔVTH,rtol ≈ Sensitivity · (ΔR/R)
Suppress: tighter tolerance, low-TC parts, ratio-matched networks, and lower impedance to reduce leakage sensitivity.
Reference noise / ripple → threshold jitter (slow ramps are the worst case)
Noise on the reference or threshold node appears as a moving decision boundary. Under slow ramps, small voltage jitter can cause repeated toggling.
Suppress: reference filtering and buffering, strong local decoupling, separation from digital switching currents, and stable routing to the threshold node.
Budget template (copy/paste): source → direction → magnitude → dominant → suppression → verification
Source Direction Magnitude (ΔVTH) Dominant? Suppression lever Verification
Vos / drift ± mV (corner) Yes/No Lower Vos, add guardband Temp sweep
Ibias × R_equiv ± mV Yes/No Reduce R, lower Ibias Swap divider, corner test
Leakage depends mV (environment) Yes/No Lower Z, coating Humidity/contamination test
R tolerance / TC ± mV (ratio) Yes/No Tighter/low-TC parts Temp sweep + ratio check
Vref noise / ripple random mVpk (node) Yes/No Filter/buffer ref, isolate Scope/VNA-like node check

The dominant term should be verified by one targeted experiment at a time (divider swap, humidity stress, reference filtering change, temperature corner).

Threshold error contributors and dominant-term tagging Bar chart style diagram showing Vos, Ibias times resistance, resistor tolerance, reference noise, and leakage as contributors to threshold error with a dominant indicator. Threshold error contributors Tag the dominant term first Relative contribution (not to scale) Vos dominant? Ibias×R dominant? Rtol/TC dominant? Vref noise dominant? Leakage dominant?

Slow ramps, chatter, and EMI (how much hysteresis is “enough”)

“Enough hysteresis” is not a guess. It is a measurable noise problem combined with a ramp-slope problem. The goal is simple: one decision per crossing under the slowest ramp and the worst EMI/noise environment.

Rule of thumb (use measured node noise)
VHYS ≥ k · noise_pk (k = 2…5)
Choose larger k when the environment varies (long cables, outdoor EMI, uncertain grounding). Choose smaller k only when the noise is well characterized.
Ramp slope effect: why slow edges chatter

Voltage noise becomes time uncertainty near the decision point. Slow ramps keep the input near the threshold longer, increasing the chance of multiple crossings.

t_jitter ≈ Vnoise / (dVin/dt)
If dVin/dt is small, the same Vnoise creates a larger timing window for repeated toggling.
RC filtering vs detection delay (a practical trade)
  • Filtering helps chatter by shrinking noise_pk at the node.
  • Filtering adds delay and can slow the edge further if the source impedance is already high.
  • Best practice: size RC from an allowed delay budget, then validate “single toggle” under the slowest ramp condition.
Protection parts can change thresholds and ramp behavior
  • TVS / clamp capacitance: increases the effective input RC, slowing ramps and increasing time spent near thresholds.
  • Series resistance: increases Rsource, magnifying Ibias × R effects and changing the effective threshold mapping.
  • Layout coupling: protection return paths can inject switching noise into the threshold node if routed through sensitive grounds.
Step-by-step: choose VHYS (measure → pick k → compute → verify)
  1. Measure noise_pk at the actual threshold node (including cable/EMI environment).
  2. Select k (2–5) based on uncertainty: higher for variable environments.
  3. Compute VHYS_target = k × noise_pk.
  4. Map VHYS_target to implementation (Rf network or Iup/Idn currents).
  5. Verify on hardware: under the slowest ramp, switching should occur once per crossing and delay must stay within limits.
Slow ramp with noise: small VHYS chatters, larger VHYS switches cleanly Side-by-side diagram comparing small hysteresis versus larger hysteresis for a slow input ramp with noise ripple, showing multiple toggles versus single toggle. Small VHYS multiple toggles slow ramp noise VTH+ VTH− toggles Larger VHYS single toggle VTH+ VTH− toggle

Output stage & logic interface (OD vs push-pull, level shifting, pull-up sizing)

Output-stage choices affect more than logic compatibility. Edge rate, sink/source current, and return-path noise can couple back into the threshold node and cause false toggles. Select the output type and pull-up values with a timing/power/noise budget, then verify “single-toggle” behavior under the worst ramp and EMI conditions.

OD vs push-pull: decision points that matter for hysteresis applications
Prefer open-drain (OD) when
  • Level shifting is required: pull-up to the target logic rail without driving across domains.
  • Multi-point alarms are used: wired-OR lines and shared fault nets.
  • Edge-rate control helps stability: pull-up can slow edges to reduce ground bounce and EMI.
Prefer push-pull when
  • Fast, clean edges are needed: reduce time spent near input thresholds on the receiver.
  • Strong drive is required: long traces or higher input capacitance without large pull-ups.
  • Single-domain logic: no cross-rail risk from driving high into an unpowered domain.

For hysteresis-based thresholding, the critical failure mode is edge/return-path noise moving the threshold node. Output choices must be validated at the board level.

Pull-up sizing (OD): compute a safe range, then verify in hardware
Speed bound (rise time)
tr ≈ 2.2 · Rp · Cload → Rp_max ≈ tr_target / (2.2 · Cload)
Include trace + input + protection + probe capacitance in Cload.
Low-level bound (sink current and VOL)
Isink ≈ (Vpullup − VOL) / Rp → Rp_min ≈ (Vpullup − VOL_target) / Isink_budget
Use corner sink capability and the receiver’s low-level threshold for VOL_target.
Power and noise reality checks
  • Static power: smaller Rp increases low-level current and power, especially if the line is low for long periods.
  • Chatter immunity: larger Rp makes edges slower; slow edges can re-enter the receiver threshold region under noise and crosstalk.
  • Return-path injection: smaller Rp creates larger switching currents and ground bounce; this can shift the comparator’s threshold node.
Level shifting and backfeed: why cross-domain push-pull can break thresholds
  • Cross-domain push-pull risk: driving high into an unpowered or lower-voltage domain can feed current through clamp paths.
  • Backfeed consequence: rails or grounds move, and the decision boundary shifts, causing false toggles in thresholding circuits.
  • Mitigation direction: use proper level shifting, limit edge rate/current where needed, and keep returns away from the threshold network.
Verification checklist (keep it short, keep it board-level)
  • Measure tr/tf at the receiver pin (not only at the driver).
  • Confirm “single toggle per crossing” under worst ramp and worst EMI/noise environment.
  • Swap Rp (two extremes within safe range) to expose sensitivity to edge-rate and ground bounce.
  • Check for overshoot/ringing and verify no clamp conduction events on the logic input.
  • Stress the return path (higher load, faster edges) and confirm the threshold node does not shift.
OD with pull-up versus push-pull: rise time and cross-domain risks Side-by-side block diagrams comparing open-drain output with pull-up resistor and load capacitance versus push-pull output with optional level shift, annotated with tr and Rp relationship. Open-Drain (OD) Comparator OD out Vout Rp Vlogic Cload tr ~ Rp·C Push-Pull Comparator PP out Level shift backfeed clean edges

Layout & protection hooks (symmetry, guard rings, input RC/TVS without killing accuracy)

Programmable hysteresis works on paper only if the threshold node remains quiet on the PCB. High-impedance networks are vulnerable to leakage, digital edge coupling, and ground bounce. Place protection and filtering in layers, and review the layout with a short priority checklist.

High-impedance threshold node: three rules that prevent most failures
  • Short: keep divider/feedback parts close to the comparator pin, minimize exposed copper length.
  • Clean: avoid contamination traps (flux, residues) around sensitive nodes; consider coating for harsh environments.
  • Far from fast edges: keep away from CLK/PWM/DC-DC switch nodes and their return paths.
Guard rings and leakage control (make the sensitive area behave)

Leakage is a surface-path problem. A guard ring is a low-impedance shield around the high-impedance node that reduces the effective voltage across leakage paths.

  • Keep it continuous: avoid gaps around the threshold node region.
  • Keep it close: guard the sensitive copper and component pads.
  • Control the zone: add keep-out (no silk, no residue traps) near the threshold network.
RC/TVS placement: protect the input without corrupting thresholds
Layer 1 (entry): TVS near the connector
Clamp ESD/surge energy early. Keep the return path short and away from the threshold network ground.
Layer 2 (local): series-R + C near the comparator input
Reduce high-frequency injection at the decision node. Keep series-R modest to avoid bias-current error and slow-edge chatter.
Ground bounce injection: the most common false-toggle mechanism
  • Fast output currents create ground bounce and supply dip.
  • Ground movement shifts the effective threshold boundary through reference/common-mode injection.
  • Result: false toggles or double triggers, especially under slow ramps and noisy cables.
  • Mitigation: tight decoupling, controlled return paths, and edge-rate management.
Layout review checklist (priority order, ≤10)
  1. Threshold node is shortest: divider/feedback parts are placed next to the input pin.
  2. Aggressors kept away: no routing near CLK/PWM/SW nodes or their return paths.
  3. Quiet return path: threshold network ground returns to a quiet reference point (not through high-current loops).
  4. Decoupling is tight: comparator supply caps are close with minimal loop area.
  5. Guard ring is continuous: sensitive copper is surrounded; gaps are minimized.
  6. Keep-out is enforced: avoid silk/residue traps; reduce exposed high-Z copper.
  7. Protection is layered: TVS at the connector; RC near the input pin with a clean return.
  8. Output edge control is possible: reserve series-R footprints or alternate Rp options.
  9. Humidity robustness is considered: coating/cleaning plan for high-Z nodes in harsh environments.
PCB layout hooks for programmable hysteresis comparators Top-view PCB style diagram showing comparator, divider resistors, feedback resistor, input RC, TVS and connector, with keep-out zone, guard ring, and return current arrows. Connector TVS Input RC R + C Comparator threshold node R1 R2 Rf KEEP-OUT Guard ring quiet return high current return keep away from fast edges

Verification & measurement traps (how to test thresholds and hysteresis correctly)

Thresholds only “exist” if they can be measured repeatably. Hysteresis tests must control ramp slope, source impedance, probe loading, and output-interface dynamics. The goal is a reproducible dataset: VTH+, VTH−, VHYS, temperature drift, and statistical spread.

Record template (minimum fields for repeatable results)
Conditions Results Pass / notes
VDD, temperature, ramp slope dVin/dt, source impedance Rs, input RC, output type (OD/PP), pull-up Rp (if OD), probe type + loading VTH+, VTH−, VHYS, σ(VTH+), σ(VTH−), false toggles per crossing, edge metrics (tr/tf at receiver) Pass/Fail windows, dominant trap ID (probe C / Rs / ramp slope / pull-up / ground bounce)

A test that cannot reproduce these fields across operators and fixtures is not a threshold measurement.

Ramp method (VTH+/VTH−): make dynamic error small on purpose
  1. Choose a slope from an error target: keep the dynamic error below the allowed threshold error: ΔV_dyn ≈ (dVin/dt) · t_pd
  2. Control source impedance Rs: keep Rs known and stable; high Rs increases bias/leakage sensitivity and probe loading error.
  3. Use the same input filtering as the product: adding or removing RC changes where the threshold “appears” during a sweep.
  4. Measure at the threshold node carefully: avoid direct probing of high-Z nodes unless a low-loading method is used.
  5. Repeat both directions: rising sweep gives VTH+, falling sweep gives VTH−; compute VHYS = VTH+ − VTH−.
Step / binary-search method: best when ramp sweeps look noisy or inconsistent
  • Apply a DAC step and hold long enough to settle input RC + output interface (OD rise included).
  • Binary search the boundary: bracket the switching point and converge to the smallest step that flips the output.
  • Collect statistics: at the final 2–3 codes near the boundary, sample multiple times to estimate σ(VTH).
  • Repeat at temperature: log drift of VTH+/VTH− and any VHYS collapse/expansion.
Typical traps (symptom → cause → corrective action)
Trap A — probe capacitance loads the threshold node
  • Symptom: threshold shifts or chatter appears only when probing.
  • Cause: Cprobe adds RC and changes coupling at a high-Z node.
  • Action: probe a low-impedance point, add a buffered test node, or use a lower-loading probe method.
Trap B — source impedance and bias/leakage move thresholds
  • Symptom: calculated thresholds look right, board thresholds are offset and humidity/temperature sensitive.
  • Cause: Ibias·Rs and leakage create hidden voltage drops at high-R networks.
  • Action: lower divider impedance, add buffering, clean/coat sensitive areas, and enforce guard/keep-out rules.
Trap C — OD pull-up and return-path noise create false toggles
  • Symptom: double triggers on slow edges or during high-current switching events.
  • Cause: slow rise (Rp·Cload) + ground bounce shifts the effective decision boundary.
  • Action: re-size Rp from timing/current bounds, measure at the receiver, and control edge rate/return paths.
Production guardband (avoid over-reject while keeping safety margins)
  1. Build distributions: measure VTH+, VTH−, VHYS across units and temperature points; compute mean and σ.
  2. Separate uncertainty: device variation, temperature drift, and measurement uncertainty must be tracked independently.
  3. Set limits from statistics: apply Nσ policy (e.g., 4σ/6σ) plus application margin; define windows for VTH+ and VTH− (not only VHYS).
  4. Close the loop: if guardband is dominated by measurement uncertainty, fix the fixture/probing method before tightening limits.
Example part numbers (for repeatable test fixtures and reference builds)
  • MCP4725 — simple I²C DAC for step/binary-search threshold sweeps (fixture use).
  • AD5683R — precision DAC option when smaller step size and stability are required (fixture use).
  • OPA197 — precision op-amp buffer option for driving controlled Rs into the DUT (fixture use).
  • TLV3691 — ultra-low-power comparator example for slow-signal thresholds and wake-up designs (device example).
  • LTC1540 — micropower comparator example with reference/hysteresis capability often used in threshold fixtures (device example).
  • TLV3501 — high-speed comparator example for fast edges and timing-oriented measurements (device example).

Part numbers are representative starting points; confirm pins/options (OD/PP, hysteresis behavior, references) against the latest datasheets.

Threshold and hysteresis measurement bench: ramp/step source, loading, and instruments Block diagram showing ramp or DAC step source with source impedance feeding input network and comparator, with output captured by scope or logic analyzer and a probe capacitance marker indicating added error. Ramp / DAC source Rs Input network R / C / HYS Comparator VTH+/VTH− Probe C adds error Output OD / PP Scope / Logic analyzer record toggles + timing Sweep rising → VTH+ Sweep falling → VTH−

Applications & engineering recipes (analog-to-square conversion without surprises)

These recipes focus on wiring and parameter knobs that prevent surprise toggles. Each card provides a target, a connection pattern, key parameter ranges, and failure-to-fix actions. Part numbers are included as representative starting points (confirm options in datasheets).

Recipe 1
Slow sensor shaping (threshold + programmable hysteresis + light RC)
Target
One clean toggle per crossing under slow ramps and ripple noise.
Connection pattern
Sensor → input RC (optional) → threshold generator (divider / DAC / Ihys) → comparator → logic interface.
Key knobs
  • Hysteresis sizing: start with VHYS ≥ (2–5)× noise_pk at the threshold node.
  • RC filter: reduce high-frequency ripple without creating unacceptable detection delay.
  • Divider impedance: avoid ultra-high values if bias/leakage can dominate the threshold error.
Common failures → fixes
  • Chatter near threshold: increase VHYS or reduce ripple at the node (shorten routing / adjust RC).
  • Threshold shifts on the PCB: lower divider impedance and apply guard/keep-out to prevent leakage.
  • Temperature drift dominates: reduce reference drift and verify comparator offset/drift corners.
Example parts (starting points)
  • TLV3691 — ultra-low-power comparator option for wake/sensor thresholding.
  • LTC1540 — micropower comparator option often used for low-power thresholds with reference/hysteresis behavior.
Recipe 2
Debounce & long cable input (protection + hysteresis + pull-up strategy)
Target
No false toggles from cable noise, contact bounce, or ESD recovery events.
Connection pattern
Cable/connector → TVS (entry) → series-R + C (local) → comparator (OD recommended for cross-domain) → pull-up Rp → MCU input.
Key knobs
  • VHYS: size for worst-case ripple on the long line (measure at the node, not only at the source).
  • Rp: choose from timing/current bounds; verify rise time at the receiver and avoid slow threshold dwell.
  • Protection placement: TVS near connector, RC near comparator input with a clean return path.
Common failures → fixes
  • Double triggers: increase VHYS or reduce edge dwell (adjust Rp, add series damping where appropriate).
  • Threshold moves during switching: improve return paths and decoupling; reduce ground-bounce coupling.
  • ESD passes but logic glitches: move TVS to the entry, shorten clamp return, and add local RC near input pin.
Example parts (starting points)
  • LTC1540 — low-power threshold detection reference device option.
  • SN74LVC1G17 — Schmitt-trigger buffer option for a hardened digital edge after thresholding.
Recipe 3
PWM / voltage-to-frequency (comparator + ramp; hysteresis impact on jitter and linearity)
Target
Stable duty/frequency without spurious switching from noise, while keeping predictable transfer behavior.
Connection pattern
Ramp (saw/triangle) + control voltage → comparator → PWM/Fout output conditioning.
Key knobs
  • VHYS vs ramp amplitude: keep VHYS as a controlled fraction of ramp swing to avoid unintended gain/offset in the PWM/V-F transfer.
  • Noise-to-jitter mapping: noise at the threshold node converts to time jitter; reduce node noise before increasing VHYS excessively.
  • Edge conditioning: avoid ringing/overshoot that re-crosses thresholds near transition edges.
Common failures → fixes
  • Unexpected nonlinearity: reduce VHYS or increase ramp swing; verify thresholds at operating temperature.
  • Jitter spikes: improve threshold-node filtering and return paths; reduce coupling from fast digital edges.
  • Multiple transitions per cycle: fix edge ringing with damping/RC and enforce single-crossing behavior.
Example parts (starting points)
  • TLV3501 — high-speed comparator option for cleaner timing edges in PWM/V-F builds.
Recipe 4
Encoder / speed input conditioning (tunable hysteresis for noisy industrial environments)
Target
Robust edge detection across cable length, EMI levels, and different sensor amplitudes without missed counts or double counts.
Connection pattern
Encoder line → clamp/protection + local RC → comparator (tunable hysteresis) → Schmitt buffer (optional) → MCU timer/counter input.
Key knobs
  • VHYS tuning: set by measured noise and expected amplitude variations (field-dependent).
  • Input protection: ensure clamps do not inject large capacitance at the threshold node without accounting for delays.
  • Digital edge hardening: use a Schmitt buffer if MCU input thresholds are sensitive to slow edges.
Common failures → fixes
  • Double counting: increase VHYS and reduce edge ringing; verify at the receiver pin.
  • Missed counts: VHYS too large for the smallest amplitude; reduce VHYS or improve signal conditioning.
  • Random glitches during switching: improve grounding/return control and isolate threshold routing from aggressors.
Example parts (starting points)
  • SN74LVC1G17 — Schmitt-trigger buffer option for a hardened edge into MCU timers.
  • TLV3691 — low-power comparator option when edge speed is not the primary constraint.
Four application recipes for programmable hysteresis comparators A four-panel block diagram showing sensor shaping, long-cable debounce, PWM/V-F generation, and encoder conditioning. Each panel contains three to four blocks with minimal labels. 1) Sensor shaping 2) Long cable / debounce 3) PWM / V-to-F 4) Encoder conditioning Sensor RC VTH gen VHYS Cable TVS RC Ramp Comparator VHYS PWM Encoder Comparator Schmitt

Request a Quote

Accepted Formats

pdf, csv, xls, xlsx, zip

Attachment

Drag & drop files here or use the button below.

FAQs (programmable hysteresis, independent thresholds, and real-world traps)

Short, actionable answers only. Each item includes a quick check, numeric decision rules, and the smallest fix that reliably works on real boards.

Why is the calculated VTH far from the measured VTH on the PCB? What are the first 3 checks? +
Likely causes (top 3)
Ibias × Rsource error, leakage/contamination on high-Z nodes, probe/fixture capacitance loading the threshold node.
Check (≤ 60 s)
  • Reduce divider impedance by 10× (temporary parallel resistors) and re-measure VTH.
  • Measure without probing the high-Z threshold node (probe output or a buffered test point).
  • Clean/dry the board around divider/Rf and re-measure (especially if R ≥ 200 kΩ).
Decision thresholds
  • If ΔVTH shrinks significantly when divider R is reduced 10×, Ibias/leakage is dominant.
  • If behavior changes when probing, treat Cprobe as part of the circuit (typ. 5–15 pF for passive probes).
  • If Ibias × Rsource exceeds 20% of the allowed VTH error budget, the network is too high-Z.
Fix
Lower divider impedance, add guard/keep-out for the threshold node, and design a low-loading measurement point (buffer or series isolation).
How large should VHYS be to avoid chatter? How to choose k from noise amplitude? +
Quick rule
Start with VHYS ≥ k × noise_pk measured at the threshold node.
Choose k
  • k = 2: low-cost false toggles (non-safety signals).
  • k = 3–4: general industrial noise (recommended default).
  • k = 5: high consequence of mis-trigger (fault latch, protection).
Decision thresholds
  • If noise_pk > 0.5×VHYS, multi-toggling is expected on slow ramps.
  • If increasing VHYS does not reduce chatter, the dominant coupling is likely Vref/ground bounce (not input noise).
Fix
Measure noise_pk at the actual threshold node, pick k by risk, then verify “single toggle per crossing” under worst-case ramp slope and temperature.
Why do high-value dividers drift in humid environments? How to protect the threshold node? +
Cause
Moisture + contamination creates leakage paths (a hidden resistor) that re-bias high-Z dividers and feedback networks.
Check (≤ 60 s)
  • Warm air / dry nitrogen over the area: does VTH move back?
  • Measure resistance from threshold node to nearby copper/guard: does it drop in humidity?
Decision thresholds
  • If divider/network uses R ≥ 500 kΩ, leakage is frequently non-negligible in humid/dirty environments.
  • If VTH shifts by > 25% of VHYS with humidity changes, treat leakage as dominant.
Fix
Lower impedance, keep the threshold node short/clean, add guard ring to a low-impedance reference, enforce keep-out from flux residues, and consider conformal coating for harsh environments.
How to size the pull-up for an open-drain (OD) output? Why does changing Rp change threshold behavior? +
Core relationship
Rise time is set by pull-up and load capacitance: tr(10–90%) ≈ 2.2 × Rp × Cload.
Check (≤ 60 s)
  • Measure tr at the receiver pin (not at the comparator output).
  • Temporarily reduce Rp by 2×: does double-triggering disappear?
Decision thresholds
  • Target: tr ≤ 10% of the minimum pulse width (or timing budget) at the receiver.
  • If slow edges cause the receiver to dwell near its input threshold, false toggles become likely even with VHYS.
Fix
Size Rp from the tr requirement, control return paths to reduce ground bounce, and verify edge behavior under worst-case load and switching noise.
Why can a slow ramp still cause multiple toggles, even with hysteresis? +
Likely causes
  • Noise_pk at the threshold node is still comparable to VHYS.
  • Coupling is injected through Vref/ground (moving the effective threshold).
  • Output/interface noise is feeding back (ground bounce, OD return currents).
Check (≤ 60 s)
  • Measure noise_pk at the threshold node during the ramp.
  • Probe Vref and local ground at the comparator at the same time (look for correlated spikes).
Decision thresholds
  • If noise_pk ≥ 0.5×VHYS, chatter is likely on slow ramps.
  • If chatter tracks switching events (PWM edges, load steps), the dominant term is usually ground/Vref injection.
Fix
Increase VHYS only after confirming node noise; otherwise reduce Vref/ground injection (routing, decoupling, return control) and harden the output interface.
RC filtering reduces noise, but increases delay. How to estimate and verify the delay? +
Estimate
For a simple first-order input filter, start with τ = Req×C. Delay depends on the local slope: Δt ≈ ΔV / (dVin/dt), where ΔV is the RC-induced attenuation at the switching region.
Check (≤ 60 s)
  • Apply a known step/ramp and time-stamp input vs output toggle (logic analyzer + scope).
  • Change C by 2× and confirm the delay scaling trend (sanity check).
Decision thresholds
  • If delay > the system’s allowed detection latency, RC cannot be the primary anti-noise tool.
  • If RC changes VTH measurably, bias/leakage interactions are present (reduce impedance or buffer).
Fix
Use VHYS for chatter immunity and reserve RC for high-frequency spikes; verify delay with the same ramp slope used in the real application.
Why does reference noise make the threshold “jitter”? How should it be filtered? +
Mechanism
If VTH is derived from Vref (divider/DAC), Vref noise directly appears as threshold noise. For slow ramps, threshold noise converts to time jitter: σt ≈ σVTH / (dVin/dt).
Check (≤ 60 s)
  • Measure Vref noise at the comparator reference pin during switching events.
  • Correlate output edge jitter with Vref noise bursts (time-domain correlation).
Decision thresholds
  • If estimated σt exceeds the timing tolerance, reference conditioning must be improved.
  • If VHYS is increased but σt does not improve, the dominant noise is likely on Vref/ground, not Vin.
Fix
Filter and decouple the reference locally (RC + good return), avoid sharing Vref with noisy loads, and route Vref/threshold nodes away from fast digital edges.
The circuit becomes unstable only when probed. How to measure thresholds correctly? +
Cause
Probe capacitance and ground lead inductance alter the high-impedance threshold node and add new coupling paths.
Check (≤ 60 s)
  • Measure VTH using the output transition time stamp (do not probe the high-Z node directly).
  • Use a short ground spring or an active/low-C probe if node probing is unavoidable.
Decision thresholds
  • If the measured VTH shifts by > 10% of VHYS when probing, treat probing as the dominant error source.
  • If chatter disappears when probing is removed, fix the measurement method before tuning VHYS.
Fix
Add a dedicated test point strategy: buffered node, series isolation footprint, or measure indirectly at a low-impedance point.
How to verify VTH drift over temperature and set production guardbands? +
Test steps
  1. At each temperature point: measure VTH+ and VTH− (same ramp slope, Rs, probe method).
  2. Collect statistics across units: mean and σ for VTH+ and VTH− separately.
  3. Repeat at worst-case supply corners if VDD affects input common-mode or output swing.
Decision thresholds
  • Guardband policy: limits = mean ± (Nσ) ± drift margin, with N = 4–6 depending on risk.
  • Set windows on VTH+ and VTH− (not only VHYS) if direction-dependent safety matters.
Fix
If guardband is dominated by measurement uncertainty (fixture/probe), improve the test method before tightening device limits.
When is “independent VTH+ / VTH−” truly necessary (not just “one threshold + hysteresis”)? +
Use this decision test
  • Rising and falling safety margins are asymmetric (different risk/cost per direction).
  • A true window is needed (upper and lower limits are independently defined).
  • Direction-dependent thresholds are required (bias, pre-charge, or “first-echo” gating behavior).
Decision thresholds
  • If a single center threshold + VHYS cannot satisfy both rising and falling margin requirements, independent thresholds are required.
  • If the allowed window is narrower than the combined drift/σ budget, independent VTH+ and VTH− provides controllable margins.
Example parts (reference only)
Devices with independent hysteresis/threshold control options exist (e.g., precision comparators with programmable hysteresis/threshold pins such as TI LMP7300 or high-speed comparators with HYS pins such as ADI ADCMP564).
If MCU changes hysteresis dynamically, how to avoid false triggers during updates? +
Cause
Updating VHYS or VTH shifts the decision boundary instantly. If Vin is near the boundary, an update can look like a real crossing.
Check (≤ 60 s)
  • Log Vin and output state before/after each update and count “update-induced toggles”.
  • Test worst-case: update when Vin is within ±(0.5×VHYS) of the center threshold.
Decision thresholds
  • Only update when Vin is safely away from both thresholds: distance ≥ ΔVmargin (e.g., ≥ 0.25×VHYS + noise_pk).
  • If updates must occur near thresholds, enforce a blanking window (ignore output transitions for a fixed settle time).
Fix
Update thresholds only in a safe region, or add a controlled “freeze/blanking + re-arm” sequence. Always validate with scripted corner tests that count update-induced toggles.
When is a Schmitt trigger gate the better choice (simpler and cheaper) than a comparator solution? +
Choose Schmitt gate if…
  • Threshold accuracy is not tight (logic-level switching is acceptable).
  • Everything stays in the logic domain (no cross-voltage analog threshold requirement).
  • Power and BOM must be minimal, and a fixed VTH+/VTH− is sufficient.
Decision thresholds
  • If allowed threshold error ≫ typical logic threshold variation, a Schmitt gate is usually sufficient.
  • If thresholds must be set by divider/DAC/reference and verified over temperature, use a comparator solution.
Example parts (reference only)
Common Schmitt options include TI SN74LVC1G17 (single buffer) and classic 74HC14-type inverters (depending on voltage domain and input protection needs).