beautypg.com

Rainbow Electronics MAX7360 User Manual

Page 11

background image

I

2

C-Interfaced Key-Switch Controller and LED

Driver/GPIOs with Integrated ESD Protection

MAX7360

______________________________________________________________________________________ 11

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 (see Table 11 in

the Register Tables section).

Autorepeat Register (0x05)

The MAX7360 autorepeat feature notifies the host that at

least one key has been pressed for a continuous period.

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–

D3 specify the autorepeat delay in terms of debounce

cycles ranging from 8–128 debounce cycles (see Table

12 in the Register Tables section). Bits D4, D5, and D6

specify the autorepeat rate or frequency ranging from

4–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.
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 bits D4–D1 until another key event

is recorded. Following the key-release event, if any keys

are still pressed, the MAX7360 restarts the autorepeat

sequence.

Autosleep Register (0x06)

Autosleep puts the MAX7360 in sleep mode to draw

minimal current. When enabled, the MAX7360 enters

sleep mode if no keys are pressed for the autosleep time

(see Table 13 in the Register Tables section).

Key-Switch Sleep Mode

In sleep mode, the MAX7360 draws minimal current.
Switch-matrix current sources are turned off and pulled
up to V

CC

. When autosleep is enabled, key-switch

inactivity for a period longer than the autosleep time
puts the part into sleep mode (FIFO data is maintained).
Writing a 1 to D7, or a keypress, can take the MAX7360
out of sleep mode. Bit D7 in the configuration register
gives the sleep-mode status and can be read any time.
The FIFO data is maintained while in sleep mode.

Autowake

Keypresses initiate autowake and the MAX7360 goes into

operating mode. Keypresses that autowake the MAX7360

are not lost. When a key is pressed while the MAX7360

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. Write a 0 to D1 in the configuration

register (0x01) to disable autowakeup.

GPIOs

The MAX7360 has eight GPIO ports with LED control

functions. The ports can be used as logic inputs, logic

outputs, or constant-current PWM LED drivers. In

addition, PORT7 and PORT8 can function as a rotary

switch input pair. When in PWM mode, the ports are set

up to start their PWM cycle in 45N phase increments. This

prevents large current spikes on the LED supply voltage

when driving multiple LEDs.

GPIO Global Configuration Register (0x40)

The GPIO global configuration register controls the main

settings for the eight GPIOs (see Table 14 in the Register

Tables section).
Bit D7 enables PORT[7:6] as inputs for a rotary switch.

Bit D5 enables interrupt generation for I

2

C timeouts.

D4 is the main enable/shutdown bit for the GPIOs. D3

functions as a software reset for the GPIO registers (0x40

to 0x5F). Bits D[2:0] set the fade in/out time for the GPIOs

configured as constant-current sinks.

GPIO Control Register (0x41)

The GPIO control register configures each port as either

an input or an output (see Table 15 in the Register Tables

section). All GPIOs allow individual configurations,

and power up as inputs. Enabling rotary switch mode

automatically sets D7 and D6 as inputs. The ports

consume additional current if their inputs are left undriven.

GPIO Debounce Configuration Register (0x42)

The GPIO debounce configuration register sets the

amount of time a GPIO must be held for the MAX7360

to register a logic transition (see Table 16 in the

Register Tables section). The GPIO debounce setting

is independent of the key-switch debounce setting. Five

bits (D[4:0]) set 32 possible debounce times from 9ms

up to 40ms.