English
Language : 

ADP5586 Datasheet, PDF (10/44 Pages) Analog Devices – Keypad Decoder and I/O Port Expander
ADP5586
KEY SCAN CONTROL
General
The 10 input/output pins can be configured to decode a keypad
matrix up to a maximum size of 25 switches (5 × 5 matrix) using
the PIN_CONFIG_A, PIN_CONFIG_B, and PIN_CONFIG_C
registers (Registers 0x3A through 0x3C). Smaller matrices can
also be configured, making the unused row and column pins
available for other I/O functions.
The R0 through R4 I/O pins comprise the rows of the keypad
matrix. The C0 through C4 I/O pins comprise the columns of
the keypad matrix. Pins that are used as rows are pulled up via the
internal 300 kΩ (or 100 kΩ) resistors. Pins that are used as
columns are driven low via the internal NMOS current sink.
VDD
KEY
SCAN
CONTROL
C0
C1
C2
R0 R1 R2
1
2
3
4
5
6
7
8
9
3 × 3 KEYPAD MATRIX
Figure 8. Simplified Key Scan Block
Data Sheet
Figure 8 shows a simplified representation of the key scan block
using three row pins and three column pins connected to a small
3 × 3, nine-switch keypad matrix. When the key scanner is idle,
the row pins are pulled high and the column pins are driven low.
The key scanner operates by checking the row pins to see if they
are low.
If Switch 6 in the matrix is pressed, R1 connects to C2. The key
scan circuit senses that one of the row pins has been pulled low,
and a key scan cycle begins. Key scanning involves driving all
column pins high, then driving each column pin low, one at a
time, and sensing whether a row pin is low. All row/column pairs
are scanned; therefore, if multiple keys are pressed, they are
detected.
To prevent a glitch or narrow press time from being registered
as a valid key press, the key scanner requires that the key be pressed
for two scan cycles. The key scanner has a wait time between
each scan cycle; therefore, the key must be pressed and held for
at least this wait time to register as being pressed. If the key is
continuously pressed, the key scanner continues to scan and
wait for as long as the key is pressed.
If Switch 6 is released, the connection between R1 and C2 breaks,
and R1 is pulled high. The key scanner requires that the key be
released for two scan cycles because the release of a key is not
necessarily in sync with the key scanner. Up to two full wait/scan
cycles may be required for a key to register as released. When
the key registers as released, and no other keys are pressed, the key
scanner returns to idle mode.
For the remainder of this data sheet, the press/release status of
a key is represented as simply a logic signal in the figures. A logic
high level represents the key status as pressed, and a logic low
level represents released. This eliminates the need to draw
individual row/column signals when describing key events.
KEY PRESSED
KEY x KEY RELEASED
KEY RELEASED
Figure 9. Logic Low: Key Released; Logic High: Key Pressed
Rev. 0 | Page 10 of 44