David Harris wrote... >CHALLENGE: can you scan a keyboard, and run an LCD display with only 8 pins/bits >= 1 port -- without extra active hardware? The minimum component solution requires 9 pins. But if you don't mind a whole bunch of passive components (including 4 small signal diodes), I think you can do it with 6 pins. You will want to read the inputs as active LO because of the weak pullups present on the data lines of most LCD controllers. Thats kind of sucky because you would have more tolerance with input logic thresholds if you were reading inputs as logic HI but thats life, I guess. PIC lines 3..0 connect to LCD data lines 7..5. PIC lines 3..0 also connect to keypad rows with 4k7 series resistors. PIC lines 3..0 also connect to keypad columns via 4 diode-capacitor networks: cathode to PIC pin, anode to keypad column and .001uF cap to GND. You also need 100k resistor pullups to the keypad columns and may want to add them to the rows as well (the pullups in the LCD module vary quite radically). 2 more PIC lines connect to LCD RS and E lines as usual. Talk to LCD as normal. You may want to pre-discharge the caps (set lines 3..0 LO for a few uS) before talking to the LCD but it shouldn't really be necessary. To read keypad, set PIC lines 3..0 HI for a few uS, then tri-state lines 3..1 and set line 0 low for a few more uS, then tri-state it as well. Wait a few more uS, then read the port. Go off and do something useful for a couple of hundred uS, then set line 1 low for a few uS, then tri-state it. Wait for a few uS and read the port. Repeat with lines 2 & 3. The important thing is to ensure the un-selected hold capacitors have a chance to charge well above 3V or 4V before trying to read the desired column. Total component count: 1- 10 pin bussed SIP (100k), 1- 8 pin iso SIP (4k7), 4- 1n4148 diodes, 4- 1n0 mono caps. dwayne Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA (780) 489-3199 voice (780) 487-6397 fax Celebrating 18 years of Engineering Innovation (1984 - 2002) .-. .-. .-. .-. .-. .-. .-. .-. .-. .- `-' `-' `-' `-' `-' `-' `-' `-' `-' Do NOT send unsolicited commercial email to this email address. This message neither grants consent to receive unsolicited commercial email nor is intended to solicit commercial email. -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics