Key-Scan
User Manual All information provided in this document is subject to legal disclaimers. © REALTEK 2019. All rights reserved.
315
Ameba-D
KeyY_0
KeyY_1
KeyY_2
KeyY_3
KeyY_4
KeyY_5
KeyX_0
KeyX_1
KeyX_2
KeyX_3
KeyX_4
KeyX_5
Column
Row
Keypad
Fig 16-2 Typical application setup with external keypad
16.2.2
Work Principle
At the beginning, all columns output low, and all rows are set as input with external pull up.
When there is a key or multiple keys pressed (Short between Column and Row), it triggers an internal state machine to start a Key-Scan cycle to
determine the column and row of the key that is pressed. The state machine sets first column as an output low and all other columns are in Hi-Z
state. The state machine then scans all rows to determine which keys are being pressed, and then second column is output low until the last
column. Firstly, scan circuit waits for a first debounce time and does first scan. Then, the circuit waits for a debounce time and scans again. After
the two scan cycles, the circuit decides the current key status, and compares with internal key status table to find which key is pressed or released.
After a full scan, the key press or release events are stored in the key event FIFO. Debounce time for the keypad is for each full scan and is
configurable, as shown in Fig 16-3.
Interval time between each full scan is configurable. Once all keys are detected release, there is a release timer to confirm that, then an all release
interrupt is triggered and state machine enters idle state. The Key-Scan timing is shown in Fig 16-4.
The document authorized to
SZ99iot
2019-05-15 10:08:03