Searching \ for '[PIC]:Intel Hex File questions' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'Intel Hex File questions'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]:Intel Hex File questions'
2000\08\17@155041 by John De Villiers

flavicon
face
I've managed to decode ( disassemble ) a program stored in hex format back
into asm format. There are just some codes that still get the better of me.
I cannot for the life of me sort out how the configuration word is stored
and eeprom data is also weird ( although i havent looked at it all that much
yet).

Can anyone help with the configuration word's decoding?
PS its for 16F84's only - so far....

John

--
http://www.piclist.com hint: To leave the PICList
spam_OUTpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu>

2000\08\17@161330 by M. Adam Davis

flavicon
face
Get the programming document from microchip, it tells you how to program the
16f84, including the configuration word.  I beleive it also includes the hex
format and how one stores the configuration fuses in a hex file.

Alternately, open MPLAB, open your programming window, and load the hex file.
The configuration fuses contained in the hex file are shown.  Unless, of course,
the hex file didn't contain fuse info, in which case the defaults are selected.

-Adam

John De Villiers wrote:
{Quote hidden}

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspamKILLspammitvma.mit.edu>

2000\08\17@170119 by John De Villiers

flavicon
face
>
> Get the programming document from microchip, it tells you how to
> program the
> 16f84, including the configuration word.  I beleive it also
> includes the hex
> format and how one stores the configuration fuses in a hex file.
i have all that. its just that what the docs explain doesnt match up with
how it looks in real life. The docs work for the opcodes but not for the
config word or the eeprom info

John

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam.....mitvma.mit.edu>

2000\08\18@015605 by Nigel Goodwin

flavicon
face
In message <EraseMENDBBKHALMLBFNHBHBMHECEKACPAA.bbjspam_OUTspamTakeThisOuTplz.co.za>, John De
Villiers <bbjspamspam_OUTPLZ.CO.ZA> writes
>I've managed to decode ( disassemble ) a program stored in hex format back
>into asm format. There are just some codes that still get the better of me.
>I cannot for the life of me sort out how the configuration word is stored
>and eeprom data is also weird ( although i havent looked at it all that much
>yet).
>
>Can anyone help with the configuration word's decoding?
>PS its for 16F84's only - so far....

You can download the Delphi 1.0 (basically Turbo Pascal) source code for
my 16 bit PIC Programmer, this includes the source code for
disassembling 16F84 hex files.
--

Nigel.

       /--------------------------------------------------------------\
       | Nigel Goodwin   | Internet : @spam@nigelgKILLspamspamlpilsley.co.uk           |
       | Lower Pilsley   | Web Page : http://www.lpilsley.co.uk       |
       | Chesterfield    | Official site for Shin Ki and New Spirit   |
       | England         |                 Ju Jitsu                   |
       \--------------------------------------------------------------/

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]: PIC only [EE]: engineering [OT]: off topic [AD]: advertisements

2000\08\18@044234 by e Frederickson

flavicon
face
               Hi John

                       The programming specifications for the PIC's contain
a description of the Hex file format. But here is a run down.

               (I also posted this a couple of days ago.)

               Each line of the hex file are   :BBAAaaTTDDdd.......cc

               Where the colon ':' is a line start marker
               BB = the number of bytes. As each program word if 14 bits,
Divide this by two.
               AAaa = Holds the program address for the line, again divide
this by two
               TT = File type, 00 = line contains data, 01 = End of file
marker.
               DDdd = Data word, as high byte first, then low byte.
               cc = Checksum of all byte in the line (Excluding the colon)

               So for an example,

                               ASM
Opcode
                               org 0004                                Set
address to 0004
                               MOVLW   012 (hex)               3012
(hex)
                               MOVWF   PORTB                   0086
(hex)

               The hex file would look like

                               :04000800123086002C                     Data
record
                               :00000001FF                             End
of file marker

               So for two program words, BB = 04 (words * 2)
               For the program address, AAaa = 0008 (address * 2)
               Record type TT = 00 (data record)
               Data word MOVLW  1230 (high byte, low byte)
               Data word MOVWF  8600
               Check sum = 2C, which is the 2's complement of the 8 bit sum
of the record
               ( 04 + 08 + 12 + 30 + 86 = D4, 2's comp. 100 - D4 = 2C)

               The configuration fuse and ID data are stored  with the
address as 2000hex to 2007hex. The configuration fuse being at 2007hex

               So for the 16F84 with code protect off, Power up timer on,
WDT off and XT Osc, fuse = 3FF1

               In the hex file,                :02400E01F13F7F

               BB = 02 (divide by 2 = 1 program word)
               AAaa = 400E (divide by 2 = 2007 address of config fuse)
               TT = 01 (Data record)
               DDdd = F13F (swapped around = 3FF1)
               cc = 7F ( 02 + 40 + 0E + 01 + F1 + 3F & FF = 81, 2's comp =
7F)

               The EEprom data is stored under address 2100hex. The data is
only 8 bits wide, so the high byte of the data word is always zero.

               e.g.    EEPROM data = AA,BB,CC , in the first three
locations of EEprom

               Hex file                :06420001AA00BB00CC0080

               BB = 06 ( 3 words)
               AAaa = 4200 (2100)
               TT = 01 (Data record)
               DDdd = AA00 (Data word 00AA)

               cc = 80

               Nice and long winded. Hope this helps and not confused you.
I am in the process of writing my own programming software to run a Tait
style programmer, So have been playing with hex files a lot.

               Feel free to ask if you need any more help. Have fun!

               Best Regards

               Clive Frederickson
               Electronics Engineer
               KILLspamClive.fredericksonKILLspamspamspectrol.co.uk
<RemoveMEClive.fredericksonTakeThisOuTspamspectrol.co.uk>

               Spectrol Electronics Ltd
               Garrard Way
               Swindon Wilts
               SN3 3HY                     Tel: +44 (0) 1793 521351
               UNITED KINGDOM                Fax: +44 (0) 1793 525163

This email message has been virus checked both by Spectrol Electronics
Limited (SEL) and by Star Internet, SEL's internet service provider. Whilst
SEL has, by these means, used all reasonable endeavours to prevent the
transmission to you of known viruses, it is still the responsibility of the
recipient to check all incoming electronic messages for viruses.
Accordingly, SEL can accept no responsibility for any damage to systems or
corruption of data caused by any virus contained in any message or file
originating from SEL.


               {Original Message removed}

2000\08\18@080352 by Bob Ammerman

picon face
How about using MPLAB/MPASM to generate a hex file, then tweak a single
config fuse and regenerate it.

Compare the two files and you'll know how that fuse is encoded.

Lather, rinse and repeat (with other fuses) ;-)

Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
sofftware)

