Coder’s Eye

A site about one of the three passions in my life.

Coder’s Eye header image 2

15 Segment ASCII Display Project

February 8th, 2006 · 3 Comments

15 segment displayWith the resurgence of interest in hobby electronics, I thought my readers might enjoy looking at the details of a simple project I did with cheap EBay-acquired parts. This was a fairly straightforward scrolling LED ascii display.

Goal

A simple-to-use Simstick display, capable of showing a reasonable subset of ASCII, utilizing cheap 15seg displays.

15 Seg Display

I chose to use LTP588G 15seg display, since it was cheaply available via EBay or surplus.

Segment Lettering

I could not find a “standard” segment-to-letter map for a 15 seg display, so I have extrapolated from the standard 7 seg layout:

image of the module with letters for the segments

Segment Map

The LTP588G is a 16 pin device in an 18 pin form-factor. It has pins 2 and 8 missing on the left side.

image of the LTP588G pin mapping

Character Shapes

Drawing all the shapes of the letters and numbers is not terribly difficult. It in somewhat more of a challenge to do this in a way that allows for different shapemaps. I chose to automate the generation of segment display header files from simple Ascii drawings.

Character Shape File

This is a text file, Unix format (no formfeeds), with all the desired shapes drawn in ascii characters.

The number 8 from my main shape file looks like:

  ---
 [   ]
  ---
 [   ]
  ---

Header File Generation

The shape file is parsed by a little python program I wrote. Use char_compiler.py to generate a header file suitable for my C compiler (CCS C) to use as an #include.

Creating the header:
python char_compiler character_defs.raw > 15seg.h

To use the generated character shapes, just include the 15seg.h file you just created and pass the ascii character you want to its get_15seg() method. Note that the return value will need to be logically ORed with 0xFFFF if your display is wired to cathodes, as is the one we are using for this project.

First Step: Testing one display

The easiest first test is to make one display show characters typed in via an RS232 connection.

Wiring

For this test, I used a PIC 16F877a running at 20Mhz wired as follows:

  • PORTB - 0-7 wired to segments A-H
  • PORTD - 0-6 wired to segments I-O
  • RS232 - TX to C7, RX to C6

picture with pin numbers

Test Program:

Test program: [source] [hex]

Usage

Type characters into a terminal session and hopefully see them appear on your 15 segment display.

Second step: Same thing, but using I2C

15 Pins is far too many pins to give up. Especially since my target chip is a 16F84.

PCF8574P I2C IO Expander chips are perfect for this purpose. They each yield another 8 pins of IO, and you can put up to 8 of them on the same I2C bus. Using two of these, I drop the pin usage from 15 to 2.

Hardware

  • PIC16F877 at 20Mhz (PIC)
  • 2 PCF8574P I2C IO expanders (IO1 & IO2)
  • LTP588G 15seg display

Test Program

Test Program: 877_15seg_i2c.c [source] [hex]

Third Step: 2 Displays

Adding more displays complicates things a bit.

Lighting the displays.

To fool the viewer into thinking all the displays are on and updating
simultaneously, I’ll just flick the displays on one at a time, real fast.
To do that, the V+ line on each display will have to be controlled
by the PIC. However, the PIC can’t source enough current, so I’ll have to
use a transistor.

Creating a Character Buffer

It is too awkward to manually control each display. It is much more
convenient to just append characters to a small buffer and then
display them as the controller has time.

I wrote a small little ring buffer library which suits my purposes pretty well.

Hardware

  • PIC16F877 at 20Mhz (PIC)
  • 2 PCF8574P I2C IO expanders (IO1 & IO2)
  • 2 LTP588G 15seg displays (LED1 & LED2)

Wiring

Follow the schematic [gschem format] [postscript] [pdf]

Test Program

Test Program: 877_15seg_2disp.c [source] [hex]

Usage

Type characters into a terminal session. They should appear on the displays, scrolling along as you type more.

Feel free to download all the GPL Licensed code from this article: 15seg.zip

Tags: Open Source · Uncategorized

Bookmark this article

del.icio.us:15 Segment ASCII Display Project digg:15 Segment ASCII Display Project spurl:15 Segment ASCII Display Project wists:15 Segment ASCII Display Project simpy:15 Segment ASCII Display Project newsvine:15 Segment ASCII Display Project blinklist:15 Segment ASCII Display Project furl:15 Segment ASCII Display Project reddit:15 Segment ASCII Display Project fark:15 Segment ASCII Display Project blogmarks:15 Segment ASCII Display Project Y!:15 Segment ASCII Display Project smarking:15 Segment ASCII Display Project magnolia:15 Segment ASCII Display Project segnalo:15 Segment ASCII Display Project gifttagging:15 Segment ASCII Display Project

3 responses so far ↓

  • 1 Kevin // Mar 27, 2007 at 10:11 am

    Hi, I read through your project and it sounded very interesting. I was thinking about doing something of the like, but I cannot seem to find a 15 segment led display to buy online. If you could let me know where I could purchase one, I would greatly appreciate it. Thanks.

  • 2 Caleb Arrivillaga // Nov 28, 2007 at 8:42 pm

    I wanted to design a 15 segment display like yours but I wanted to it to say ” Dulce XX” . It’s an inside joke that the class has with our professor. Can you help?

  • 3 simon // Sep 9, 2008 at 9:34 am

    I need to know how to make a display using 7segments connected to a decoder then to a counter and the input is from a keyboard.

Leave a Comment