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.

msp430 toggle gpio to three state

Other Parts Discussed in Thread: MSP430G2744

Hi all,

Using msp430g2744, wondering if and how is it possible to set a GPIO to three state? 

I've seen in the forum that the default value before using pull up/ pull down is high impedance (although I done't understand why as PxDIR is reset at power up, probably to value of 0x00).

Even if this is the case, I need to toggle certain pin to be in three state on and off, scary enough, the user's guide has nothing about such thing.

Thanks in advance,

  • If you truly want a high impedance state without a pullup or pulldown, then you need to perform the following:

    1) Turn off the pull resistor by clearing the appropriate bit in the PxREN register.  See Section 8.2.4 of Family User's Guide.

    2) Configure pin to be an input (shuts off output driver) by clearing the appropriate bit in the PxDIR register.  See Section 8.2.3 of Family User's Guide.

  • Omri Berg1 said:
    I've seen in the forum that the default value before using pull up/ pull down is high impedance (although I done't understand why as PxDIR is reset at power up, probably to value of 0x00).

    MSp430 uses CMOS technology. This means, transistors are FET type. CMOS transistors do not have an input current, They are controlled by input voltage. So they are high impedance (excepf for a small leakage current and a parasitic gate capacitance).

    After reset, pullups are disabled and I/O pins are input, to the are high impedance.

    To use a pin inthree-state mode, switch between input (pullups disabled), high output and low output. That's tri-state.

    Omri Berg1 said:
    the user's guide has nothing about such thing.

    It does not explicitely name it such, but from funcitonal description, this should be obvious. Tri-state is nothing more than the three options high output, low output and no output.

**Attention** This is a public forum