Newbie question: pullup LPC GPIO Pins?

If I want to put a simple momentary button on one of the LPCs IO pins, that pulls the pin down when closed. Do I need to put a pullup on the pin? This may be a dumb question, but I’ve seen designs both [withand [without pullups on pushbutton inputs. What’s the general consensus?](http://embeddedartists.com/products/education/edu_base.php)](http://www.sparkfun.com/commerce/product_info.php?products_id=545)

well, no one’s replied yet, so I guess I’d better clarify. I’m using an LPC2148.

Is a pullup required on this type of I/O:

[

…or can I skip the pullup, like so?

[](http://www.putfile.com/pic.php?img=3225849)](http://www.putfile.com/pic.php?img=3225859)

Assuming the switch you’re using is identical to the one in the schematic (SPST or single-pole single-throw), you will need a pull-up resistor. If you had an SPDT (single-pole, dual-throw), you could tie one side to ground and the other to VCC.

The reason for this is that with an SPST switch, when the switch is not pressed, it acts as high-impedance to the input of your microcontroller. Therefore, the only inputs to your input pin are noise (basically the trace acting like an antenna), so your input could bobble around anywhere. The purpose of the pull-up is to keep it at a known state at all times.