EVAL-ADP5520
Rev. 0 | Page 14 of 24
KEYPAD MATRIX DECODING WITH INTERRUPT
First press the reset button (S17) on the evaluation board to put
the device in a known state; then complete the following steps.
1.
On the motherboard, move the jumpers on Block J1
through Block J8 to the KP position.
2.
On the
Aux LEDs Config
tab, set Bit 4 and Bit 5 in
Register 0x11 high; then program this setting by clicking
the
Program 0x11
button.
This reconfigures the R3 and C3 pins.
3.
On the
GPIO Config
tab, do the following:
a.
Set Bit 0 through Bit 3 in Register 0x1F high; then
program this setting by clicking the
Program 0x1F
button.
This enables the pull-ups on Pin R0 through Pin R3.
b.
Set Bit 0 through Bit 3 in Register 0x17 high; then
program this setting by clicking the
Program 0x17
button.
This configures Pin R0 through Pin R3 as keypad
matrix rows.
c.
Set Bit 4 through Bit 7 in Register 0x17 high; then
program this setting by clicking the
Program 0x17
button.
This configures Pin C0 through Pin C3 as keypad
matrix columns.
4.
On the
BackLight Config
tab, set Bit 0 and Bit 1 in
Register 0x01 high; then program this setting by clicking
the
Program 0x01
button.
This enables key presses/releases to generate interrupts on
the INT pin (nINT on the board).
5.
On the motherboard, press and release the S1 switch
(Keypad A).
6.
On the
Keypad Status
tab, do the following:
a.
Read the key press interrupt status Register 0x20 by
clicking the
Read 0x20
button.
Bit 0 is set, indicating that Key A was pressed.
b.
Read the key release interrupt status Register 0x22 by
clicking the
Read 0x22
button.
Bit 0 is set, indicating that Key A was released.
7.
On the
BackLight Config
tab, read Register 0x00 by
clicking the
Read 0x00
button.
Bit 0 and Bit 1 (the master key press/release interrupt bits)
should be set, indicating that one of the keypad matrix
switches was pressed/released.
On the motherboard, LED D18 lights up, indicating that the
INT pin (nINT on the board) is active and that an interrupt has
triggered.
To clear the interrupt, do the following:
1.
On the
Keypad Status
tab, clear all bits in Register 0x20
through Register 0x23 by reading the registers.
2.
On the
BackLight Config
tab, clear Bit 0 and Bit 1 in
Register 0x00 by writing 1 to each bit.
LED D18 on the motherboard goes out, indicating that the
INT pin (nINT on the board) is inactive.
Key press and release interrupts can be enabled independently
of each other.
BACKLIGHT TURN-ON DUE TO KEY PRESS
First press the reset button (S17) on the evaluation board to put
the device in a known state; then complete the following steps.
1.
On the motherboard, move the jumpers on Block J1
through Block J8 to the KP position.
2.
On the
Aux LEDs Config
tab, set Bit 4 and Bit 5 in
Register 0x11 high; then program this setting by clicking
the
Program 0x11
button.
This reconfigures the R3 and C3 pins.
3.
On the
GPIO Config
tab, do the following:
a.
Set Bit 0 through Bit 3 in Register 0x1F high; then
program this setting by clicking the
Program 0x1F
button.
This enables the pull-ups on Pin R0 through Pin R3.
b.
Set Bit 0 through Bit 3 in Register 0x17 high; then
program this setting by clicking the
Program 0x17
button.
This configures Pin R0 through Pin R3 as keypad
matrix rows.
c.
Set Bit 4 through Bit 7 in Register 0x17 high; then
program this setting by clicking the
Program 0x17
button.
This configures Pin C0 through Pin C3 as keypad
matrix columns.