7
\$\begingroup\$

When pulling something up or down why is a resistor used and it not just connected straight to the +V or 0V rail?

\$\endgroup\$
2
  • 2
    \$\begingroup\$ If it were connected directly to V+, then it would always be V+. You couldn't pull it down. \$\endgroup\$
    – endolith
    Commented Mar 7, 2011 at 16:36
  • 1
    \$\begingroup\$ @endolith - that's the answer. Simple. And you would create a short circuit trying to pull it down. \$\endgroup\$
    – stevenvh
    Commented Jun 15, 2011 at 10:19

5 Answers 5

12
\$\begingroup\$

It limits current to protect the switch (transistor, etc.) and allows signal sources with limited driving capability to change that node's voltage. Rails generally have high drive capability, or low resistance. Think voltage divider, including source impedance of signal and rail, then let the rail impedance be 0-ohms for simplicity.

Other factors, other than operating current and voltage drops, to determine the pull resistance is charge time and substrate leakage. A 2M-ohm pull-down resistor on a top layer exposed to humidity and salts won't do anything due to sub-1M-ohm electrical resistance of grime layer.

\$\endgroup\$
4
  • 2
    \$\begingroup\$ If the board is exposed to environmental conditions that severe, the value of your pull-up isn't what you should be worried about. \$\endgroup\$
    – Nick T
    Commented Mar 6, 2011 at 23:13
  • \$\begingroup\$ Often have boards subjected to high humidity and hydrocarbon mist (exhaust, etc.), @NickT, but you are right: salts would be a killer. \$\endgroup\$
    – tyblu
    Commented Mar 7, 2011 at 8:25
  • \$\begingroup\$ if they are, a sealed enclosure and/or conformal coating is a must. The only reason that you should up the strength of a pull-up is for manufacturing reasons (flux residue left on the board) or for part tolerances, especially IC and transistor leakage at higher temperatures. \$\endgroup\$
    – Nick T
    Commented Mar 7, 2011 at 15:50
  • \$\begingroup\$ Well, conformal coatings have measurable conductance, too... \$\endgroup\$
    – tyblu
    Commented Mar 8, 2011 at 1:05
5
\$\begingroup\$

Another point not mentioned is that if it's necessary to alter the board, it's possible to pull off the resistor and replace it with a wire connecting one of the resistor pads to something else. By comparison, trying to rework a surface-mount pin which connects to a power ground plane using a via which is under the chip can be difficult or impossible (at least difficult enough that scrapping the board would be cheaper).

\$\endgroup\$
2
  • \$\begingroup\$ Yes, though this could be done with a 0-ohm SMT part too. \$\endgroup\$ Commented Mar 8, 2011 at 18:24
  • \$\begingroup\$ @Chris Stratton: Indeed it could, but usually there will be some other resistor value that's already used elsewhere on the board that would work just as well. The rare possibility that a port pin might accidentally get configured as an output might not justify using a part where none would otherwise be needed, but if one is going to use a part, it may as well be a resistor. \$\endgroup\$
    – supercat
    Commented Mar 8, 2011 at 20:41
4
\$\begingroup\$

You can also think of it this way - without a pull-up (or pull-down) resistor in place on an input, the source of the input would have to directly oppose your device's power supply to change the voltage at that input. Depending on the situation, you'd either cause problems for your power supply, or the input source, or both. With the resistor, the input can be controlled by the input source without inordinate currents. The situation for output pull-ups is similar, except that the 'input source' is the device's output transistor.

\$\endgroup\$
2
\$\begingroup\$

Another reason is that it makes it very easy to alter the input - just connect it to the positive supply if it is pulled down, for instance, rather than rewiring the connection. A couple of pins for a jumper are all that is required. A typical example is pin P0.14 on an NXP ARM chip, which determines whether it boots from a serial input or from internal flash memory.

\$\endgroup\$
4
  • \$\begingroup\$ What? I don't understand this? Are you saying its easier to swap it from being pulled up to being pulled down? \$\endgroup\$
    – Dean
    Commented Mar 6, 2011 at 22:08
  • \$\begingroup\$ Just one connection has to be made, instead of one having to rewire the input. It applies to both pull-up and pull-down resistors on inputs. \$\endgroup\$ Commented Mar 6, 2011 at 22:22
  • \$\begingroup\$ The edit makes it alot clearer. \$\endgroup\$
    – Dean
    Commented Mar 6, 2011 at 23:26
  • \$\begingroup\$ Yes - and you could even manually hold a powered or grounded jumper wire on a configuration pin's pull up/down resistor to over-ride the resistor while tripping the reset. \$\endgroup\$ Commented Mar 8, 2011 at 18:24
2
\$\begingroup\$

If you only want to supply a defined logical level to a definitely unused input, a direct connection to ground or vcc would be ok in my opinion. BUT: if you do that, it is impossible to drive the input from other sources. (see posts above)

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.