2010 Microchip Technology Inc. DS39583C-page 31
PIC18FXX20
5.4 Embedding Configuration Word
Information in the HEX File
To allow portability of code, a PIC18FXX20
programmer is required to read the configuration word
locations from the HEX file. If configuration word
information is not present in the HEX file, then a simple
warning message should be issued. Similarly, while
saving a HEX file, all configuration word information
must be included. An option to not include the
configuration word information may be provided. When
embedding configuration word information in the HEX
file, it should start at address 300000h.
Microchip Technology Inc. feels strongly that this
feature is important for the benefit of the end customer.
5.5 Checksum Computation
The checksum is calculated by summing the following:
• The contents of all code memory locations
• The configuration word, appropriately masked
• ID locations
The Least Significant 16-bits of this sum are the
checksum.
Table 5-4 (pages 32 through 37) describes how to
calculate the checksum for each device.
Note 1: The checksum calculation differs depend-
ing on the code protect setting. Since the
code memory locations read out differ-
ently, depending on the code protect set-
ting, the table describes how to
manipulate the actual code memory val-
ues to simulate the values that would be
read from a protected device. When cal-
culating a checksum by reading a device,
the entire code memory can simply be
read and summed. The configuration
word and ID locations can always be
read.