19.1 Device Configuration

In PIC32 devices, the configuration words select various device configurations that are set at device Reset prior to execution of any code. These values are available at the highest locations of the Boot Flash Memory (BFM) and since they are part of the program memory, are included in the programming file along with executable code and program constants. The names and locations of these configuration words are listed in Table 19-1 through Table 19-4.

Additonally, Table 19-3 through Table 19-4 include configuration words for the PIC32MZ and the PIC32MK family devices, respectively, with dual boot and dual panel Flash. Refer to “Section 48. Memory Organization and Permissions” (DS60001214) of the “PIC32 Family Reference Manual” for a detailed description of the dual boot regions.
Table 19-1. DEVCFG Locations for 15X/17X/25X/27X and PIC32MX3XX/4XX/5XX/6XX/ 7XX Devices Only
Configuration WordPhysical Address
DEVCFG00x1FC02FFC
DEVCFG10x1FC02FF8
DEVCFG20x1FC02FF4
DEVCFG30x1FC02FF0
Table 19-2. DEVCFG Locations for 28/36/44-Pin PIC32MX1XX/2XX and 64/100-Pin PIC32MX1XX/2XX/5XX Devices Only
Configuration WordPhysical Address
DEVCFG00x1FC00BFC
DEVCFG10x1FC00BF8
DEVCFG20x1FC00BF4
DEVCFG30x1FC00BF0

On Power-on Reset (POR) or any Reset, the configuration words are copied from the Boot Flash memory to their corresponding Configuration registers. A Configuration bit can only be programmed = 0 (unprogrammed state = 1).

During programming, a configuration word can be programmed a maximum of two times for PIC32MX devices and only one time for PIC32MZ, and PIC32MK family devices before a page erase must be performed.

After programming the configuration words, a device Reset will cause the new values to be loaded into the Configuration registers. Because of this, the programmer must program the configuration words just prior to verification of the device. The final step is programming the code protection configuration word.

These configuration words determine the oscillator source. If using the Two-Wire Enhanced ICSP mode the configuration words are ignored and the device will always use the FRC; however, in Four-Wire mode this is not the case. If an oscillator source is selected by the configuration words that is not present on the device after Reset, the programmer will not be able to perform Flash operations on the device after it is Reset. See the “Special Features” chapter in the specific device data sheet for details regarding oscillator selection using the configuration words.

Table 19-3. Configuration Word Locations for PIC32MZ Family Devices
Configuration Word(1)Register Physical Address
Fixed Boot Region 1Fixed Boot Region 2Active Boot Alias Region(2)Inactive Boot Alias Region(2)
Boot sequence number0x1FC4FFF00x1FC6FFF00x1FC0FFF00x1FC2FFF0
Code protection0x1FC4FFD00x1FC6FFD00x1FC0FFD00x1FC2FFD0
DEVCFG00x1FC4FFCC0x1FC6FFCC0x1FC0FFCC0x1FC2FFCC
DEVCFG10x1FC4FFC80x1FC6FFC80x1FC0FFC80x1FC2FFC8
DEVCFG20x1FC4FFC40x1FC6FFC40x1FC0FFC40x1FC2FFC4
DEVCFG30x1FC4FFC00x1FC6FFC00x1FC0FFC00x1FC2FFC0
DEVCFG4(3)0x1FC4FFBC0x1FC6FFBC0x1FC0FFBC0x1FC2FFBC
Alternate boot sequence number0x1FC4FF700x1FC6FF700x1FC0FF700x1FC2FF70
Alternate code protection0x1FC4FF500x1FC6FF500x1FC0FF500x1FC2FF50
Alternate DEVCFG00x1FC4FF4C0x1FC6FF4C0x1FC0FF4C0x1FC2FF4C
Alternate DEVCFG10x1FC4FF480x1FC6FF480x1FC0FF480x1FC2FF48
Alternate DEVCFG20x1FC4FF440x1FC6FF440x1FC0FF440x1FC2FF44
Alternate DEVCFG30x1FC4FF400x1FC6FF400x1FC0FF400x1FC2FF40
Alternate DEVCFG4(3)0x1FC4FF3C0x1FC6FF3C0x1FC0FF3C0x1FC2FF3C
Note:
  1. All values in the 0x1FCxFF00-0x1FCxFFFF memory regions must be programmed using the QUAD_WORD_PROGRAM command to ensure proper ECC configuration. Refer to Quad Word Program (QUAD_WORD_PROGRAM) Command for details.

  2. Active/inactive boot alias selections are assumed for an unprogrammed device where fixed region 1 is active and fixed region 2 is inactive. Refer to “Section 48. Memory Organization and Permissions” (DS60001214) for a detailed description of the alias boot regions.

  3. These configuration words are available only on the PIC32MZ DA family devices.

