Program PIC_READ
10 November 2006
pic_read [options]
Read the data from a Microchip PIC (registered trademark of Microchip Inc,
http://www.microchip.com) microcontroller via a PIC programmer conforming
to the Embed Inc PIC programmer protocol, described in the PICPRG_PROT
documentation file. Conforming programmers include the Embed Inc EasyProg
and ProProg.
The programmer must be on and the target chip properly connected before
this program is run. The programmer must also be connected via a serial
port (COM port on PC systems).
The command line options are:
-HEX filename
filename
Specifies the output file name. The ".hex" file name suffix will
be assumed and may be omitted from the FILENAME argument.
The first command line option that does not start with a dash (-)
is assumed to be the HEX output file name. This is a short form of
supplying the file name for convenience, but can not be used when
the file name starts with a dash. The full form of this option
using the -HEX keyword works whether the file name starts with a
dash or not. In either case, if the file name includes spaces or
some other special characters, it must be enclosed in quotes ("")
or apostrophies ('').
The output file name must be supplied. There is no default.
-SIO n
Selects the system serial line number to use in communicating with
the programmer. Only that programmer is accessed.
The default is to use the first available programmer known to be
connected to the system. If no known connected programmer exists,
then the programmer connected to serial line 1 is used.
-N name
Selects the programmer by name.
If no other command line option specifies a connection means to the
programmer (like -SIO), then the first programmer of this name from
those known to be connected to the system is used. A programmer is
known to be connected to the system if it is connected and uses a
connection type that the system can enumerate, such as USB.
If a connection type is specified, the first programmer found with
that name and connection type is used. Note that some connection
types inherently specify a unique programmer, such as serial line,
since only a single device can be attached to any one serial line.
In that case it is an error if the programmer does not have the
indicated name or does not have a name.
The NAME parameter is case-sensitive. Programmer names can
generally be set by the user (see the PIC_CTRL command). It is
strongly recommended that all programmers connected to a system
have a unique name. Otherwise the choice of programmer used when a
non-unique name is given is arbitrary, and there is no way to
select between multiple programmers of the same name. All Embed
Inc programmers that have names are initially given globally unique
names by Embed Inc.
-PIC name
Explicitly identifies the target PIC. Example names are "16F876",
"18F452", and "16LF628". Note that the suffixes denoting package
type, temperature range, etc, are not included. The NAME argument
is case-insensitive.
If this command line option is omitted, then the programmer
attempts to determine the target chip type by reading its hard
coded ID. If successful, the program will proceed assuming the
most generic variant with that ID. For example, the 16F628 and
16LF628 have the same ID word. If that ID is found, then the
16F628 will be assumed unless this command line option is used and
16LF628 specified.
Some PICs do not contain hard coded IDs, and it is not possible to
determine the exact target chip type. It appears that PICs with
the 12 bit "baseline" core, such as the 10F2xx, do not contain
target IDs. In case of such a target PIC, this command line option
is required. The program will abort with an error condition if
this command line option is omitted and the target PIC type can not
be determined.
If this command line option is supplied, then that particular
target PIC is verified to the extent possible. If that target type
has a unique ID, then the ID is read and checked against the
expected value. If the target has no unique ID, some test are
performed to verify the target chip, but these are not guaranteed
to be conclusive. The program will abort with an error condition
only if it can conclusively determine that the target PIC is not
the one specified with this command line option.