Issue
161 December 2003
Easing
into eZ80Acclaim!
HOW
EZ WAS THAT?
I
am still absorbing the eZ80Acclaim! development kit’s
documentation. The good news is that it’s all beginning
to make sense, and the multitude of code modules I’ve
been sorting through for the last couple of days are
starting to read like C source code instead of hieroglyphics.
Some
of the example code I collected had been written for
other variants of the eZ80Acclaim! or used a back level
of the Developer Studio II environment. I tried unsuccessfully
to get the older demos to run under the latest Developer
Studio II IDE. I didn’t spend much time trying to modify
the build parameters for the older code, because the
latest Developer Studio II example code included the
older code’s functionality.
I
studied the eZ80Acclaim! LED demo code and tried my
hand at writing a simple routine to blink some of the
LEDs in the 5 × 7 LED array on the Zilog development
board. The LED array’s wiring is depicted in Figure
1. To display a character, the anodes are scanned and
the appropriate LEDs for each row are selected by placing
a logic low on the cathode of each LED you want to illuminate
in each row. I laid out the letter C in Figure 2 and
included the source code for displaying it in Listing
1.
|

(Click
here to enlarge)
|
Figure
1—The abbreviated schematic is intended to illustrate
how the LED matrix is driven. The anodes are scanned
and a logic low is applied to each LED that needs
to be illuminated on each selected row. The anodes
are scanned just fast enough to eliminate visual
flicker. |
|

(Click
here to enlarge)
|
Figure
2—Take a logical look at how the letter C is generated.
A demo program comes with the eZ80Acclaim! development
kit that displays characters entered on the keyboard.
You can use the demo program to get your LED matrix
codes instead of having to sit and figure them all
out from scratch. |
| Listing
1—After I matched the discreet LEDs with their
respective bits, I had a blast playing with the
lights. |
After
an hour or so of amusing myself with various LED patterns,
I removed the comments from the code responsible for
the pinging, e-mailing, serial I/O, and web serving.
I pasted the results in Listing 2. Note that there isn’t
much there. That’s because the Zilog TCP/IP software
suite (ZTP) generates most of the magic.
| Listing
2—There’s lots of functionality here that was
assembled with very little code. |
ZTP
is a combination TCP/IP stack and preemptive, multitasking
kernel. APIs allow ZTP to operate over the entire family
of eZ80 microcontrollers and microprocessors. In addition
to housing a complete TCP/IP stack, the ZTP incorporates
support for the physical layer as well. Most of the
standard network protocols are supported by ZTP, and
there’s even an HTML-to-C compiler included in the package.
All of the major features of ZTP are used in the demo
code, which is shown without the comment fat in Listing
2. So, instead of trying to explain every nuance of
the ZTP, I’ll take the example code in Listing 2 line
by line and describe what’s behind it.