Digital input threshold voltage.

BCJKiwi

Senior Member
Would someone please confirm the voltages (at a standard regulatd 5.0V supply) that are seen as "High' and 'Low'.

Have seen reference to a "1/3 to 2/3 of supply" but would appreciate something a little more definitive.

Have searched but not found.

Thanks
 

womai

Senior Member
The Microchip data sheet should have those numbers. Otherwise:

Standard CMOS inputs have the threshold somewhere in the middle, i.e. at Vcc/2 (which is 2.5V if your Picaxe is running from 5V). Typical 74xx style Schmitt trigger inputs have hysteresis, i.e. will go high when the signal rises above about 2/3 of Vcc, but drop low only when it drops below 1/3 of Vcc.
Many microcontroller inputs add a small bit of hysteresis as well (to avoid double-clocking), but often much less than then 1/3 Vcc cited above.

So in a nutshell, assuming low meaning 1/3 Vcc or less and high meaning 2/3 Vcc or more is a pretty reasonable assumption when you lack the datasheet numbers (which are always preferable). Anything closer to Vcc/2 may be flaky and could vary from one Picaxe to the next.

Wolfgang
 

BCJKiwi

Senior Member
Thanks,

Tried to find the info in the Microchip data sheet but couldn't see it anywhere - probably not looking in the right place - it's pretty dense!

Just had another look so maybe this is it!

This suggests at supply voltage above 4.5v
High at 2.0v and up for a TTL buffered port, and,
High at 4.0v and up for a Schmitt trigger port (0.8 x Vdd i.e 0.8 x 5 = 4)
Low at 0.8v and below

Both the 2.0 and 0.8 being much less than I previously understood and the 4.0 higher!
 

Attachments

Last edited:

hippy

Ex-Staff (retired)
That looks about right. They are usually the "VIL" and "VIH" ratings in the "DC Characteristics" section of the related datasheet. For the 18X (16F88) at 5V ...

VIL : TTL <= 0.8V, Schmitt <= 1.0V
VIH : TTL >= 2.0V, Schmitt >= 4.0V

One has to look at the Pinout Description Table to find what sort of input pins a chip has, and they can change depending on mode. For the 18X, Inputs 0 through 2 are TTL, but Inputs 6 and 7 are Schmitt.

That means that some signals may work well with I0 to I2 but not so well with I6 and I7. Conversely, an RC debounced switch would be better suited to I6 and I7.

Connecting PICAXE output to PICAXE Input isn't a problem regardless of gate type as "VOL" and "VOH", the output voltages are designed to suit both types of input gate.

A table showing the type of inputs for each PICAXE wouldn't go amiss in the manual as an appendix.
 
Top