Agere Systems Inc.
225
Data Sheet
July 2001
T8302 Internet Protocol Telephone
Advanced RISC Machine (
ARM
)
17 Key and Lamp Controller (KLC)
(continued)
However, if any column inputs are found to be high indicates that a key must be pressed and the KLC will deter-
mine its location.
When a user depresses keys on the keypad, the keys often bounce before settling into the on state. To avoid this
problem, a debounce interval has been incorporated into the design. The debounce interval is the period between
detecting that a key has been pressed, and the time it scans the matrix to detect which specific key has been
pressed. During this interval of roughly 2.5 ms, the KLC switches to LED drive mode and drives the first three rows
of the LED matrix. After finishing the third LED row's time slice, the KLC disables the LED matrix and scans the key
matrix to determine which key has been pressed. This process involves asserting each row output individually for
roughly
125 ns
and checking the column inputs. When a certain row causes a certain column to be asserted, the
location of the key has been determined. At the end of this interval, the
key scan status register
is set with the
row and column of the pressed key
(see Table 204 on page 230)
and any enabled interrupts corresponding to the
key-press are asserted. The remaining four LED rows are driven after locating the key to finish the LED drive cycle
that was interrupted by the key location process.
The KLC provides a programmable delay interval after it detects a key transition. During this
noscan
interval the
key matrix will not be scanned. The KLC will not scan the key matrix for 0, 1, 2, or 3 LED drive cycles depending on
the programmed
noscan
code residing in the
noscan control register
,
see Table 202 on page 229
. After this nos-
can delay interval, the KLC begins waiting for the key to be released. During these key scan intervals, the KLC
asserts the row containing the pressed key and checks the column containing the pressed key. If the column is still
pulled high, the key is still depressed. If the column stays low, the key has been released and again the
key scan
status register
and
interrupt registers
are updated. A noscan period is also inserted after the key is released
before any new key presses can be noted.
The process for detecting a key press and release is summarized in the following state description:
I
Ready to detect key depression: the KLC is looking for a key depression and upon completion of driving the last
LED row (
ROW8
) it will sample all the rows of the key matrix. If it detects a key depression, it will enter the next
state.
I
Detected key depression: the KLC detected a key depression during the last key sample cycle. It waits 2.5 ms as
a key debounce time and then scans each row in the key matrix. The row/column address of the first key it finds
depressed will be recorded in the
key scan status register
. The press bit will also be set to 1 on the following
clock, setting the row/column address. This will generate an interrupt to the processor if the corresponding bit is
enabled in the interrupt controller. After recording the key depression in the
key scan status register
, the KLC
will enter the next state.
I
Detected key wait: after recording a key depression in its register, the KLC will not sample the key matrix at the
end of the cycle during which it scanned the matrix. In addition, the KLC will not scan the key matrix again for the
time set in the
noscan control register
.
I
Wait for key release: when the
noscan
interval has expired the KLC will enter this state. The KLC will sample the
key matrix looking only for the key recorded in its
key scan status register
. When the KLC detects that key as
not being depressed, it will reset the press bit in its
key scan status register
to 0.
I
Key released wait: the KLC detected that the key it recorded as pressed has now been released. The KLC will
wait the number of LED drive cycles programmed into its
noscan control register
before acting on any new key
depressions. When the noscan interval has expired, the KLC will enter the first state.
The circuit interface to the KLC should be designed so that the red and green LEDs associated with a key are
placed in the same row and adjacent columns. This would place both LEDs in the same register with the red LED
in the low nibble and the green LED in the high nibble.
If more than one key is depressed at a time, the KLC detects the first key that is registered as being pressed. If
multiple keys are pressed in one column of the key matrix during the keyboard scanning cycle, one row will attempt
to pull the column high while the other rows will pull the column low. To avoid a short in this situation, diodes have
been placed in the KLC interface matrix, see
Figure 30 on page 223
.