Searching \ for '*.COD file format why I want it' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=cod+file+format
Search entire site for: '*.COD file format why I want it'.

Truncated match.
PICList Thread
'*.COD file format why I want it'
1997\08\09@102109 by Fred Thompson

flavicon
face
Walter,
       I have written a PIC programming program in C to work with a home
made PIC programmer.  The programmer I built is similar to several
described in magazines like Nuts & Volts, and Electronics Now.  The
difference is that mine provides pins to set Vdd to the Max and Min
voltages for testing (the book said to do this when programming).  Most
kits don't provide for this, but I find it makes a difference (testing at
Vdd Min (4.0V) shows if the chip has really been erased).  My program
talks to the programmer through the parallel printer port.

Outputs
0 - clk
1 - Data
2 - set Vdd to 5V
3 - Vpgm 13V
4 - set Vdd to Vmax (trim pot controlled)
5 - set Vdd to Vmin (again trim pot controlled)

Inputs
6 - Data In

       The program reads the *.COD file for the binary data to program
the chip with.  It also allows you to alter the data value at one address
during program time, if you wish to include a "chip ID" which your program
can read.  (If you have several PICs on a serial line and you wish to talk
to one of them you would send its ID.  This programming feature allows you
to vary that chip number at program time rather than re-assembling.  As I
understand it the PIC program can not read the chip ID numbers that you
can program at the ID locations.)
       I was playing around with locating address of an ID location and
happened to place a second ORG statement in my code and discovered that I
didn't understand the *.COD file well enough to do this.
       Thank you for the format description.  It should be just what I
need.

Fred Thompson
spam_OUTfthompsoTakeThisOuTspammail.win.org

1997\08\09@110705 by Mike Keitz

picon face
On Sat, 9 Aug 1997 09:19:44 -0500 Fred Thompson <.....fthompsoKILLspamspam@spam@MAIL.WIN.ORG>
writes:
>Walter,
>        I have written a PIC programming program in C to work with a
>home
>made PIC programmer.  The programmer I built is similar to several
>described in magazines like Nuts & Volts, and Electronics Now.  The
>difference is that mine provides pins to set Vdd to the Max and Min
>voltages for testing (the book said to do this when programming).
>Most
>kits don't provide for this, but I find it makes a difference (testing
>at
>Vdd Min (4.0V) shows if the chip has really been erased).  My program
>talks to the programmer through the parallel printer port.

This would be very useful.

>        The program reads the *.COD file for the binary data to
>program
>the chip with.

The binary data to program the chip with is also contained in the .HEX
file, in a very simple format.  For your programmer to be compatible with
more software, it should (also) be able to use .HEX files which are
supported by all PIC assemblers/compilers and used by all PIC
programmers.  There is no certainty that Microchip .COD files will match
Hitech, will match CCS, etc.

It also allows you to alter the data value at one
>address
>during program time, if you wish to include a "chip ID" which your
>program
>can read.  (If you have several PICs on a serial line and you wish to
>talk
>to one of them you would send its ID.  This programming feature allows
>you
>to vary that chip number at program time rather than re-assembling.

If you're reading the .COD file, the programmer software would have
access to the symbols, so one could define a special symbol and label a
location with it, and the programmer would know to put the ID there.
Using the hex file the user would need to enter the address of the ID
location for the programmer.

getid           ;Read this chip's ID value to compare to address
               ; received over serial bus.  ID returned in W.
FT_CHIP_ID              ;Special symbol for Fred Thompsom programmer
       retlw   0xff    ;Programmer will patch actual ID here.

On both 12 and 14-bit PICs, the retlw, movlw, xorlw, etc. instructions
all store the literal in the low 8 bits.  So the patch function of the
programmer should leave the upper bits of the instruction at the ID
location unchanged.

>As I
>understand it the PIC program can not read the chip ID numbers that
>you
>can program at the ID locations.)

This is true.  The ID locations can only be read when the chip is in
programming mode.  But it would be a good idea to store a copy of the ID
value there so someone checking later could find it easily without
needing to know where it is buried in the program.

1997\08\10@140523 by John Payson

picon face
> Walter,
>         I have written a PIC programming program in C to work with a home
> made PIC programmer.  The programmer I built is similar to several
> described in magazines like Nuts & Volts, and Electronics Now.  The
> difference is that mine provides pins to set Vdd to the Max and Min
> voltages for testing (the book said to do this when programming).  Most
> kits don't provide for this, but I find it makes a difference (testing at
> Vdd Min (4.0V) shows if the chip has really been erased).  My program
> talks to the programmer through the parallel printer port.

The programmer I designed has a somewhat similar feature, but I implemented
it a little bit differently: I have two power modes:

[1] Low-power; current-limitted to about 15mA [total]
[2] High-power; current-limitted to about 150mA [total]

There is also a load pot across VDD.  By adjusting this pot, 15mA may made
to yield any voltage from about 2V to about 4.5V.

Then, when I'm going to program, I start out by setting the device to "low
power" and do an "anything there" check.  If nothing is there, the programmer
shuts down immediately.  Otherwise, it does a blank check.  If that passes,
then it turns on "high power", programs the chip, switches to "low power",
and verifies it.  Finally (if needed) it switches to high-power again and
burns the config fuses.

On the occasions where I have incorrectly inserted a part (or ISP cable)
the current limittng and automatic shutdown have been real life-savers.
Those features weren't hard to add, but they have saved me from slagging
a few chips.
and should IMHO be a part of any "serious" programmer.

More... (looser matching)
- Last day of these posts
- In 1997 , 1998 only
- Today
- New search...