16C505 Support Information

XC8-CC #pragma config Usage

#pragma config <setting>=<named value>
For example:
// Oscillator selection bits : External RC Clockout
// Watchdog timer enable bit : WDT enabled
// Code protection bit : Code protection off
// Master Clear Enable : RB3/MCLR pin function is MCLR
#pragma config OSC = ExtRC_CLKOUTEN, WDT = ON, CP = OFF, MCLRE = ON
#pragma config <setting>=<literal constant>
For example:
// Oscillator selection bits : External RC Clockout
// Watchdog timer enable bit : WDT enabled
// Code protection bit : Code protection off
// Master Clear Enable : RB3/MCLR pin function is MCLR
#pragma config OSC = 0x7, WDT = 0x1, CP = 0xFD, MCLRE = 0x1
#pragma config <register>=<literal constant>
For example:
// Oscillator selection bits : External RC Clockout
// Watchdog timer enable bit : WDT enabled
// Code protection bit : Code protection off
// Master Clear Enable : RB3/MCLR pin function is MCLR
#pragma config CONFIG = 0xFFF
For example:
// IDLOC @ 0x400
#pragma config IDLOC0 = 0x4095

PIC-AS config Usage

config "<setting>"="<named value>"
For example:
; Oscillator selection bits : External RC Clockout
; Watchdog timer enable bit : WDT enabled
; Code protection bit : Code protection off
; Master Clear Enable : RB3/MCLR pin function is MCLR
config "OSC" = "ExtRC_CLKOUTEN", "WDT" = "ON", "CP" = "OFF", "MCLRE" = "ON"
config "<setting>"=<literal constant>
For example:
; Oscillator selection bits : External RC Clockout
; Watchdog timer enable bit : WDT enabled
; Code protection bit : Code protection off
; Master Clear Enable : RB3/MCLR pin function is MCLR
config "OSC" = 0x7, "WDT" = 0x1, "CP" = 0xFD, "MCLRE" = 0x1
config "<register>"=<literal constant>
For example:
; Oscillator selection bits : External RC Clockout
; Watchdog timer enable bit : WDT enabled
; Code protection bit : Code protection off
; Master Clear Enable : RB3/MCLR pin function is MCLR
config "CONFIG" = 0xFFF
For example:
; IDLOC @ 0x400
config "IDLOC0" = 0x4095

Configuration Registers & Settings

Register: CONFIG @ 0xFFF
OSC Oscillator selection bits
ExtRC_CLKOUTEN External RC Clockout
ExtRC_RB4EN External RC No Clock
IntRC_CLKOUTEN Internal RC Clockout
IntRC_RB4EN Internal RC No Clock
HS HS oscillator
XT XT oscillator
LP LP oscillator
WDT Watchdog timer enable bit
ON WDT enabled
OFF WDT disabled
CP Code protection bit
OFF Code protection off
ON Code protection on
MCLRE Master Clear Enable
ON RB3/MCLR pin function is MCLR
OFF RB3/MCLR pin function is digital I/O, MCLR internally tied to VDD
Register: IDLOC0 @ 0x400
Register: IDLOC1 @ 0x401
Register: IDLOC2 @ 0x402
Register: IDLOC3 @ 0x403