{Original Message removed}

2000\08\18@092621 by Richard Ramsey

flavicon
face
Howdy John,
   I wrote a disassembler for f84. If I can find it I will send you a copy. I
don't remember the particulars of the top of my head, but it wasn't difficult to
decipher. I was converting some of my old parallax code to microchip, and this
was an easy way to accomplish it. The source will be in Visual C++.

Richard

John De Villiers wrote:

{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]: PIC only [EE]: engineering [OT]: off topic [AD]: advertisements

2000\08\18@135025 by w. v. ooijen / f. hanneman

picon face
> >Can anyone help with the configuration word's decoding?
> >PS its for 16F84's only - so far....
>
> You can download the Delphi 1.0 (basically Turbo Pascal) source code for
> my 16 bit PIC Programmer, this includes the source code for
> disassembling 16F84 hex files.

And the source code for the WISP tool is (Turbo Pascal) is also available
for download.
Wouter

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]: PIC only [EE]: engineering [OT]: off topic [AD]: advertisements

2000\08\19@043919 by John De Villiers

flavicon
face
>                 TT = File type, 00 = line contains data, 01 = End of file
> marker.

>                 So for the 16F84 with code protect off, Power up timer on,
> WDT off and XT Osc, fuse = 3FF1
>
>                 In the hex file,                :02400E01F13F7F
>
>                 BB = 02 (divide by 2 = 1 program word)
>                 AAaa = 400E (divide by 2 = 2007 address of config fuse)
>                 TT = 01 (Data record)

this is where the confusion set in. TT = 01 which according to the docs
incicates end of file marker yet you say its a data record indicator

Also, where did you find out that the address has to be divided by 2 for the
data records ??? This bit also got me

John

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2000\08\20@153955 by Peter L. Peres

picon face
>divide address by two, other mysteries

There are two Intel file formats that can be used to store PIC binary
code. One is INHX8M and the other is INHX16. Unfortunately the tools
default to INHX8M which is a strange format. Use INHX16 instead imho, as
it is easier to understand. INHX16 stores NN words of 16 bits each per
record, and the addresses are calculated as expected. The checksum is
still performed on 8 bits however ! (using the higher and lower bytes of
each word separately like: word=HHhh cksum+=((HH+hh)%0x100) )

Peter

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2000\08\21@050945 by e Frederickson

flavicon
face
Hi John

Yes, You are right. Record type marker 00 is for data, and 01 is for end of
file. Not sure what happened, I was writing my response from memory while at
work, my brain must have over heated. Please accept my apologies.
You can find a description of the hex file format in the application note
TB025 Description: Downloading HEX Files to PIC16F87X PICmicro ®
Microcontrollers Date: 11/06/1998 Documentation: 91025a.pdf
<../../../../Download/Appnote/Category/16CXX/91025a.pdf> (54 K). It explains the divide by two for the address etc.

               Best Regards

               Clive Frederickson
               Electronics Engineer
               TakeThisOuTClive.fredericksonEraseMEspamspam_OUTspectrol.co.uk
<RemoveMEClive.fredericksonspamTakeThisOuTspectrol.co.uk>
               Spectrol Electronics Ltd
               Garrard Way                 Swindon Wilts
               SN3 3HY                     Tel: +44 (0) 1793 521351
               UNITED KINGDOM                Fax: +44 (0) 1793 525163

This email message has been virus checked both by Spectrol Electronics
Limited (SEL) and by Star Internet, SEL's internet service provider. Whilst
SEL has, by these means, used all reasonable endeavours to prevent the
transmission to you of known viruses, it is still the responsibility of the
recipient to check all incoming electronic messages for viruses.
Accordingly, SEL can accept no responsibility for any damage to systems or
corruption of data caused by any virus contained in any message or file
originating from SEL.


               {Original Message removed}

2000\08\21@090853 by Olin Lathrop

flavicon
face
> There are two Intel file formats that can be used to store PIC binary
> code. One is INHX8M and the other is INHX16. Unfortunately the tools
> default to INHX8M which is a strange format.

The tools also support the INHX32 format.


*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, olinEraseMEspam.....cognivis.com, http://www.cognivis.com

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspammitvma.mit.edu>

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