Connect 2 GPIO pins?

17 Dec 2011

Hi, I saw that it is possible to set a pin as input and output at the same time. Can I connect 2 such pins and query the state of the other pin?

Is it possible to receive interrupts there? Do they need special modes (pullup/down)?

17 Dec 2011

Ok forget it. It's not possible.

But another question: If I'm free to select PullUp/PullDown mode, which one is preferrable?

17 Dec 2011

Depends on the application. PullDown will result in reading a 0 when nothing is connected to this pin. PullUp will read a 1 when nothing is connected to the pin. PullNone can be used if you are using external pullup or pull down resistors. Also if you are connecting an external devices that have a pullup or pulldown resistors of their own, you can use PullNone.

17 Dec 2011

Not an external device. I just want to detect a bypass to another output pin. I can do this by using PullUp on Input and set the other pin to low or vice versa. So if one option e.g. uses less power, I would prefer this one :)

20 Dec 2011

As long as both pins are the same. If one is pullUp and the other is PullDown, you'd connect the total resistance across the supply an increase power consumption

20 Dec 2011

Thought PullUp/PullDown is only used for Inputs ::confused::