The MAX7359 I2C interfaced peripheral provides microprocessors with management of up to 64 key switches.
Key codes are generated for each press and release of
a key for easier implementation of multiple key entries.
Key inputs are monitored statically, not dynamically, to
ensure low-EMI operation. The switches can be metallic
or resistive (carbon) with up to 5kΩ of resistance.
The MAX7359 features autosleep and autowake to further minimize the power consumption of the device.
The autosleep feature puts the device in a low-power
state (1µA typ) after a sleep timeout period. The
autowake feature configures the MAX7359 to return to
normal operating mode from sleep upon a key press.
The key controller debounces and maintains a FIFO of
key-press and release events (including autorepeat, if
enabled). An interrupt (INT) output can be configured to
alert key presses either as they occur, or at maximum rate.
Any of the column drivers (COL2/PORT2–COL7/PORT7)
or the INT, if not used, can function as a general-purpose output (GPO).
The MAX7359 is offered in small, 24-pin TQFN (3.5mm x
3.5mm) and 25-bump WLP (2.31mm x 2.31mm) packages for cell phones, pocket PCs, and other portable
consumer electronic applications. The MAX7359 operates over the -40°C to +85°C temperature range.
Applications
Cell Phones
PDAs
Handheld Games
Portable Consumer Electronics
Features
o Optional Key Release Detection on All Keys
o Monitor Up to 64 Keys
o +1.62V to +3.6V Operation
o Autosleep and Autowake to Minimize Current
Consumption
o Under 1µA Sleep Current
o FIFO Queues Up to 16 Debounced Key Events
o Key Debounce Time User Configurable from 9ms
to 40ms
o Low-EMI Design Uses Static Matrix Monitoring
o Hardware Interrupt at the FIFO Level or at the End
of Definable Time Period
o Up to Seven Open-Drain Logic Outputs Available
Capable of Driving LEDs
o 400kbps, 5.5V-Tolerant, 2-Wire Serial Interface
o Selectable 2-Wire, Serial-Bus Timeout
o Four I2C Address Choices
o Small, 24-Pin TQFN Package (3.5mm x 3.5mm) , or
Stresses beyond those listed under “Absolute Maximum Ratings” may cause permanent damage to the device. These are stress ratings only, and functional
operation of the device at these or any other conditions beyond those indicated in the operational sections of the specifications is not implied. Exposure to
absolute maximum rating conditions for extended periods may affect device reliability.
(All voltages referenced to GND.)
V
CC
..........................................................................-0.3V to +4V
COL2/PORT2–COL7/PORT7 ....................................-0.3V to +4V
SDA, SCL, AD0, INT .................................................-0.3V to +6V
All Other Pins..............................................-0.3V to (V
CC
+ 0.3V)
DC Current on COL2/PORT2–COL7/PORT7 ......................25mA
GND Current .......................................................................80mA
The MAX7359 is a microprocessor peripheral low-noise
key-switch controller that monitors up to 64 key switches
with optional autorepeat, and key events are presented
in a 16-byte FIFO. Key-switch functionality can be traded
to provide up to six open-drain logic outputs.
The MAX7359 features an automatic sleep mode and
automatic wakeup that further reduce supply current consumption. The MAX7359 can be configured to enter sleep
mode after a programmable time following a key event.
The FIFO content is maintained during sleep mode and
can be read in sleep mode. The MAX7359 does not enter
autosleep when a key is held down. The autowake feature
takes the MAX7359 out of sleep mode following a keypress event. Autosleep and autowake can be disabled.
Interrupt requests can be configured to be issued on a
programmable number of FIFO entries, or can be set
to a period of time to prevent overloading the microprocessor with too many interrupts. The key-switch status can be checked at any time by reading the
key-switch FIFO. A 1-byte read access returns both the
next key-event in the FIFO (if there is one) and the
FIFO status, so it is easy to operate the MAX7359 by
polling. If the INT pin is not required, it can be configured as an open-drain general-purpose output (GPO)
capable of driving an LED.
If the application requires fewer keys to be scanned, up
to six of the key-switch outputs can be configured as
open-drain GPOs capable of driving LEDs. For each
key-switch output used as a GPO, the number of key
switches that can be scanned is reduced by eight.
Pin Description
PIN
TQFNWLP
1A1
2A2
3A3
4B3
5A4
6A5
7B5
8B4
9C5
10C4
11D5
12E5
13E4
14D4
15D3
16E3
17E2
18D2
19E1
20D1
21C2, C3
22C1
23B2
24B1
——
NAMEFUNCTION
ROW2Row Input from Key Matrix. Leave ROW2 unconnected or connect to GND if unused.
ROW3Row Input from Key Matrix. Leave ROW3 unconnected or connect to GND if unused.
COL3/PORT3Column Output to Key Matrix or GPO. Leave COL3/PORT3 unconnected if unused.
COL4/PORT4Column Output to Key Matrix or GPO. Leave COL4/PORT4 unconnected if unused.
ROW4Row Input from Key Matrix. Leave ROW4 unconnected or connect to GND if unused.
ROW5Row Input from Key Matrix. Leave ROW5 unconnected or connect to GND if unused.
ROW6Row Input from Key Matrix. Leave ROW6 unconnected or connect to GND if unused.
ROW7Row Input from Key Matrix. Leave ROW7 unconnected or connect to GND if unused.
COL6/PORT6Column Output to Key Matrix or GPO. Leave COL6/PORT6 unconnected if unused.
COL5/PORT5Column Output to Key Matrix or GPO. Leave COL5/PORT5 unconnected if unused.
COL2/PORT2Column Output to Key Matrix or GPO. Leave COL2/PORT2 unconnected if unused.
COL1Column Output to Key Matrix. Leave COL1 unconnected if unused.
COL0Column Output to Key Matrix. Leave COL0 unconnected if unused.
I.C.Internally Connected. Connect to GND for normal operation.
GNDGround
AD0Adddress Input. ADO selects up to four device slave addresses (Table 10).
SDAI
SCLI
INTActive-Low Interrupt Output. INT is open drain.
V
CC
N.C.No Connection. Not internally connected.
COL7/PORT7Column Output to Key Matrix or GPO. Leave COL7/PORT7 unconnected is unused.
ROW0Row Input from Key Matrix. Leave ROW0 unconnected or connect to GND if unused.
ROW1Row Input from Key Matrix. Leave ROW1 unconnected or connect to GND if unused.
EP
2
C-Compatible, Serial-Data I/O
2
C-Compatible, Serial-Clock Input
Positive Supply Voltage. Bypass VCC to GND with a 0.047µF or higher ceramic capacitor.
Exposed Pad (TQFN only). EP internally is connected to GND. Connect EP to a ground plane
to increase thermal performance.
Table 2. Register Address Map and Power-Up Condition
Key-Scan Controller
Key inputs are scanned statically, not dynamically, to
ensure low-EMI operation. As inputs only toggle in
response to switch changes, the key matrix can be
routed closer to sensitive circuit nodes.
The key controller debounces and maintains a FIFO of
key-press and release events (including autorepeated
key presses, if autorepeat is enabled). Table 1 shows
keys order.
_____________________Initial Power-Up
On power-up, all control registers are set to power-up
values and the MAX7359 is in sleep mode (Table 2).
Registers Description
Keys FIFO Register (0x00)
The keys FIFO register contains the information pertaining to the status of the keys FIFO, as well as the key
events that have been debounced (Table 3). Bits D0 to
D5 denote which of the 64 keys have been debounced
and the keys are numbered as in Table 1.
D7 indicates if there is more data in the FIFO except
when D5:D0 indicate key 63 or key 62. When D5:D0
indicate key 63 or key 62, the host should read one
more time to determine whether there is more data in
FIFO. It is better to use key 62 and key 63 for rarely
used keys. D6 indicates if it is a key-press or release
event except when D5:D0 indicate key 63 or key 62.
Reading the key-scan FIFO clears the interrupt INT
depending on the setting of bit D5 in the configuration
register (0x01).
Configuration Register (0x01)
The configuration register controls the I2C bus timeout
feature, enables key release detection, enables autowake,
and determines how INT should be deasserted. By writing
to bit D7, you can put the MAX7359 into sleep mode or
operating mode, however, autosleep and autowake,
when enabled, also change the status of this bit (Table 4).
0x00Read only0x3FKeys FIFORead FIFO key scan data out
0x01R/W0x0AConfiguration
0x02R/W0xFFDebounceKey debounce time setting and GPO enable
0x03R/W0x00InterruptINT frequency setting
0x04R/W0xFEPortsPorts 2–7 and INT GPO control
0x05R/W0x00Key repeatDelay and frequency for key repeat
0x06R/W0x07SleepIdle time to autosleep
The key number indicated by D5:D0 is a key event. D7
is always for a key press of key 62 and key 63. When
D7 is 0, the key read is the last data in the FIFO. When
D7 is 1, there is more data in the FIFO. When D6 is 1,
key data read from FIFO is a key release. When D6 is
0, key data read from FIFO is a key press.
FIFO is empty.00111111
FIFO is overflow. Continue to read data in FIFO.01111111
Key 63 is pressed. Read one more time to determine
whether there is more data in FIFO.
Key 63 is released. Read one more time to determine
whether there is more data in FIFO.
Key repeat. Indicates the last data in FIFO.00111110
Key repeat. Indicates more data in FIFO.01111110
Key 62 is pressed. Read one more time to determine
whether there is more data in FIFO.
Key 62 is released. Read one more time to determine
whether there is more data in FIFO.
The debounce register sets the time for each debounce
cycle, as well as setting whether the GPO ports are
enabled or disabled. Bits D0 through D4 set the
debounce time in increments of 1ms starting at 9ms
and ending at 40ms (Table 5). Bits D5 through D7 set
which of the GPO ports is enabled. Note the GPO ports
can be enabled only in the combinations shown in
Table 5, from all disabled to all enabled.
The interrupt register contains information related to the
settings of the interrupt request function, as well as the
status of the INT output, which can also be configured as
a GPO. If bits D0 through D7 are set to 0x00, the INT out-
put is configured as a GPO that is controlled by bit D1 in
the port register. There are two types of interrupts, the
FIFO based-interrupt and time-based interrupt. The timebased interrupt can be configured to assert INT after a
number of debounce cycles. By setting bits D0 through
D4 to an appropriate value, the interrupt can be asserted
at the end of the selected number of debounce cycles
following a key event (Table 6). This number ranges from
1 to 31 debounce cycles. The FIFO based interrupt can
be configured to assert INT when there are between 4
through 16 key events stored in the FIFO. Bits D7 through
D5 set the FIFO based interrupt. Both interrupts can be
configured simultaneously and INT asserts depending on
which condition is met first. INT deasserts depending on
the status of bit D5 in the configuration register.
Table 6. Interrupt Register Format (0x03)
Ports Register (0x04)
The ports register sets the values of ports 2 through 7 and
the INT port when configured as open-drain GPOs. The
settings in this register are ignored for ports not configured as GPOs, and a read from this register returns the
values stored in the register (Table 7).
Autorepeat Register (0x05)
The MAX7359 autorepeat feature notifies the host that at
least one key has been pressed for a continuous period
of time. The autorepeat register enables or disables this
feature, sets the time delay after the last key event before
the key repeat code (0x7E) is entered into the FIFO, and
sets the frequency at which the key repeat code is
entered into the FIFO thereafter. Bit D7 specifies whether
the autorepeat function is enabled with 0 denoting
autorepeat disabled and 1 denoting autorepeat enabled.
Bits D0 through D3 specify the autorepeat delay in terms
of debounce cycles ranging from eight debounce cycles
to 128 debounce cycles (Table 8). Bits D4 through D6
specify the autorepeat rate or frequency ranging from 4
to 32 debounce cycles.
When autorepeat is enabled, holding the key pressed
results in a key repeat event that is denoted by 0x7E. The
key being pressed does not show up again in the FIFO.
REGISTER DATA
REGISTER DESCRIPTION
INT used as GPO00000000
FIFO based INT disabled000Not all zero
INT asserts every debounce cycles00000001
INT asserts every 2 debounce cycles00000010
INT asserts every 29 debounce00011101
INT asserts every 30 debounce00011110
INT asserts every 31 debounce00011111Time based INT disabledNot all zero00000
INT asserts when FIFO has 2 key events00100000
INT asserts when FIFO has 4 key events01000000
INT asserts when FIFO has 6 key events01100000
INT asserts when FIFO has 16 key events11100000
Both time base and FIFO based interrupts activeNot all zeroNot all zero
1Set port 2 high (high impedance)
0Clear port INT low
1Set port INT high (high impedance)
1
1
1
1
1
1
1
REGISTER DATA
REGISTER DESCRIPTION
Autorepeat is disabled0XXXXXXX
Autorepeat is enabled1AUTOREPEAT RATEAUTOREPEAT DELAY
Key-switch autorepeat delay is 8 debounce cycles1XXX0000
Key-switch autorepeat delay is 16 debounce cycles1XXX0001
Key-switch autorepeat delay is 24 debounce cycles1XXX0010
Key-switch autorepeat delay is 112 debounce cycles1XXX1101
Key-switch autorepeat delay is 120 debounce cycles1XXX1110
Key-switch autorepeat delay is 128 debounce cycles1XXX1111
Key-switch autorepeat frequency is 4 debounce cycles1000XXXX
Key-switch autorepeat frequency is 8 debounce cycles1001XXXX
Key-switch autorepeat frequency is 12 debounce cycles1010XXXX
Key switch autorepeat frequency is 32 debounce cycles1111XXXX
Power-up default setting00000000
D7D6D5D4D3D2D1D0
ENABLEAUTOREPEAT RATEAUTOREPEAT DELAY
.
.
.
.
.
.
Only one autorepeat code is entered into the FIFO, regardless of the number of keys pressed. The autorepeat code
continues to be entered in the FIFO at the frequency set by
the bits D4–D1 until another key event is recorded.
Following the key-release event, if any keys are still
pressed, the MAX7359 restarts the autorepeat sequence.
Autosleep Register (0x06)
Autosleep puts the MAX7359 in sleep mode to draw minimal
current. When enabled, the MAX7359 enters sleep mode if
no keys are pressed for the autosleep time (Table 9).
Sleep Mode
In sleep mode, the MAX7359 draws minimal current.
Switch matrix current sources are turned off and pulled
up to VCC. Writing a 0 to D7 in the configuration register
(0x01) puts the device in sleep mode. Writing a 1 to D7
or a key press, when the part is programmed to
autowake, can take the MAX7359 out of sleep mode.
Bit D7 in the configuration register gives the sleep
mode status and can be read anytime. The FIFO data is
maintained while in sleep mode.
Autowake
Key presses initiate autowake and the MAX7359 goes
into operating mode. Key presses that autowake the
MAX7359 are not lost. When a key is pressed while the
MAX7359 is in sleep mode, all analog circuitry, including switch matrix current sources, turn on in 2ms. The
initial key needs to be pressed for 2ms plus the
debounce time to be stored in the FIFO. Autowakeup
can be disabled by writing a 0 to D1 in the configuration register (0x01).
Serial Interface
Figure 1 shows the 2-wire serial interface timing details.
Serial Addressing
The MAX7359 operates as a slave that sends and
receives data through an I2C-compatible 2-wire interface. The interface uses a serial-data line (SDA) and a
serial-clock line (SCL) to achieve bidirectional communication between master(s) and slave(s). A master (typically a microcontroller) initiates all data transfers to and
from the MAX7359 and generates the SCL clock that
synchronizes the data transfer.
The MAX7359’s SDA line operates as both an input and
an open-drain output. A pullup resistor, typically 4.7kΩ,
is required on SDA. The MAX7359’s SCL line operates
only as an input. A pullup resistor is required on SCL if
there are multiple masters on the 2-wire interface, or if
the master in a single-master system has an open-drain
SCL output.
Each transmission consists of a START (S) condition
(Figure 2) sent by a master, followed by the MAX7359 7bit slave address plus R/W bit, a register address byte, 1
or more data bytes, and finally a STOP (P) condition.
START and STOP Conditions
Both SCL and SDA remain high when the interface is not
busy. A master signals the beginning of a transmission
with a START condition by transitioning SDA from high to
low while SCL is high. When the master has finished
communicating with the slave, it issues a STOP condition
by transitioning SDA from low to high while SCL is high.
The bus is then free for another transmission.
Bit Transfer
One data bit is transferred during each clock pulse
(Figure 3). The data on SDA must remain stable while
SCL is high.
The acknowledge bit is a clocked 9th bit (Figure 4),
which the recipient uses to handshake receipt of each
byte of data. Thus, each byte transferred effectively
requires 9 bits. The master generates the 9th clock
pulse, and the recipient pulls down SDA during the
acknowledge clock pulse, so the SDA line is stable low
during the high period of the clock pulse. When the
master is transmitting to the MAX7359, the MAX7359
generates the acknowledge bit because the MAX7359
is the recipient. When the MAX7359 is transmitting to
the master, the master generates the acknowledge bit
because the master is the recipient.
Slave Addresses
The MAX7359 has a 7-bit long slave address (Figure 5).
The bit following a 7-bit slave address is the R/W bit,
which is low for a write command and high for a read
command.
The first 4 bits (MSBs) of the MAX7359 slave address
are always 0111. Slave address bits A3, A2, and A1
correspond, by the matrix in Table 10, to the states of
the device address input AD0, and A0 corresponds to
the R/W bit. The AD0 input can be connected to any of
four signals: GND, VCC, SDA, or SCL, giving four possible slave address pairs, allowing up to four MAX7359
devices to share the bus. Because SDA and SCL are
dynamic signals, care must be taken to ensure that AD0
transitions no sooner than the signals on the SDA and
SCL pins.
The MAX7359 monitors the bus continuously, waiting for
a START condition followed by its slave address. When
the MAX7359 recognizes its slave address, it acknowledges and is then ready for continued communication.
Bus Timeout
The MAX7359 features a 20ms minimum bus timeout on
the 2-wire serial interface, largely to prevent the
MAX7359 from holding the SDA I/O low during a read
transaction if the SCL hangs for any reason before a serial transaction has been completed. Bus timeout operates
by causing the MAX7359 to internally terminate a serial
transaction, either read or write, if SCL low exceeds
20ms. After a bus timeout, the MAX7359 waits for a valid
START condition before responding to a consecutive
transmission. This feature can be enabled or disabled
under user control by writing to the configuration register
(Table 4).
A write to the MAX7359 comprises the transmission of the
slave address with the R/W bit set to zero, followed by at
least 1 byte of information. The first byte of information is
the command byte. The command byte determines which
register of the MAX7359 is to be written by the next byte,
if received. If a STOP condition is detected after the command byte is received, the MAX7359 takes no further
action (Figure 6) beyond storing the command byte.
Any bytes received after the command byte are data
bytes. The first data byte goes into the internal register of
the MAX7359 selected by the command byte (Figure 7).
If multiple data bytes are transmitted before a STOP
condition is detected, these bytes are generally stored
in subsequent MAX7359 internal registers (Table 7)
because the command byte address generally autoincrements (Table 11).
Message Format for Reading the
Key-Scan Controller
The MAX7359 is read using the MAX7359’s internally
stored command byte as an address pointer, the same
way the stored command byte is used as an address
pointer for a write. The pointer generally autoincrements
after each data byte is read using the same rules as for
a write (Table 11). Thus, a read is initiated by first configuring the MAX7359’s command byte by performing a
write (Figure 6). The master can now read n consecutive bytes from the MAX7359, with the first data byte
being read from the register addressed by the initialized command byte. When performing read-after-write
verification, remember to reset the command byte’s
address because the stored command byte address is
generally autoincremented after the write (Figure 8,
Table 11).
Operation with Multiple Masters
If the MAX7359 is operated on a 2-wire interface with multiple masters, a master reading the MAX7359 should use
a repeated start between the write that sets the
MAX7359’s address pointer, and the read(s) that takes
the data from the location(s). This is because it is possible
for master 2 to take over the bus after master 1 has set up
the MAX7359’s address pointer but before master 1 has
read the data. If master 2 subsequently resets the
MAX7359’s address pointer, master 1’s read may be from
an unexpected location.
Address autoincrementing allows the MAX7359 to be
configured with fewer transmissions by minimizing the
number of times the command address needs to be
sent. The command address stored in the MAX7359
generally increments after each data byte is written or
read (Table 11). Autoincrement only works when doing
a multiburst read or write.
Applications Information
Ghost-Key Elimination
Ghost keys are a phenomenon inherent with key-switch
matrices. When three switches located at the corners of
a matrix rectangle are pressed simultaneously, the
switch that is located at the last corner of the rectangle
(the ghost key) also appears to be pressed. This occurs
because the potentials at the two sides of the ghost-key
switch are identical due to the other three connections—
the switch is electrically shorted by the combination of
the other three switches (Figure 9). Because the key
appears to be pressed electrically, it is impossible to
detect which of the four keys is the ghost key.
The MAX7359 employs a proprietary scheme that
detects any three-key combination that generates a
fourth ghost key, and does not report the third key that
causes a ghost key event. This means that although
ghost keys are never reported, many combinations of
three keys are effectively ignored when pressed at the
same time. Applications requiring three-key combinations (such as <Ctrl><Alt><Del>) must ensure that the
three keys are not wired in positions that define the vertices of a rectangle (Figure 10). There is no limit on the
number of keys that can be pressed simultaneously as
long as the keys do not generate ghost key events and
FIFO is not full.
Low-EMI Operation
The MAX7359 uses two techniques to minimize EMI
radiating from the key-switch wiring. First, the voltage
across the switch matrix never exceeds 0.55V when not
in sleep mode, irrespective of supply voltage V
CC
. This
reduces the voltage swing at any node when a switch is
pressed to 0.55V maximum. Second, the keys are not
dynamically scanned, which would cause the keyswitch wiring to continuously radiate interference.
Instead, the keys are monitored for current draw (only
occurs when pressed), and debounce circuitry only
operates when one or more keys are actually pressed.
Power-Supply Considerations
The MAX7359 operates with a +1.62V to +3.6V powersupply voltage. Bypass the power supply to GND with a
0.047µF or higher ceramic capacitor as close as possible to the device.
Switch On-Resistance
The MAX7359 is designed to be insensitive to resistance either in the key switches or the switch routing to
and from the appropriate COLx and ROWx up to 5kΩ.
These controllers are therefore compatible with lowcost membrane and conductive carbon switches.
Port Capacitance
There are discharge and charge processes at the switch
closing point during the key scan. To restrict the charging time at less than that allocated for each individual key
detection, the external capacitance at each port, including those from ESD-protection diode, should be less than
100pF for the application where two keys can be simultaneously pressed. The above applies only when two keys
pressed share the same column port. The allowed external capacitance can be relaxed to 160pF if simultaneously pressed keys do not share the same column port.
Software Reset
The sequence machine for key-detection control can
be reset using I2C commands implementable by the
software. During the normal operating mode, bit D7 of
the configuration register 0x01 is 1. To software reset
the MAX7359’s key-detection sequence machine, send
two I2C commands to set the D7 bit to 0 and then to 1,
respectively.
Maxim cannot assume responsibility for use of any circuitry other than circuitry entirely embodied in a Maxim product. No circuit patent licenses are
implied. Maxim reserves the right to change the circuitry and specifications without notice at any time.
20
____________________Maxim Integrated Products, 120 San Gabriel Drive, Sunnyvale, CA 94086 408-737-7600