This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Hex & Bin

Hi All,
What different about hex and bin file,
why the MUC that can be pragraming by these two format?

Thanks!

Parents
  • BIN is just plain binary format, no checksums etc.

    The Intel HEX format is described in the A51 manual (User's guide 02.2001) on page 394.

    The HEX file consists of lines that end on carriage return/line feed and the structure of them is always equal.
    :llaaaatt[dd... ]cc

    Every line starts with a ":"
    the aaaa is the address of were the date belongs to in a hexadezimal form.

    tt is the type field that specifies if it is a data record or an end-of-file record.

    ll is the length field that contains the number of bytes in the data field.

    dd.. is the data field, cc is a cheksum. Usually it contains between 0 and 16 bytes, more is uncommon. All fields are in a hexadezimal form and you can easily read a hex file with a text editor.

    What the processor receives as programming data (when it is programmed) is the decoded hex file. So it always receives "binary" data.

    If the processor programs itself while runtime (using a bootloader), then it could receive a hex file on the serial interface, decode it and check the checksum before writing the data to memory. But you have to write a bootloader that can "understand" the hex file format and that should usually send back an acknowledge or not acknowledge byte after every record.

    When you plug your processor into a programmer that "burns" the data into the processord memory, the data is written into that memory in a binary form using a certain programming algorithm, which describes the voltages applied and the timing. When the data is send to a bootloader program that runs on the processor, you can just specify your personal fomat and transmission protocol. So the format can be hex and binary and whatever you want (the bootloader ahs to decode it).

    Take care
    Sven

Reply
  • BIN is just plain binary format, no checksums etc.

    The Intel HEX format is described in the A51 manual (User's guide 02.2001) on page 394.

    The HEX file consists of lines that end on carriage return/line feed and the structure of them is always equal.
    :llaaaatt[dd... ]cc

    Every line starts with a ":"
    the aaaa is the address of were the date belongs to in a hexadezimal form.

    tt is the type field that specifies if it is a data record or an end-of-file record.

    ll is the length field that contains the number of bytes in the data field.

    dd.. is the data field, cc is a cheksum. Usually it contains between 0 and 16 bytes, more is uncommon. All fields are in a hexadezimal form and you can easily read a hex file with a text editor.

    What the processor receives as programming data (when it is programmed) is the decoded hex file. So it always receives "binary" data.

    If the processor programs itself while runtime (using a bootloader), then it could receive a hex file on the serial interface, decode it and check the checksum before writing the data to memory. But you have to write a bootloader that can "understand" the hex file format and that should usually send back an acknowledge or not acknowledge byte after every record.

    When you plug your processor into a programmer that "burns" the data into the processord memory, the data is written into that memory in a binary form using a certain programming algorithm, which describes the voltages applied and the timing. When the data is send to a bootloader program that runs on the processor, you can just specify your personal fomat and transmission protocol. So the format can be hex and binary and whatever you want (the bootloader ahs to decode it).

    Take care
    Sven

Children
No data