tri-state input

Thread Starter

eminthepooh

Joined Aug 26, 2012
27
Hi,
I know about pull ups and pull downs, but i'm trying to see if there is a real way to reliably have all three 0,1, and Z values on an input. I can't use pull ups and pull downs since they eliminate the Z value. I want to either give a command of 0 or 1 to an input, if I haven't commanded anything, it shouldn't register any input. And of course for maximum fun this is all done using 1 line.


Thanks,
 

tshuck

Joined Oct 18, 2012
3,534
Your Z value on an input is called a floating input, and is generally regarded as a bad thing...

Why exactly would you want a non-deterministic circuit?
 

Thread Starter

eminthepooh

Joined Aug 26, 2012
27
Your Z value on an input is called a floating input, and is generally regarded as a bad thing...

Why exactly would you want a non-deterministic circuit?
It's to conserve resources (and it's a challenge at work to come up with a cool design)

the truth table would be input A, output C and D
A C D
Z 0 0
1 0 1
0 1 0
- 1 1

and based on the input either C or D would command the system into 1 of 2 states.

I'm guessing there's some game to play based on MOSFET threshold voltages.
 

tshuck

Joined Oct 18, 2012
3,534
So, Z is an undefined voltage between Vss and Vdd? If so, how could you differentiate this from a 0 or 1 input?

What is the difference between your "-" input and your "Z" input?
 

tshuck

Joined Oct 18, 2012
3,534
If you're talking CMOS, or otherwise using MOSFETs, what current is there to supply? MOSFETs are voltage controlled devices...
 

Thread Starter

eminthepooh

Joined Aug 26, 2012
27
...and it's safe to assume these will be used in a voltage-dividing manner?
yup. Every avenue I go down though I seem to need a validation of some sort. Now since I don't have a separate chip select or enable line I'm working on conditioning the input to provide that enable.
 

tshuck

Joined Oct 18, 2012
3,534
yup. Every avenue I go down though I seem to need a validation of some sort. Now since I don't have a separate chip select or enable line I'm working on conditioning the input to provide that enable.
...doesn't that act as a pull-down when the input (to the "device") is floating?
 

tshuck

Joined Oct 18, 2012
3,534
I would suggest you define what it is you want to accomplish with this device, then attempt to implement that.

A single inverter can implement your truth table, save for the "Z" and "-" inputs and could be fully implemented with another input..
 

Thread Starter

eminthepooh

Joined Aug 26, 2012
27
I would suggest you define what it is you want to accomplish with this device, then attempt to implement that.

A single inverter can implement your truth table, save for the "Z" and "-" inputs and could be fully implemented with another input..
Yeah i know, this is more of a research into innovating with as few resources as possible.
 

WBahn

Joined Mar 31, 2012
30,077
This is an input to what? A standard chip of some kind, are a chip that you are designing?

What you are trying to do is to process a multi-level signal as opposed to a binary-level signal, though in your case you are adding the complication that one of the levels is a high-impedance output instead of a defined voltage level.

But that's fairly easy to accommodate.

Take your single input and buffer it with two voltage followers. The apply the outputs of the followers to two inverters, one of which has a pull-down and the other of which has a pull-up. Call the output of the first one X and the output of the second one Y. Your truth table is therefore:

A||X|Y
0||1|1
1||0|0
Z||1|0

If you ever saw XY=01, that would indicate a likely failure of some part of the circuit.

Note that you need the buffers to allow the inputs of the two inverters to be at different levels.
 

panic mode

Joined Oct 10, 2011
2,761
put some tiny capacitor across input, then in your code:
- change input to output,
- set it low
- change back to input,
- wait a bit
- check if it is low.
- change input to output,
- set it high
- change back to input,
- wait a bit
- check if it is high.

if both checks match the state you assigned while pin was configured as output, then you have Z
 

WBahn

Joined Mar 31, 2012
30,077
put some tiny capacitor across input, then in your code:
- change input to output,
- set it low
- change back to input,
- wait a bit
- check if it is low.
- change input to output,
- set it high
- change back to input,
- wait a bit
- check if it is high.

if both checks match the state you assigned while pin was configured as output, then you have Z
This is IF the OP's input is on a programmable part.

Also, they need to be careful that they don't mess something up in whatever is providing the output signal. It probably would not be physically damaged by the short-lived contention, but it might upset the state of the output pin or it might upset the state that the device thinks it is outputting. For instance, if it is a part that writes data to the port and then relies on reading the actual state of the output pin in order to infer the value stored as the output data in the register.
 
Top