18F8585 Support Information

XC8-CC #pragma config Usage

#pragma config <setting>=<named value>
For example:
// Oscillator : HS oscillator with SW enabled 4x PLL
// Osc. Switch Enable : Oscillator system clock switch option is disabled (main oscillator is source)
#pragma config OSC = HSSWPLL, OSCS = OFF
#pragma config <setting>=<literal constant>
For example:
// Oscillator : HS oscillator with SW enabled 4x PLL
// Osc. Switch Enable : Oscillator system clock switch option is disabled (main oscillator is source)
#pragma config OSC = 0xE, OSCS = 0x1
#pragma config <register>=<literal constant>
For example:
// Oscillator : HS oscillator with SW enabled 4x PLL
// Osc. Switch Enable : Oscillator system clock switch option is disabled (main oscillator is source)
#pragma config CONFIG1H = 0x2E
For example:
// IDLOC @ 0x200000
#pragma config IDLOC0 = 0x255

PIC-AS config Usage

config "<setting>"="<named value>"
For example:
; Oscillator : HS oscillator with SW enabled 4x PLL
; Osc. Switch Enable : Oscillator system clock switch option is disabled (main oscillator is source)
config "OSC" = "HSSWPLL", "OSCS" = "OFF"
config "<setting>"=<literal constant>
For example:
; Oscillator : HS oscillator with SW enabled 4x PLL
; Osc. Switch Enable : Oscillator system clock switch option is disabled (main oscillator is source)
config "OSC" = 0xE, "OSCS" = 0x1
config "<register>"=<literal constant>
For example:
; Oscillator : HS oscillator with SW enabled 4x PLL
; Osc. Switch Enable : Oscillator system clock switch option is disabled (main oscillator is source)
config "CONFIG1H" = 0x2E
For example:
; IDLOC @ 0x200000
config "IDLOC0" = 0x255

Configuration Registers & Settings

