Hardware
2.1.2
Membrane Keypad
Figure 4. Membrane Keypad Connections
The membrane keypad is a 4x4 matrix keypad, controlled by 4
Keypad Out
pins (columns), and 4
Keypad
In
pins (rows). Without any buttons pressed, the columns and rows are not connected to each other.
When a button is pressed, it connects its corresponding column pin with its corresponding row pin.
To detect any key presses, the connection of the row pin to the column pin must be detected. This is
accomplished by configuring the
Keypad Out
pins as outputs, and
Keypad In
pins as inputs. The Keypad
Out pins are toggled high one at a time, while the
Keypad In
pins are read for any changes. This allows
the exact key to be determined in the 4x4 matrix.
As an example, refer to the
keypad layout. If the bottom left button is pressed, the
Keypad Out 4
pin is now connected to the
Keypad In 1
pin. The host MCU starts reading the keypad matrix by toggling
Keypad Out 1
high (while keeping all other
Keypad Out
pins low), and reads all
Keypad In
pins low. This
is because
Keypad Out 1
is still not connected to any
Keypad In
pins by a button press. The host MCU
then toggles
Keypad Out 2
high, and reads all
Keypad In
pins still low. Eventually, the MCU toggles
Keypad Out 4
high, and reads that
Keypad In 1
has now transitioned to high. Recall that the bottom left
button connects
Keypad Out 4
with
Keypad In 1
, forcing the input row to read high. The MCU maps out
this connection and knows that the bottom left button was pushed, because that is the intersection point of
Keypad Out 4
and
Keypad In 1
. The MCU can now perform the action that corresponds to the key press.
It may seem like a key press can be missed with this procedure, but it is happening many times per
second, allowing for any key press to be detected. It is possible for keys to go undetected due to key
"ghosting" in a matrix keypad, but that is outside the scope of this brief overview. This only occurs when
multiple buttons are pressed at the same time, and there are ghost key detection algorithms to prevent
any misinterpretations.
NOTE:
The
Keypad Out 2
(J1.3) pin is connected to the UART receive pin on the BoosterPack
standard. On most 20-pin LaunchPads (MSP-EXP430G2, MSP-EXP430FR5969, MSP-
EXP430FR4133), the
Keypad Out 2
pin is also connected to the LaunchPad backchannel
UART pin. For proper operation of the Keypad, disconnect the UART RX jumper on the
LaunchPad isolation block.
6
BOOST-IR Infrared (IR) BoosterPack™ Plug-in Module
SLAU598A – December 2014 – Revised July 2015
Copyright © 2014–2015, Texas Instruments Incorporated