Can resistor on input impede its (digital) readings?

I want to connect two pins of different controllers that should switch between inputs/outputs.
To prevent obvious damage when both are mismatching state outputs I'm thinking of putting a 5K resistor in-between.
The question: can a 5K resistor impede input from hearing other device output properly in some situation? At 100KHz for instance?

I want to connect two pins of different controllers that should switch between inputs/outputs.

What?

To prevent obvious damage when both are mismatching state outputs I'm thinking of putting a 5K resistor in-between.

Between what?

You can safely connect an output to an input.

You can safely connect two inputs together. i.e. You can run the same signal into two different microcontrollers.

You CANNOT connect two outputs together. A 5K resistor between two outputs would be OK, but it wouldn't accomplish anything... If one output is high and the other output is low, current will flow through the resistor, but the high output will still be high and the low output will still be low.

Ok, bad description maybe.
Two pins of different microcontrollers, that dynamically change between being input/output, output/input, without synchronization, thus at some intermediate point there will be a situation when both are outputs - one low, other high. Hence the resistor.
But might that resistor impede proper functioning of input/output situation?

Still a poor description.

Explain what it is you actually want to do and why.

As a general answer, a 1k resistor between the two will not affect the function as an input, and will not overload an output, but it is likely that what you are really trying to do is already done, and there are already well-researched ways of doing it.

I am not a fan of input seriese resistors but in this case it would cause no harm. However I would use a 330R as it is still well within the source / sink capability of an arduino pin and the lower the resistance the less effect it has on the noise immunity of the input pin.

Paul__B:
As a general answer, a 1k resistor between the two will not affect the function as an input, and will not overload an output, but it is likely that what you are really trying to do is already done, and there are already well-researched ways of doing it.

I'm thinking of implementing a rudimenrary bitbang communication. I need it to tolerate lack of defined timing, not be using interrupts and have multiple connections via different pins not via addressing. Also I don't need huge speed so I thought to give it a go myself.

Grumpy_Mike:
I am not a fan of input seriese resistors but in this case it would cause no harm. However I would use a 330R as it is still well within the source / sink capability of an arduino pin and the lower the resistance the less effect it has on the noise immunity of the input pin.

Thanks.

Often a cleaner way of interfacing two signals that can both be outputs is to use
open-drain and pull-up resistor. Not only does this mean no hardware can be damaged,
but there is a well defined state when both outputs are active.

When you link two outputs with a current-limiting resistor then you introduce low-pass
filtering (the R combines with the stray capacitance and the input-capacitange of the pin).

For fast signals that means you need quite a small resistor, such as 220 ohms, for slower
signals 2k2 or 10k might be fine.

If you have two devices with separate power such that one may be powered up when the
other is down you have to worry about back-powering one device from the other, and
the consequent risk of CMOS-latch-up. In this circumstance current is forced
through the input protection diodes, and too much is a one way to trigger
latch-up mode (which is bad news).

Of course this is also exactly what tri-state was defined for, but I don't think it is available on the AVR's, you might be able to find a tri-state buffer and use that.

Go with a 1K, such as between the USB/Serial chip and the Rx/TX pins.
When the USB is high but not active, the lines are driven high with 5V/1000 = 5mA of current that the 20mA capable output pin can drive low if needed.

5K, even less, just 1mA.

CrossRoads:
Go with a 1K, such as between the USB/Serial chip and the Rx/TX pins.

Hmm, what I suggested!

How effective this is depends on whether you are talking communication between two adjacent devices, or over some metres of cable which will introduce capacitance. At minimum, the trick would be to have half the series resistance at each end.

KeithRB:
Of course this is also exactly what tri-state was defined for, but I don't think it is available on the AVR's

So if the general-purpose I/O pins of the ATmegas are not tri-state, what are they?

Why not use two digital I/O pins on both devices? Use one as output, one as input on each device and plug them in to each other?

I am a total newbie and I'm willing to bet that every single poster in this thread knows more about this subject than I do, I am just wondering if that's a bad idea or not.

Thanks for responses!

MarkT:
Often a cleaner way of interfacing two signals that can both be outputs is to use
open-drain and pull-up resistor

Thanks, now I know what open-drain means :smiley: Correction: have vague understanding :smiley:

CrossRoads:
5K, even less, just 1mA.

That's what I was hoping for, as 1/20 of maximum seems to put less strain on pin if considering things "visually". Have no idea if there is any use of not going to allowable maximum - it's not that I care about power, I really do about any possible errors though.

Paul__B:
How effective this is depends on whether you are talking communication between two adjacent devices, or over some metres of cable

When finished - a few Attiny85 on a shield talking to Arduino Mega. Though I'm afraid there's a chance I'll have to go with DUE, which probably will be comletely different story.

nightsd01:
Why not use two digital I/O pins on both devices? Use one as output, one as input on each device and plug them in to each other?

Not so easy if you want to transmit a couple of bytes.

I am a total newbie and I'm willing to bet that every single poster in this thread knows more about this subject than I do, I am just wondering if that's a bad idea or not.

Are you going to write the hand-shaking code ?

That's what I was hoping for, as 1/20 of maximum seems to put less strain on pin if considering things "visually".

How much "strain" does an LED put on a pin? Do you worry about that?

kivig:
When finished - a few Attiny85 on a shield talking to Arduino Mega. Though I'm afraid there's a chance I'll have to go with DUE, which probably will be completely different story.

Well then, a 1k resistor will do just fine. If you are using multiple devices (i.e. more than 2), then a 1k resistor from each to a common point.

If the DUE uses different voltages, that is another problem.

raschemmel:
Are you going to write the hand-shaking code ?

In case that was directed to me :slight_smile: There are clock(in) and data(out) pins connected. Upon receiving a pulse the clock becomes output and clocks output on data for a fixed amount of bits. Then turns back to listening mode. Simple as that :slight_smile:

Grumpy_Mike:
How much "strain" does an LED put on a pin? Do you worry about that?

No. But then again when connecting a led I usually hope it just won't burn anything right away at best :slight_smile: Here I'm aiming for reliability, which I know nothing about.

Paul__B:
Well then, a 1k resistor will do just fine. If you are using multiple devices (i.e. more than 2), then a 1k resistor from each to a common point.

Thanks.