digital I/O hypothetical

Status
Not open for further replies.

reginalStetson

Active member
Two digital outputs connected to one digital input

I'm trying to understand digital I/O functionality.

I want to connect pin1 and pin2, both in OUTPUT mode, to pin3, which is in INPUT_PULLUP mode.
With pin1 and pin2 set to write LOW, pin3 will read 0.
With pin1 set to LOW and pin2 set to HIGH, pin3 should read 1, correct?
Will pin1 be damaged when pin2 is writing HIGH, since they are connected?

In other words:
Is there a way to safely have pin1 and pin2 both connected to pin3 at the same time, while pin1 is writing LOW and pin2 is writing HIGH?

Will diodes solve the problem?:

twoOuputsOneInput.png
 
Last edited:
Use a logic OR gate. A 74HC32 is probably the best part.

Diodes might also work, but the configuration shown above needs a pull down resistor on pin 3, not a pull up.
 
...the configuration shown above needs a pull down resistor on pin 3, not a pull up.

That makes sense. If I understand correctly, there is only built-in functionality for a pullup resistor, and not a pulldown? In other words, I'll have to manually connect pin3 to ground with a resistor? (and remove "pinMode(pin3, INPUT_PULLUP)")
 
Status
Not open for further replies.
Back
Top