English
Language : 

AN980 Datasheet, PDF (4/8 Pages) STMicroelectronics – ST7 KEYPAD DECODING TECHNIQUES
ST7 KEYPAD DECODING TECHNIQUES, IMPLEMENTING WAKE-UP ON KEYSTROKE
3 EXTERNAL INTERRUPTS
The MCU is in HALT mode. When a key is pressed, a low level is applied to the pin corre-
sponding to the row the key belongs (pins configured as inputs with pull-up). It’s a falling edge
applied to a pin of Port C which creates an external interrupt (EI1) and wakes up the MCU. The
MCU executes then the external interrupt subroutine (decoding the pressed key) and comes
back to its previous state (HALT state in the main program).
4 KEYPAD
The keypad used is a 4x4 matrixed keypad. Rows are connected to pins configured as inputs
with pull-up. So the initial state of these pins are a high level (1). When a key is pressed, a low
level is applied to the corresponding pin. For this reason, the keypad is coded as follows:
Table 1. Key values
KEY
1
2
3
F
4
5
6
E
row
value
0x0E
0x0E
0x0E
0x0E
0x0D
0x0D
0x0D
0x0D
column
value
0x0E
0x0D
0x0B
0x07
0x0E
0x0D
0x0B
0x07
KEY
7
8
9
D
A
0
B
C
row
value
0x0B
0x0B
0x0B
0x0B
0x07
0x07
0x07
0x07
column
value
0x0E
0x0D
0x0B
0x07
0x0E
0x0D
0x0B
0x07
1 23F
456 E
789D
A0 BC
PC0
PC1
PC2
PC3
PA0 PA1 PA2 PA3
4/8