Implementing Keypad Scanners with CoolRunner-IIThis application note provides a functional des cription of Verilog source code for a keypadscanner. The code is used to target the lowest density, 32-macrocell CoolRunnerTM-IIXC2C32A CPLD device in a CP56 package (6 mm x 6 mm). The keypad accommodated in thisdesign has 8 rows and 8 columns. The design can easily be scaled to target keypads with moreor less rows/columns. For instance, a keypad with 7 rows and 7 columns would allow thedesign to fit in the smallest QFG32 package (5 mm x 5 mm). To obtain the Verilog source codedescribed in this document, see “Verilog Code,” page 4, for instructions.As handheld devices such as cell phones pack more and more features into them, they requiremore effective ways of entering data. Most cell phones, for example, use the standard DTMFstyle keypad and a multi-tap process to enter alphanumeric data; however, for larger amountsof data multi-tapping becomes cumbersome. More and more high-end phones are thereforeemploying QWERTY keypads that make entering data easier and quicker.Going from a DTMF to a QWERTY keypad requires more I/O. For instance, a DTMF keypadmight have 4 rows and 3 columns, where a QWERTY keypad might have 8 rows and 8columns. This can vary depending on the requirements.Typically, a processor (or ASIC) is used to interface to the keypad’s rows and columns. Theprocessor scans the rows and monitors the columns for a logic change. When a changeoccurs, it indicates that one of the buttons in that column was pressed. By knowing which rowwas being scanned, and which column changed state, the processor can deduce whichspecific button was pushed. Additional functions such as debounce are also typicallyemployed. Figure 1 shows how a simple 4 x 4 keypad uses 8 GPIO of a processor.
猜您喜欢
评论