Skip to content

ANA-12 Comparator on a slow or noisy signal without hysteresis

Severity Status Implementation
suggestion runs in better_erc easy, depends on netlist

Data it needs: graph, part classes.

Looks at. Comparator parts and their feedback.

What it catches. A comparator (or an op-amp used as one) with no positive feedback resistor from the output to the non-inverting input, no built-in hysteresis, fed from a slow or noisy signal.

Why it matters. Near the threshold the input spends a long time within millivolts of the reference; noise and the comparator's own output edge coupling back through the supply make it toggle many times per crossing. A battery-low flag chatters, an interrupt fires a thousand times, a relay buzzes. A few millivolts of hysteresis cost one resistor.

Example. A thermostat comparator on a thermistor divider with a 10 nF filter: the temperature crosses the threshold over seconds and the output oscillates at tens of kHz for the whole crossing, until a 1 MΩ positive feedback resistor gives 30 mV of hysteresis.

How to check. For each comparator unit (library class), look for a resistor between OUT and IN+ (or a datasheet hysteresis pin). Which signals are slow or noisy is not in the netlist, so this lists every comparator without one.

Fix. A positive feedback resistor sized per SBOA313 (and a small capacitor across it if the edge is noisy), or a comparator with built-in hysteresis.

References. SBOA313 (non-inverting comparator with hysteresis, design steps); Wikipedia, Schmitt trigger; AoE3 chapter 4.

Test schematics

Each schematic below is in test_schematics/sources. The block under it is what berc check --only ANA-12 reports on it.

ana-12_comparator_hysteresis

The test schematic ana-12_comparator_hysteresis The test schematic ana-12_comparator_hysteresis

  suggestion ANA-12 #mk7    comparator U1 unit 1: no resistor from the output to the non-inverting input; on a slow or noisy input it chatters at each crossing
                            part U1, pin U1.1, pin U1.3
                            fix: a positive feedback resistor for a few mV of hysteresis (SBOA313), or a comparator with built-in hysteresis