This is only a preview of the January 1994 issue of Silicon Chip. You can view 29 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:
Articles in this series:
Items relevant to "40V 3A Variable Power Supply; Pt.1":
Items relevant to "A Switching Regulator For Solar Panels":
Items relevant to "Printer Status Indicator For PCs":
Items relevant to "Simple Low-Voltage Speed Controller":
Items relevant to "Computer Bits":
Articles in this series:
Items relevant to "Control Stepper Motors With Your PC":
|
A printer status
indicator for PCs
Have you ever been frustrated by files
disappearing down your printer cable & not
appearing at the other end? This Printer
Status Indicator uses an alphanumeric display
to indicate any errors that occur during
transmission.
By DARREN YATES
When it comes to printing, most
programs leave you flat if something
goes wrong while the file is being sent
to the printer. And with many graphics
print files exceeding 4Mb, it can be extremely annoying after sitting around
for 10 minutes or so for the printer to
compile the pages and then nothing
happens!
If you are using Windows, you will
44 Silicon Chip
know that it does have a fairly good
and reliable Print Manager to take care
of these things. However, booting up
Windows just to use the Print Manager
is an exercise in time-wasting.
If you’re running a small business
with a number of PCs, the odds are
that only one of the machines is
connected to the printer. Those who
need to print a file can then “Print to
file” on their own machine, copy that
file to a floppy disc and then trans
fer the file to the PC that’s hooked to
the printer.
The problem arises when you use
the DOS commands COPY <filename.
ext> LPT1 or PRINT <filename.ext>.
They give you little or no indication
as to what’s going on. Try this for
a test. Disconnect the printer from
your PC and go into the root direc
tory of your boot drive. Type “COPY
AUTOEXEC.BAT LPT 1” and press
<enter>. You should find that you get
a message saying that the machine is
now happily sending your file to the
printer. You will have to wait quite a
while to see it though – an eternity,
in fact.
Our Printer Status Indicator won’t
prevent errors from occurring but it
will notify you as soon as they happen.
The basis of the project is a driver
program called PRINTER.EXE and a
16-character x 2-line alphanumeric
display.
The Printer Status Indicator connects between your PC’s printer port
and the printer (via DB-25 sockets) but
becomes transparent to the printer port
when a print file is being sent.
Circuit diagram
The circuit for the Printer Status
Indicator in Fig.1 shows that very
little additional electronic circuitry
is involved. Putting it simply, the
computer sends data to the printer
via an 8-way Tri-state buffer. This is
enabled via the SI line (pin 17) from
the printer port.
The SI (Select In), I (Initialise) and
AF (auto-feed) control lines do not
have to go directly from the computer
to the printer socket for the printer to
work correctly. As long as these lines
are at the correct logic state, the print
er will behave as normal. The only
control line that must be fed straight
through to the printer socket is the
STROBE line.
The SLCT, PE, BUSY, ACK and ERROR lines are outputs from the printer
back to the PC and are used to indicate
any problems the printer may experience during a print run.
To enable us to run both the printer
and the alphanumeric display from the
same port, we have to stop the data
from port A (data lines D0-D7) that is
specifically meant for the display from
going to the printer.
This is accomplished by using IC1,
the 74HC244 8-way Tri-state buffer.
When SI pulls low, the buffers allow
data to flow from the PC to the printer
but when SI goes high, the outputs of
IC1 go into a high-impedance state.
Since IC1 is used to prevent confusion between data for the printer and
data for the display, you may wonder
how the display can function properly
since it has the data lines connected
to its inputs at all times. This is OK
though because the display does not
respond to the data until the AF and
I lines are changed appropriately. In
effect, pin 6 of the display must go high
and then low (it’s a negative edge-triggered device) and pin 4 must either be
high for data or low for a command
(such as “clear display”).
Power supply
PRINTER PORT
OUTPUT
FROM PC
(15) ERROR
PRINTER PORT
OUTPUT
TO PRINTER
ERROR (15)
STR (1)
(1) STR
(13) SLCT
SLCT (13)
(12) PE
PE (12)
BUSY (11)
(11) BUSY
ACK (10)
(10) ACK
1
1G
19
(17) SI
8
(2) D0
6
(3) D1
4
(4) D2
2
(5) D3
17
(6) D4
15
(7) D5
13
(8) D6
11
(9) D7
(14) AF
(16) I
IC1
74HC244
2G
1A4
1Y4
1A3
1Y3
1A2
1Y2
1A1
1Y1
2A4
2Y4
2A3
2Y3
2A2
2Y2
2A1
2Y1
10
6
4
7
8
9
12
D0 (2)
14
D1 (3)
16
D2 (4)
18
D3 (5)
3
D4 (6)
5
D5 (7)
7
D6 (8)
9
D7 (9)
AF (14)
20
I (16)
10 11 12 13 14
2 ROW x16 CHARACTER
ALPHANUMERIC DISPLAY
VCC
GND
R/W
5
1
VO
2
3
SI (17)
D1
1N4004
VR1
10k
OUT
10
16VW
78L05
GND
IN
9VDC
300mA
PLUGPACK
10
16VW
IN
PRINTER STATUS INDICATOR
OUT
GND
VIEWED FROM
BELOW
Fig.1: the circuit uses Tri-state buffer IC1 to prevent information intended for
the alphanumeric display from corrupting the data intended for the printer.
The alphanumeric display shows the current printer status & displays error
messages under software control.
dicator comes via a 9V DC 300mA
plugpack. Diode D1 provides reverse polarity protection. A 78L05
low-power 5V regulator produces the
5V DC required to drive the display,
as well as the two “dummy drive”
lines to the printer; ie the AF and I
lines to the Centronics port connector.
Trimpot VR1 allows you to optimise
the contrast of the display to suit your
viewing angle.
Software
As mentioned earlier, the Printer Status Indicator is driven via a
software program called PRINTER.
EXE. You can obtain a copy of this
program from SILICON CHIP as set out
PARTS LIST
1 PC board, code 07101941, 133
x 84mm
1 zippy case, 158 x 95 x 53mm
1 front panel label, 90 x 131mm
1 9VDC 300mA plugpack
1 DB25 male-to-male cable
2 DB25 PC-mount female
sockets
1 2.1mm DC socket
1 16-pin 90-degree pin header
1 10kΩ horizontal 5mm trimpot
2 10µF 16VW electrolytic
capacitors
4 10mm x 3mm spacers
2 5mm x 3mm spacers
Semiconductors
1 16x2 row alphanumeric display
(Altronics Z-7299; see note)
1 74HC244 Tri-state buffer (IC1)
1 78L05 5V 100mA regulator
1 1N4004 rectifier diode (D1)
Miscellaneous
Tinned copper wire, solder, screws,
nuts & washers.
Note: an alternative alphanumeric
display panel and matching PC
board are available for this project
from Oatley Electronics. For details,
phone them on (02) 579 4985.
Power for the Printer Status InJanuary 1994 45
FROM
PC
TO
PRINTER
ALPHANUMERIC DISPLAY
IC1
74HC244
1
10uF
78L05
D1
VR1
10uF
9V FROM
PLUGPACK
Fig.2: install the wire links on the PC board before mounting the remaining
parts. The alphanumeric display is installed by first soldering a right-angle pin
header to the underside of the module & then soldering the pin header directly
to the PC board.
in the accompanying panel. We’ll be
supplying both the EXE file and the
source code for this project, so that
those of you with the skill and incliBelow: the PC board assembly is
secured to the lid of the case on
10mm stand-offs, with an extra nut on
each stand-off to provide additional
spacing. The trimpot sets the display
contrast.
46 Silicon Chip
nation can modify the program to suit
an individual need.
In operation, the software drives
the alphanumeric display and sends
the file byte by byte to the printer. It
also provides a continuous on-screen
display which shows the current status
of the file in terms of the number of
kilobytes sent and its status in bargraph form. This can be seen in the
screen shots elsewhere in this article.
Briefly, the program checks the
printer’s status lines after each byte is
sent to make sure that no errors have
occurred during that transmission.
If an error does occur, the printer
changes the state of one of these status
lines and the program then notifies
you, both on-screen and on the LCD,
that the error has occurred.
To keep the speed up, the program
uses one of the DOS interrupts, INT
21, in a machine-code routine to send
each byte of data to the printer.
The main benefit of this project is in
the remote display. By having this sit
next to your printer, you can instantly
see when an error occurs and then
rectify it.
Construction
The Printer Status Indicator is constructed on a small PC board coded
07101941 and measuring 133 x 84mm.
Before you start installing components, check the PC board carefully
against the published artwork – see
Fig.7. Any defects should be fixed
before proceeding further.
You can start the board assembly by
installing the wire links. Next up, take
the alphanumeric display module and
solder the 16-pin right-angle connector
to the copper pads on the underside of
its board. You should end up with a
How To Buy The Software
The program PRINTER.EXE and
the source code PRINTER.BAS
can be obtained by sending $6
plus $3 for postage and packing
to SILICON CHIP, PO Box 139,
Collaroy, NSW 2097 or by faxing
your credit card authorisation
to (02) 979 6503. Please nominate your choice of 3.5-inch
or 5.25-inch floppy disc to suit
IBM compatible computers. We
accept credit card authorisations
for Bankc ard, Visacard and
Mastercard.
Fig.4: this is the opening on-screen display when PRINTER.EXE is executed. It
gives the name of the file to be printed plus various file details & gives you the
option of either printing or quitting back to the DOS prompt.
row of pins which will then fit neatly
into the associated holes on the main
PC board. Don’t solder them to the
main PC board just yet, though.
The next task is to solder in the IC,
followed by the capacitors, the diode,
the regulator and the trimpot. After
that, you can install the two right-angle
DB25 female connectors on the board.
Finally, mount the display module
in position and secure it at the back
using two 5mm spacers plus machine
screws, nuts and washers.
Drilling the case
The next major job is to make the
necessary cutouts in the specified
plastic case which measures 158 x
95 x 53mm. You will need cutouts
for the display bezel and for the two
DB-25 sockets.
The first step is to use the front
panel label as a template to mark the
cutout for the alphanumeric display.
The easiest way to make this cutout
is to first drill a series of small holes
around the inside perimeter of the
display’s outline. The centre piece
can then be knocked out and the job
filed to a smooth finish. This done, the
board can be temporarily positioned
on the lid and its four mounting holes
marked and drilled.
The next step is to mark the cutouts
for the two DB-25 sockets. Note that
these cutouts must provide sufficient
clearance for the cable connectors.
As you can see from the photos, this
requires holes to be cut in both the lid
and the base. The cutouts in the lid
are approximately 58 x 13mm at both
ends, while the cutouts in the ends of
the base are 58 x 14mm deep.
Fig.5: this is the on-screen display that appears if problems are encountered in
transferring the file. It suggests possible causes of the problem (eg, printer out of
paper, printer cable not connected or printer off-line) & tells you what to check.
Pressing ‘c’ will continue the file transfer to the printer once the problems have
been cleared or you can press ‘q’ to quit.
Fig.6: if printing is successful, the on-screen display completes the bargraph at
top right & indicates that the file has been sent. Pressing any key then returns
you to the DOS prompt.
January 1994 47
TO PRINTER
TO PC
+ 9VDC 300mA
PRINTER STATUS
INDICATOR
Fig.7: it’s a good idea to check your PC board for etching
defects by comparing it with this full-size pattern before
installing any of the parts. The board is coded 07101941
& measures 133 x 84mm.
Finally, you will have to drill a
hole in one end of the case for the DC
power socket.
Applying power
Before the unit is fully assembled
into the case, it should be tested and
the first step is check its current consumption. To do this, connect your
multimeter in series with one of the
supply leads (select the 400mA range),
apply power and check that the current
Fig.8: this artwork can be used as a drilling template for
the display cutout. The cutout is made by drilling a series
of small holes around the inside perimeter & then knocking
out the centre piece & filing to a smooth finish.
is less than 10mA. Any more than
20mA and you should switch off and
check that you have installed all of the
components correctly.
If this is OK, you can hook up your
printer and computer to the PC board
via two DB25 cables. It is time to test
the software and alphanumeric display. Copy the files on the program
disc into a directory on your hard disc
that’s in the path command (or modify
your path command to include the
These two photos show the read-out on the alphanumeric display when
the printer is off-line & when the printer is switched off, respectively. Other
messages are used to indicate that the printer is out of paper or that the file is
being sent to the printer.
48 Silicon Chip
relevant directory) and type: PRINTER
C:\AUTOEXEC.BAT <return>.
You should obtain a screen display
similar to those shown in this article.
You are now asked to “Press [c] to
start printing”. When you do so, the
alphanumeric display should now
show “Sending file:” on the top line
and “AUTOEXEC.BAT_” on the bottom
line. At the same time, your printer
should also start to operate.
If you’ve come this far without any
problems, then it’s safe to say that
the unit is working correctly. If the
alphanumeric display shows the correct information but the printer isn’t
working, you should check that IC1
is working correctly and that you’ve
installed it the correct way around.
Finally, bolt the board to the lid
and secure the lid to the case. Your
Printer Status Indicator is now ready
SC
for action.
|