■ FIGURE 8. Breadboard setup for single digit experiment.
switching action that will do exactly
what we need. Figure 9 is a
schematic of an NPN switch and a
PNP switch that are both connected
to the 20M2 A.0 pin. Below the
schematic is a chart that summarizes
the complementary switching action
of the two transistors. As you can
see, when the A.0 output is high the
PNP transistor turns off the one's
digit segments, and the NPN
transistor turns on the ten's digit
segments. When the A.0 pin is low,
the reverse is true: The PNP
transistor turns on the one's digit
segments, and the NPN transistor
turns off the ten's digit segments. In
other words, toggling the A.0 pin
toggles the two display digits which
is exactly what we want to do.
board by displaying a repetitive
count from 0 to 9 on the one's digit
of the N514RA. In Figure 8 (which
is a photo of the breadboard circuit),
you can see how I connected the
20M2 ground pin to avoid placing a
jumper under the N514RA. Also,
only the common cathode for the
one's digit is connected to ground,
so that's the only digit that will light.
The software is again simple enough
to just type into the Programming
Editor. Here's the code snippet:
Symbol myNum = b0
do
for myNum = 0 to 9
lookup myNum,(63,6,91,
79,102,109,125,7,
127,111),pinsB
pause 500
next myNum
loop
Not a very impressive program,
but it does show you whether your
board is working correctly. I also ran
an even simpler program that just
displayed " 8." on the N514RA one's
digit (note the "."), so that I could
measure the maximum current
consumption when all eight
segments are lit. The total current
54 February 2013
consumption was about 66 mA or
just over 8 mA per output pin, which
is well within the 20M2's
specifications.
Of course, our ultimate goal is
to multiplex the two-digit display. In
order to do so, we can't just connect
the two common cathode pins to
two of the 20M2 port C output pins.
When either of the port C pins is in
a low state, it could be sinking as
much as 66 mA which is way
beyond the maximum pin capability
of 25 mA. It could damage or
destroy the output pin. The solution
— which we used way back in the
December 2009 column — is to use
bipolar transistors as switches to
handle the higher current
requirements.
In that installment, we used four
KSP2222A NPN transistors to
multiplex a four-digit LED display;
presently, we could certainly use
two NPN transistors to multiplex the
N514RA, but this time I was
determined to not use any of the
port C pins to drive the display. In
other words, I wanted to accomplish
our goal by using only the "pseudo"
A.0 output pin.
Fortunately, NPN and PNP
transistors exhibit a complementary
MULTIPLEXING THE
N514RA LED DISPLAY
At this point, we're ready to set
up the breadboard circuit for our
multiplexed LED display. When I
implemented my breadboard circuit,
I used a 2N3904 NPN transistor and
a 2N3906 PNP transistor (which are
both available on my website, along
with the LDD-N514RI-RA display).
Both these transistors are rated
for a maximum continuous current
of 200 mA which is more than
adequate for this project. Most
commonly available bipolar
transistors should also work, as long
as they can handle the required
current flow.
Figure 10 presents another
version of the same schematic that
we just saw in Figure 9. This time,
however, the circuit is drawn in a
way that more clearly reflects the
breadboard setup that we'll be using.
Figure 11 is a photo of my
breadboard setup for the
multiplexed display.
When you have completed your
breadboard circuit, we're ready to
discuss the software for our
multiplexing project. There are three
important points that we need to
keep in mind: