3 Gordon Drive, P.O.Box 1347 Rockland, Maine 04841 U.S.A.
Find Tools for Your Chip


Subscribe to our Newsletter

© 2004 Avocet Systems, Inc.
Call Us Today at 207-596-0080
Avocet Systems, Inc. : The Complete Solution for Embedded Systems Development Tools

Compiler Output File FAQs


SourceGate can't find my source files.

SourceGate first looks in the current directory where the executable is located. If the file is not found it will look in the xxxxx.ini file for the HMISPATH selection. This is an Environment Variable section. The format is as follows:
[HMISPATH]
path0=v:\rand\home\files\
path1=c:\files\*
path2=f:\source\files1\files2\files3\

v:\rand\home\files\ and the other paths are just examples, use the path for YOUR files. The "*" at the end of the path tells SG2 to search in the directories above the "*".
For example the path1=c:\files* will search in the \files directory first then in the \files\xxx\ then the \files\xxx\xxx\... and so forth up.

And finally SourceGate will look at the PATH environment variable.


I'm having a parallel port download problem on Win NT

This is a well-known problem that has been around for quite some time with
no resolution. Basically, Windows NT 4.0 ignores Parallel Port handshake and downloads without regard for the emulator asserting the Parallel Port's "Busy" line.

The following procedure is a workaround:

This has been tested on Windows NT 4.0 with Service Pack 1 (Build 1381)
installed, logged in as Administrator, with 16-bit SourceGate II v3.1.0.Beta16. Any Parallel Port mode (AT, PS/2, EPP, ECP) is acceptable.
This has *not* been tested under other builds of Windows, logged in as
other (ordinary) users, nor with other versions of SourceGate, notably not any 32-bit version of SourceGate.

The problem we are trying to resolve is twofold: Without a printer driver
attached to the parallel port, NT will not handshake properly. With a
printer driver attached to the parallel port, NT insists on spooling
anything sent to the parallel port (even when we tell it quite firmly not
to), resulting in truncated downloads.

Procedure:

1) Make sure no printer drivers are attached to the parallel port
SourceGate is going to use for downloading (for the purposes of this writeup, we will assume that this is LPT1). Go to "Start|Settings|Printers" and right-click on all the printer icons shown in this dialog. Select "Properties" and
then the "Ports" tab and make sure "LPT1:" is *not* checked.

2) Install the "Generic/Text Only" printer driver and attach it to LPT1. Accept all default settings for this printer driver. If the "Generic/Text Only" printer driver is already installed, go to "Start|Settings|Printers" and right-click on the "Generic/Text Only" printer icon. Select "Properties" and then the "Ports" tab and click on the checkbox for "LPT1:". Close the dialog via the "OK" button.

3) Start SourceGate. Download a small file via the Parallel Port. A "small" file is one smaller than 3.5K in size. A file containing the following two lines will do:

%276E01058585858585858585858585858585858
%0781010

The purpose of this download is to "grease the skids" and get something
from SourceGate, through NT, through the Parallel Port, and down to emulator memory. A file smaller than 3.5K appears to download correctly without running afoul of the spooling system. Once SourceGate says the download is complete, close SourceGate's download status dialog.

3a) Double-check: Go to "Start|Settings|Printers" and double-click on the
"Generic/Text Only" printer icon. The print job status dialog that appears
should be empty. If it is not empty, right-click on the print job and select "Cancel". Note that it might take several minutes for the print job to disappear from the dialog. You *must* wait for the print job to be purged and disappear from the dialog before proceeding. (This is why the initial download file should be "small". If the initial download file is too big, it will not download completely through the spooling system before the emulator believes the download has ended, and the tail end of it will be
stuck in the spooler. After 90 seconds, NT will timeout and let you know
there is something stuck in the print spooler. If this happens, select
"Cancel" from the timeout dialog to make the stuck download go away.)

4) Go to "Start|Settings|Printers" and right-click on the "Generic/Text
Only" printer icon. Select "Properties" and then the "Ports" tab and attach
the printer driver to something other than "LPT1:" ("FILE:" will do). Close
the dialog via the "OK" button.

SourceGate should now be able to download properly through the Parallel
Port until the next time the NT box is rebooted (as long as LPT1 is not used for ordinary printing). After the NT box is rebooted, this procedure will have
to be followed again to make the Parallel Port work with SourceGate. Exiting and restarting SourceGate does not appear to have any effect on the ability to use the Parallel Port after this procedure is followed.

For whatever reason, once the "Generic/Text Only" printer driver has been
attached to the Parallel Port, used by SourceGate, and then detached, NT
will handshake properly and not use the spooling system to handle Parallel
Port downloads.

Error indications:

Step 1) If this step is nor performed, SourceGate will get "CHECKSUM ERROR"s, "INVALID HEX RECORD" errors, or other errors as the Parallel Port
handshake is not observed and character overruns occur. Or, the printer
driver that is attached to LPT1 will intercept and mangle the download, and
possibly spool it. If the download is spooled, after 90 seconds a print
spooler error will occur.

Step 2) If the "Generic/Text Only" printer driver is not used, the driver that *is* used will mangle the bytes being sent to the emulator. The "Generic/Text Only" driver will (usually) not try to interpret the bytes sent to it, but will instead simply pass them through unchanged.

Step 3) If this step is not performed, NT will not put everything into place that makes the handshake occur. The bytes sent out the Parallel Port to the emulator *must* come from SourceGate, and not from some other source
(for example, the "Generic/Text Only" printer driver's "Print Test Page" function won't do!).

Step 3a) If something becomes stuck in the print spooler, SourceGate will
not be allowed access to the Parallel Port until the stuck download is cleared.

Step 4) If the "Generic/Text Only" printer driver is not disconnected from the Parallel Port, SourceGate Parallel Port downloads will appear to occur much more quickly as usual as they are spooled, but the emulator will not receive the complete download. After 90 seconds, a print spooler error will
occur, and the stuck download will need to be canceled.