Intel Hex File Error

Status
Not open for further replies.

Electrix

Member
I am building 'Semiconductor Analyser' project using a PIC16F876A, which was published by Elektor Magazine. The hex file, which is available at their webiste is giving a problem.. When I load the .hex file for this proj into the programmer software.. it gives the following error message:
"Input Program file in Intel Hex Format contains errors. Line number 1: Invalid data byte in the record"
I am sending the .hex file in a zipped file.. Please have a look and help me out in fixing this error.
Thanks
 

Attachments

  • hex_file.zip
    12.3 KB · Views: 185
Last edited:

I recall that project, the French fellow who designed it has a much more advanced version on his site but not hex file. It's a commercial version.

If you find a working version please post it. Cool project.
 
That hex file seems to be missing a Linear Address Record as the very fist record. This in and of itself is not a sin, but, many programmers (and bootloaders) rely on it.

I added the missing Linear Address Record to the beginning of the file (":020000040000FA"). Try it now and let me know if it works please?

Regards, Mike
 

Attachments

  • hex_file.zip
    12.4 KB · Views: 175
Oops, I need to apologize.

I tried loading the modified hex file into my programmer and I received a number of errors too. I would need to examine the file a little closer but I suspect it's not a hex file for a 16F' series device since it has FFFF words in a bunch of locations instead of 3FFF words.

Sorry. Mike
 
Last edited:
I've just downloaded and disassembled the file, it seems full of errors and mistakes? - I've no idea what generated it, but I'm presuming it was some really naff compiler?, the HEX file includes lots of words that read 0xFFFF, when the maximum possible word is only 0x3FFF for a 16F series chip.

Code:
            ORG     0x0000

            NOP
            GOTO    Label_0001
            ; ????
            ; ????
            MOVWF   Var_0001
            SWAPF   STATUS    , W
            BCF     STATUS    , RP0
            BCF     STATUS    , RP1

For example, this is the first few words, words 2 and 3 are 0xFFFF which disassembles as '; ????' (which means invalid) - and notice address 0x0004 doesn't have a label assigned to it, which means it's not called from anywhere in the rest of the HEX file.

Thinking back?, I remember looking at this file befor -, when the project first appeared in Elektor, I can only suspect the author intends you to buy a kit for his full version, rather than building the magazine version?.
 
Yes, its still popping up an error.. This time its 'Line number 2: Invalid Data Byte in the Record' .. I think all the lines have errors.. but my programmer software shows the first one only and not the ones below it
 
Ok.. a piece of information .. the Elektor article which quotes this project:

**broken link removed**
 
Interesting quote from that link:

The MicroChip configuration fuses are clearly explained in all the datasheets, with no possibility of confusion (assuming you look at them!) - and they should also be defined in the source code and included in the HEX file, as required by MicroChip recommendations.
 
Sorry man. That's a screwed up hex file and those guys should be ashamed of themselves for publishing it in that condition.

Regards, Mike
 

Hey Nigel,
I was wondering .. if we delete all the 0xFFFF words from the above .hex file, it should compile correctly ... and have those locations replaced by 0x0000..whether it works as intended is still a question mark ... Is it worth a try ?
 
Forgive me for "butting in" again.

The FFFF words were not a problem on my programmer. They actually converted to 3FFF words correctly when I viewed the buffer.

The problem was multiple data records with target addresses of 4000 and higher.

A very wierd file. Sorry.

Any luck getting in touch with the Author?

Regards, Mike
 
Last edited:
I've E-mailed the author and informed him and have also requested him to send me the correct file .. its been about 8 hours since then.. no reply yet.
 
Electrix said:
Hey Nigel,
I was wondering .. if we delete all the 0xFFFF words from the above .hex file, it should compile correctly ... and have those locations replaced by 0x0000..whether it works as intended is still a question mark ... Is it worth a try ?

No, the 0xFFFF will become 0x3FFF when they are programmed in the PIC, they don't have any detrimental effect - they just shouldn't be there, and I can only imagine the file was created by some flawed compiler?. But the code itself consists of subroutines that are never called, it's just completely bizzare! - I went through it quite throughly a good while back, as a friend of mine was considering building it.
 
The correct file

Hey
I got a reply from the author of the project. He has sent me the code.
I've built the project and its working fine. I'm attaching the code along, for those of you who plan to build this project.
 

Attachments

  • SC_analyser.zip
    11.4 KB · Views: 211
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…