On Sun, 22 Aug 2004 22:18:02 -0400, Denny Esterline wrote: > > I'd drive the rows with the outputs of a 74HC138 decoder, and read the outputs > > from the columns using a 74HC151 multiplexer. It'll take 7 PIC I/O pins to do > > the job: 3 to drive the HC138, 3 to drive the HC151, and one input to > > read the HC151. > > > > BAJ > > Really? I'd have thought an 8x8 square with no external parts. Drive the > rows with portD and read the columns with portB interrupt on change. I'm not sure either technique allows for multiple simultaneous key depressions, which was mentioned by the OP. As far as I can see, any simple x-y matrix will give ambiguity if two non-orthogonal keys are pressed at once. I wonder if a keyboard controller chip (I know they exist, I just don't know any!) would be the answer, since n-key rollover is part of what they do. > I'm not familiar with MIDI, but certainly I'd have thought the other 17 IO > lines would be enough to implement it. MIDI is basically serial I/O with a tightly-defined format specification. I believe you can do it with 1 input and 1 output (there may be a clock too - can't remember) but half of a PIC I/O port is plenty. It may even be possible to use a UART on PICs that have it. > As others are fond of saying "engineering is the art of compromise" Indeed! Any engineering that's straightforward with one obvious solution isn't really worth the name :-) Cheers, Howard Winter St.Albans, England -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu