16F526 Support Information

XC8-CC #pragma config Usage

#pragma config <setting>=<named value>
For example:
// Oscillator : EXTRC with CLKOUT function on RB4/OSC2/CLKOUT and 1 ms DRT
// Watchdog Timer Enable bit : Enabled
// Code Protection bit : Code protection off
// Master Clear Enable bit : RB3/MCLR functions as MCLR
// Internal Oscillator Frequency Select : 8 MHz INTOSC Speed
// Code Protection bit - Flash Data Memory : Code protection off
#pragma config FOSC = ExtRC_CLKOUT, WDTE = ON, CP = OFF, MCLRE = ON, IOSCFS = 8MHz, CPDF = OFF
#pragma config <setting>=<literal constant>
For example:
// Oscillator : EXTRC with CLKOUT function on RB4/OSC2/CLKOUT and 1 ms DRT
// Watchdog Timer Enable bit : Enabled
// Code Protection bit : Code protection off
// Master Clear Enable bit : RB3/MCLR functions as MCLR
// Internal Oscillator Frequency Select : 8 MHz INTOSC Speed
// Code Protection bit - Flash Data Memory : Code protection off
#pragma config FOSC = 0x7, WDTE = 0x1, CP = 0x1, MCLRE = 0x1, IOSCFS = 0x1, CPDF = 0x1
#pragma config <register>=<literal constant>
For example:
// Oscillator : EXTRC with CLKOUT function on RB4/OSC2/CLKOUT and 1 ms DRT
// Watchdog Timer Enable bit : Enabled
// Code Protection bit : Code protection off
// Master Clear Enable bit : RB3/MCLR functions as MCLR
// Internal Oscillator Frequency Select : 8 MHz INTOSC Speed
// Code Protection bit - Flash Data Memory : Code protection off
#pragma config CONFIG = 0xFF
For example:
// IDLOC @ 0x440
#pragma config IDLOC0 = 0x4095

PIC-AS config Usage

config "<setting>"="<named value>"
For example:
; Oscillator : EXTRC with CLKOUT function on RB4/OSC2/CLKOUT and 1 ms DRT
; Watchdog Timer Enable bit : Enabled
; Code Protection bit : Code protection off
; Master Clear Enable bit : RB3/MCLR functions as MCLR
; Internal Oscillator Frequency Select : 8 MHz INTOSC Speed
; Code Protection bit - Flash Data Memory : Code protection off
config "FOSC" = "ExtRC_CLKOUT", "WDTE" = "ON", "CP" = "OFF", "MCLRE" = "ON", "IOSCFS" = "8MHz", "CPDF" = "OFF"
config "<setting>"=<literal constant>
For example:
; Oscillator : EXTRC with CLKOUT function on RB4/OSC2/CLKOUT and 1 ms DRT
; Watchdog Timer Enable bit : Enabled
; Code Protection bit : Code protection off
; Master Clear Enable bit : RB3/MCLR functions as MCLR
; Internal Oscillator Frequency Select : 8 MHz INTOSC Speed
; Code Protection bit - Flash Data Memory : Code protection off
config "FOSC" = 0x7, "WDTE" = 0x1, "CP" = 0x1, "MCLRE" = 0x1, "IOSCFS" = 0x1, "CPDF" = 0x1
config "<register>"=<literal constant>
For example:
; Oscillator : EXTRC with CLKOUT function on RB4/OSC2/CLKOUT and 1 ms DRT
; Watchdog Timer Enable bit : Enabled
; Code Protection bit : Code protection off
; Master Clear Enable bit : RB3/MCLR functions as MCLR
; Internal Oscillator Frequency Select : 8 MHz INTOSC Speed
; Code Protection bit - Flash Data Memory : Code protection off
config "CONFIG" = 0xFF
For example:
; IDLOC @ 0x440
config "IDLOC0" = 0x4095

Configuration Registers & Settings

Register: CONFIG @ 0xFFF
FOSC Oscillator
LP LP oscillator and 18 ms DRT
XT XT oscillator and 18 ms DRT
HS HS oscillator and 18 ms DRT
EC EC oscillator with RB4 function on RB4/OSC2/CLKOUT and 1 ms DRT
INTRC_RB4 INTRC with RB4 function on RB4/OSC2/CLKOUT and 1 ms DRT
INTRC_CLKOUT INTRC with CLKOUT function on RB4/OSC2/CLKOUT and 1 ms DRT
ExtRC_RB4 EXTRC with RB4 function on RB4/OSC2/CLKOUT and 1 ms DRT
ExtRC_CLKOUT EXTRC with CLKOUT function on RB4/OSC2/CLKOUT and 1 ms DRT
WDTE Watchdog Timer Enable bit
ON Enabled
OFF Disabled
CP Code Protection bit
OFF Code protection off
ON Code protection on
MCLRE Master Clear Enable bit
ON RB3/MCLR functions as MCLR
OFF RB3/MCLR functions as RB3, MCLR internally tied to Vdd
IOSCFS Internal Oscillator Frequency Select
8MHz 8 MHz INTOSC Speed
4MHz 4 MHz INTOSC Speed
CPDF Code Protection bit - Flash Data Memory
OFF Code protection off
ON Code protection on
Register: IDLOC0 @ 0x440
Register: IDLOC1 @ 0x441
Register: IDLOC2 @ 0x442
Register: IDLOC3 @ 0x443