Click here to Skip to main content
12,551,121 members (46,217 online)

Welcome to the Lounge


For discussing anything related to a software developer's life. Technical discussions are encouraged, but click here to ask your programming questions.

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.
GeneralToday I embarked... Pin
CDP180211-Jan-13 13:27
memberCDP180211-Jan-13 13:27 
... 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.
GeneralRe: Today I embarked... Pin
Brisingr Aerowing11-Jan-13 14:26
memberBrisingr Aerowing11-Jan-13 14:26 
GeneralRe: Today I embarked... Pin
Roger Wright11-Jan-13 17:50
memberRoger Wright11-Jan-13 17:50 
GeneralRe: Today I embarked... Pin
CDP180212-Jan-13 1:20
memberCDP180212-Jan-13 1:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Advertise | Privacy | Mobile
Web02 | 2.8.161021.1 | Last Updated 24 Oct 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid