Ben,
To calculate the checksum, add all of the data bytes (exclude
the : and the checksum)
02 + 06 + 70 + 00 + 1A + 29 = BB
keep the low order byte (still BB)
take the twos complement (not BB + 1 = 44 + 1 = 45)
To use the checksum to check the result, add all the data bytes
including the checksum
02 + 06 + 70 + 00 + 1A + 29 + 45 = 100
The low byte should be (and is) 00.
Note that the Intel hex file format (like this) uses twos complement
for the checksum, while Motorola S-record format uses ones complement.
Quoting Benjamin Menk|c <.....benjaminKILLspam
@spam@AUTO-INTERN.COM>:
{Quote hidden}> How is the checksum of a pic hexfile calculated?
>
> ie:
> :020670001A2945
>
> in this line 0x45 is CS, but i don't know why.
>
>
>
> regards,
>
>
>
> Ben
>
--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listserv
KILLspammitvma.mit.edu with SET PICList DIGEST in the body