Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Is there any calculator to calculate checksum

Status
Not open for further replies.

poojapatel2210

New Member
I have a hex file
:020000040000FA
:0A0000004028000000000000D42892
:1000800064008B13A020C73095003C308C000330F7
:1000900096004A3099009101A3209701A6208C0177
:1000A0009E208B01AC20AC209120A9209116111626
:1000B0009301A02017149E20B401B601B501A92018
:1000C00093019E208B170B168B15640063000000B4
:1000D000031A7328640001308C06361C7328B70B92
:1000E0007328912036108B130B128B11B4188728AC
:1000F000341C8928A92013089E20B500351E8428A9
:100100001430B70036148928B51A36108928912082
:10011000AC200C198928C1200C198928B401B5011B
:100120005F28A0201C308C009E208C16C120C1208E
:100130008C12A0203C308C009E2008008801080012
:100140000130880008000230880008000330880071
:1001500008000730880008000130B000B9200B1DEE
:10016000AF280A3095000B110730B005B00BAF284F
:100170000800A020073095049E200A3095000B113E
:1001800008000130B000A0201511951415109E2014
:10019000D83095000B110B1DCB28B00BC828A02020
:1001A000073095049E200800B300030EB2000B0830
:0E01B000B400320E8300B30E330E8B01090033
:020000040001F9
:02000E006C097B
:02001000FF1CD3
:00000001FF

I want to clculate the total check sum Is ther any way to find out i have program on MPLAB IDE
If there is a way to find out total checksum please explain it step by step.
 
I think this might be what you're looking for:

http://onlinemd5.com/

You can import a file, or copy and paste the text.
 
You don't need to click "Compare". That's only for verifying that a file matches a given checksum. In order to generate the checksum you just have to select your file. When you upload it, the checksum is instantly given to you (the field labeled "File checksum").
 
I want to clculate the total check sum Is ther any way to find out i have program on MPLAB IDE

Why do you desire to do this? - it's of no use at all, unless you're writing programming software (to read the HEX file) or assembler software (to write the file).

The details required were in one of the MPASM help files, no idea if they still are?.
 
If you are using MPLAB ide.... The checksum is displayed at the top after a clean build!!!

upload_2016-1-21_18-39-58.jpeg
 
I tried MPLab 8.92, but couldn't get it to calculate the checksum from just the hex. That is not to say it won't do that. I just haven't done it. (That is, I didn't want to risk screwing up the chip I currently have on my board.)

I did check and it seems to be Intel hex, as I am sure we all assumed:

:02 00 00 04| 00 00| FA (2's complement of (0x2 +0x4 = 0x6) = 0xFA)

:0A 00 00 00| 40 28 00 00 00 00 00 00 D4 28| 92 (sum = 0x16E, last 2 digits of 2's complement = 92)

On the chance that is what the OP wants to know how to do, the first 4 bytes are addresses and counts, the next series of bytes are data, and the last byte is the last two characters of the 2's complement of the sum of everything except the checksum. I have shown the calculations above. Here's a useful link: https://en.wikipedia.org/wiki/Intel_HEX

If the OP adds the last two digits of each line, she will get the checksum, I think. I tried that and got an interesting 12-bit number, but I probably made a mistake in addition somewhere.

John
 
Last edited:
I once wrote one in assembly to calculate the checksum of a Modbus transmission, this only entailed 6 to 8 bytes.;)
Max.
 
John:

Don't add. XOR everything.

If I had 1111 or -1 in 4 bits (-8 to +7)

-1+-1 = -2 or 1100
1111 xor 1111 is 0
If you add them in an 8 bit world without sign extending you get
0001000
AND it with 00001111 and you also get the right answer.
 
I did check and it seems to be Intel hex, as I am sure we all assumed:

Yes, Intel, but modified slightly to deal with 14 bit (and other size) words - as I mentioned earlier, it was described in the MPASM help file which was where I got the details from when writing PicProg and WinPicProg.

But as I asked before, why would he want to calculate the checksum? - simply read it off the HEX file.
 
But as I asked before, why would he want to calculate the checksum? - simply read it off the HEX file.

Well, the question is posted in the Homework forum, so I assumed the OP (she) was asked to do the calculation and possibly even to show her work. Also, her previous posts have impressed me as being from someone who is thoughtfully trying to understand the how to, not just get answers.

John
 
Well, the question is posted in the Homework forum, so I assumed the OP (she) was asked to do the calculation and possibly even to show her work. Also, her previous posts have impressed me as being from someone who is thoughtfully trying to understand the how to, not just get answers.

John

I did not realize she was asking for homework help. Should have checked the forum I suppose....
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top