Table 19-4. Configuration Word Locations for PIC32MKXXXXXXD/E/FXX Family Devices

Configuration Word(1)

Register Physical Address
Fixed Boot Region 1Fixed Boot Region 2Active Boot Alias Region(2)Inactive Boot Alias Region(2)
Boot sequence number0x1FC43FF00x1FC63FF00x1FC03FF00x1FC23FF0
Code protection0x1FC43FD00x1FC63FD00x1FC03FD00x1FC23FD0
DEVCFG00x1FC43FCC0x1FC63FCC0x1FC03FCC0x1FC23FCC
DEVCFG10x1FC43FC80x1FC63FC80x1FC03FC80x1FC23FC8
DEVCFG20x1FC43FC40x1FC63FC40x1FC03FC40x1FC23FC4
DEVCFG30x1FC43FC00x1FC63FC00x1FC03FC00x1FC23FC0
Note:
  1. If the device has ECC memory, each of the following configuration word groups must be programmed using the QUAD_WORD_PROGRAM command:
    • Boot sequence number (single quad word programming operation)
    • Code protection (single quad word programming operation)
    • DEVCFG3, DEVCFG2, DEVCFG1 and DEVCFG0 (single quad word programming operation)
  2. Active/inactive boot alias selections are assumed for an unprogrammed device where fixed region 1 is active and fixed region 2 is inactive. Refer to “Section 48. Memory Organization and Permissions” (DS60001214) for a detailed description of the alias boot regions.

Table 19-5. Configuration Word Locations for PIC32MKXXXXXXH/G/J/K/L/MXX Family Devices
Configuration Word(1)Register Physical Address
Fixed Boot Region 1Fixed Boot Region 2Active Boot Alias Region(2, 3)Inactive Boot Alias Region(2, 3)
Boot sequence number0x1FC43FF00x1FC63FF00x1FC03FF00x1FC23FF0
Code protection0x1FC43FD00x1FC63FD00x1FC03FD00x1FC23FD0
DEVCFG00x1FC43FCC0x1FC63FCC0x1FC03FCC0x1FC23FCC
DEVCFG10x1FC43FC80x1FC63FC80x1FC03FC80x1FC23FC8
DEVCFG20x1FC43FC40x1FC63FC40x1FC03FC40x1FC23FC4
DEVCFG30x1FC43FC00x1FC63FC00x1FC03FC00x1FC23FC0
DEVCFG40x1FC43FBC
Alternate boot sequence number0x1FC43F700x1FC63F700x1FC03F700x1FC23F70
Alternate code protection0x1FC43F500x1FC63F500x1FC03F500x1FC23F50
Alternate DEVCFG00x1FC43F4C0x1FC63F4C0x1FC03F4C0x1FC23F4C
Alternate DEVCFG10x1FC43F480x1FC63F480x1FC03F480x1FC23F48
Alternate DEVCFG20x1FC43F440x1FC63F440x1FC03F440x1FC23F44
Alternate DEVCFG30x1FC43F400x1FC63F400x1FC03F400x1FC23F40
Alternate DEVCFG40x1FC43F3C0x1FC63F3C0x1FC03F3C0x1FC23F3C
Note:
  1. If the device has ECC memory, each of the following Configuration Word Groups should be programmed using the QUAD_WORD_PROGRAMcommand:
    • Boot sequence number (single quad word programming operation)
    • Code protection (single quad word programming operation)
    • DEVCFG3, DEVCFG2, DEVCFG1 and DEVCFG0 (single quad word programming operation)
  2. All values in the 0x1FCxFF00-0x1FCxFFFF memory regions must be programmed using the QUAD_WORD_PROGRAM command to ensure proper ECC configuration. Refer to Quad Word Program (QUAD_WORD_PROGRAM) Command for details.
  3. Active/inactive boot alias selections are assumed for an unprogrammed device where fixed region 1 is active and fixed region 2 is inactive. Refer to “Section 48. Memory Organization and Permissions” (DS60001214) for a detailed description of the alias boot regions.