1-pin? Ok fine. I dare you... Let's see you do it with 0 pins! :) That's why I put the "more external hardware" qualifier. Resistors are external hardware. I'll have to think about the 1-pin solution. Seems like it would be a challenge to be able to detect multiple keys pressed at the same time. Gee Whiz, Thanks a lot Mike. Now I gotta think about this all night :) -Mark > -----Original Message----- > From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu]On Behalf > Of Mike Hord > Sent: Monday, April 11, 2005 4:13 PM > To: Microcontroller discussion list - Public. > Subject: Re: [PIC] Matrix Keyboard Philosophy > > > > Can you use a I/O port with internal pullups? Any way you slice > it you will > > need 11 I/O lines (or more external hardware). > > Not entirely true. It would be possible to do this 8x3 with one > pin (tough) > or 3 pins (easier), IF you pick the right pin(s); I guess this > DOES fall under > "more external hardware", although that hardware is just resistors. > > By using a pullup resistor on the columns and a pulldown on the rows (or > vice-versa), you can create a voltage divider which will produce > a different > voltage depending on the button pressed. Use a different resistance for > each row. Now you can poll each of three ADC pins and, if the value is > in the right range, you know a valid button press has occured. > > Not necessarily the best possible way, from a CPU overhead/software > simplicity point of view, but it's pretty easy on the pin count. > > Mike H. > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist