The Lounge is rated PG. If you're about to post something you wouldn't want your
kid sister to read then don't post it. No flame wars, no abusive conduct, no programming
questions and please don't post ads.
... on the noble quest to build the ultimate instrument of programming: A hexdecimal keyboard.
First I built the keyboard itself, oldschool style. That involved stripping (the insulation off little wires), heavy metals (good old lead/tin solder), and Heavy Metal. The result: A board with 17 keys, some resistors and a ribbon cable to hook it up to a decoder device.
In the old days there used to be ICs to scan and encode a 4 x 4 keyboard matrix, but they have become expensive and extremely hard to get. So I wanted to design my own encoder. Four standard logic ICs should be sufficient: A counter, a dual 2 to 4 decoder, a comparator and a latch to hold the value of the last key that was pressed.
Draw a schematic, get parts, wire everything up on a breadboard (more stripping!)...
... and don't believe your eyes. That thing acted weird!
The first bug: I took a 74LS192 counter. It's 4 bit (correct), synchronous (correct) and BCD
(ARGH!). Encoding a hex keyboard obviously needs a counter that can actually count to 16! I should have read the caption of the datasheet where it tells you that a 74LS192 counts BCD, while a 74LS193 counts binary.
Lesson learned: The ability to read is an advantage.
Replaced the 74LS192 with a 74LS163 (the only suitable IC I found in my parts box) and...
... it still did not work. This time the bug was having accidentally used the wrong output pin of the comparator.
Lesson learned: The ability to count is an advantage.
Now everything should be ok, or perhaps not. I could press keys as much as I wanted, the outputs of the latch remained - nothing. Not 1, not 0 - nothing. Hold on, that's a tri-state latch! Maybe that pin named OE (output enable) has something to do with it.
It did. Finally! It works! The counter counts (even to 16), the dual decoder decodes, the comparator compares and the latch latches (correct key values!)
Now I can etch a small circuit board, build the encoder and hook it up to any computer, old or new. I seriously doubt that using it will be nearly as much fun as building it.
there used to be ICs to scan and encode a 4 x 4 keyboard matrix,
Don't they make diodes and SN74LS154 4-to-16 de-multiplexors anymore? I seem to recall that we used diode (1N914 or 1N4148) OR arrangements on the keyswitches to encode a 4x4 array into 4 bits, then the '154 to expand to one of 16 outputs. We didn't need no stinkin' scanners, though a switch debounce circuit certainly came in handy.
Now that you have it working, have you thought of any practical use for it?
Both, the signal diodes and the 74LS154 are alive and well. They would just not quite do the job.
Here[^] is a link to the article about building a little computer from 1977. If you look closely, you will see that it's completely CMOS, including the processor. Very unusual at that time, as well as building a simple complete little computer for under 100$.
People still build this computer today and there are also some modernized incarnations. A common 'feature' usually are IC8 and IC9 with the eight toggle switches to input data. My old computer was a slightly improved version where the eight switches were replaced by a 74C922 keyboard encoder and a 74C179 latch.
The encoder's output was only 4 bits wide, the value of the last key that was pressed. The latch stored the other four bits, so that you had a complete byte that could be read by those 4016 switches. A 1 to 16 decoder like the 74LS154 would not help very much here.
The 74C922 is out of production for many years. With some effort you may locate one, but then it will be relatively expensive. What we need is a replacement that delivers a full byte, the last two keys that have been pressed. If possible, with standard logic ICs. God forbid, no microcontrollers or programmable logic. It should be kept simple, cheap and easy to reproduce. I needed parts for less than 15$, including the buttons for the keyboard.
For building a prototype on the breadboard LS TTL was convenient, but in the end I would certainly use CMOS again, replacing 74LSXX with 74HCXX or 74HCTXX. Mixing logic families usually is not a good idea and it would keep the little computer's power requirements low. There are some versions that can run for months on ordinary batteries.
Last Visit: 31-Dec-99 18:00 Last Update: 20-Jul-17 21:48