Register: CONFIG1H @ 0x300001
OSC Oscillator
HSSWPLL HS oscillator with SW enabled 4x PLL
ECIOSWPLL EC oscillator with OSC2 configured as RA6 and SW enabled 4x PLL
ECIOPLL EC oscillator with OSC2 configured as RA6 and HW enabled 4x PLL
RCIO RC oscillator with OSC2 configured as RA6
HSPLL HS oscillator with HW enabled 4x PLL
ECIO EC oscillator with OSC2 configured as RA6
EC EC oscillator with OSC2 configured as divide by 4 clock output
RC RC oscillator with OSC2 configured as divide by 4 clock output
HS HS oscillator
XT XT oscillator
LP LP oscillator
OSCS Osc. Switch Enable
ON Timer1 oscillator system clock switch option is enabled (oscillator switching is enabled)
OFF Oscillator system clock switch option is disabled (main oscillator is source)
Register: CONFIG2L @ 0x300002
PWRT Power Up Timer
OFF PWRT disabled
ON PWRT enabled
BOR Brown Out Detect
ON Brown-out Reset enabled
OFF Brown-out Reset disabled
BORV Brown Out Voltage
20 VBOR set to 2.0V
27 VBOR set to 2.7V
42 VBOR set to 4.2V
45 VBOR set to 4.5V
Register: CONFIG2H @ 0x300003
WDT Watchdog Timer
ON WDT enabled
OFF WDT disabled (control is placed on the SWDTEN bit)
WDTPS Watchdog Postscaler
32768 1:32768
16384 1:16384
8192 1:8192
4096 1:4096
2048 1:2048
1024 1:1024
512 1:512
256 1:256
128 1:128
64 1:64
32 1:32
16 1:16
8 1:8
4 1:4
2 1:2
1 1:1
Register: CONFIG3L @ 0x300004
MODE Processor Mode
MC Microcontroller mode
MP Microprocessor mode
MPB Microprocessor with Boot Block mode
EM Extended Microcontroller mode
WAIT External Bus Wait
OFF Wait selections unavailable for table reads and table writes
ON Wait selections for table reads and table writes are determined by WAIT1:WAIT0 bits (MEMCOM<5:4>)
Register: CONFIG3H @ 0x300005
CCP2MX CCP2 Mux
ON CCP2 input/output is multiplexed with RC1
OFF CCP2 is multiplexed with RB3 in Extended Microcontroller, Microprocessor or Microprocessor with Boot Block mode. Or with RE7 in Microcontroller mode.
ECCPMX ECCP Mux
PORTE P1B, P1C are multiplexed with RE6, RE5
PORTH P1B, P1C are multiplexed with RH7, RH6
MCLRE MCLR enable
ON MCLR pin enabled, RG5 input pin disabled
OFF RG5 input enabled, MCLR disabled
Register: CONFIG4L @ 0x300006
STVR Stack Overflow Reset
ON Stack full/underflow will cause Reset
OFF Stack full/underflow will not cause Reset
LVP Low Voltage Program
ON Low-voltage ICSP enabled
OFF Low-voltage ICSP disabled
DEBUG Background Debugger Enable bit
OFF Background debugger disabled. RB6 and RB7 configured as general purpose I/O pins.
ON Background debugger enabled. RB6 and RB7 are dedicated to in-circuit debug.
Register: CONFIG5L @ 0x300008
CP0 Code Protect 000800-0003FFF
OFF Block 0 (000800-003FFFh) not code-protected
ON Block 0 (000800-003FFFh) code-protected
CP1 Code Protect 0004000-007FFF
OFF Block 1 (004000-007FFFh) not code-protected
ON Block 1 (004000-007FFFh) code-protected
CP2 Code Protect 008000-00BFFF
OFF Block 2 (008000-00BFFFh) not code-protected
ON Block 2 (008000-00BFFFh) code-protected
Register: CONFIG5H @ 0x300009
CPB Code Protect Boot
OFF Boot block (000000-0007FFh) not code-protected
ON Boot block (000000-0007FFh) code-protected
CPD Data EE Read Protect
OFF Data EEPROM not code-protected
ON Data EEPROM code-protected
Register: CONFIG6L @ 0x30000A
WRT0 Table Write Protect 00800-003FFF
OFF Block 0 (000800-003FFFh) not write-protected
ON Block 0 (000800-003FFFh) write-protected
WRT1 Table Write Protect 004000-007FFF
OFF Block 1 (004000-007FFFh) not write-protected
ON Block 1 (004000-007FFFh) write-protected
WRT2 Table Write Protect 08000-0BFFF
OFF Block 2 (008000-00BFFFh) not write-protected
ON Block 2 (008000-00BFFFh) write-protected
Register: CONFIG6H @ 0x30000B
WRTC Config. Write Protect
OFF Configuration registers (300000-3000FFh) not write-protected
ON Configuration registers (300000-3000FFh) write-protected
WRTB Table Write Protect Boot
OFF Boot block (000000-0007FFh) not write-protected
ON Boot block (000000-0007FFh) write-protected
WRTD Data EE Write Protect
OFF Data EEPROM not write-protected
ON Data EEPROM write-protected
Register: CONFIG7L @ 0x30000C
EBTR0 Table Read Protect 00800-003FFF
OFF Block 0 (000800-003FFFh) not protected from table reads executed in other blocks
ON Block 0 (000800-003FFFh) protected from table reads executed in other blocks
EBTR1 Table Read Protect 004000-07FFF
OFF Block 1 (004000-007FFFh) not protected from table reads executed in other blocks
ON Block 1 (004000-007FFFh) protected from table reads executed in other blocks
EBTR2 Table Read Protect 08000-0BFFF
OFF Block 2 (008000-00BFFFh) not protected from table reads executed in other blocks
ON Block 2 (008000-00BFFFh) protected from table reads executed in other blocks
Register: CONFIG7H @ 0x30000D
EBTRB Table Read Protect Boot
OFF Boot block (000000-0007FFh) not protected from table reads executed in other blocks
ON Boot block (000000-0007FFh) protected from table reads executed in other blocks
Register: IDLOC0 @ 0x200000
Register: IDLOC1 @ 0x200001
Register: IDLOC2 @ 0x200002
Register: IDLOC3 @ 0x200003
Register: IDLOC4 @ 0x200004
Register: IDLOC5 @ 0x200005
Register: IDLOC6 @ 0x200006
Register: IDLOC7 @ 0x200007