English
Language : 

PIC32MX795F512L-80IPT Datasheet, PDF (48/68 Pages) Microchip Technology – PIC32 Flash Programming Specification
PIC32
17.4.4 CALCULATING FOR “DIR” IN THE
CHECKSUM FORMULA
The value of Device ID register, its mask value, the
value derived from applying the mask, and the 32-bit
summation of bytes are shown in Table 17-3.
From Table 17-3, the value of “DIR” is:
DIR = 0x00000083 (32-bit number.)
TABLE 17-3: DIR CALCULATION EXAMPLE
Register
POR Default Value
Mask
DEVID
0x00938053
0x000FF000
17.4.5 COMPLETING THE PIC32
CHECKSUM CALCULATION
The values derived in previous sections (PF, BF, DCR,
DIR) are used to calculate the checksum value. First,
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, as shown in Example 17-1.
POR Default Value 32-Bit Summation of
& Mask
Bytes
0x00038000
0x00000083
EXAMPLE 17-1: CHECKSUM CALCULATION PROCESS
1. First, temp = PF + BF + DCR + DIR, which translates to:
temp = 0x7F80000 + 0x002FC010 + 0x000003D6 + 0x00000083
2. Adding all four values results in temp being equal to 0x0827C406
3. Next, the 1’s complement of temp, called temp1, is calculated:
temp1 = 1’s complement (temp), which is now equal to 0xF7D83B96
4. Finally, the 2’s complement of temp is the checksum:
Checksum = 2’s complement (temp), which is Checksum = temp1 + 1, resulting in 0xF7D83B97
17.4.6 CHECKSUM VALUES WHILE
DEVICE IS CODE-PROTECTED
Since the device Configuration Words are not readable
while the PIC32 devices are in code-protected state,
the checksum values are zeros for all devices.
DS61145L-page 48
 2007-2013 Microchip Technology Inc.