# output resistors on digital I/O

Discussion in 'General Electronics Chat' started by derikd, Jun 17, 2008.

1. ### derikd Thread Starter New Member

Jun 17, 2008
7
0
I am examining / replacing a pre-existing microcontroller circuit. My background is from Physics not EE, so I can tell you how a doped semiconductor works, but don't know much about practical electronic circuits.

The previous electrical engineer placed 5.1k resistors on each of the digital I/O pins of the microcontroller. Most notably on the pins connecting to the serial bus.

I have seen this sort of output resistor elsewhere.

What are these "input/output resistors for? what value is appropriate and how do I calculate that?

The current values of 5k are inconvenient, but since I don't know why they are there, I don't know if it would be good electronics practice to remove/change them.

EDIT: I should say that the serial bus runs less than 20k Baud, but the 5k reisistors are on ALL the digital IO pins. They must be there for something, but I don't know it was.

Last edited: Jun 17, 2008
2. ### kppp Member

Apr 23, 2008
14
0
hi,
microcontroller port (i/o) pins are opendrain i.e there is no resistor between collector of transistor and VCC (pls, study opendrain and pushpull concept of microcontroller pins) thus to get output we conect resistors between these points and we get optput across this wrt ground
standard value used is 10KOHM, in case of SMD microcontroller we connect resistor array to these pins
in short, to drive the io pins we use resistors
if any query, pls post
bye
take care

3. ### roddefig Active Member

Apr 29, 2008
149
0
I think it has to do with suppressing oscillations when the I/O pin switches levels. From the outside the I/O pin looks like a capacitor, so we can model the connection as an RC circuit. A small resistance equals a small time constant so there is "ringing" as the output settles, which is undesirable. By adding a resistor we increase the resistance which decreases the oscillations at the expense of a longer switching time.

You can take a look at the datasheet which should list the capacitance of the I/O pins and calculate the time constant and see if it makes sense.

4. ### derikd Thread Starter New Member

Jun 17, 2008
7
0
rodddefig,

I am not sure I follow you. are you saying that in input pin looks like a capacitor to a driving pin elsewhere on the buss?

Or are you saying that the output pin looks like a capacitor to another input pin on the bus.

I am familiar with the input capacitance of an input pin. And I do recognize that if your driving resistors were very large (say 100k) that it could take a finite amount of time (say 100 microseconds) to rise to half maximum. (BTW those time are for the particular circuit that I have).

But I have never seen the output resistors this large. I have seen them go as low as 47 ohms. But I (almost) never see a naked output (or even a naked input).

I have considered slight reduction in slew rate on the bus of even a 5k resistor might reduce E/M emmisions. Though in this case, I doubt it would be significant.

5. ### derikd Thread Starter New Member

Jun 17, 2008
7
0
KPPP.

these are not open drain outputs. And the resistor is NOT between the IO pin and Vcc. It is between the IO pin and the bus (that other devices are listening to).

BTW, most of the ther devices that are connected to this buss have their own 5k resistors between their input pins and the bus. It is really weird. It is as if they are expecting two things on this bus to be driving (possibly in the opposite directions) at the same time. And on some buses I suppose that a packet collision could cause that. But on other buses that I have seen, only ONE device ever talks, the others strictly listen. And in that case, given the 1megaOhm in put resistance, I fail to see how adding 5 additional kOhoms matterse.

Not that the cost of a 5k chip resistor and its placment during assembly bothers me. Nor the space wasted on the board, though both are annoying in principle. But there are times, for instance when I am driving a capacitive load, that I don't want to have that resistor there.

6. ### roddefig Active Member

Apr 29, 2008
149
0
Hello derikd.

The input pin or whatever is sampling the voltage. But, I don't have an explanation for why they would be so large. I generally use 22 ohm resistors . Let me ask someone more knowledgable than myself what they think and I'll get back to you.

What microcontroller are you using?

Last edited: Jun 19, 2008
7. ### SgtWookie Expert

Jul 17, 2007
22,201
1,809
The resistors might also be there to limit current through clamping diodes within the uC in case transients on the bus exceeded maximums and/or to keep the current source/sink of the uC within safe limits due to the capacitance of the bus.

Without seeing the entire circuit, it's difficult to guess what the exact intentions were of the designer.

8. ### derikd Thread Starter New Member

Jun 17, 2008
7
0
roddefig,

I am using the PIC16F876.

9. ### derikd Thread Starter New Member

Jun 17, 2008
7
0
SGTWookie,

I had not conisdered the transients, though I doubt any transients on this particular bus would carry enough charge to challenge the clamping diodes.

I did consider the current maximums due to the capacitive load of the bus. Though again in this case it would not seem to apply. The devices can put out 25mA and if they can't handle charging a 50pF load, they can just charge it a little slower. I think they have internal current limiting resistors (I think). I never tried driving a uC output pin to ground to see if I would damage the pin. Perhaps, it would do exactly that. Though 5kOhms still seems kind of large if that was their intention.

I am reassured to see that at least one other person that uses these in-line resistors is using much smaller values.