Electronic Design
SPI Eases Interfacing For 5-By-5 Dot-Matrix Display

SPI Eases Interfacing For 5-By-5 Dot-Matrix Display

The circuit interfaces a display that features four 5-by-5 dot-matrix characters by using the display’s serial peripheral interface and a programmable system on a chip (PSoC). The SPI reduces firmware overhead and enhances clock stability.

Download this article in .PDF format
This file type includes high resolution graphics and schematics.

When discussing displays, seven-segment displays and LCDs are among the first that come to mind. Each type has its pros and cons. But generally, seven-segment displays cannot display letters, and LCDs tend to be bulky. Recently, I came across a four-character 5-by-5 dot-matrix, serial-input display (the SCDV5542 from Osram) that has several advantages.

The display can display alphanumeric characters and measures 10.16 by 19.91 mm (0.400 by 0.784 in.) with 3.12-mm (0.123-in.) characters. It has a serial peripheral interface (SPI) and allows high-speed data input. It features eight levels of dimming, an internal/external clock capability, and decoders, multiplexers, and an LED driver.

The device consists of a CMOS IC with control logic and drivers for the four 5-by-5 characters (Fig. 1). Each individual LED dot is addressable, so the user can create special characters. The device requires only four lines from a microcontroller. The IC accepts decoded serial data that is stored in internal RAM. Asynchronously, the RAM is read by the character multiplexer at the rate defined by the strobe.

1. The SCDV5542 four-character 5-by-5 LED dot-matrix display stores decoded serial data in a 100-bit internal RAM. Users can address each dot individually so they can generate custom characters.

The microcontroller supplies a string of bit-mapped characters (Fig. 2a, b, and c). Each character consists of six 8-bit words. The first word is the character address. It’s followed by the row data, which represents the on/off status of each LED in the column. Each bit of the 8-bit word consists of a 3-bit opcode (D7-D5) and 5 bits (D4-D0) of column data or character address or control word data.

2. The bit-mapped characters supplied by the microcontroller occur within certain timing specifications. The times in this example are based on the use of a 5-MHz clock (a period of 200 ns).

To load data, bring the /Load line low, which puts data in the serial register(Fig. 2d). The shift action occurs on the low-to-high transition of the serial clock (SDCLK). The least significant bit (D0) is loaded first. After one word is transferred, the /Load line is set to high for opcode decoding. The decoded opcode latches D4-D0 in the character address register. The time between loads must be at least 600 ns. The character address register bits (D0-D4) and row address register bits (D7-D5) direct the column data bits (D4-D0) to a specific RAM location.

The load character address tells the display the location (Table 1). The load column data controls the individual LED dot (Table 2). This feature allows you to create your own special symbols.

The display has seven brightness levels, defined by the percentage of full brightness that can be achieved: 100% (0xF0), 53% (0xF1), 40% (0xF2), 27% (0xF3), 20% (0xF4), 13% (0xF5), and 6.6% (0xF7). To control the brightness level, change the duty factor of the strobe pulse. Table 3 shows an example line.

In the power-down mode, the display brightness is set to 0% and the clock to the internal multiplexer is stopped, reducing the quiescent current, ICC, to 50 µA (Table 4). The display is reactivated by loading a new brightness level control word into the display. During power-down mode, data can be written to RAM.

Download this article in .PDF format
This file type includes high resolution graphics and schematics.

Table 5 illustrates the operation of the lamp test mode, which sets all the LEDs to 53% brightness. This operation can be cleared by loading a brightness level control word.

Finally, the software-clear mode clears the address register and the RAM (Table 6). The display is blanked and the character register address is set to character 0. The internal counter and control word register are unaffected.

The example circuit uses a Cypress CY8C27443-24PXI programmable system-on-chip (PSoC) and a program written in C. I chose the PSoC because it enables designers to select individual hardware blocks. The serial interface to the display is straightforward and easy.

There are two ways to interface the display. The first is to connect a microcontroller via the serial port in mode 0. The serial port control register will be a simple shift register. Serial data enters and exits through the RXD pin, and the TXD pin outputs the clock.

The second method interfaces the display via the SPI in mode 0. Besides MISO (master in slave out) and clock, the display needs /Reset and /Load control lines. I chose SPI for this project because of its inherent advantages over serial port (Fig. 3). The circuit uses a MAX1232 as a reset controller, but you can choose any other method for properly resetting the microcontroller.

3. The author opted to use a SPI instantiation for the display because it reduced the firmware overhead required.

As noted, the PSoC enables you to choose your own hardware modules, which speeds development. For this project I opted for the SPI hardware instantiation to reduce firmware overhead. This choice also ensures the clock is stable and isn’t influenced by other priority events.

Instantiating SPI simplified the display’s communication block. Below is the flow chart for firmware implementation. (The code for the demo is available here.)

• Power up the display.

• Bring /Reset low (for at least 600 ns) to clear the multiplex counter, address register, control word register, user RAM, and data register. The display will be blank. The display brightness will be set to 100%.

• If different brightness is desired, load the proper display brightness control word from Table 4.

• Load the character address into the display (Table 1).

• Load column data into the display (Table 2).

• Repeat steps 4 and 5 for rest of the digits.

Finally, one display CLK_I/O line can drive 15 slave CLK_I/O lines, so you can cascade displays to increase the project’s display capabilities. Figure 4 shows the block diagram for interfacing multiple displays.

4. The display’s CLK_I/O line can drive up to 15 slave CLK_I/O lines, so designers can easily cascade multiple units

Sources

1.  Osram SCDV5542 display, catalog.osram-os.com/media/_en/Graphics/00034132_0.pdf

2. Cypress Semiconductor CY8C27443-24PXI, www.cypress.com/?mpn=CY8C27443-24PVXI

3.Cypress Semiconductor PSoC Designer, www.cypress.com/?id=2522

4. Maxim Integrated MAX1232, www.maximintegrated.com/datasheet/index.mvp/id/1286

Girish Choudankar works at Emphatec Inc., a Toronto-based design house for industrial control interfaces and switch-mode power supplies. He holds a bachelor’s degree in electronics engineering from Mumbai University, India. 

Download this article in .PDF format
This file type includes high resolution graphics and schematics.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish