Link to home
Start Free TrialLog in
Avatar of toddsab
toddsab

asked on

What is a PULL-UP resistor?

Hi,

I am a software engineer trying to learn hardware. When reading
about the I2C protocol for PIC programming, I came across the following (see 2nd
sentence before the end of the paragraph):

"An open-drain or open-collector pin has output drivers that can
only pull the signal line to ground. They cannot drive it high. This
has the advantage that more than one device connected to a signal
line may pull it low. If this were not the case, one device
attempting to pull the line low while another tried to pull it high
would result in a short circuit, with disastrous results. Interrupt
lines are typically open-collector. All open-collector signals need
a PULL-UP RESISTOR and are active low. The idle state (when no
device is asserting) is to be pulled high by the resistor."

I understand most of what is being said, but don't understand why
the resistor is specifically named as such. What other types of
resistors are there?

Regards,

Todd
Alameda, CA 94501
ASKER CERTIFIED SOLUTION
Avatar of Harisha M G
Harisha M G
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of toddsab
toddsab

ASKER

Harish,

Thank you for your response.  You say "The resistor will keep the volate AT THAT POINT at +5V..."  Based on your diagram, which point is that point?  Between the lower leg of the resistor and the ground?

Sorry if this is a silly question, I may be missing some fundamentals here and that's why I'm asking.

Regards,

Todd
No, I have reloaded the image to show the points..
Avatar of toddsab

ASKER

Thanks Harish.  One last question: What software do you use to draw your figures?

Paint :)
Just a clarification.  With most logic families using "5V logic" a "1" is not defined as +5V since it's actually rare that the input voltage to the device would get that high.  The logic device will have a spec called "Vih" that is the voltage above which it will interpret the signal as a "1".  Similarly, there will also be a "Vil" which is the voltage BELOW which it will interpret the signal as a "0".  Typical values for Vih are +2.4V and for Vil are +0.4V.

Many devices use "active" output devices where there is a transistor which pulls up the output for a "1" and another one that pulls down the output for a "0".  Some special devices, however lack a pull up transistor and require an external resistor to pull up the output when the internal pull down transistor is off.  A typical use for these "open drain" devices are where multiple outputs will be tied together in a "wired-OR" configuration.  This lets any one of several outputs which are wired together pull a signal down to "0" without using additional logic gates.  (This is commonly done in computers for IRQ lines for example.)

Of course there is a lot more to this...
Also note that the diagram referenced above does not accurately show a typical configuration of a pull up resistor.

A better diagram can be found at:  http://www.seattlerobotics.org/encoder/mar97/basics8.gif

Note that the resistor R2 pulls up the pin 1 on U2A when the transistor T1 is OFF (i.e. not conducting).  This will place a logic "1" on the U2A pin 1.

If transistor T1 is conducting, current will flow through it and pull the U2A pin 1 down to a voltage below the Vil of U2A.
>> Typical values for Vih are +2.4V and for Vil are +0.4V.

That's for TTL families. Doesn't that change depending upon their type ?

>> Also note that the diagram referenced above does not accurately show a typical configuration of a pull up resistor.

LOL, that was written in Paint just to show where will be its position, and which point will be "pulled up"
It's not clear what logic family we are talking about.  But those values are typical for TTL and most TTL compatible CMOS 5V parts.

In the diagram reference, no resistor is a pull up resistor.  That makes it misleading in my opinion.  Both resistors are, in fact, pull down resistors which makes no sense in most positive logic circuits.  They are (actually were) common in ECL (emitter coupled logic) circuits but that technology has ended up in the dust bin of history at this point.  Another place where they were commonly used was in negative logic (i.e. PMOS) logic circuits.  Most of those circuits used 0V and -12V power with 0V being a "0" and -12V being a "1".  The Intel 4040 (precursor to the well known 8080) as well as the Rockwell PPS4 and PPS8 microprocessors were PMOS circuit designs.  PMOS preceeded the more common NMOS due to the ease of manufacture at the time.  NMOS achieved widespread use with the 8080, Z80, 6800, and 6502 devices.  CMOS was around almost from the beginning (i.e. the RCA COSMAC as well as the 4000 series of CMOS logic) but wasn't used widely in LSI (large scale integration) circuits until the mid-to-late 1980's.  CMOS, as you know, contains both NMOS and PMOS devices so is actually twice as hard to make as either NMOS or PMOS.

Avatar of toddsab

ASKER

jhance,

Thank you for your very informative response.  I had closed the question yesterday due to lack of responses, but will be happy to award you points through some other means (I am new to EE, so I'm not sure how it's done).

Do you have any electronics text you can recommend for beginners?

Thanks -

Todd
Avatar of toddsab

ASKER

jhance,

I apologize if the following is a silly question, but can you describe what would happen if the R2 was not present in the diagram you provided?  I can guess that it would not work, but why not?

Thanks -

Todd
If there is no R2, then Vcc and Point "2" are essentially shorted. As a result, the inverting buffer will always have an input of HIGH and the output will always be LOW
Also, if there is no R2, there is a good chance for the transistor to get damaged when it conducts.
Avatar of toddsab

ASKER

