Here are some examples of how to set the hysteresis voltage of a comparator.

Conditions: VDD = 3.3 V, VREF = 1.4 V, hysteresis width = 6 mV, rise detection voltage 1.650 V

1) R3 rate

In order to minimize the influence of the input leakage voltage, it is necessary to pass a current of at least 0.5 µA to R_{3}. The current flowing to R_{3} is (V_{REF} − V_{OUT})/I_{R3}, with V_{OUT} = 0 V or V_{OUT} = V_{DD}, so you can obtain the rate by calculating R_{3} = V_{REF}/I_{R3} or R3 = (V_{DD} − V_{REF})/I_{R3}.

The smaller of the two results is used. When V_{DD} = 3.3 V, V_{REF} = 1.4 V and I_{R3} = 1 µA, the two resistance rates are 1.4 MΩ and 1.9 MΩ, so our choice here is 1.4 MΩ.

2) Hysteresis width

V_{HB} will be 6 mV in this case.

3) R_{1} rate

R_{1} = R_{3} (V_{HB}/V_{DD})

R_{1} = 1.4M (6m/3.3) = 2.55 kΩ

4) VTHR

Set the rise detection point of V_{THR} so that V_{THR} > V_{REF}(R_{1} + R_{3})/R_{3} is satisfied. It will be 1.650 V in this case.

5) R_{2 }rate

R_{2} = 1/(V_{THR}/(V_{REF}⋅R_{1}) − (1/R_{1}) − (1/R_{3}))

= 1/(1.65/(1.4⋅2.55k) − (1/2.55k) − (1/1.4M))

= 14.4 kΩ

6) Result

The rise and fall time and hysteresis width are as follows:

Rise time: V_{THR} = V_{REF}⋅R_{1}(1/R_{1 }+ 1/R_{2} + 1/R_{3})

Fall time: V_{THF} = V_{THR} − R_{1}⋅V_{CC}/R_{3
}Hysteresis: V_{HB} = V_{THR} − V_{THF} = R_{1}⋅V_{CC}/R_{3}