Figure 3. The PIC is labeled like this when
the matrix LED is used vertically. Swap rows and
columns when connected horizontally.
About the Firmware
The complete source code for the firmware (available at
the article link) has been written in the free and open source
Great Cow Basic language, which itself is available from
gcbasic.sourceforge.net. You might recall that I described this
compiler in the November 2012 issue of Nuts & Volts , and it's put
in appearances in several other articles since then. This really is
an easy-to-use yet powerful package, and it’s completely free —
no strings attached! The three main source files and their
OneChar.GCB — Display a single ASCII character
TwoChar.GCB — Display two ASCII characters
Horizontal.GCB — Display two digits horizontally on a single
control the columns, while seven lines of port B handle the
rows. This still leaves a few port pins left over for other uses.
Just in case it isn’t clear, we’ll run things on the built-in
8 MHz clock, and also let power-on resets be handled
So, just connect things up as in Figures 2 and
away you go! Figure 4 shows what the breadboarded result
We still have to figure out the software. Get the
download package at the article link. In there, you will find
the complete source code which drives our single character
display. In particular, the firmware will put the unit through its
paces, showing all of the standard ASCII characters including
upper- and lower-case letters, digits, and punctuation. See the
sidebar for more information on the programs.
More Than One Character
You'll also find two "include" files:
Characters.GCB — Bit codes for ASCII characters 32 through 127
Digits.GCB — Bit codes for 3 x 5 digits using negative logic
Bear in mind that Great Cow Basic files are really just
ordinary text, so even if you're using an Arduino, for example,
you'll be able to rip off the character bit codes and exploit them.
That'll save you tons of time because designing a complete
character set is usually fairly time-consuming.
Once you’ve figured out how to display a single
character, it’s pretty straightforward to extend this to longer
messages. After all, each new character represents little more
than five additional columns to be scanned. Theoretically, this
ought to be easy, but after a moment’s reflection it’ll dawn
on you that you may run out of port lines on the
microcontroller. Here’s one approach that keeps things
manageable when displaying two-digit numbers.
Figure 5 gives us the scoop. A CD4017 divide-by-ten
counter is called upon to service the column select lines.
Hey, that’s pretty nice: Two characters of five columns each
require 10 control lines — exactly what this CMOS chip has.
Now, it’s just a matter of stepping the counter along to
multiplex the columns sequentially. All that’s needed is a
microcontroller port pin to clock the device, and a reset line
to ensure the counting commences from the beginning.