November
2005, Issue 184
Large-Scale
Electronic Display
SOFTWARE
The
BASIC Stamp 2 microcontroller’s control program is small.
A 3-byte data transfer protocol is used to send data
to a digit. The protocol consists of a start byte, an
address byte, and a data byte.
The
BASIC Stamp 2 microcontroller receives commands from
the laptop control program using the SERIN
command. The start byte used is a colon, or ASCII 3Ah.
To accommodate 25 possible addresses using a single
byte, ASCII characters are assigned to digit positions.
Digit 0 is character @ (40h). Digit 1 is character A
(41h). Digit 2 is character B (42h). After reception,
40h is subtracted from each address byte to recover
a digit’s true numerical address value. You may download
the code from the Circuit Cellar FTP site.
Similarly,
2Fh is subtracted from each data byte to obtain a numerical
data value that will be sent to a digit. This is stored
in the DTA
variable. The bit pattern sent to a digit is obtained
in the manner shown in Figure 4. It uses the LOOKUP
command. The DTA
variable acts as the pointer in the table. The CHAR
variable receives the result. To reset a digit, the
/ character (2Fh) is used. The t,
r, i,
and a
characters are assigned to the functions shown in Figure
4. For normal operation, :B6 displays 6 on digit 2.
Any
terminal program like HyperTerminal will suffice for
testing. You can then develop an application program
on a PC to control the system via a high-level language.
A
student of mine at the University of the West Indies
in Barbados wrote the application program in Microsoft
Access. The program, which displays a crude replica
of the scoreboard, enables you to pull down the appropriate
table box and click on a value, which is then sent to
the scoreboard (see Photo 2).
|

(Click
here to enlarge)
|
Photo
2—The operator interface enables you to pull down
the appropriate table and send a value to the scoreboard. |
My
scoreboard has worked for more than two years without
any significant problems. Most problems have been mechanical
ones and have involved sticking vanes, which are easy
to clean with distilled water (absolutely no oily lubricating
agents).