16F506 Support Information

XC8-CC #pragma config Usage

#pragma config <setting>=<named value>
For example:
// Oscillator Selection bits : EXTRC With CLKOUT and 1.125 ms DRT
// Watchdog Timer Enable bit : WDT enabled
// Code Protect : Code protection off
// Master Clear Enable bit : RB3/MCLR pin functions as MCLR
// Internal Oscillator Frequency Select bit : 8 MHz INTOSC Speed
#pragma config OSC = ExtRC_CLKOUTEN, WDT = ON, CP = OFF, MCLRE = ON, IOSCFS = ON
#pragma config <setting>=<literal constant>
For example:
// Oscillator Selection bits : EXTRC With CLKOUT and 1.125 ms DRT
// Watchdog Timer Enable bit : WDT enabled
// Code Protect : Code protection off
// Master Clear Enable bit : RB3/MCLR pin functions as MCLR
// Internal Oscillator Frequency Select bit : 8 MHz INTOSC Speed
#pragma config OSC = 0x7, WDT = 0x1, CP = 0x1, MCLRE = 0x1, IOSCFS = 0x1
#pragma config <register>=<literal constant>
For example:
// Oscillator Selection bits : EXTRC With CLKOUT and 1.125 ms DRT
// Watchdog Timer Enable bit : WDT enabled
// Code Protect : Code protection off
// Master Clear Enable bit : RB3/MCLR pin functions as MCLR
// Internal Oscillator Frequency Select bit : 8 MHz INTOSC Speed
#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 : EXTRC With CLKOUT and 1.125 ms DRT
; Watchdog Timer Enable bit : WDT enabled
; Code Protect : Code protection off
; Master Clear Enable bit : RB3/MCLR pin functions as MCLR
; Internal Oscillator Frequency Select bit : 8 MHz INTOSC Speed
config "OSC" = "ExtRC_CLKOUTEN", "WDT" = "ON", "CP" = "OFF", "MCLRE" = "ON", "IOSCFS" = "ON"
config "<setting>"=<literal constant>
For example:
; Oscillator Selection bits : EXTRC With CLKOUT and 1.125 ms DRT
; Watchdog Timer Enable bit : WDT enabled
; Code Protect : Code protection off
; Master Clear Enable bit : RB3/MCLR pin functions as MCLR
; Internal Oscillator Frequency Select bit : 8 MHz INTOSC Speed
config "OSC" = 0x7, "WDT" = 0x1, "CP" = 0x1, "MCLRE" = 0x1, "IOSCFS" = 0x1
config "<register>"=<literal constant>
For example:
; Oscillator Selection bits : EXTRC With CLKOUT and 1.125 ms DRT
; Watchdog Timer Enable bit : WDT enabled
; Code Protect : Code protection off
; Master Clear Enable bit : RB3/MCLR pin functions as MCLR
; Internal Oscillator Frequency Select bit : 8 MHz INTOSC Speed
config "CONFIG" = 0xFFF
For example:
; IDLOC @ 0x400
config "IDLOC0" = 0x4095

Configuration Registers & Settings

Register: CONFIG @ 0xFFF
OSC Oscillator Selection bits
LP LP oscillator and 18 ms DRT
XT XT oscillator and 18 ms DRT
HS HS oscillator and 18 ms DRT
EC EC Osc With RB4 and 1.125 ms DRT
IntRC_RB4EN INTRC With RB4 and 1.125 ms DRT
IntRC_CLKOUTEN INTRC With CLKOUT and 1.125 ms DRT
ExtRC_RB4EN EXTRC With RB4 and 1.125 ms DRT
ExtRC_CLKOUTEN EXTRC With CLKOUT and 1.125 ms DRT
WDT Watchdog Timer Enable bit
ON WDT enabled
OFF WDT disabled
CP Code Protect
OFF Code protection off
ON Code protection on
MCLRE Master Clear Enable bit
ON RB3/MCLR pin functions as MCLR
OFF RB3/MCLR pin functions as RB3, MCLR tied internally to VDD
IOSCFS Internal Oscillator Frequency Select bit
ON 8 MHz INTOSC Speed
OFF 4 MHz INTOSC Speed
Register: IDLOC0 @ 0x400
Register: IDLOC1 @ 0x401
Register: IDLOC2 @ 0x402
Register: IDLOC3 @ 0x403