Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

configuration intel .hex file extension

Status
Not open for further replies.

freakkaito

Member level 1
Joined
May 11, 2008
Messages
37
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
1,595
each record in hexadecimal object file format (Intel hex) contains the following fields:

<:><rec length><load address><rec type><data><checksum>

the colon is the record header.
the record length field consists two hex digit, and represents the number of entries in data field.
the load address field consists of for hex digit, and indicates the absolutes at which the data in the data field is to be loaded.
the record type field consists of two hex digits, which are always zero data records.
the data field contains from 1 to 16 pairs of hex digits.
the last two hex digit are a checksum on the record length, load address, record type, and data fields.the sum of the binary equivalents of these fields and the checksum itself is zeo.
each record in the file is terminated by carriage return (oDhex) and line feed (0Ahex).
a type one record marks the end of the file. file record always contains."000001FF".


that's the theory of the structure intel hex file extension. my problem is, when i try to write the file into a buffer i don't know how to use the information data like load address & etc.

for the example i have this data file:

:0000010035475621A57C15348945
:00000200563244758CB768767209
.
.
.
.

here the result on my buffer:
0000010035475621A57C15348945
0D0A00000200563244758CB7687
67209
.
.
.

i don't know how to remove the information bit and how to remove 0D and 0A

i hope you understand what i mean. for information I want to make standalone programer for at89s that's why I need to understand how to write .hex file into the buffer
 

Hi,
You must make the buffer as an exact image of your controller's memory and fill up the data from the hex file at buffer locations specified by the data records. You can also store the value of the last byte address stored in the buffer so that while copying the buffer to the memory you need not copy the entire buffer.

While reading the file, you should read one line at a time. It will be a string of characters as you have explained. Pick up the right string of characters corresponding to the data bytes from the stream. Convert them into binary and store them in the data buffer starting at the absolute address specified in the record. Repeat this process till the end of file record.

Regards,
Laktronics
 

hi laktronics, nice to have you in this forum.


i've got your explanation, but somehow i don't know where i have to start. would you give me and example code how to read and write the file????? :cry::cry::cry:
just example pleeeease :roll:
 

Hi,
I suggest you to use VB as it directly supports COM port using MSCOMM. But regarding coding, you have to help yourselves.

Regards,
Laktronics
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top