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.
PIC18FXX20
DS39583C-page 32 2010 Microchip Technology Inc.
TABLE 5-4: CHECKSUM COMPUTATION
Device
Code
Protect
Checksum
Blank
Value
0xAA at 0
and Max
Address
PIC18F6520
None SUM(0000:07FF)+SUM(0800:1FFF)+SUM(2000:3FFF)+
SUM(4000:5FFF)+SUM(6000:7FFF)+(CFGW1L & 0000)+
(CFGW1H & 0027)+(CFGW2L & 000F)+(CFGW2H & 000F)+
(CFGW3L & 0000)+(CFGW3H & 0002)+(CFGW4L & 0085)+
(CFGW4H & 0000)+(CFGW5L & 00FF)+(CFGW5H & 00C0)+
(CFGW6L & 00FF)+(CFGW6H & 00E0)+(CFGW7L & 00FF)+
(CFGW7H & 0040)
05A8 04FE
Boot
Block
SUM(0800:1FFF)+SUM(2000:3FFF)+SUM(4000:5FFF)+
SUM(6000:7FFF)+(CFGW1L & 0000)+(CFGW1H & 0027)+
(CFGW2L & 000F)+(CFGW2H & 000F)+(CFGW3L & 0000)+
(CFGW3H & 0002)+(CFGW4L & 0085)+(CFGW4H & 0000)+
(CFGW5L & 00FF)+(CFGW5H & 00C0)+(CFGW6L & 00FF)+
(CFGW6H & 00E0)+(CFGW7L & 00FF)+(CFGW7H & 0040)+
SUM(IDs)
077F 734
Boot/
Block1/
Block2
SUM(4000:5FFF)+SUM(6000:7FFF)+(CFGW1L & 0000)+
(CFGW1H & 0027)+(CFGW2L & 000F)+(CFGW2H & 000F)+
(CFGW3L & 0000)+(CFGW3H & 0002)+(CFGW4L & 0085)+
(CFGW4H & 0000)+(CFGW5L & 00FF)+(CFGW5H & 00C0)+
(CFGW6L & 00FF)+(CFGW6H & 00E0)+(CFGW7L & 00FF)+
(CFGW7H & 0040)+SUM(IDs)
857C 8531
All (CFGW1L & 0000)+(CFGW1H & 0027)+(CFGW2L & 000F)+
(CFGW2H & 000F)+(CFGW3L & 0000)+(CFGW3H & 0002)+
(CFGW4L & 0085)+(CFGW4H & 0000)+(CFGW5L & 00FF)+
(CFGW5H & 00C0)+(CFGW6L & 00FF)+(CFGW6H & 00E0)+
(CFGW7L & 00FF)+(CFGW7H & 0040)+SUM(IDs)
480 048A
Legend: Item
Description
CFGW = Configuration Word
SUM[a:b] = Sum of locations, a to b inclusive
SUM_ID = Byte-wise sum of lower four bits of all customer ID locations
+ = Addition
& = Bit-wise AND
2010 Microchip Technology Inc. DS39583C-page 33
PIC18FXX20
PIC18F6620
None SUM(0000:01FF)+SUM(0200:3FFF)+SUM(4000:7FFF)+
SUM(8000:BFFF)+SUM(C000:FFFF)+(CFGW1L & 0000)+
(CFGW1H & 0027)+(CFGW2L & 000F)+(CFGW2H & 000F)+
(CFGW3L & 0000)+(CFGW3H & 0001)+(CFGW4L & 0085)+
(CFGW4H & 0000)+(CFGW5L & 000F)+(CFGW5H & 00C0)+
(CFGW6L & 000F)+(CFGW6H & 00E0)+(CFGW7L & 000F)+
(CFGW7H & 0040)
02D8 022E
Boot
Block
SUM(0200:3FFF)+SUM(4000:7FFF)+SUM(8000:BFFF)+
SUM(C000:FFFF)+(CFGW1L & 0000)+(CFGW1H & 0027)+
(CFGW2L & 000F)+(CFGW2H & 000F)+(CFGW3L & 0000)+
(CFGW3H & 0001)+(CFGW4L & 0085)+(CFGW4H & 0000)+
(CFGW5L & 000F)+(CFGW5H & 00C0)+(CFGW6L & 000F)+
(CFGW6H & 00E0)+(CFGW7L & 000F)+(CFGW7H & 0040)+
SUM(IDs)
04AF 455
Boot/
Block1/
Block2
SUM(8000:BFFF)+SUM(C000:FFFF)+(CFGW1L & 0000)+
(CFGW1H & 0027)+(CFGW2L & 000F)+(CFGW2H & 000F)+
(CFGW3L & 0000)+(CFGW3H & 0001)+(CFGW4L & 0085)+
(CFGW4H & 0000)+(CFGW5L & 000F)+(CFGW5H & 00C0)+
(CFGW6L & 000F)+(CFGW6H & 00E0)+(CFGW7L & 000F)+
(CFGW7H & 0040)+SUM(IDs)
82AC 8252
All (CFGW1L & 0000)+(CFGW1H & 0027)+(CFGW2L & 000F)+
(CFGW2H & 000F)+(CFGW3L & 0000)+(CFGW3H & 0001)+
(CFGW4L & 0085)+(CFGW4H & 0000)+(CFGW5L & 000F)+
(CFGW5H & 00C0)+(CFGW6L & 000F)+(CFGW6H & 00E0)+
(CFGW7L & 000F)+(CFGW7H & 0040)+SUM(IDs)
02A0 029B
TABLE 5-4: CHECKSUM COMPUTATION (CONTINUED)
Device
Code
Protect
Checksum
Blank
Value
0xAA at 0
and Max
Address
Legend: Item Description
CFGW = Configuration Word
SUM[a:b] = Sum of locations, a to b inclusive
SUM_ID = Byte-wise sum of lower four bits of all customer ID locations
+ = Addition
& = Bit-wise AND

PIC18F8620-I/PT

Mfr. #:
Manufacturer:
Microchip Technology
Description:
8-bit Microcontrollers - MCU 64KB 3840 RAM 68I/O
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet