> Why are pull-up resistors used? I am interfacing a keypad to a > PIC16C84, I understand I can set the internal pull up resistors but I am > not sure why they are needed. Pull-up resistors (either internal or external) are needed so that the input doesn't simply float. If an input floats, it may spend a good bit of its time between the valid logic levels. CMOS gates are intended to operate in saturation, where they draw nearly no current. When they switch (or the input is an invalid logic level), they operate in a linear region, in which both the N-channel and P-channel transistors are partially on. This results in much higher current consumption. On CMOS inputs there may actually be enough parasitic capacitance and low enough leakage that the input will remain at a valid logic level for a short while after it has ceased to be actively driven. However, for a keypad that's exactly what you don't want. When a key is pressed, you want a PIC input to go low. When the key is released, you want it to go high again. But if there is no pullup, what is going to drive it high? Eric