Ports and key scanning (max6959 only), Port configuration register (max6959 only) – Rainbow Electronics MAX6959 User Manual

Page 14

Advertising
background image

MAX6958/MAX6959

Ports and Key Scanning

(MAX6959 Only)

The MAX6959 features two input ports, INPUT1 and
INPUT2. These two ports can be used as general-pur-
pose logic inputs, or configured to perform automatic
keyscanning. Both ports have internal pullup resistors
enabled in shutdown and normal operation for both
general-purpose input mode and keyscanning mode.
The ports can be read using the 2-wire interface.

The keyscan logic uses one or both of the INPUT1 and
INPUT2 logic inputs (Figure 12). An interrupt output that
flags key presses is optional. The interrupt flag can be
read (polled) through the serial interface instead, allow-
ing IRQ/SEG9 to be used as an open-drain general-
purpose logic output or as a segment driver.

One small-signal diode is required per key switch when
more than one key is connected to INPUT1 or INPUT2.
The diodes prevent two simultaneous key switch
depressions from shorting digit drivers together. For
example, if KEY0 and KEY1 were pressed together
(Figure 12) and the diodes were not fitted, DIG0/SEG0
and DIG1/SEG1 would be shorted together and the
LED multiplexing would be incorrect. These diodes can
be common-anode dual diodes in SOT23 like BAW56.
A diode is not required for a single key connection to
INPUT1 or INPUT2. Therefore, up to two key switches
can be automatically debounced without adding
diodes (Figure 13).

Resistors R1 and R2 are required if the MAX6959 is
operated with V+ greater than 4V. R1 and R2 are
optional if V+ is between 3V and 4V.

The keyscanning circuit utilizes the LED’s common-
cathode driver outputs as the keyscan drivers. The out-
puts DIG0/SEG0 to DIG3/SEG3 pulse low for nominally
320µs sequentially as the displays are multiplexed. The
actual low time varies from 5µs to 315µs due to pulse-
width modulation from 1/64th to 63/64th for intensity
control. The timing diagram (Figure 14) shows the typi-
cal situation when all four LED cathode drivers are used.
The maximum eight keys can be scanned only if the
scan-limit register is set to scan the maximum four dig-
its. If fewer than four digits are driven, then only (2 x n)
switches can be scanned, where n is the number of dig-
its (1, 2, 3, or 4) set in the scan-limit register (Table 14).

The keyscan cycle loops continuously over time, with
all eight keys experiencing a full keyscanning
debounce over 41ms (Figure 14). A key press is
debounced and an interrupt issued if at least one key
that was not pressed in a previous cycle is found
pressed during both sampling periods. The keyscan
circuit detects any combination of keys pressed during
each debounce cycle (n-key rollover).

Port Configuration Register

(MAX6959 Only)

The port configuration register configures INPUT1,
INPUT2, and IRQ/SEG9 ports for the MAX6959 (Table 16).

IRQ/SEG9 can be set to either an LED segment output
(driving four multiplexed LED segments), or an open-
drain logic output. The open-drain logic output can be
configured as either an IRQ output controlled by the
keyscan circuitry, or as a general-purpose logic output
controlled through the 2-wire interface. Connect a

2-Wire Interfaced, 3V to 5.5V, 4-Digit,
9-Segment LED Display Drivers with Keyscan

14

______________________________________________________________________________________

Key0

Key1

Key2

Key3

Key5

Key6

Key7

DIG0/SEG0

INPUT1

INPUT2

V+

V+

IRQ/SEG9

DIG1/SEG1

DIG2/SEG2

DIG3/SEG3

MICROCONTROLLER INTERRUPT

Key4

R2

39k

R1

39k

4.7k

Figure 12. Maximum Keyscan Configuration

Key4

INPUT1

INPUT2

V+

V+

IRQ/SEG9

DIG0/SEG0

MICROCONTROLLER INTERRUPT

Key0

R2

39k

R1

39k

4.7k

Figure 13. Keyscanning Two Keys Without Diodes

Advertising