2. Pinouts and Serial Protocol for an Alphanumeric LED Display

(article continued from previous page)

The Lite-On LTM-Y2K19JF-03 is available from All Electronics for $1. However, it doesn’t come with a datasheet or pinouts, and its electronics are covered in epoxy. One of the displays went under the knife to reveal its secrets for science.

LTM-Y2K19JF-03 Connector Pins

With a multimeter in continuity mode (beeps when resistance is around 0 ohms), each connector pin is tested against the exposed chip pins. After a quick pass to determine if there are any matches, a slow pass is made while holding a magnifying glass to find the exact pin.

Pinout of the Lite-On LTM-Y2K19JF-03 multifunction LED display module.

Pinout of the Lite-On LTM-Y2K19JF-03 multifunction LED display module.

Every one of the pins on the five pin connector are wired to at least one pin on the chip. Of course, there are other discrete electronics in the display module, but since I know the limits of the ST2225A chip from its datasheet, I know enough to hookup the board without frying it.

As you can tell from the photograph at the beginning of this article, I was successful in getting the display to work. So, that was pretty good evidence that the pins were correctly identified. After receiving a copy of the official datasheet, it turns out that I originally had GND and reset swapped [now corrected], but I couldn’t tell the difference because both pins are tied to GND during normal operation.

Based on continuity testing, I believe the “reset” pin is actually the “data enable” pin of the ST2225A. This contradicts the official datasheet. So, I show “reset” in the pinout picture.

Setting reset high clears the display, ignores input, and puts the part in a “low power” state. Usually, I tie the reset pin to ground and ignore it.

The easiest way to save power is to simply output a full message of empty data to turn off all the LED segments (and then stop sending data, since the processing of even an empty message consumes power). In my tests, I found that an empty screen consumed 5.4 mA, whereas setting reset to high consumed 5.3 mA. If you have a spare microcontroller pin and you really want to save power, consider hooking it to a transistor to control all power to the display, rather than connecting it to the reset pin. Of course, you might want to use the reset pin to reset the display and communication protocol to overcome startup or intermittent clock glitches, but the self-correcting protocol doesn’t seem to need it.

ST2225A LED Driver Serial Protocol

The ST2225A is a serial-to-parallel driver. That is, the transmitter delivers one bit at a time, wiggling the clock high for each bit, until all the bits are delivered. At that point, the ST2225A latches (stores) all of the data and changes the output states of all of its pins to the corresponding bits.

The ST2225A requires the first bit to be logic 1 (high/5V). This is called the “start bit”. After that, transmit 35 data bits as desired. As each bit is pushed into the chip, the preceding bit moves over, until finally the start bit reaches the 36th position and trips the latch on the ST2225A.

What if the transmitter and the ST2225A become out of sync? If the transmitter thinks it is delivering the 5th bit, but a communication glitch causes the ST2225A to miss a bit, then the ST2225A thinks it is only on the 4th bit. Each bit will be in the wrong place from then on. The display will be complete nonsense unless 35 additional bits are missed. Nasty!

The use of a start bit overcomes that potential problem. If desired, the transmitter can deliver extra 0 bits at the beginning or the end of a sequence without consequence. Extra 0 bits will be ignored because only a 1 bit can start a sequence and trip the latch. Therefore, extra zeros can make up for any lost bits during any prior sequence.

That takes care of a missing-bit communication error.

To avoid sync problems from an extra-bit communication error, ingeniously the Lite-On engineers simply didn’t use the final bit. So, make it zero and the sync will autocorrect for up to one extra bit per burst.


The clock and data sequence for communicating with an ST2225A LED display driver chip.

The clock and data sequence for communicating with an ST2225A LED display driver chip.

Looking at the above logic analyzer signal trace, this is how the clock and data pins work:

Note that the ST2225A doesn’t care about the state of the data pin except when the clock is set high. If desired, the data pin can be used for other purposes as long as the clock is held low.

Also note that the transmitter has complete control over the rate of data bit delivery. If desired, the microcontroller can go slower. Or, the microcontroller can perform other work (handle interrupts) in between delivering data bits. In fact, I took advantage of this feature by delivering the bits in three groups: 15 bits (really 1 start + 14 data bits), 14 bits, and 7 bits. In the trace picture above, you can see the clock low time is a little longer between those groups.

Now, you ask yourself, how do the 35 data bits relate to the LED segments on the display? Count the seven 14-segment alphanumeric character segments, the four 7-digit numeric character segments, two 2-dot colons, and four double-width icons.

(7 * 14) + (4 * 7) + (2 * 2) + (4 * 2)
= 98 + 28 + 4 + 8
= 138

How are 138 LEDs going to be controlled by only 35 bits of data?

Multiplex

It turns out that it takes 5 deliveries of 35 data bits (some bits are ignored) to draw the complete display.

For each 35-data-bit sequence, only a part of the display is drawn. Each part is turned on and off by a transistor (there are 5 transistors in total). Therefore, only 1/5 of the display is drawn with each group of data delivered.

Because the ST2225A only has 35 outputs, the previously delivered data for other portions of the screen is lost with each new delivery. That is, while one part of the display is lit, the other four parts are turned off. The microcontroller must redraw each portion of the display over and over very quickly (refresh) to make it seem that the entire display is lit at the same time.

Sharing data pins is called multiplexing. Because of the relatively large number of segments in an alphanumeric character, it is standard practice to use multiplexed alphanumeric displays. Reusing pins saves board space and reduces costs for additional chips, but it does require the microcontroller spend a lot of time repeatedly redrawing the display.

Here’s the final breakdown of the bits used by the Lite-On LTM-Y2K19JF-03 to display all LED segments in five passes:

1) 1 start + 14 alpha + 1 ignore + 2 colon + 8 icon + 2 colon + 2 ignore + 5 transistor + 1 zero = 36
2) 1 start + 14 alpha + 7 numeric + 7 numeric + 1 ignore + 5 transistor + 1 zero = 36
3) 1 start + 14 alpha + 7 numeric + 7 numeric + 1 ignore + 5 transistor + 1 zero = 36
4) 1 start + 14 alpha + 14 alpha + 1 ignore + 5 transistor + 1 zero = 36
5) 1 start + 14 alpha + 14 alpha + 1 ignore + 5 transistor + 1 zero = 36

Don’t panic! It turns out that this can be programmed into a cheap little 2K microcontroller, along with a 96-character alphanumeric font. Want to see?