Advertisement
Advertisement

Camera serializer/deserializer chip set reduces wire count for keypad

-April 28, 2005

Many systems that require a user to manually enter data feature a keyboard similar to that in Figure 1. Although early keypads comprised arrays of individually wired switches, a typical modern keypad comprises a matrix of x and y lines. Pressing a key creates a momentary connection between an x line and a y line. For example, an individually wired keypad comprising discrete switches arranged in four rows and three columns (also known as a 4×3 layout) would require 24 wires. The more economical matrix approach in Figure 2 requires only seven signal wires, but even that number can sometimes prove difficult to route to a microcontroller. To further reduce the number of interconnecting wires from seven to three, plus a ground return, you can adapt a configurable serializer/deserializer such as National Semiconductor's LM2501.

The device typically finds use in adapting video buses, such as wide, low-voltage CMOS-video interfaces for portable electronics to Mobile Pixel Link service. The LM2501's typical application circuit features low-voltage and low-current operation and produces low levels of EMI (Figure 3). The circuit requires only two support devices—a counter (a CMOS CD4017 decade counter) and a 10-MHz clock-oscillator module (Figure 4). In operation, the host microcontroller drives the deserializer's WCLK input pin with a low-voltage-CMOS clock pulse, which translates to an MPL-level signal and then is applied to the serializer. The serializer reconverts the WCLK pulse, which drives the counter's clock input.

Unlike divide-by-10 encoded-output decade counters, the CD4017's internal organization comprises a Johnson counter that activates only one of its 10 outputs at a time. Thus, the counter's outputs D0, D1, and D2 sequentially apply a logic one to the keypad's column lines, and output D3 resets the counter to zero. When a user presses a key and connects a column line to one of four row lines, the serializer samples the keypad's row lines, converts the selected active line to a serial signal, and transmits the signal to the deserializer.

For example, suppose that the user presses the 5 key. The first clock pulse that the CD4017 receives drives column line D0 to a logic one, but, because the user does not press keys 1, 4, 7 and *, row lines A, B, C, and D remain at logic zero. The second clock pulse drives column line D1 to a logic one, and pressing key 5 connects row line B to logic one, whereas lines A, C, and D remain at logic zero. The pseudocode fragment in Listing 1 instructs the microcontroller to decode which key a user is currently pressing. In practice, additional code enables the microcontroller to reject multiple simultaneous key closures.

You can expand the architecture to accommodate a keypad matrix as large as 8×10 keys by using more of the counter's outputs and wiring the Nth output to the counter's reset input. The keypad's rows connect to the serializer's data inputs, and both of the LM2501s' unused inputs connect to pullup resistors, ground, or VCC.

 

Check out our Best of Design Ideas section!

Loading comments...

Write a Comment

To comment please Log In

FEATURED RESOURCES