AN-426
AN-426 is Analog Keyboard Encoder manufactured by Altera.
..
Using MAX II CPLDs as Analog Keyboard Encoders
Application Note 426
July 2006, Version 1.0
Introduction
Keyboard encoders are a very mon application for CPLDs. Typically a processor, ASSP, or ASIC does not have enough pins for keypads or keyboards. I/O expansion is a very mon function for CPLDs and allows a processor to decode a very large keyboard with very few I/Os. Even though CPLDs like MAX® and MAX® II may have abundant low-cost I/Os, decoding a keypad or keyboard with one I/O per switch is not desirable. The advantage of decoding a keyboard with fewer wires is that it reduces the number of wires going from a keypad to a main circuit board or it reduces the plexity of a switch matrix in the keyboard assembly. This application note explains how the resources of a MAX II device can be used to decode a very large number of switches in a keypad or keyboard with only two I/Os and a GND pin. The decoding approach used works for as few as 4 switches and as many as 48 switches. The most mon way to encode a switch with a CPLD is by using a simple circuit that ties one end of the switch to GND and the other terminal to VCC through a pull-up resistor, typically 10 KΩ . The switch and resistor node are connected to any CPLD input pin. For a pushbutton normally-open Single Pole, Single Throw (SPST) switch, the CPLD input is normally a logic one and is a logic zero when the switch is pressed. Figure 1 shows the circuit for a simple one CPLD I/O per switch hookup. You can enhance this circuit by using a Schmitt trigger input buffer available in the MAX II device. The Schmitt trigger input reduces switching noise and makes switch debounce easier. Refer to AN 422: Power Management in Portable Systems Using MAX II CPLDs to learn how to integrate a power-up and power-down mechanism into the switch decode circuit.
Keyboard Decode Methods
Altera Corporation AN-426-1.0
1 Preliminary
Using MAX II CPLDs as Analog Keyboard Encoders...