Keypad -- Matrix Type

Here we go with a little fancier input, a 4X3 keypad affair. These look much like you might see on a telephone. This particular unit is arranged in a matrix switching topology. Pressing a button shorts a row and column together uniquely. I picked this guy up from All Electronics several years ago.

As you can see in the photo, above, both the row and column are indicated on the LCD for learning purposes, as well as the key-translation.

The circuit is a snap. But notice how the row-drive pins of the PIC are shared by the LCD. This is do-able because the LCD and keypad are never addressed simultaneously.

There's nothing too tricky in the code. But you might pause to read it over and see how the library unit (for the LCD) and a procedure are used. Also observe how the row and column are detected, and how this intersection is turned into an ASCII keycode. PIC Micro Pascal makes these sorts of operations easy; moreover, the source code is exceptionally self-documenting.

Click to get the source code.
Click to get the schematic PDF.

Next Project: Keypad -- One-Wire

No comments:

Post a Comment