When pulling something up or down why is a resistor used and it not just connected straight to the +V or 0V rail?
feedback
|
|
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. | |||||||||||
feedback
|
|
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). | |||||
feedback
|
|
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. | |||
|
feedback
|
|
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. | |||||||||
feedback
|
|
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) | |||
|
feedback
|