This is only a preview of the February 2003 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 "The PortaPAL Public Address System":
Items relevant to "The SC480 50W RMS Amplifier Module; Pt.2":
Items relevant to "Using Linux To Share An Optus Cable Modem; Pt.4":
Items relevant to "A Windows-Based EPROM Programmer; Pt.3":
Purchase a printed copy of this issue for $10.00. |
FEATURE PROJECT: EPROM PROGRAMMER; PT.3
In this final article, we’re presenting the Windows-based
software for controlling our new EPROM programmer. We
also detail a few modifications which have been made to
the circuitry to improve its performance.
Pt.3: By JIM ROWE
72 Silicon Chip
www.siliconchip.com.au
D
URING THE SOFTWARE development, we encountered a
number of problems which
delayed its release until now. Some of
these problems were caused by timing
errors that were encoun
tered when
using different settings for the “en
hanced” printer port. They were fixed
by adding a couple of RC filters. The
rest were fixed by adding a few pullup
resistors on the data input lines and
by eliminating one capacitor.
This means that we are now able
to present the software and it’s the
Windows-based version – not just
a clunky interim version written in
VBDOS, which looked a strong possibility when the second article was
published.
Before I start talking about the software though, let’s take a look at the
modifications which have been made
to the programmer hardware. Incidentally, the revised PC board pattern
has been sent to board manufacturers,
so the boards you buy or receive in
programmer kits should have all the
modifications included.
Hardware modifications
The first modification involves adding pullup resistors to the input lines
from the printer port connector (CON1)
to data buffer IC1 and mode decoder
IC3. This prevents the chip inputs
from “floating” at indeterminate voltage levels when the programmer isn’t
connected to the printer port. Leaving
the inputs floating makes them prone to
induced cable crosstalk and noise (and
could even result in damage).
The extra parts involved a SIL
(single in-line) array of eight 10kΩ
resistors for the data inputs of IC1 and
discrete 2.2kΩ pullup resistors on the
three inputs to IC3. These are shown
at upper and lower left in Fig.11,
which shows the modified input and
decoding circuitry.
There is one small complication
with these changes: if the programmer is now powered up when it isn’t
connected to a PC, the fact that IC3’s
inputs are all pulled high sets the
programmer into programming mode.
This means that if an EPROM is also
plugged into the ZIF socket, it will be
subjected to the programming voltages
continuously.
So it’s now important that an
EPROM should not be plugged into
the ZIF socket until the programmer
is connected to a PC’s printer port,
www.siliconchip.com.au
Fig.11: the modified EPROM Programmer circuitry. The modifications
involved adding extra pull-up resistors on the data lines to IC1 & IC3,
plus RC filters to the READ & PROG* lines. A capacitor is also deleted
from another section of the circuit (see text).
powered up and set to read mode by
the software (which does this as soon
as it starts).
Another modification involved adding a couple of RC filter networks. The
original circuit showed low-pass RC
filters on five of the outputs from mode
decoder IC3 (LAL*, LAM*, LAH*,
LCF* and LPD*). They were necessary
to suppress narrow glitches from IC3,
for reliable address and configuration
downloading.
Similar RC filters have now also
been added to the remaining two mode
February 2003 73
This revised version of Table 1 shows the corrected entries for the CF1 configuration bit.
lines (READ and PROG*). They provide small time delays which match
those caused by the existing RC filters.
Both these extra filters are shown in
Fig.11 and have exactly the same component values as the originals.
The remaining hardware modification involves removing a component.
The original circuit showed a 100nF
bypass capacitor from pin 24 of the
ZIF socket to ground. However, this
line cannot be fitted with a bypass
capacitor because it’s the EPROM
OE* line (output enable/disable)
and must be toggled rapidly during
programming and data verification.
A bypass capacitor slows down the
voltage changes quite seriously, so it
can’t be used here.
The solution to this one was easy –
remove the capacitor. It was originally
mounted at the very front of the PC
board, just below the ZIF socket – see
Supplementary Parts List
Capacitors
2 1nF metallised polyester
Resistors (0.25W 1%)
3 2.2kΩ
2 100Ω
1 8 x 10kW SIL resistor array,
pin 1 common (SIL1)
Delete
1 100nF multilayer monolithic
capacitor (near ZIF socket)
74 Silicon Chip
the PC board overlay (Fig.8) on page
34 of Pt.2. It was also shown on the
original circuit diagram (Fig.3) on page
27 of Pt.1 and should be deleted.
The revised PC board overlay is
shown here as Fig.12 and includes
all the corrections. Most of the added
components are just above IC1, IC2 &
IC3, with the remaining components
just to the left of IC1.
Note that to fit in SIL1 (the 8 x 10kΩ
pullup resistor array), I had to reduce
the mounting centres for nine of the
100Ω input suppressor resistors. This
means that these no longer mount
horizontally but are instead tilted at
about 45°, so their leads mate with
the board holes.
Note too that SIL1 is fitted with its
“common” pin to the left, just above
pin 19 of IC1. If you fit SIL1 the other
way around, you’ll almost certainly
get rather strange problems.
So that’s the story on the hardware
modifications. Just follow the revised
layout shown in Fig.12 and you won’t
have any problems.
Configuration table error
There was also an error in Table 1
(Pt.1, p23), which showed the functions of the CF1 bit transposed. As a
result, a corrected version of Table 1
has been reproduced in this article, to
avoid any possible confusion.
Any port won’t do!
Before moving on to the software,
let’s first take a look at the various
printer port configurations and see
how the differences between them
can affect the operation of the EPROM
programmer and its software.
When the IBM PC first appeared in
the early 1980s, it was provided with
a fairly basic parallel printer port
conforming to the standards originally
specified by printer maker Centronics.
This “Centronics” type of printer port
became the standard for quite a few
years but as processors and printers
both became faster, various “enhanced” printer port configurations
came into use. These provided both
faster operation and fully bidirectional
parallel data transfer.
When the American IEEE came out
with its IEEE-1284 standards (see side
panel), PC makers began incorporating
multi-mode ports directly into their
motherboard chipsets. That’s why
the CMOS setup program in modern
PCs gives you a number of options for
configuring the onboard printer port(s)
– usually as a “legacy” Centron
ics
port or SPP (standard parallel port),
an enhanced EPP port or an enhanced
ECP port with DMA options.
We wanted the new EPROM Programmer to be backward compatible
with older PCs having only an SPP, so
that it could be used with just about
any PC. As a result, I originally tested
the design using an old 66MHz 486
machine, running a quick-and-dirty
test program written in VBDOS (and
running under DOS). This machine
has only a bog-standard SPP/Cen
tronics port and everything worked
fine.
However, when it came to developing the final software using Visual
Basic 6, I used a Pentium 3 866MHz
machine running Win98SE. This
machine allows the onboard parallel
port to be set to one of several different
modes, so I automatically went into
the CMOS setup and configured it as
an SPP which seemed like the logical
choice.
Unfortunately, I was wrong! It
turned out that on both this machine
and a Pentium 2 266MHz machine
which I tried as well, setting the
port for SPP/Centronics mode operation gave all kinds of weird timing
problems. In this mode, the ports
couldn’t toggle the various bit lines
in synchronism in response to soft
ware instructions. It was only when I
tried setting the port to ECP mode (or
www.siliconchip.com.au
Fig.12: this is the parts layout for the modified PC board. Most of the added
components are just above IC1, IC2 & IC3, with the remaining components just
to the left of IC1. The deleted 100nF capacitor was originally installed just
below the ZIF socket (see text).
“EPP+ECP” mode for the P2 machine),
that these timing problems suddenly
disappeared.
This means that if you’re planning
to use the EPROM programmer with a
PC that has a multimode parallel port,
you’ll almost certainly have to set it for
ECP or ECP+EPP operation.
By contrast, you probably won’t be
able to change the port mode on an
older PC (eg, a 486) but this shouldn’t
be a problem – it will almost certainly
have an original SPP/Centronics type
port which should work OK.
Windows complication
There’s another trap for the unwary
in using devices like the EPROM Programmer which communicate with
the PC via the printer port – especially
when the PC is running one of the
many versions of Windows. This is
because Windows and its printer drivers are very possessive about the port
and simply won’t let another program
www.siliconchip.com.au
talk to it after they have previously
used it for printing (during the current
session, that is).
This means that if you use the PC’s
parallel port to print out from a Windows program during your current
session, you can’t then simply connect the EPROM Programmer to the
port and fire up the software to read
or program an EPROM. The software
simply won’t be able to communicate
with the programmer if you try!
Instead, you have to reboot the PC
to unlock Window’s steely grasp on
the port and allow the software and
hardware to talk to each other.
The software
OK, let’s now look at the actual
software.
As mentioned earlier, the software
is Windows-based and was written
using Visual Basic 6. It makes use of
a freeware DLL (dynamic link library)
called IO.DLL to directly access the
parallel port hardware. This DLL was
written by Fred Bulback and works
with Win95, Win98 and Windows
NT/2000/XP.
The DLL file can be downloaded
from Fred Bulback’s website located
at www.geekhideout.com and has also
been made available in the software
package on the SILICON CHIP website.
Thanks to IO.DLL, the VB6 software
can send data out via one of the parallel port registers by calling the added
subroutine:
PortOut (ByVal PortAddress As
Integer, ByVal Data As Byte)
and can retrieve input data nibbles
from the port’s status register by calling
the added function procedure:
ReadVal = PortIn (ByVal PortAddress As Integer)
In each case, PortAddress has a
value corresponding to the address of
the port register in I/O space.
So that’s how the software actually
passes data out to the EPROM programmer and fetches it back again.
Software interface
A screen grab of the software’s main
February 2003 75
Fig.13: the main interface for the software that’s used to drive the EPROM
Programmer. It shows all the critical settings and includes a large “list box”
that’s used to view a data file loaded from disk or read back from an EPROM.
interface is shown in Fig.13. It has the
standard Windows appearance, with
a menu bar at upper left and a bunch
of display windows and option button
controls. There’s also a fairly large list
box at lower left which can be used to
view a data file loaded from disk or
read back from an EPROM.
The two small display boxes at top
right are used to show the I/O base
address of the selected parallel port
(ie, the one that the programmer is
connected to) and the current setting
for the programming pulse width in
microseconds or milliseconds.
Beneath these boxes are eight pairs
INSTALLING THE SOFTWARE
On the SILICON CHIP website, in the software folder, you’ll find the following
files: EPROMP1.CAB (1,283KB), EPROMP2.CAB (373KB), SETUP.EXE
(137KB), SETUP.LST (4KB) and DEVCFGS.ZIP (1KB).
Download these files and save them in your PC’s C:\Temp folder. Then
from the Start menu, select Run, Browse to C:\Temp\Setup.exe and click
OK to run this file. It’s then just a matter of following the simple instructions.
Setup will unpack and install the executable EPROMProg.exe in the C:\
Program Files\EPROMProg folder, together with IO.DLL and all other files
needed to run the program. It will also add a shortcut called “Silicon Chip
EPROM Programmer” to your Start->Program Files menu.
After the setup program has finished, open the file DEVCFGS.ZIP with
Winzip, and extract the sample device config files in it to the C:\Program
Files\EPROMProg folder, so that they’re ready for accessing by the program.
The programming software is now installed, and ready to run. The compressed installation files can be deleted from the C:\Temp folder if you wish,
or saved on floppy disks or a CD-ROM if you want to keep a backup.
Incidentally, along with the EPROMProg.exe program and its associated
files, the setup program also installs an uninstall log file, ST6UNST.LOG.
This file is used by the Windows uninstall utility to uninstall all files, if you later
choose to remove the software from your computer.
76 Silicon Chip
of option buttons, which are used to set
up the programmer’s configuration to
suit each different type of EPROM. In
the screen grab shown here, these have
been set up automatically by opening
the configuration file for a Microchip
27C256 device.
Incidentally, I have produced a
few of these configuration files for
different EPROMs and these will be
made available along with the software on the SILICON CHIP website.
However, you’ll find that it’s also easy
to produce other device configuration
files yourself, using the software and
information from the EPROM manufacturer’s datasheet.
Basically, you only have to set the
pin connections, the supply voltage
levels for reading and programming,
and the pro
gramming pulse width.
That done, you simply select File ->
Save Device Config (from the menu)
and the software guides you through
saving the configuration as a file.
Once the device configuration data
has been saved to disk, you can set
up the programmer for working with
that type of EPROM at any time in the
future simply by opening that configuration file again. This is done by
selecting File -> Open Device Config
from the menu.
Two other options in the File menu
allow you to open and save an EPROM
data file (as you might expect). The
software will not only load and save
EPROM data in raw binary form but
can open files in Intel and Motorola
S-record hex formats as well. These
latter formats are often used for saving
EPROM data.
The final option in the File menu is
used to exit the program. Incidentally,
when you do exit, the program automatically saves two handy pieces of
information to a set-up file: the parallel
port address currently in use and the
device configuration file currently in
use (if any). This information is then
loaded by default the next time you
fire up the program.
The next main menu option (along
from File) is Set. This gives you two
options: the ability to set the parallel
port base address and the desired
programming pulse width in microseconds.
There are three standard base addresses (278h, 378h or 3BCh) to choose
from and a dialog which allows you
to set the programming pulse width to
any value from 1µs to 50ms.
www.siliconchip.com.au
Next along in the main menu options is Test. There’s just one option
here and that’s to confirm that the
software can communicate with the
EPROM Programmer hardware – ie,
that you have selected the right port
base address and the programmer is
powered up and ready to go (and that
Windows hasn’t locked up the port)! It
does this by making the programmer’s
LED3 glow and then asking you to
confirm that it is glowing. It then turns
LED3 off again.
The fourth of the main menu options is View, which again has only
one option: to display the currently
loaded data which has been either
opened from a disk file or read from
an EPROM in the programmer. The
data is displayed in hex in the viewer
wind
ow, in lines of 16 bytes, with
the address offset shown at the start
of each line. The viewer window has
a scroll bar so that you can examine
every part of the data at your leisure.
Read options
The next main menu option is
Read, which gives you two choices.
One is to read the contents of any
desired address range in the EPROM
in the programmer, so you can view
the data and/or save it to disk. This
option asks you for the start and end
addresses for the range to be read but
offers the EPROM’s own start and end
addresses as defaults, in case you want
to read all of its content (this depends
on you having opened the right device
configuration file, though).
The second Read option is Check
Erasure, which is provided so that
you can quickly check if an EPROM
has been properly erased. When this
option is selected, the software quickly
reads the contents of all addresses in
the EPROM, checking to see if they
all contain FFh (this is the sign of
complete erasure).
It’s always a good idea to use this
option after you’ve wiped an EPROM
in your UV eraser, to make sure it’s
ready for reprogramming.
The final main menu option is Program, which provides a list of three
options. The first programs the complete EPROM with the data currently
in memory – (ie, from opening a disk
file or reading another EPROM). The
second option programs just a range of
addresses in the EPROM, again using
the data currently in memory. You
can specify just one EPROM address
location if you wish, which is good for
testing purposes.
With both of these Program options,
the software controls the programmer
to perform a “fast” programming algorithm at each device address. This
kind of programming algorithm does a
“verify read” after each programming
pulse, to check if the programming
was successful. If it was, the address is
regarded as properly programmed and
the software sends the next address to
the programmer.
On the other hand, if the verify
read shows that programming wasn’t
successful, the software directs the
programmer to try again with another
programming pulse.
This “try again” routine continues
until either that address has been successfully programmed, or a total of 10
programming pulses have been used
without success. In the latter case,
the software stops the programming
operation and lets you know that
programming failed at the EPROM
address concerned.
Fig.14: this oscillogram shows the key data and control line
waveforms during a read operation – in this case, the read
sequence for a single EPROM address at 7FFEh.
www.siliconchip.com.au
Don’t Skimp On The
Programming Cable
Be sure to use a good quality
round DB25M-DB25M parallel data cable to connect the
EPROM Programmer to your
PC’s parallel port. Don’t use a
25-way ribbon cable with IDC
connectors on each end if
you can avoid it, because this
type of cable has no shielding
and degrades the noise and
crosstalk performance of the
programmer-PC link.
A good-quality round cable,
preferably one manufactured
to conform to the IEEE 1284
specification, will give you virtually error-free EPROM reading
and programming. I found this
out the hard way, so be sure to
follow this advice. In short, don’t
skimp on the cable.
This type of fast programming
algorithm is now recommended by
virtually all EPROM manufacturers,
for most modern devices. Each manufacturer tends to call it by a different
name, though – eg, “Turbo Programming”, “Programming Express”,
“Flashrite”, “Presto II” and so on. The
basic idea is that each address is only
given just enough short programming
pulses to ensure that the data is reliably stored.
As you can see, this type of programming algorithm has built-in data
verification while the programming
is taking place. Despite this, the third
option in the software’s Program menu
Fig.15: the key data and control line waveforms during
a programming operation. In this example, the address
programmed is 1FE8h and the data is E8h.
February 2003 77
About The Various PC Parallel Printer Ports
The parallel port used in IBM’s
original PC of 1981 – and in just
about every clone made during
the following few years – was
very similar to the Centronics
printer port. This in turn had
been used on most of the earlier
8-bit computers like the Tandy
TRS-80 and allowed 8-bit parallel
data transfer from the PC to the
printer. However, there were only
five lines for transfer of “status”
information the other way.
This made it capable of transferring outgoing data fast enough
to keep up with a dot-matrix or
daisywheel printer but it could
only be used for transferring
data back into the PC in 4-bit
“nibbles” – ie, at less than half
the speed.
This type of parallel port is now
known as the “legacy”, “Centron
ics” or “standard parallel port”
(SPP) and is probably the only
type found on every model of PC.
When IBM subsequently released its PS/2 models in 1987, it
provided them with an improved
version of the SPP which allowed fully bidirectional 8-bit
data transfer on the eight main
data lines. This type of paral-
lel port was adopted by other
makers as well and became
known as the “PS/2 parallel
port”, “simple bidirectional port”
(SBP) or “byte mode parallel”
(BMP) port.
Not long after this, when Intel
produced its 386 processor and
its associated chipset, it collaborated with computer makers
Zenith and Xircom to produce
an enhanced parallel port which
would allow much faster bidirectional data transfer than the SPP
or SBP. This new port became
known as the “enhanced parallel
port” or EPP and was designed
to speed up both printing and
communication with peripherals like scanners, memory, tape
drives and even external disk
drives.
The EPP specification allowed
for fast byte-wide transfer of both
data and address information in
both directions and was widely
adopted in computers based on
the 486 and later processors.
Then in the early 1990s, yet
another type of enhanced parallel port appeared: the “extended
capability port” or ECP. Originally
proposed by Hewlett-Packard
is Verify, which allows you to do a
complete re-read of an EPROM and
have its contents compared with the
data currently in memory.
This option might seem unnecessary but it has two uses. The first is
obvious: it allows you to make doubly
sure that an EPROM has been correctly
programmed with the data. The second
use is for re-reading an EPROM you’ve
just read, to make sure the Read operation did indeed retrieve a faithful
copy of the EPROM contents. If Verify
gives the “all clear”, the re-read data
compares exactly with the data you
read the first time.
OK, so that’s a quick rundown on the
EPROMPrg.exe program, the features
it provides and how it’s used.
Signal Oscilloscope/Logic Analyser.
They show key data and control line
waveforms during a read operation
(Fig.14) and a programming operation
(Fig.15).
In Fig.14, you can see that a read
sequence for a single EPROM address
(here address 7FFEh) takes about 40µs.
The first 15µs are taken by the address
downloading (high bits, middle byte
and low byte in that order), while the
high data nibble is read after the address has stabilised and then the low
data nibble at the end of the sequence.
Fig.15 shows a programming sequence which is successful after a
single 100µs pulse, so it is complete
after about 160µs. The address programmed is 1FE8h and the data programmed into it is E8h. You can see
the address download at the start, the
100µs long programming pulse in the
centre (PGM_N and CE_N lines) and
Key waveforms
Figs.14 & 15 are screen grabs from
SILICON CHIP’s Agilent 54622D Mixed
78 Silicon Chip
and Microsoft, this soon became
incorporated into the new IEEE
1284 standard specification entitled “Standard Signalling Method
for a Bidirectional Paral
lel Peripheral Interface for Personal
Computers”, which was released
in March 1994.
As well as establishing a full
standard for very fast byte-wide
transfer using an ECP, IEEE
1284 also formalised the speci
fications for the existing EPP,
SBP and SPP port configurations. At the same time, it also
established standards for the
cables and connectors to be
used with each type of port, for
optimum performance.
In most PCs manufactured in
recent years, the primary parallel
port is incorporated inside one
of the motherboard chipset ICs.
Many of these onboard parallel
ports can be configured by the
BIOS firmware to emulate any of
the types of port we’ve mentioned
above – or at least some of them.
This configuration is done using
the CMOS setup utility, which
can usually be entered during
bootup by pressing the <DEL>
or <F2> key.
then the verify read operation at the
end (far right).
Note that during EPROM Read,
Check Erasure, Program and Verify
operations, the software displays a
graphical “progress” bar at lower left
(just below the viewer window). This
lets you observe the progress of the
selected operation.
Finally, the program is available
for download from the SILICON CHIP
web-site (www.siliconchip.com.au),
together with IO.DLL and some sample
EPROM config files to get you going
(see panel). We are also providing the
VB6 source code for the program, for
those who’d like to see for themselves
just how it does what it does.
Hotshot programmers might also
want to improve it in various ways
–feel free to modify it to meet your
needs.
Happy EPROM programming! SC
www.siliconchip.com.au
|