Digital Input. AN1775 Datasheet

AN1775 Datasheet PDF

Part Number



Expanding Digital Input


Freescale Semiconductor

Total Page 12 Pages
Download AN1775 Datasheet

Freescale Semiconductor
Order this document
by AN1775/D Rev. 1
Expanding Digital Input with an A/D Converter
By Brad Bierschenk
Freescale Applications Engineering
Austin, Texas
This application note documents a method of extending digital input
using the analog-to-digital converter (ADC) of a microcontroller unit
Many MCU applications require digital input and arbitration. For
example, determining which key of a keypad was pressed. This is
commonly done by arranging switches in a matrix configuration,
connecting to a series of digital input pins, and reading a digital input
data register to determine which key was pressed. While this method is
easily implemented, it does require the use of an MCU’s parallel port
Some applications require all available bidirectional or input-only pins for
other purposes. In such a case, an alternate method of arbitrating
keypresses is desired. By using the ADC of an MCU connected to a
resistor ladder, user input can be more efficiently processed.
© Freescale Semiconductor, Inc., 2004. All rights reserved.
© Motorola, Inc., 1998
AN1775 Rev. 1
For More Information On This Product,
Go to:

Application Note
Freescale Semiconductor, Inc.
Dedicated Input
A microcontroller typically receives user input through digital input pins.
The simplest implementation is a single switch directly connected to a
digital input pin. This is easy to realize, but is not the most efficient use
of resources, with one pin dedicated to one input. One port data bit
represents the state of one switch.
Matrix Input
Another method uses a keypad, a common element in embedded
systems. These are ordinarily arranged in a matrix, as shown in
Figure 1. In this case, the byte value of an entire port data register can
be polled to determine which key was pressed. This is more efficient, as
a 4 x 4 keypad can interface 16 keys with eight input pins.
Figure 1. Resistor Matrix Keypad Using Parallel Port Pins
For More Information On This Product,
Go to:
AN1775 Rev. 1

@ 2014 :: ::
Semiconductors datasheet search & download site (Privacy Policy & Contact)