On Thu, 13 May 1999, Nuno Pedrosa wrote: > Can a keypad share pins with the bus to an LCD? > > What about keypresses? How do you keep them from interfering with the LCD > comms? Absolutely. Either on the rows or columns of the keypad will work. If you do it on the output side it's real easy, no change in data direction. The other side is still easy, but you must tris the pins to input to read the keypad. Put a pulldown resistor on the 4 passive keypad lines, and also use a series resistor to the PIC pins. the LCD is direct to the PIC. Therefore the keypad can not out-drive the PIC when it is talking to the LCD. This is standard operating procedure for me, never waste pins between keys and LCD. The Enable pin of the LCD can not be shared. I usually don't read from the LCD, but I don't see any problem doing it with this method(but in the application mentioned, the extra pin for R/W might be hard to allocate). Put the LEDs off the PIC with their own series resistors. Even if you use low(say 220 ohm) LED resistors and high(say 10k) keypad series resistors, the keypad can still be read because the LED will only clamp to 1.6 volts or more and the PIC input high level is 1.2 volts on PORTB(at 5 volts operation). Put a series diode before each LED if you are chicken and want more margin. Or use green LEDs. Cheers, Bob