■ FIGURE 2. LED-2x7v2 stripboard
layout.
20M2. (We’ll soon see why.)
Figure 5 is a photo of the same
breadboard after I inserted the LED-
2x7v2 board. In order to test the
board, I re-wrote the LED-
2x7count.bas program that we used
back in April. The updated program
( LED2x7v2-CountBad.bas) is available
at the article link.
Now would be a good time to
download it, so that we can move on
to discussing what’s “bad” about the
program. Even if you decide not to
construct the LED-2x7v2 stripboard
circuit, you may want to continue
reading because the problem we’re
about to discuss illustrates an
important aspect of the use of the
outpinsB and/or outpinsC special
function variables that are available
for use with the 14M2, 18M2, and
20M2 processors.
traces; if you want to use a small
stripboard (as I did), you will need to
drill two holes in the extra solid trace
on the right side of the board, at
locations T3 and T6. Also (as I
mentioned earlier), we’re not using
the decimal point for LED 2 (the
one’s digit), so in order to avoid
drilling a third hole at location T9, I
just snipped pin 9 from the display
and soldered the display directly to
the stripboard.
Of course, you can also use two
female headers to mount the
LED display. If you choose that
option, just remove the
corresponding pin from one of
the header’s before you solder it
in place. A two-pin shunt can be
used in conjunction with the
three-pin male header at
locations E9-G9 to select
whether you want the 20M2’s
A.0 pin to be connected to the
decimal point of LED 1 (ten’s
digit) or to the discrete
resistorized LED on the board.
You can also omit the shunt
entirely if you prefer to use pin
A.0 for some purpose on your
breadboard circuit. Finally, note
that I forgot to remove the holes
from the bottom view of trace
T; just pretend they aren’t there!
The board is easy enough
to assemble without detailed
instructions. However, if you
decide to build this version of our
project, you may want to refer to the
photo of my completed board that’s
shown in Figure 3 for further
clarification. Also (as you can see in
the photo), I’ve snipped off the three
pins that we are not using. Since
those pins aren’t connected to
anything this isn’t really necessary,
but it does make it easier to correctly
align the stripboard with the pins of
the 20M2 on the breadboard. Figure
4 is a photo of the breadboard circuit
that I used to test
the completed
stripboard display.
I’m including it so
that you can see
how I connected
my Prog-03
programming
adapter to the
20M2. You can
also see that I
have connected a
resistorized LED to
pin B.0 on the
WRITING SOFTWARE
FOR THE LED 2x7v2
STRIPBOARD
■ FIGURE 3.
Completed LED-
2x7v2 stripboard.
For reference during the
following discussion, you may want
to print out a copy of the LED-2x7v2-
CountBad.bas program. If you don’t
already have one handy, you may
also want to print out a copy of
April’s LED-2x7count.bas program for
comparison. The first thing you will
probably notice is that the v2 version
requires fewer variables and it has a
much simpler data structure. As I’ve
already mentioned, these
simplifications are the result of the
simplified I/O connections on the
LED-2x7v2 board; this time, the port
B pins only connect to LED 1, and
the port C pins only connect to
LED 2.
In the v2 program, I derived the
20 data values in the same way that
we discussed for the 40 data values
that were needed for version 1 of the
software, so I won’t repeat that
process this time. However, as we
saw earlier in the schematic of
Figure I, we’re not using pins C. 6 or
B.0 this time. As a result, note that
the data values for bit 6 of port C
and bit 0 of port B have all been set
16
August 2012