Intel Hex

R

Rick Rothstein

What is the difference between Intel Hex and ordinary Hex? For future
reference, it is always a good idea to provide examples of what you are
trying to do.
 
F

Fan924

HEX
04 AF 30 C0 11 08 01 FF 40 5A 20 80 84 7C 88 A2
64 28 FC 4F F2 40 14 05 01 01 08 01 02 04 01 FF
00 0C 0C 3A 05 01 1E 3E 04 15 16 00 17 FE 80 03
01 8A 42 42 09 FF 93 60 4A 75 07 57 64 0D 4B 05
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF 78 FF FF FF FF
FF 37 31 FF 13 12 11 49 2F 10 7A 26 28 7A 26 28
12 A0 12 A6 12 C0 12 CA 13 76 13 98 13 A2 13 AC


Intel HEX
:100AD000005003D203F97A331206B2854FF0B5F015
:100AE000004002D204021056AF01AE00740112059C
:100AF000DD8F17743E931205CC743F932FFF740B58
:100B000093F8740C93F9120413EEF4F8EFF4F974FB
:100B10000B93FB740C93FCD3EE9BCF9CFBC2AB8F6F
:100B2000478B4888458946D2AB22751680751500DB
:100B300079007800223026012230270122157EE537

Intel HEX has a line number, then hex data, followed by a checksum of
the data on that line.
 
R

Rick Rothstein

Do the example values represent the same data? I see 2 rows of 32 FFs in the
Hex example, but I don't see that type of repeat in the Intel Hex example.
If they do not represent the same data, then they are meaningless as
examples (it would be like saying "How do I convert base 10 numbers to base
12... here is an example of each 23 and 456?"). You don't have to give that
much data, one or two lines would be enough, but they should be of the same
underlying data.
 
R

Rick Rothstein

Alright, I did an online search to look up Intel Hex. Assuming the Hex
values' byte ordering is in correct order, this should do what you want...

NormalHex = Format(Mid(IntelHex, 10, 32), _
"@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@")


If the byte ordering is reversed, then maybe something like this will
work...

NormalHex = Format(Mid(IntelHex, 10, 32), _
"@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@")
Bytes = Split(NormalHex)
For X = 0 To 15: Bytes(X) = Mid(Bytes(X) & Bytes(X), 2, 2): Next
NormalHex = Join(Bytes)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top