Extending the MAX6959 LED Display-Driver Keyscan from 8-Keys to 12-Keys

Abstract

Mapping multiple key presses extends the MAX6959 LED display driver's keyscan capability from 8 keys to up to 12 keys. This application note provides details on how to extend that capability.

Introduction

The MAX6959 is a 4-digit, 9-segment LED driver that also automatically scans and debounces up to eight key switches, optionally alerting the system processor to debounced keys through an interrupt output pin. (The similar, pin-compatible MAX6958 can drive the same number of LEDs, but does not have the keyscan capability.) The technique described here extends the MAX6959's capability from 8 to 12 keys, with the addition of one dual diode per extra key.

Table 1. Standard 8-Key Connections to the MAX6959 LED Display Driver
INPUT1 INPUT2
DIG0/SEG0 Key0 Key4
DIG1/SEG1 Key1 Key5
DIG2/SEG2 Key2 Key6
DIG3/SEG3 Key3 Key7

Figure 1. Standard 8-key connections to the MAX6959 LED display driver.

Figure 1. Standard 8-key connections to the MAX6959 LED display driver.

Table 1 and Figure 1 show the standard key-switch connections to the MAX6959. The key-switch circuit reads eight keys organized in a 2 x 4 matrix (two columns, four rows). The four key-matrix rows are driven by the four LED cathode drive outputs, DIG0/SEG0 through DIG3/SEG3. These LED cathode drive outputs take turns to go low for 320µs (nom) (and drive their LEDs sequentially) as part of the multiplex LED drive. These drive outputs are also used to each pull one end of two key switches low. The other ends of the keys connect to two input pins, INPUT1 and INPUT2, which are internally pulled up to V+ inside the MAX6959. If a switch is pressed, then INPUT1 or INPUT2 will be pulled low by the appropriate DIG_/SEG_ output and the MAX6959 detects and debounces the key press.

The diodes in series with the switches ensure that two or more LED cathode drive outputs are not shorted together if multiple keys are pressed simultaneously. For example, if Key0 and Key1 are pressed together, the diodes in series with the keys prevent DIG0/SEG0 from being shorted to DIG1/SEG1, because at any time at least one of the diodes will be reverse biased. The diodes are typically implemented as the low-cost, common-anode BAW56 in SOT-23.

The MAX6959 will distinguish and discriminate between any combination of the eight possible keys being pressed and released at any time. There are 8-bit registers in the part to provide status for these eight keys. It is obvious that there is no way to extend this scanning topology beyond the eight keys that the MAX6959 is designed for. So we have to do what every self-respecting engineer does in a case like this: Yup, we cheat!

To put it more fairly, we look for a redundant situation to exploit. In many cases, the application only needs to know if one key of many is pressed. Typically, two-key presses on equipment are either mis-keyed entries or a devious means to enter factory diagnostic modes. So the redundant situations are two-key presses...the cheat suggested here is to make four additional keys appear as if certain key pairs are being pressed simultaneously. This is shown in Table 2. For example, when Key8 is pressed, it must appear to the MAX6959 as if Key0 and Key4 are pressed simultaneously. This extension architecture works well as long as each original key-pair (e.g., Key0 and Key4) are not placed physically next to each other, to avoid their being pressed together accidentally. The software should be written to respond to a key IRQ within the 30.3ms minimum debounce cycle time, to ensure that the result from exactly one keyscan pass is being analyzed. If the software IRQ response is slow, it will not be able to distinguish between a simultaneous dual key press (identifying our extra keys) and sequential key presses of the same two keys. In either case, the Key Debounced register 0 x 08 will simply show a bit set for each key.

Table 2. Extended 12-Key Connections to the MAX6959 LED Display Driver
  INPUT1 INPUT2 INPUT1 and INPUT2
DIG0/SEG0 Key0 Key4 Key8
DIG1/SEG1 Key1 Key5 Key9
DIG2/SEG2 Key2 Key6 Key10
DIG3/SEG3 Key3 Key7 Key11

The circuit is shown in Figure 2. Each key requires a dual diode (such as the low-cost common-cathode BAV70 in SOT-23), which pulls both INPUT1 and INPUT2 low when the switch is pressed.

Figure 2. Extended 12-key connections to the MAX6959 LED display driver.

Figure 2. Extended 12-key connections to the MAX6959 LED display driver.

Finally, a caution. Each of the four extension keys is wired to simulate a dual key press for the two keys on each of the four LED cathode drive outputs, DIG0/SEG0 through DIG3/SEG3. With this connection, each key pair is always scanned and debounced at the same time. Extra keys that simulate a dual key press of keys scanned by different LED cathode drive outputs will be unreliable. Because the keyscan is performed sequentially, two keys at a time, the extra key could miss the debounce cycle for one LED cathode drive, yet be correctly debounced by the other. This dual key press would then appear as two sequential key presses, not as a dual key press. This wouldn't happen with the recommended connection scheme because each key pair representing a dual key is debounced together.