18.4.5 Completing the PIC32 Checksum Calculation
The values derived in previous sections (PF, BF, DCR, DIR) are used to calculate the checksum value. Perform the 32-bit summation of the PF, BF, DCR and DIR as derived in previous sections and store it in a variable, called temp.
The following are the steps of the checksum calculation process:
- First,
temp
= PF + BF + DCR + DIR, which translates to:temp
= 0x7F80000 + 0x002FC010 + 0x000003D6 + 0x00000083
- Adding all four values results in
temp
being equal to 0x0827C469 - Finally, the 2’s complement of the
temp
is the checksum:- Checksum = 2’s complement (
temp
), which is Checksum = (1’s complement (temp
)) + 1, resulting in 0xF7D83B97
- Checksum = 2’s complement (