This is only a preview of the October 1989 issue of Silicon Chip. You can view 46 of the 112 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:
Articles in this series:
Articles in this series:
Articles in this series:
Articles in this series:
Articles in this series:
Articles in this series:
Articles in this series:
|
buffer
for your printer
A 1
This easily built unit installs between your
computer's Centronics printer port and your
printer. By feeding your printout files to a
buffer, you and your computer can proceed
with other tasks while the printer operates
in the background.
Design by DON McKENZIE
Waiting for your printer to do a
printout can be a real pain, particularly if the file concerned occupies several hundred kilobytes of
memory. With an average printer,
printing out a file of this size could
take several hours. That's a long
time to have your computer tied up ,
if you are anxious to get on with
other computing tasks.
If you use your computer for CAD
work, the files can be very large
when fed to a plotter. Here's where
this buffer really finds its niche.
By having a printer buffer with a
large memory, you can dump your
files to it and it can then feed the
printer at the pace it requires, leav-
ing the computer free for other
things.
Printer buffers are not cheap
though and those with large
memory can set you back quite a
bit. For example, a buffer with
256Kb of memory is likely to cost
around $339 [eg, the BIT PEPbuffer)
while a unit with one megabyte
(1Mb) will set you back a lot more.
Some printers can also be fitted
with fair-sized buffers which
achieves the same result but
they're often even dearer for a
given amount of memory.
RAM chips have come down
drastically in price in the last year
or so, so you really can save quite a
The printer buffer is built into a standard plastic instrument case. The two
pushbutton switches are for Reset and Test, while the two toggle switches are
for printer Pause and Copy control.
40
SILICON CHIP
lot of money by building your own
printer buffer to this design. You
can also tailor it to suit your needs,
building in as much or as little
memory as you need. We expect
that you could build the 1MB
printer buffer described here for
$300 or less.
To build the printer buffer you
will need a reasonably well equipped tool kit which will include a
multimeter. A logic probe could
also be a help with any hardware
problems that you could run into.
The logic probe suggested by the
designer is a 3800A which is
available at most electronic outlets
for around $30.00. Don't buy a logic
probe right now but if you do run
into strife then it may be needed.
While you can build the buffer into virtually any box, the prototype
was housed in standard plastic instrument case available from most
kitset suppliers. It is powered by a
12V DC plugpack which means
there is no 240V AC mains wiring to
mess about with.
Main features
On the front panel of the buffer
there are two LED indicators, one
of which flashes when the unit is
handling data. There are two toggle
switches: one to pause the printer
and one as the copy control. There
are also two pushbuttons: one to
reset the unit and one for the test
routine.
As the name suggests, the Copy
control lets you print out the contents of the buffer. Thus, you can
print out more than once without
having to go back to your computer.
On the rear panel of the buffer,
there is a standard female Centronics printer port and a DB25
female socket. We'll talk more
about these later.
Inside, there are two printed cir-
~
,-,.
CD
CXl
CD
....
~
t'I:I
6ttl
0
(")
.0
C
R
10
3.58M
X1
R1
100
12
B
+5V
CB
.01
I
_
INPUT
_
-
IV AC
lR DC
J4
I
2
~
C4 ,: :
W!
-
1
4
IN
GND
--"'i 7805
,-0+12V
.,c....._....
01
~13\
_
lc9•
74SLOO
1
2 IC9b
9
10
D7
r
4
GND
OUT
\w ==- sc1-01-11::
16
TANT
c~
OUT
;
IN
3
D7
DO
01
02
03
04
05
06
8255/CS
fW
!-
PORT D J1 PIN 18
sr
2
20
19
11
12
13
15
16
17
1f
10
9
8
7
6
5
4
3
2s
24
21
23
22
"
CS
K
->-
1M PRINTER BUFFER
2!090 -
P~Si°E~
le~
A
K
~
A
+5V
IC
13
j1°
c"'?a
11
26 11
IC11
BK EPROM
2764 OR
27128
120 121
I
T
j,!!...,
I
1~
4 RAS
15
14
13
9
18
19
11
12
13
15
16
17
IC1
I
22
OE
1
27
WE
IC14
6364
28
14
'
~
S3
DO
01
02
03
D4
05
06
07
02
IC2
IC3
10
04
tl1e
06
IC12
8255
26
::i
4
PC4 13
A14
IC5
l10
IC6
IC7
1k
IC13 e
6
1-s·
3_ D.
2 D
- D
OUTPU
130+ 5V
PAUSE
120GI
_
~B:
10-Al
9;;
s-D
Dt
7 O
6- 0
5
.
4 - D:
~i . ,.
R5
=
16- D
15-~
14 - S
17
=
24_ 8
22;; 0
21;; D
20 D
19;; 0
10;;0
25o 6 ND
23-A
J2
INPUl
260 ➔ 5V
r----------
A13
J
·RN2
4.7k
5
ICB
5
16
17
8
=
+n
-
1M:
o----:f.
CAS
AO
A3
AB
o----~-
CAS
=- ~
1M
256-
256
1M-
2:~- -
AS
M2 TO M5 A D D I T I O N A L ~
GND BUS FOR 1 MEG ,.
M2
M3
M4
M5
l
1
l
l
256 __
1M-
......25__s,.,_._M.1,_.....,
u
MS AND M7 ADDITIONAL +5V
FOR S4 Kl~:K M
7
12"'+7
'i;718
07
~
l
RN4
4n
RN 3
47
- k
+
I
13~-" - , ~ ) 6
I IC9c ~ D ' ' - - - - - + - ~
.
+5V
RN5
4.7k
+ 5V
5
6~
LED1
DATA'i;
K
R4
IC13d 3300
2
r>
PC 12
5
PA 7 37 PAS 38
PA 39
5
PA 40
4
PA3 1
2
PA 2 1s
PCS 11
PC 2 16
25
PB7 24
P86
PB 5 23
P84 22
21
PB3 20
2
PB
19
CS
PB1 18
PBD
RESET RD WR
35 5
36
PC7
-
n ◄;i18 L L L
-
05
'\
BxDYNAMIC RAMS 4164 ,41256,4&1024
IC4
◄;718
03
'I
7
15DpFI
C5 •~
...Ji
~
9
~
AO
__]
--F°"
34
33
32
31
30
29
28
27
,----1J!
COPY\(
RN6
4.7k
L...1...._.,_,..__1..._..,_,,,__1..._..,_,,,__.__.,._,,,_,--.__.,._,,,__.L-_...,,,
__,-..__...,,,,__,--'--..,,,_.,,.....,19
A2
A3
A4
A5
A7
A11 _
~
7
l2
•-=---',i
1
D1
'I
06
01
DO
01
02
03
04
05
9
8
7
6
5
4
3
25
24
21
2
2
20 CS1
26 CS 2
10
-
'-------~--➔------<
.
➔_,,
A1
A2
A3
A4
A5
A6
A7
AB
A9
A10
A11
A12
A14
A1 5
AO
4
iz71s 10 ';718 10 tl1e 10
3 WR
DC
ADDRESS BUS
--.....,-::::::::~:::
'DATA BUS _ _
I
AO
A1
A2
A3
A4
A5
A6
A7
AB
A9
A10
A11
A15
N?-,.L
i ___J S ~
bH
n _ , o lI
22
WR 21
Ml
lORO 20
27
19
13
9
10
00
01
02
03
04
05
06
A2
A3
A4
A5 .,
A6
A7
AB
A9
A10
A11
A12
A13
A14
A15
AO
A1
-------
'-----.l!.j-~)2..----___.
9
14
15
12
8
~
I
MREQ
' - -- ~.J;2!9_ _
-
:1i1i
32
33
34
j 35
36
'7
38
39
1 40
1
2
3
4
5
i
I 31
1 30
L-------~---•.---~--~
~
-
.,.
,------:'.:J AC
TANT
1lv2wI
16 INT
17 NMI
6 CLOCK
111
25 lz4
VCC BSRQ WT
26
, _ RESET
4
~
I
l
+ 5V
-.
7
_J;
:I
5
I3
R6
4 .7k
_j_
•
11e
14 •
.,.
-:-
555
IC1 5
4
+5V
4
m~
1
7
14
7
~.,.
.,.
3""
RN 7
4.7k
T~JT
l
R2
2700
E
1~~
RltETI
. .- - - ~
,____.
6
....__]
I
,
I
1
8
0
E
C
VIEWED FROM
BELOW
~
•=
C1
220pF'
I
c:,
CS ,:=
680pF
-------"+~-I
8~48
.,-.,,,.C
8£ r"'<
The circuitry for the printer buffer is built onto two PC boards, one carrying
the microprocessor and memory chips, and the other the two parallel
interface sockets. Note the heatsink on the 3-terminal regulator.
cuit boards, one to carry the
microprocessor and memory chips
while the other is for the two
parallel interface sockets.
Z80A microprocessor
The printer buffer is designed
around the good old Z80A which
can be had for peanuts. The
operating system and instructions
for the Z80A are stored in a 2764
EPROM (Electrically Programmable
Read Only Memory) while a 6264
static RAM (Random Access
Memory)serves as a stack for the
microprocessor's instructions. Input and output interfacing to the
outside world is provided by the
8255 PPI (Programmable Peripheral Interface).
The main concept of the design is
to cut down the hardware required
to produce a microprocessor controlled printer buffer with a large
capacity and perform all the bells
and whistles in the software. No address or data buffers are used or
required.
As already noted, the only port
addressed device is the 8255 PPL
This is the interface to the computer input and printer output bus.
42
SILICON CHIP
The Z80A's IORQ line is connected
to the chip select of the 8255. Any
time an 1/0 instruction is executed
the 8255 responds. Any port from
zero to 255 is the 8255's port
decode. The power up routines program the 8255's three ports to mode
1: Port A input, Port B output, and
Port C handshaking for A and B.
Capacitor C5 hanging on the chip
select line to ground produces
enough of a delay to satisfy the timing restrictions of Z80A to 8255 interfacing. The printer output strobe
is produced by one inverter of the
74LS04 which inverts CPU signal
A13. Any time the program sets
A13 high, a printer strobe pulse is
produced. The setting of A13 is actually done with a BC register pair
port instruction, not a memory
address.
During a power up or reset of the
CPU all address and data bus
signals go to a high impedance
state. The high to A13 appears as a
printer output strobe every time the
buffer is reset. This is where
resistor R5 is useful.
Without R5 installed some
printers will hang up. They detect
the output pr-inter strobe during
reset, read the data and issue an
acknowledge (ACK) to the buffer.
The buffer doesn't pay much attention to this ACK because it has just
had a reset and now wants to do
initialisation.
With R5 installed, instead of A13
tri-stating during a reset, it is held
low by R5 to ground and this
spurious strobe isn't produced.
Pin 12 of the 8255 is the input
BUSY to the computer. This signal
is inverted by the 74LS04 to produce the ACK signal. This means
that while the 8255 is holding the
ACK active (low) it sends the BUSY
signal to the computer. The ACK is
also connected to R4 and the Data
LED.
The Data LED lights up when the
BUSY is high and ACK is low, and
switches off when BUSY is low and
ACK is high. This LED is used for
the ROM diagnostic routines to aid
kit builders, and also indicates data
entry into the buffer. When the buffer is full, the LED lights up brightly
to indicate a full BUSY condition.
The value of R4 is a compromise
between lighting the LED up brightly enough to see data activity, and
not loading the ACK line to the computer excessively.
The Reset signal to the 8255 is a
positive going pulse, which is the inverse of that for the CPU. One gate
of the 74LS04 is used to generate
this pulse from the CPU reset.
The dynamic RAMs are enabled
when address lines A14 and A15
are high. This gives a starting address of C000H. A15 high disables
the EPROM.
The Z80A takes care of refreshing the DRAMs (D for dynamic) in
the normal refresh register mode.
The data in the refresh counter is
sent on the lower portion of the address bus (A0-A6) along with a
refresh control signal while the
CPU is decoding and executing the
fetched instruction. This mode is
totally transparent to the programmer and does not slow down the
CPU operation.
The program must constantly
service this refresh requirement.
This involves calling a refresh
routine approximately every 256
instructions.
So the DRAMs aren't really part
of a typical memory map; it's soft-
ware deception. The true map of
the DRAMs as far as the CPU addressing is concerned is C000H to
C0FFH (only 256 addresses). H
register set to C0H and L register
set to LSB select each byte. The
MSB (most significant bit) of the
DRAMs is dependent on the contents of the R register during a read
or write procedure.
What we are left with is a lump
of DRAM that is not much good for
anything except storing great
chunks of data. You can't run a
machine language program in it.
It's a complete wraparound buffer.
When the storage pointer gets to
FFFFH, its next location is zero, and
round and round it goes.
So what is the 6264 static RAM
used for? It actually functions as an
external stack for the microprocessor since the Z80's internal
stack is not big enough for the
program.
Short form kit
If you want to build this printer
buffer, there's only one way to do it.
The designer, Don McKenzie, owns
the copyright on the printed circuit
board patterns and the software in
the EPROM. He sells a short form
kit which comprises the double sided buffer printed board, an EPROM
containing the software and the
assembly instructions for $39 plus
$3 for packing and postage.
If you want the small DB25 to
Centronics socket adaptor board,
that will be an extra $9.00.
All the rest of the components
have to be obtained separately by
you, the builder. If you are looking
for a one stop shop, one good
possibility is Rod Irving Electronics
who have stores in Sydney and
Melbourne (see their adverts
elsewhere in this magazine).
You can build the buffer in three
memory sizes: 64Kb, 256Kb or 1Mb.
The software in the EPROM will
sense how much memory is installed and operate accordingly. No
fuss, no bother.
Assembly
The first step in assembly is to
check the double sided printed
board for manufacturing faults .
These are rare but it is highly
desirable that you find any problems before components are in-
PARTS LIST
1 plastic instrument case, 200
x 160 x 65mm, DSE Cat.
H-2505 or equivalent (see
t~xt)
1 9V 500-600mA DC
plugpack, DSE Cat. M-9560
or equivalent
1 double sided plated through
printed board, code PBUFF
(available from Don
McKenzie)
1 single sided printed board,
code BPIO (available from
Don McKenzie)
1 3 .58MHz crystal
1 DB25F socket
1 Centronics female socket
1 IBM printer cable
2 SPST toggle switches
2 momentary contact
pushbutton switches
1 LED bezel
1 T0-220 clip heatsink (for
7805 regulator)
2 40-pin IC sockets
2 28-pin IC sockets
8 20-pin IC sockets
2 1 4-pin IC sockets
1 8-pin IC socket
1 26-way dual row male header
socket (J2)
1 1 6-way dual row male header
socket (J3)
Semiconductors
1 Z80A microprocessor (IC10)
1 2764 EPROM (IC11),
available from Don McKenzie
1 6264 8K static RAM (IC14)
1 8255 programmable
peripheral interface (IC12)
stalled. If a track fault is under an
installed IC it can be impossible to
find. So check it thoroughly, now.
IC sockets are recommended by
the designer for all the large chips
and the memory. The memory chips
are very close together so you can't
use bulky sockets. Use the good
quality slimline types.
Take note of the orientation of
pin 1 of all ICs, as they do not all
face the same way. This has been
done to minimise the size of the
board. Regardless of what size
memory you intend using it is a good
idea to install all the memory IC
sockets and their accompanying
.01µ,F ceramic bypass capacitors.
Install the 8-pin resistor network
8 41256 256K bit dynamic
RAMs (IC1 -IC8) for 256Kb
version or
8 4C1024 1024K bit dynamic
RAMs (IC1 -IC8) for 1 Mb
version
1 555 timer (IC15)
1 7 4LSOO TTL hex buffer
(IC13)
1 7 4LS04 TTL quad 2-input
NANO gate (IC9)
1 BC548 NPN transistor (01)
1 7805 3-terminal +5V
regulator
1 W02 or W04 bridge rectifier
(DSE Cat. Z-3304)
Capacitors
1 2200µ,F 16VW PC
electrolytic (C4)
1 22µ,F 16VW tantalum
electrolytic (C2)
1 1 Oµ,F 16VW tantalum
electrolytic (C3)
11 0.1 µ,F ceramic (BC1-BC11)
2 .01 µ,F ceramics (C7 ,C8)
1 680pF ceramic (C6)
1 220pF ceramic (C1)
1 150pF ceramic (C5)
Resistors (¼W, 5%)
2 100k0 (R1 ,R7)
1 10k0 (R3)
1 4.7k0 (R6)
2 1 kO (R5,R8)
1 3300 (R4)
1 2700 (R2)
1 2200 (R9)
1 SIP resistor network package
with 7 x 4 .7 kO resistors with
one common pin
into the board as shown on the
overlay; ie, with pin 1 towards the
dynamic RAMs. This done, install
all the resistors as shown on the
overlay. They can now be soldered
in and the legs cut off flush with the
solder joint.
Watch the polarity of the three
electrolytic capacitors C2, C3 and
C4. They must be soldered in the
correct way around. The same goes
for the diode bridge Dl. Take notice
of the markings on the bridge and
make sure that these line up with
the overlay.
Solder in the 7805 regulator. The
words " 7805 " must be facing
towards the diode bridge. Fit the
heatsink to the 7805.
OCT0BER1989
43
DB-25 connector tracks so that the
DB-25 connector will push hard onto the board without damage. Looking at the overlay side of the board,
the two female connectors should
be soldered with the widest part
facing down. A 1k0 and a 4.7k0
resistor can be soldered into position as shown on the overlay,
followed by the 26-pin dual row
male header. The BPIO board is
now finished.
9V AC OR
DC INPUT
Mounting the hardware
2 COPY
3 TEST
4 LED15 PAUSE
6 LED2-
10 COPY
11 TEST
12 LE01+
13 PAUSE
14 LE02+
r~~~~:?-c~·
Fig.2: this wiring diagram is for the 1Mb version of the printer buffer.
The PBUFF board is connected to the PBIO board via a 26-way cable
fitted with IDC female headers at either end.
Position transistor Q1 into the
board. If you use a DS548, the CBE
connections are marked on the case
and line up with the overlay as far
as the flat side is concerned. The
BC548 and the others, although not
marked, should mount into the
board the same way.
Now solder in the 3.58MHz
crystal. Don't push it fully into the
board but leave enough length on
the legs so that the crystal body will
not short out the tracks immediately underneath it.
BPIO hoard
This is an adapter board to allow
you to use an IBM to Centronics
printer which is the cheapest you
can buy. The BPIO board makes use
of the IBM cable and standard connectors to save cost and simplify
cable interfacing. Flat ribbon cable
with standard 26-pin crimp type
connectors is used to connect this
board to the PBUFF board.
44
SILICON CHIP
The BPIO board overlay is drawn
showing the component side of the
board. A standard DB-25F (female)
solder type connector is soldered
onto the edge of the board in the
position shown. The female Centronics solder tail connector (or
chassis type mount) will not be hard
to obtain, but there are several
types around. Some have spring
clips that lock onto the male connector. The clips are nice but the
standard (non-clip) connectors do
lock hard onto the male connector
quite firmly.
The point to watch out for with
the Centronics female connector is
the distance between the two rows
of solder tails. Look for a connector
that has the two rows close enough
together to be able to solder to the
edge of a printed circuit board. The
pin numbers of the two connectors
are marked on the BPIO board.
You may need to use a file to
bevel a slight 45° angle along the
The BPIO adaptor board can be
mounted using the two outer mounting holes of the DB25 and Centronics connectors only. Board
inter-connections can be done with
a 200mm-long 26-wire flat ribbon
cable fitted with a 26-pin dual row
IDC type female crimp header at
each end.
When drilling holes in the front
of the case to mount the switches,
make sure that they don't interfere
with the components on your
PBUFF board.
All the connections to the front
panel hardware are made via a
cable from the 16-pin dual row
header J3 on the PBUFF board. This
provides wires to the Reset button,
Copy switch, Test button, Data LED,
Power LED and the optional Pause
switch.
Powering up
When all your assembly work is
complete, you are ready to install
the chips. But before doing that,
connect up the plugpack transformer. The power pack connection
points are shown on the overlay.
With your multimeter check that
ground and + 5V are not shorted
together. Power up the unit and
check that the + 5V is there before
proceeding. All OK? Power down
and install chips IC12 (8255) and
IC13 (74LS04). Power up again and
check the + 5V. If the LED is not
already on, press the Reset button.
The LED should light up brightly.
If the LED is not flashing, then
you have one of the following faulty:
IC12, IC13, the reset circuit or,
more likely, you have the data LED
wired in back to front.
With that sorted out, you can install IC9 (74LSOO), IC10 (ZBOA) and
The rear panel of the printer buffer carries a DB25 female socket (left) and a
standard female Centronics printer port. This allows you to use a standard
IBM printer cable which is cheaper than other types.
Fig.3: here are the linking
details for the 64Kb and
256Kb versions. Note
particularly the different
arrangement for Mt.
ICl 1 (EPROM), and power up. The
Data LED should now be flashing at
about once per second. If the LED is
flashing, it indicates that the Z80A
is running and the software is doing
its job but that a RAM fault exists.
With no RAM installed this is to be
expected.
Now it's time to insert one RAM
chip. Power down and insert a
RAM chip into socket IC8 (Data bit
7). Watch out for pin 1 (look at the
overlay).
Switch to Copy ON, power up and
check your + 5V again. At this
stage, the LED should be flashing at
3 cycles per second, which indicates that RAM is present and
can be written to and read from.
Switch to Copy OFF. The LED
should go out. Press the Reset button. The Data LED should light up
brightly. Release the Reset button
and the LED should go out. This indicates that the software is
working.
All looking OK'? Power down, install additional RAM chips to suit
your memory requirements, and
power up again. Repeat the above
test procedures using the Copy and
Reset switches. A simple RAM test
is performed before the LED will
flash. This test may not show up a
shorted track, or a faulty RAM in
some cases.
If you have a suspect RAM, it can
be further tested on its own in the
Data bit 7 position by setting Copy
ON and power up. The LED should
flash at approximately 3Hz. If at
any time the LED flashes at lHz,
then a RAM fault has been
detected.
Loopback test
Now power down, connect the
output port pins 1 (STROBE), 10
(ACK) and 11 (BUSY) to the input
port pins 1, 10 and 11. This can be
done by simply plugging the input
and output of your IBM printer
cable into the BPIO board. If your
input and output can't readily be
connected together, then three
jumper leads can be used to connect pin 1 to pin 1 etc. When this
has been done, set Copy OFF,
power up and press Test. This Test
function outputs a sign on message
to the printer.
In this case, it outputs a string of
characters to its own input port
that keeps cycling through the buffer until the Reset button is press-
ed. The Test function will light up
the Data LED to about half
brilliance.
Now power down, connect a
printer, set Copy OFF, power up
and press Test. If all is well you
should get the sign on message complete with memory size information.
When the test facility is used, a
ROM check is also done. If any byte
in the ROM is incorrect then an error will be reported on the printout.
Power down, have a quick read
through the operating instructions
and connect your computer and
printer. Power up, and try printing
a file. It either works OK or doesn't
work at all. If it works then you can
slap on the lid and forget it. If it
doesn't work then Don McKenzie's
instructions include an extensive
troubleshooting procedure which
should get you out of trouble.
Thousands of this printer buffer
have already been built so it's been
well debugged. At the price you can
build it yourself, it will make a very
good add-on for your computer. ~
Where to buy the parts
A short form kit of parts for this project is available from the designer,
Don McKenzie, for $39 plus $3 for packaging and postage. This kit
comprises the double-sided PBUFF board , an EPROM containing the
software, and the assembly instructions.
If you want the small 0B25 to Centronics socket adaptor board, that
will be an extra $9.00. Write to Don McKenzie, 29 Ellesmere Crescent,
Tullamarine, Victoria 3043.
Note: copyright of the PCB patterns and the software in the EPROM is
retained by Don McKenzie.
OCT0BER1989
45
|