EDN logo


Design Ideas: October 13, 1994

4-bit µP's A/D converter decodes keypad's inputs

Zhaohua Zhu,
Ryoden International (Shanghai) Ltd, Shanghai, China


thumbnail Fig 1 shows a Mitsubishi M50927-XXXSP/FP 4-bit microcontroller decoding a 4×4 keypad using only four digital I/O lines instead of eight. Saving four of a 4-bit µC's precious I/O lines couild be significant.

The 4-bit µC's ADC provides the key to the savings. The µC's output lines, F1 through F4, energize the keypad's column lines one at a time via 74HC4049 buffer/driver. If a user presses a key, the µC's ADC reads an analog voltage coresponding to the row of the pressed key. The resistors that the keypad's keys connect to the µC's ADC determine the voltage that the ADC sees. Table 1 lists these voltages.

Scanning each of the columns for a 3-msec period provides good response. Connect the ADC's reference to +5V. The 74HC4049 buffer/driver ensures that the voltage applied to the keypad's columns is a full 5V. (DI 1594)

Table 1--Voltages vs row of key pressed
Voltage (V)Row of Key pressed
5First
3.75Second
2.50Third
1.25Fourth
0.00no key




| EDN Access | feedback | subscribe to EDN! |
| design features | design ideas | columnist |


Copyright © 1995 EDN Magazine. EDN is a registered trademark of Reed Properties Inc, used under license.