-1
\$\begingroup\$

TTL logic level says that if input voltage is above 2V it is high and if below 0.8V it is low. what if the input voltage is between 0.8V to 2V, how does one deal with such voltage range to convert the logic level?

\$\endgroup\$
  • 3
    \$\begingroup\$ ... You use analog circuitry to move it into those ranges. \$\endgroup\$ – Ignacio Vazquez-Abrams Apr 17 '17 at 2:59
  • 5
    \$\begingroup\$ You can use a comparator (linear, analog comparator) to switch at a single, precise voltage threshold. Normally you would incorporate hysteresis in the comparator circuit to make sure that it doesn't oscillate near the switching point. \$\endgroup\$ – mkeith Apr 17 '17 at 3:09
2
\$\begingroup\$

How you 'deal with it' depends on circumstances, depends on what you want.

In a standard logic system, there can be errors of level, noise spikes, ground bounce, all sorts of things that mean voltages are not read exactly. This is why the wide margin is used. Voltages below 0.8v are low, above 2.0v are high, and any other voltage should only occur transiently, on the way between one or the other. If an intermediate voltage persists, then it is an error, an indication of failure of operation or design.

If you're not operating a logic system, but have an analogue signal that you have defined your own threshold for, say <1.3v is low, >1.3v is high, then you might think you can use a comparator with a reference voltage of 1.3v to tell those apart.

The problem is your comparator may have a few mV of level error, and when the input voltages are within a mV may well oscillate. This means your spec is really <1.29v is low, >1.31v is high, and between them, who knows? Exactly the same issue as for the logic specification, just a smaller error window.

You can never get down to a zero error window. You either recognise that, and specify it. Or, you fall foul of it one day.

The best way to deal with oscillation when comparator inputs are nearly equal is to use hysteresis, this is a deliberate offsetting of positive going and negative going thresholds. For instance the input might need to be >1.4v to switch to a 1, <1.2v to switch to a 0, and between those two levels the output could be either, and will stay there. As you spend more money on precision, you could reduce the hysteresis range, but as before, you can never get down to zero hysteresis.

An alternative way is to read the input voltage with an ADC, and make the decision based on the digital reading. The ADC will have its uncertainties specified, level error, noise amplitude, reading rate, so you're not getting a free pass for precision, but it's more flexible setting thresholds in software than in comparator hysteresis.

\$\endgroup\$
1
\$\begingroup\$

The comments are telling you exactly what to look for: hysteresis. This is simply a design where a rising input signal is required to reach higher before the output changes and a falling input signal is then required to reach lower before the output changes, once again.

For example, the hysteresis band might be set to exactly those two values so that if the input signal had been previously "low" and was rising upward, it would have to climb above \$2\:\textrm{V}\$ before the output would change to reflect a new input value. And then, once the input had achieved that level and the input was falling again, the circuit would require the input to fall below \$800\:\textrm{mV}\$ before the output would change to reflect the new state.

There are Schmitt triggers, comparators, opamps used in a comparator configuration of one kind or another, and a variety of other schemes that can be applied.

However, if it is your desire to actually have a third state in the output that is meant to indicate an indeterminate value when the voltage is between those levels, then that is a different animal altogether. You may need to include a window detector. But you have to ask yourself why you could possibly want to know that.

Reality is complicated, though. And no matter what you decide, there will be corner situations where further design could be added to advantage. (Given enough time and money, most anything can be achieved.) But those are ideas applied by many others, depending on circumstances. So what would you want to do?

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.