Thank you -
If there were no R2, the voltage at the input of U2A would be INDETERMINATE when the transistor is NOT conducting.  In general this is a bad thing as it might float high or low or perhaps even oscillate.  The behavior of digital logic gates is not specified when their inputs are indeterminate.

This situation would not cause any damage but the circuit operation would be in question.

The only way Vcc and point 2 would be shorted would be if someone wired a short circuit into it.  But omitting R2 from this circuit would certainly NOT cause a "virtual" short to +5V as has been implied.

>>Do you have any electronics text you can recommend for beginners?

I can recommend a good magazine.  Nuts & Volts:

http://www.nutsvolts.com/

Lots of good elecronics stuff for beginners and experts alike...

I don't really know of any good beginner elecronics books.  You might take a trip over to your local bookseller and see if they have anything interesting on their shelves.

Don't worry about the points, I have plenty...

"Electronic Principles" by Malvino is a very good book.. with practical aproach...
http://www.malvino.com/ep/ 
Avatar of toddsab

ASKER

Hi jhance, if you're still monitoring this question, I have a follow-up question to ask.

Thank you -

Todd
You can ask .. we will answer when we are online :)
Sure.  Please ask...
Avatar of toddsab

ASKER

Hi jhance,

Thanks for your reply.  I was looking around the Seattle Robotics web site, and came across the following article from which you had supplied the link to the figure you had used for your earlier explanation:

http://www.seattlerobotics.org/encoder/mar97/basics.html

Please look at the explanation to the right of the figure whose caption reads "Pull-up resistor limits the current"; the 2nd paragraph says:

==> "When switch S1 is open (off), pin 1 is tied to Vcc through the resistor. Since pin1 is a high impedance input, a voltage meter or logic probe placed on pin 1 will show Vcc (+5v) if connected to pin 1."

Q1: Why would the meter show +5v?  Shouldn't it instead read a reduced voltage because of the resistor R1 that is between Vcc and Pin 1? [I also don't understand what a high impedance input is, but I can research that myself.]

Also, the following paragraph says:

==> "When switch S1 is closed (on), pin 1 has a direct connection to GND, which takes it to the low state. The pin1 side of R1 also has a direct connection to ground. Current will flow from Vcc, through R1, and to ground. It isn't considered a short, however, because R1 will limit the amount of current that can flow to a very small amount. In fact, you can compute this using Ohms law."

Q2: Why does Pin 1 prefer to "see" the Ground (thus becoming low) and not the Vcc behind the resistor?

Thank you for your interest and for your help -

Todd
Q1: Why would the meter show +5v?  Shouldn't it instead read a reduced voltage because of the resistor R1 that is between Vcc and Pin 1?

No. Voltage at any point can be found using the formula V = V ( R1/R1+R2 )

In your case, when S1 is closed, V = 5 * 0/(0+10k) = 0
when S1 is open, V = 5 * ( Some large value )/(Some large value + 10 k )

where Some large value is the resistance of air (or any other medium, which is very large compared to 10k)

V = 5 * 1 = 5
(Neglecting 10k)

Indeed in the real world an accurate voltmeter will NOT show 5V when the switch is open.  There will be some leakage current through the input to U1A, probably on a order of a new microAmps.  From Ohm's Law the voltage drop across a resistor is V = IR where I is the current through the resistor in Amps and R is the resistance in Ohms.

So lets assume the leakage current is 10 uA (a reasonable value for a circuit like this) with the resistor at 10K Ohms the voltage drop across the resistor is 10E-6 * 10K = 1 mV (0.01 V).  So the voltmeter (assuming that the 5V supply was set at 5.00V) would read 4.99V.  In this type of circuit, that is close enough to 5V to be 5V.  Not everything in engineering is considered to the last detail.

On your second point, the "low" side of the resistor will be very close to 0V (or whatever the actual voltage is on the "bottom" side of the switch.)  As with the first part of my answer, there is a real and measurable resistance in the switch so Ohms law is still in effect.  Let's assume that the contact and misc. resistance of this switch of 10 mOhm ( 0.01 Ohm, probably a typical value for a switch).  When closed you have what is called a voltage divider between the 10K Ohm resistance of the resistor and the 1 mOhm in the switch.  So the voltage at the junction of the two where the U1A pin 1 is connected will be the 5V * (0.01/(0.01+10000)) = 5 uV (5 microVolts).  Or about as close to 0V as you can get.
Avatar of toddsab

ASKER

OK, so the reason for the existence of R1 is to prevent a short in the circuit when S1 is closed.  Its existence is otherwise negligible.

Would this be a true statement?
Not only that, but it will also limit the current through other devices in case the buffers get damaged.
No, it's purpose is to hold the input to the U1A device at a logic "1" until such time that the switch is closed.  

If R1 were missing, the circuit operation would be indeterminate.  If R1 were replaced with a wire to +5V, circuit damage would possibly occur when S1 is closed.

It's existence is far from negligible.  It's a vital part of the operation of the circuit as most pull-up resistors are.  Engineers do not add parts to circuit designs that do not serve a purpose.  That adds cost and reduces reliability without a corresponding benefit.
Avatar of toddsab

ASKER

jhance, you're right, you had mentioned R1's purpose earlier for holding the input to the gate at "1".  I forgot about that in my second round of questions.  Thank you again.