PDA

View Full Version : Is it a must to add pull-up resistors for inputs?



sayzer
- 20th January 2006, 12:01
Usually, I add 10K pull up resistor for an input.

Is it a must to keep an input positive (high) to detect negative (low) when a button is pressed? (or the other way around)

Is there another way to eliminate the resistor by adding some kind of “define” or couple of lines into the code? I just don't want to use the resistor.

Thanks in advance

J. Mark Wolf
- 20th January 2006, 12:29
Pull-ups are required for outputs that are open-collector or open-drain outout types. The pull-up resistor is what provides the high state of the signal, because open-collector output ports, typically, can only drive a signal to ground. They can't drive a signal to +5volts. The resistor does this.

Further, the value of the pull-up resistor can be important because it dictates the rate at which a signal goes high. If you're trying to generate a signal that needs to toggle fast, a weak pull-up (too high resistance) will pull the signal high too slow, and your'e signal will flounder.

Note that some PIC pins have internal pull-ups you can enable, but they are the weak variety.