For my Uno's A1 pin, the digital input hysteresis is about 0.3V centered at about 2.35V.
I was curious about the Arduino Uno digital input Schmitt Trigger thresholds and hysteresis, because I wanted to hook up an IR photodiode and bias it so I could read it as a digital input.
In the mega328 data sheet the Table 28.2 (page 258) lists the values for Vil and Vih. They are dependent on Vcc.
Vil is for a voltage that is dropping. When the voltage drops through Vil the input will switch from HIGH to LOW. Conversely, with a rising voltage the input will switch from LOW to HIGH at Vih.
Thanks, I was interested in seeing the behavior in the unspecified space between "the highest value where the pin is guaranteed to be read as low" and "the lowest value where the pin is guaranteed to read as high"
If the voltage at the digital input is between 0.3 * Vcc and 0.6 * Vcc at reset the state of the input is indeterminate. The same as floating until the input is set to a known state by raising or lowering the voltage passed the threshold. Is that what you mean?
If the voltage is HIGH to start with, it will remain so until the voltage drops below 0.3 * Vcc. And if it starts LOW it will re.ain so till the voltage rises past Vcc * 0.6.
I think the spec is saying the opposite -- one should design a reliable digital sensor to produce voltages outside the {0.3*Vcc, 0.6*Vcc} range to be reliably read, because it is unreliable in between.
As measured here:
... if the voltage is HIGH to start with, it toggled LOW when the voltage dropped below 2.18/5=0.43 * VCC, and when LOW, it toggled to HIGH when the voltage rose past 2.527/5 = 0.51*VCC.
I agree with that. If what I wrote was interpreted differently, I apologize. The above is why there are pullup and pulldown resistors, ie to establish a known state for an open or floating input.
...but using some stuff from my junk box. I thought if his PIC's Schmitt triggers worked, why not try it with the Arduino's?
With a couple bent up LEDs on a breadboard, and with 150K of series resistance on the LED/photodiode, it works. The Arduino analogReads(A0) as 2 and 680, or 0 and 3.32V, or 0*VCC and 0.66*VCC, or as digitalRead 0 and 1, when the light path is either blocked and unblocked.
I think what I was perceiving from your words was that the hysteresis behavior is specified as Vil and Vih, while I was more interested in the behavior the schmitt trigger per these graphs from that datasheet:
I cranked the pot up to 250K, and am getting >0.6*VCC signals out of this configuration, but it still toggles cleanly around VCC/2 due to the Schmitt trigger.