Hi again,
The hysteresis resistor RH is calculated based on how much voltage it adds or takes away from the node at the two resistor junction R1 RC it is connected to. When the comparator output is high, it adds to the voltage, and when it is low, it takes away. This is how it does it.
Thus, to calculate the junction voltage when it is high you put the RH plus the pullup resistor R3 value in parallel with the upper resistor R1, and when the comparator is low you put the RH resistance in parallel with the lower resistor RC. In each case you get a different voltage either VHigh or VLow, and the hysteresis voltage is then VHigh-VLow.
When you get the required voltage difference you then have found the right value for RH.
So we calculate (the symbols "a][b" means to calculate a in parallel with b):
Rs=RH+R3
RpH=R1][Rs
RpL=RC][RH
VHigh=Vcc*RC/(RpH+RC)
VLow=Vcc*RpL/(RpL+R1)
VHysteresis=VHigh-VLow
Do you understand how to do this?
So the value of RH comes out to be:
Code:
RH=(sqrt((Vh*R3+Vcc*R1)^2*RC^2+Vh*R1*R3*(2*Vh*R3*RC-2*Vcc*R1*RC+Vh*R1*R3))-Vh*R3*RC-2*Vh*R1*RC+Vcc*R1*RC-Vh*R1*R3)/(2*Vh*RC+2*Vh*R1)
where Vh=VHysteresis
or for an approximate value when RH is at least 10 times greater than R3:
RH=((Vcc-Vh)*R1*RC)/(Vh*RC+Vh*R1)