This is only a preview of the January 1995 issue of Silicon Chip. You can view 30 of the 96 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Articles in this series:
Items relevant to "Build A Sun Tracker For Solar Panels":
Items relevant to "Simple Battery Saver For Torches":
Items relevant to "Dolby Pro-Logic Surround Sound Decoder; Pt.2":
Articles in this series:
Articles in this series:
Items relevant to "Build A Stereo Microphone Preamplifier":
Articles in this series:
Items relevant to "Amateur Radio":
Articles in this series:
|
COMPUTER BITS
BY DARREN YATES
A low-cost emulator for
Zilog’s Z8 microcontroller
Creating your own microcontroller projects
is not as hard or expensive as you may have
thought. GEC Electronics now has available
Zilog’s new low-cost emulator for their Z86C04/
E04 & Z86C08/E08 8-bit microcontrollers. We
take a look at the IceBox to see what it can do.
Microcontrollers either have you
interested or totally bored but whatever your persuasion, they represent
the “now” generation of electronics.
They are more often than not seen as
little “do-everything” boxes capable
of solving just about every circuit
problem.
Now while that may be the case
for industry, for the average hobbyist
they are still pricey, particularly the
programming systems. Let’s take a look
at the pros and cons.
Programmer vs Emulator
It used to be that code was
hand-programmed into the chip but
now all programming is done via
the PC, which can make for a much
more convenient approach. The
convenience depends on what path
you follow. While microcontroller
programmers are relatively cheap (ie,
around a few hundred dollars), they
do present something of a problem.
If you are debugging code and trying
to fine-tune your project, you are
forced to erase and reprogram your
EPROM microchip each time you wish
to change the code. This may sound
fairly simple but it is a time-consuming exercise.
This is also an expensive approach.
Most distributors will tell you that
their micros are cheap but that’s so
long as they’re only talking about
One-Time Programmable (OTP) devices. When you start to talk about
the EPROM versions, which you need
if you only have a programmer, the
price skyrockets – you can expect to
pay 5-10 times the cost of an OTP part!
In real terms, this could be anywhere
up to $35 more.
The better alternative is to have an
emulator. This is a board which can
actually emulate or take the place of
a chip. The board has a socket and
a cable is connected between it and
your circuit. The cable has a header
on it which takes the place of the
chip in your project. You now simply
program the board to act like the chip
and you no longer need the expensive
EPROM part.
The beauty of this system is that
you can modify your code and check
it instantly – there’s no waiting to erase
the UV PROM in the chip which means
that you can get your project up and
running a lot sooner.
The IceBox
The register windows allow you to not only see all registers at a glance but also
to edit any one by simply wiping over the register you wish to edit & typing in
the new value. The ASCII equivalent of that code is displayed on the right.
62 Silicon Chip
So what’s so good about Zilog’s
IceBox? Firstly, it is low cost. For
an emulator from most other micro
controller manufactur
ers, you can
Zilog’s IceBox emulates the Z86C04/E04 & Z86C08/E08 devices & costs just
$285 plus tax. It comes with two manuals which include application notes &
the software is designed to run under Windows. All you have to add is a 9V DC
power supply & a DB25 serial cable.
can quickly compare code from two
different applications as well as open
multiple windows. You can open a
memory map window as well as output port status windows – in fact, you
can open every option available at the
same time if you so wish.
Thirdly, the Zilog Z86E04 chips
which it emulates are very competitively priced at around $2.75 each
in quantities of a hundred. In OEM
quantities, the masked-C04 part price
can be as low as $1.20. This rises to
around $4.55 for one-off but it is still
quite cheap when you consider what
they can do. It will also emulate the
Z86C/E30 and 31 devices (among others) which have more I/O lines.
The IceBox will run quite happily
on an old 286 PC but Zilog recommend
that you use a 386 PC to get maximum
performance. You’ll also need at least
DOS 5 and Windows 3.0. There are
two manuals which include applications notes and ideas, as well as code
examples to get you going.
All you need to add is a 9VDC
500mA power supply, a serial DB25
cable and the ideas. Now while the
IceBox emulator is well worth a look,
what about the devices themselves?
The Z86E04/08
This shows both the code & data memory windows. Again, each one is shown in
hexadecimal format (which can also be switched to binary). The data memory
has no meaningful data in it & displays its default settings; ie, FF hex. Both can
be edited by wiping over the particular byte & writing in the new value.
expect to pay over $700. The IceBox
is available for only $285 plus sales
tax, and that includes a sample chip
and all software.
Secondly, the software itself is well
designed and runs from Windows.
The software programmer is very well
written and is much easier to use than
most DOS-based programmers.
By operating from Windows, you
The Z8 micros are 8-bit standard
instruction code set devices but they
have a very high proportion of input/
output (I/O) lines compared to the
number of device pins (14 I/O lines for
an 18-pin package). However, some of
the more unusual features are within
the chip itself.
The Zilog range starts with the
Z86E03 which has 512 bytes of ROM
and continues through up to the Z86
E63/64 which has 32K of ROM. I/O
lines also can range from 14 for the
smaller devices up to a whopping 52
for the Z86E64.
The particular OTP devices of interest are: (1) the E04 which has 1K x 8 of
read-only memory (ROM) and 124 x 8
random-access memory (RAM); and (2)
the E08 which has 2K of ROM and 124
x 8 RAM. Each of these bytes of RAM is
individually addressable so you don’t
need to waste time working through
an accumulator to get to a particular
piece of data.
Another good feature is that all software is transferrable to other members
of the Z8 family. This makes it easy to
upgrade from one device to another to
suit your particular needs.
January 1995 63
Each device has two comparators
which can accept analog signals and
produce a high or a low, referred to
a common exter
nal reference voltage. This reference voltage can be
anywhere between 0 and 4VDC (the
supply voltage is 5VDC). What this
does is make it very easy to interface
outside analog circuits with the micro.
The two on-chip comparators also
allow you to create analog-to-digital
converters (ADCs). Since eight of
the 14 I/O lines are arranged into an
8-bit register address, you can easily
pro
gram an 8-bit digital-to-analog
converter (DAC) and create a fairly
quick 8-bit ADC using the microcontroller as a successive approximation
register.
The comparators can also link to
internal program inter
rupts which
allow you to tell the micro to execute a
certain portion of code upon receiving
an external voltage level of some kind.
This should give plenty of scope for
experimentation.
Timing
For timing considerations, there are
two on-board 8-bit counters, both of
which run as a function of the main
clock but one can also be programmed
to work from an external clock source.
This can be very handy if you’re
working on a frequency counter, for
example. Each counter has a 6-bit
programmable prescaler to allow you
to define a start position. This is useful
for working on time-critical applications where you want a specific time
to pass before executing some program
branch. These counters can also be
linked to internal interrupts and the
current value of the counter is available in a specified register which can
be read at any time.
They are also reasonably fast, with
the E04 capable of clocking at 8MHz
and the E08 at 12MHz. Current consumption is in the order of 5-10mA,
depending on the device, application
and speed. Each device also has two
sleep modes; one turns the device off,
while the other also turns the main
clock off. In this latter mode, current
consumption falls to just 1µA which
makes them entirely suitable for battery operation.
By programming one of the external
interrupts, you can easily wake the
device back up again, even from this
almost “dead” position. Both devices
have power on reset, which starts the
64 Silicon Chip
If your code isn’t working quite write, this is where you come. The debug
window allows you to see each line of code and allows you to step through the
code by any number of lines, which you can specify. The trace code box displays
each line of code executed after its completion. You can also set break points
though the code to find a particular error condition.
Downloading hex code
from the PC into the
emulator is easy. You
simply click on the
DOWNLOAD option and
you are presented with
this screen. When you
click on OK, the code is
automatically loaded.
The file format can
be in either standard
INTEL hex or binary.
micro and enables it to begin executing
code from location 000C(hex).
OTP capability
The E04/08 OTP option allows you
to mass-produce low cost proprietary
software fairly easily and, most importantly, these devices can be ROM
protected. This feature enables the
programmer to lock away the code so
that it can’t be copied.
Overall the Zilog IceBox emulator
is a winner. It brings
together a low-cost emulator system with a
good all-round micro
from one of the oldest
manufacturers in the
game. It certainly is
the lowest-cost, most
efficient programming
system I have yet come
across. For $285 + tax, it is excellent
value for money.
The package includes cross assembler, graphical user inter
face (GUI)
software and object utility files, as well
as an emulator operating manual and
a Zilog technical reference manual.
For more information on the Zilog
range of devices, contact Russell
Lemon at GEC Electronics in Sydney.
SC
Phone (02) 638 1888.
|