# Output - connect - Input. what we get?

Pin 2 - Output High
Pin 3 - Input pull - up

what will be if

a) we connect them direct w/o resistor?
b) we connect them through LED and resistor ?

then

Pin 2 - Output High
Pin 3 - Input low

what will be if

a) we connect them direct w/o resistor?
b) we connect them through LED and resistor ?

this is an circuit equivalent of using the pull up... sooo.... looking at it.

1. with no resistor - nothing changes it shows HIGH state]
2. using LED and resistor - nothing happens because there's no difference in potential

case 2 - output high and input low

1. no resistor - DON'T try this a home it will send too much current and burn out the pins and perhaps more
2. using LED and resistor - assuming it is correctly connected it will light the LED

this is an circuit equivalent of using the pull up... sooo.... looking at it.

1. with no resistor - nothing changes it shows HIGH state]
2. using LED and resistor - nothing happens because there's no difference in potential

case 2 - output high and input low - input is high impendance

1. no resistor - nothing but input will register high
2. using LED and resistor - nothing

You can connect an output to an input and it will work fine with or without a pull-up because the output is driven high or driven low. An output pin never "floats". You could use an SPDT switch and you wouldn't need a pull-up with that either.

Of course, there's no reason to do that unless you are connecting two different microcontrollers because the software always "knows" if the output is high or low and there's no reason to read it.

b) we connect them through LED and resistor ?

If "through" means in series, that won't work properly because an LED is a diode, and there's a voltage drop across the LED. With the pull-up the LED might light-up dimly depending on the polarity but it won't light at all with no pull-up because no current flows. So... connecting through the LED is "just wrong".

Of course you CAN connect an LED+resistor "as usual" and then connect an input pin in parallel.

And if you want to connect an output to an input, just put a 470 Ohm resistor between the two, physically located nearest to the new input.

That protects you from accidentally setting both to output and writing them to opposing levels.