In microcontrollers we have 2 situation for every pin, input and output. Input mode has 2 different forms, pull-up and pull-down. What is the main difference between them?
Both cases are the connection by a resistor (1-20 k Ohm) to a voltage source. It is needed to prevent uncontrollable triggering of input when an external driving net is in off state.
Pulled-up Input. It's mean input connected to the voltage source with high level (logic "1"). Frequently it is a powering voltage for MC.
Pulled-down Input. It's mean input connected to the voltage source with low level (logic "0"). Frequently it is a ground (digital ground) for MC.
Both cases are the connection by a resistor (1-20 k Ohm) to a voltage source. It is needed to prevent uncontrollable triggering of input when an external driving net is in off state.
Pulled-up Input. It's mean input connected to the voltage source with high level (logic "1"). Frequently it is a powering voltage for MC.
Pulled-down Input. It's mean input connected to the voltage source with low level (logic "0"). Frequently it is a ground (digital ground) for MC.
The terms pull up and pull down are used with digital inverters inparticular and digital circuits in general. An output point can be pulled up to VDD or can pulled down to ground 0 V. The pull up of the point potential to VDD can be carried out by a pull up device like resistor or by a pull transistor operating as an active load or swith.
The pull down can be carried out by a pull down device which may be an ohmic resistor or a controlled transistor, like an n-MOS transistor.
Any inverter is composed of a pull up device and a pull down device. In case of CMOS inverter the n-MOST operates as a pull down device and the P-MOST operates as Pull down device.
The most important thing is that when we pull the point up to VDD, the path of the ground must be interrupted or at least of high ohmic and vice verse.
Just to add to the above comments. The importance of whether an input is pull up or down is when you are coupling them to a particular type of output. For example the output of many sensors and ICs can be either "current sinking" or "current sourcing". A simple comparator like the LM397 has an "open collector" output on it. This means it can only pull something to zero volts and so it would have to be used with a "pull up" input to work properly. Some ICs and sensors maybe "push-pull" (like the output of a logic gate), so they can sink and source current and can be used with pull-up pull-down or in fact without any such resistor. There's a nice summary of this here:
These are figurative words; so it might be more correct to put them in quotes. Example: The resistor RC "pulls up" the collector voltage.
Also, when used as an adjective, it would be correct to link the two parts by a hyphen. Example: "pull-up" resistor.
However, what exactly do these resistors pull? What exactly do they do?
The explanation of this strange phenomenon, which contradicts human intuition and it is difficult to understand, is the following:
If a resistive element (resistor, transistor...) is connected only through one of its terminals to one of the power supply terminals, there is no current flowing through the element... there is no voltage drop across it... so the voltage at the other ("floating") terminal is the same. The resistance hinders the current... but as there is no current, there is no to hinder. As though, the resistance is not resistance... but rather conductance conveying the voltage without losses:)
But if we connect the floating terminal by another resistive element to the other power supply terminal, some current begins flowing through the element... some voltage drop appears across it... and the voltage of the "floating" terminal starts approaching the other power supply terminal. As though, the second element "pulls" the voltage of "floating" terminal towards the power supply terminal...
Strictly speaking, both elements are "pulling" - the one "pulls" the common point up while the other opposes it by pulling" the point down... as if they "fight" each other:) An interesting example of such an "arm wrestling" is the op-amp inverting amplifier where the input voltage source and the op-amp output "pull" via resistors R1 and R2 the common point at the inverting input in opposite directions. As a result, its voltage does not "move" and stays zero (virtual ground).
Here is a related to this question example of using "pull-up" resistors in the input part of Port C of 68HC11 (EVBplus2). Since the input switches are connected to ground, 100k "pull-up" resistors are connected between the port inputs and VDD.
More precisely speaking, the switches are not connected directly to ground but through 4.7k "pull-down" resistors. It is interesting to see why...