This is only a preview of the August 1993 issue of Silicon Chip. You can view 27 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 "Low-Cost Colour Video Fader":
Articles in this series:
Articles in this series:
|
THE SOUTHERN
A single board Z80-based compute
Here is a single board computer designed especially for
the 1990s generation of students. With a series of addon boards, smart sockets, fully commented Monitor & an
intelligent EPROM emulator, it can teach many aspects
of microprocessor & microcontroller techniques of
programming.
By PETER CROWCROFT & CRAIG JONES
82 Silicon Chip
board computer (SBC) in
the early 80s will remember
how quickly their limitations were
met. The worst was that when you
had written a program of about 6080 lines of code, the calculation of
forward and backward subroutine
jumps and the actual data entry
became a real chore. Second, there
was no easy way to store your work
when you turned off the power to the
board. Third, some SBC suppliers
did not publish their Monitor and so
disregarded a whole area of teaching
programming and worked against the
very aim that the SBC was supposed
to promote.
With the advances in electronics
over the last few years there was an
opportunity to launch a modern, updated SBC. It had to meet all the above
objections. But it had to be more; it had
to be able to introduce students to the
real world of current day µP and µC
programming techniques. We wanted
to be able to take a student who had
never programmed before and after a
few hours (after the kit was constructed) have them writing programs using
Monitor system calls and software and
KEYBOARD
DISPLAYS
Z80
POWER
SUPPLY
MEMORY
DECODER
ROM
RAM
Fig.1: the concept of the Southern Cross is simple with a
Z80, RAM, EPROM & decoding.
also look at how to use the routines in
the Monitor for your own programs
and how to do software and hardware
single stepping to debug your own
programs. Full documentation on
programming the Southern Cross SBC
is contained in the user manual which
comes with the kit.
Features
The Southern Cross comes on a
large, single-sided PC board measuring 248 x 130 mm. It is
designed around a Z80
microprocess or and
nine CMOS ICs. The
system runs at 4MHz
but a speed con
trol
has been built into the
board for those times
that speed control is
more efficiently carried out in hardware
than in software.
All the circuit features of the Southern
Cross are shown in the
block diagram of Fig.1.
The complete circuit
is shown in Fig.2. In
the bottom lefthand corner of the circuit is the 5 x 4 keypad and 74C923
keyboard encoder (IC9). The 74C923
continuously monitors the keypad
matrix, looking for a keypress. When
one is detected, it produces a 5-bit
number and its pin 13 output (Data
Available) is set high. Two capacitors
are connected to the 74C923. C9 sets
the speed at which the chip scans the
keypad matrix while C11 provides
keypad debouncing.
The 5-bit data from IC9 is buffered
by IC8, a 74HC244 octal Tristate buffer, which feeds the data bus. The Z80
N CROSS
er for the 1990s
hardware interrupts, almost before
they knew it.
In the first article of this series, we
will introduce the Southern Cross
SBC, its features, its circuit diagram
and describe the construction.
In future articles we will look at
how to connect it to a Personal Computer to aid in code development and
introduce two add-on boards which
give the Southern Cross SBC access
to the outside world. Further on, we
will introduce an EPROM emulator
and look at how it can be used with a
PC for program development. We will
I/O
DECODER
CLOCK
controls IC8 through the I/O address
decoder chip IC3. The keyboard buffer
chip (IC8) has two unused input lines.
These have been taken to connector
CN4 where they are available for
other uses.
Output interface
The output interface consists of
six 7-segment common cathode LED
displays and an 8-ohm loudspeaker
driven by transis
tor Q7. Latch IC1
drives the display segments and
decimal points via two resistor networks, SIL1 & SIL2. Latch IC4 drives
the common cathodes of each display
as well as the speaker via seven NPN
transistors.
Both latches IC1 & IC4 are controlled
by I/O decoder chip IC3. IC4 has one
unused output line (pin 16) which
is taken to connector CN4, as is the
speaker output line.
The core of the Southern Cross consists of the Z80 (IC6), the I/O address
decoder (IC3), memory decoder (IC2),
RAM (IC7) and EPROM (IC6).
The reset circuit consists of pushbutton switch S21 in conjunction
with resistor R19 and capacitor C15.
Pressing the reset button resets the Z80
CPU and the display latch IC4. R19
and C15 also provide the power-on
Fig.2 (following page): this is the
complete circuit of the Southern
Cross computer. It has a 5 x 4 keypad
for data entry & program execution &
a 6-digit display as the major output
interface.
August 1993 83
▼
A
NYONE WHO USED a single
84 Silicon Chip
August 1993 85
CN1
K
1uF
SIL1
LED1
0.1
1
SW1
100pF
Memory decoding
The Z80 has a full address space
of 64K and 16K of this is used for
memory, 8K for the EPROM and 8K
for RAM. Depending on which section of memory is being addressed,
the EPROM or RAM must be selected
and this is done by IC2, a 3-to-8 line
decoder. Three address lines, A13, A14
& A15, are used as input to IC2 and
two of its output lines become CHIP
SELECT signals for the memory chips;
the EPROM from 0000H to 1FFFH and
RAM from 2000H to 3FFFH.
Each input/output (I/O) device
needs one I/O port address for itself.
To get this unique address, we need to
decode one of the 256 I/O addresses
provided by the Z80 and this is done
by IC3, another 3-to-8 line decoder.
The connection of address line A7
to the enable (E3) pin 6 of IC3 effectively divides the memory map into
two halves. If A7 is low, the decoder
is disabled and no I/O ports on the
Southern Cross are selected.
The upper half of this memory
map is further divided in half by
86 Silicon Chip
1k
1k
Q6
1k
Q5
CN4
0.1
100
100k
100k
S17
S1
S2
S3
S4
S18
S5
S6
S7
S8
S19
S9
S10
S11
S12
S20
S13
S14
S15
S16
IC9 74C923
IC8 74HC244
0.1
3.3uF
P1
0.1
1uF
S21
Fig.3: this is the component overlay of the Southern Cross. It uses a single sided
board & 54 links to keep costs low. Take care with the orientation of the keypad
switches (S1-S20) – see text.
reset circuit. It holds the reset line at
ground immediately power is applied
to the board. C15 then charges up via
R19 and the line goes high (and the
reset is removed) after several milliseconds.
Q4
1
22k
10k
2.2k
RESET
PAD
74HCU04
560
10M
22k
22k
22k
22k
22k
33pF
Q3
B1
0.1
1
DISP6
1k
1
XTL1
DISP5
Q7
IC7 6264
IC5 Z80ACPU
IC6 27C64
1
33pF
Q2
IC4 74HC273
1
DISP4
1k
SIL2
1
CN3
DISP3
1k
10uF
Q1
0.1
1k
0.1
DISP2
IC1 74HC273
1
IC3 74HC138
1
IC2 74HC138
DB1
10uF
330
7805
CN2
AC/DC
DISP1
1
1000uF
address line A6, connected to enable
pin 4 (E1) of IC3. Thus, 64 locations
from 80H to BFH are available to the
Southern Cross. If A6 is high, then
a quarter of the address space, from
C0H to FFH, is available for use by
other devices.
To get eight I/O ports from this
64 block, address lines 0, 1 & 2 are
decoded by IC3. You can see seven
decoded ports, 80H to 86H, on the
diagram. Ports 80H to 83H are taken
to the expansion port. Ports 84 and 85
communicate with the displays; port
86 connects to the keyboard. Port 87H
is not used.
Clock circuit
As mentioned above, the clock
frequency for the Z80 is 4MHz and
this is provided by an oscillator built
around a 74HCU04 inverter and a
4MHz crystal. For those applications
where a slower clock is desirable, a
second variable oscillator is provided.
This is built around three inverters
(IC10d-f) and is varied with trimpot
P1. The change over from the fixed
to the variable clock circuit is via the
Fast/Slow switch SW1.
Expansion connectors
There are three expansion sockets.
On the right of the board is CN4. This
contains two input lines and two
output lines, as well as ground and
+5V lines. As we shall see later in this
series, serial downloading of programs
from a PC comes via this socket. Experiments which can use single bits
can also use this connector.
At the top centre of the board is the
I/O connector CN1 which has connections to ports 80h to 83h, the reset line
and supply connections.
Finally, on the left of the board all
the address, data and Z80 control lines
are taken to a 40-pin header connector,
CN3. Expansion projects too big to be
accommodated at the other sock
ets
can be performed using the signals
available here.
Monitor program
The Southern Cross SBC can do
nothing on its own. It requires a set of
instructions in the form of a program to
tell it what to do. This is stored in the
27C64 EPROM and is called a “monitor”. The basic function of a “monitor”
is to allow memory locations to be
viewed and changed and to allow program execution. It also contains many
useful programs which you can use
to develop your own programs. This
use of the monitor will be discussed
in detail later in this series.
The fully commented monitor for
the Southern Cross SBC is supplied
on a floppy disc with the kit. It can be
printed out for study. It is a deliberately simple monitor without program
tricks or cryptic code. Its purpose is
to teach, not to impress or confuse
the beginner.
Programming of the Southern Cross
begins with the simple examples listed
in the User Manual which comes with
the kit. First, one LED segment in one
of the six segment displays is turned
on. Gradually, the student is shown
how to assemble code and enter it into
the Southern Cross.
Several demonstration programs
are built into the monitor. Function
8 (pressing the ‘Fn’ function key then
the ‘8’ key) will play a tune. You
can then enter your own tune, press
Function A and the tune you entered
will play.
Function C brings up a random
4-digit hex number which you must
be find within 20 tries (9 tries is our
best).
Other Function key assignments
include:
• Function 0 – start program execution.
• Function 1 – ready to receive Intel
hex file in serial download.
• Function 4 – move a block of memory defined by Function 2 (begin block)
and Function 3 (end block) to the
address displayed.
• Function 5 – calculate a check sum
on the block of memory defined by
Function 2 (start) & Function 3 (end).
• Function 6 – relative branch calculator.
• Function B – toggle the speaker
off/on. If you get tired of the speaker
beeping when you press a key, you
can turn it off and have a variable off
period of the displays instead.
• Function D – test the Relay Board
if attached.
• Function E – test the 8 x 8 LED dot
matrix board if attached.
• Function F – brings up the time/
day/date in the Smartwatch socket if
attached.
Saving programs
One of the big problems with SBCs
in the 1980s was that when you turned
off the power, your programs in RAM
were lost. The solution in those days
was to build a battery-backed RAM
board but these days Dallas Semiconductor has neatly solved the problem
with their Smartsocket DS1213B.
This can be fitted in the RAM socket
underneath the 6264 RAM IC. It has a
battery life of 10 years. When power
is turned off, the Smartsocket senses
this and the built-in battery takes over
and all your programs are safely kept
in the RAM.
Time & date option
Dallas Semiconductor also has a
Smartsocket of the same physical size
which incorporates a time and date
function. This is the DS1216B. You
can set the time and the date and it is
permanently saved in the chip until
you alter it.
Two simple changes to the board allow the DS1216B to be used. Function
F then brings up the time and date on
the displays. The date comes up in the
standard DD/MM/YY format or you
can change a single bit in the Monitor
Where to buy the kit
The Southern Cross computer kit was designed in Australia for DIY Electronics, GPO Box 904, Hong Kong. The kit containing all the components,
documentation and floppy disc with the monitor program may be ordered
in Australia from Alpine Technology, PO Box 934, Mt. Waverley, Vic 3149.
Phone or fax (03) 751 1989. You may pay by Bankcard, Mastercard, cheque
or money order. Buyers outside Australia should contact DIY Electronics in
Hong Kong. Phone (852) 725 0610. The kit costs are as follows:
Southern Cross Computer..............................................................$172.00
Dallas DS1213B SmartSocket..........................................................$55.00
Dallas DS1216B SmartSocket..........................................................$74.00
Technical manual of IC data sheets................................................. $10.00
The kit will be sent to buyers from Hong Kong by registered airmail and this
is included in the purchase price. Note that there is no copyright on the PC
artwork, program code or documentation and buyers are encouraged to
copy and modify the software provided.
PARTS LIST
1 PC board, 247 x 130mm
21 keypad switches
1 miniature slide switch (SW1)
1 4MHz crystal
1 5V buzzer
Semiconductors
2 74HC273 8-bit latches
(IC1,IC4)
2 74HC138 3-to-8 line decoders
(IC2,IC3)
1 Z80A microprocessor (IC5)
1 27C64 8K EPROM (IC6)
1 6264 8K static RAM (IC7)
1 74HC244 octal Tristate buffer
(IC8)
1 74HC923 keypad encoder
(IC9)
1 74HCU04 hex inverter (IC10)
7 BC547 NPN transistors
(Q1-Q7)
1 5mm red LED (LED1)
1 7805 5V regulator (REG1)
1 bridge rectifier (DB1)
6 CM1-5615S red 7-segment
common cathode displays
(DISP1-6)
Sockets & connectors
1 40-pin socket
2 28-pin sockets
4 20-pin sockets
2 16-pin sockets
1 14-pin socket
1 16-way rightangle socket (CN1)
1 2.5mm DC socket (CN2)
1 40-way rightangle socket (CN3)
1 6-way header & socket (CN4)
Capacitors
1 1000µF 35VW electrolytic
2 10µF 16VW electrolytic
1 3.3µF 16VW electrolytic
2 1µF 16VW electrolytic
7 0.1µF monolithic
1 100pF ceramic
2 33pF ceramic
Resistors (0.25W, 5%)
1 10MΩ
7 1kΩ
1 100kΩ
1 560Ω
6 22kΩ
1 330Ω
1 10kΩ
1 100Ω
1 2.2kΩ
2 4 x 100Ω SIL resistor arrays
(SIL1, SIL2)
1 20kΩ trimpot (P1)
Miscellaneous
Heatsink for regulator, tinned
copper wire, rubber feet.
August 1993 87
The Southern Cross single board computer is intended as a learning tool for
those who want to know more about microprocessors. It uses the Z80 8-bit
microprocessor & all the other parts are readily available.
program to use the American MM/DD/
YY format if you wish. The day of the
week can also be indicated using the
decimal points.
Construction
The Southern Cross computer is
built on a single-sided PC board.
The top is screen printed with the
component overlay diagram while
the copper pattern on the underside
has a solder mask which covers all
the board except around the solder
pads. This makes soldering easier
and reduces the risk of solder shorts
on the copper pattern.
The first thing to do is to place all
the components into a container and
then check them off against the parts
list. The component overlay shows
where all the parts go. First, there are
54 links to be inserted. Next, insert
the resistors and we suggest you check
each one for correct value with your
multimeter. Your can also insert the
two resistor packages, SIL1 and SIL2,
at this stage.
Sockets are used for all the ICs and
they all oriented the same way, with
the end notch pointing to the top of
the board. Watch the polarity of the
electrolytic capacitors, C1, C2, C3, C5,
C11 & C15. The buzzer B1 must also
be correctly oriented.
There are seven BC547 transistors to
88 Silicon Chip
be inserted and their case orientation
should match the shapes shown on
the board overlay.
The six LED displays are oriented
with their decimal points adjacent
to the driver transistors. For LED1,
the cathode lead is the shorter of the
two and should be at the top of the
PC board. The bridge rectifier, DB1,
should be inserted so that the “+”
symbol on the package is adjacent to
the “+” on the PC overlay. The 7805
voltage regulator’s leads should be
bent with pliers before it is soldered
in place. It is assembled on the board
together with its heatsink, as shown
in the photograph.
Each keypad switch has a flat part
on one of its sides. This faces towards
the bottom of the PC board as shown
in Fig.2. All 21 key switches are
identical. Sixteen of the same colour
are supplied for the hex numbers 1-F.
Now insert all the miscellaneous
components such as the Speed and
Reset switches, the 20kΩ trimpot P1,
the various connectors and the 4MHz
crystal. Lastly, insert the integrated
circuits in their sockets, making sure
that they are oriented correctly.
When all the components have been
installed on the board, check your
work very carefully. In particular,
check the following points: electrolytic capacitors around the correct
way; ICs in their sockets the right way
around; and all the links on the board.
We also suggest that you fit four
rubber feet to the corners of the
Southern Cross PC board. This will
prevent the component leads on the
underside from damaging your bench
or desk surface and will prevent any
shorts if you place the board on a
metal surface.
Now set the Speed switch to the
F (fast) position and connect a 9V or
12V AC or DC plugpack. The Southern
Cross should then beep, the power LED
should light and the numbers ‘2000’
should appear in the group of four
Address displays.
If the board does not work when
you turn it on, remember that the
problem is almost certainly a mistake
you made during construction. The
most common cause of kit failure is
bad soldering or forgetting to solder a
pad. Also common is incorrect insertion of components or solder shorting
across two pads.
Use your multimeter to check that
+5V is present at the respective pins
of the ICs, as shown on the circuit
diagram of Fig.2.
If the Southern Cross is completely
dead when the power is connected
(and LED1 does not come on), then
clearly the place to look for faults is
around the bridge recti
fier and the
7805 regulator. Similarly, if some of
the board is active and some parts are
not, then this will indicate where to
SC
direct your attention.
|