This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Tri-State Input

Hi ,everyone,

 

I'm quite new about the hardware design. Could someone explain what is the tri-state input for GPIO pin? Thank you very much.

  • Tri-state refers to an output, not the input.

    Outputs can be one of several types:

    An Open Drain has a transistor that connects the GPIO pin  to ground when a zero. There is a resistor connecting the GPIO to the supply for a one when the transistor is off and not conducting since there is no current flowing through the open transistor, there is no drop across the resistor therefore the GPIO pin is at the supply voltage which makes it a one 1. When the transistor is on the pin is connected to ground and therefore a 0.
    The advantage is several Open Drain GPIOs outputs can be connected together.
    The disadvantage is the transition from a 0 to a 1 can be very slow since the capacitance of the load is charged through the pull up resistor. The transition from a 1 to 0, while faster, will be slower than a Push Pull output because the transistor to ground must discharge the load capacitance while also passing the current flowing through the Pull Up resistor. Further, current flows through the Pull Up resistor continuously while the transistor is on and the output is low.

    Push Pull has a transistor that connects the GPIO pin to ground when a zero and a transistor that connects the GPIO to V supply for a one.
    The advantage is a low resistance through the transistor that is on to charge or discharge any capacitance of the load attached to the GPIO so it switches fast from 1 to 0, or 0 to 1. Once the load is charged or discharged there is no current flow.
    The disadvantage is two push pull GPIO outputs cannot be connected together because if one is a 1 and the other is a 0 the supply is basically connected to ground, excess current will flow damaging the part.

    Tristate uses an additional transistor in series with the GPIO output which serves as a switch to disconnect the GPIO from the load resulting in a high impedance of the GPIO with respect to ground and V supply. This high impedance, where impedance is Z is often referred to as “high Z” output or state. This is generally used with a Push Pull GPIO or peripheral output but can be useful with Open Drain ports as well. This approach permits the fast switching of the push pull output while also permitting multiple push pull devices to be connected to the same load.
    So the Tri, as in 3, states are High, Low, and High Z.

    With many devices there are often 3 (Tri) modes for the input. They include a pull up resistor, a pull down resistor and neither a pull up or down resistor. While there are 3 this is not commonly referred to as Tri-State. The pull up or down resistor can be useful when a input is not connected to anything, connect to an open switch or connector pin, or when it is connected to a High Z Tri-state output. Left unconnected a floating input  may float around its’ transition point permitting it to continuously toggle between a 1 and 0 adding noise and power consumption to the circuit.

    The Ti  devices uses various combinations of the input and output types outlined above on the GPIO and peripheral pins.

    Hope I came close to answering the question.

    -H