16LF627 Support Information

XC8-CC #pragma config Usage

#pragma config <setting>=<named value>
For example:
// Oscillator Selection bits : ER oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, Resistor on RA7/OSC1/CLKIN
// Watchdog Timer Enable bit : WDT enabled
// Power-up Timer Enable bit : PWRT disabled
// RA5/MCLR pin function select : RA5/MCLR pin function is MCLR
// Brown-out Reset Enable bit : BOD Reset enabled
// Low-Voltage Programming Enable bit : RB4/PGM pin has PGM function, low-voltage programming enabled
// Data Code Protection bit : Data memory code protection off
// Code Protection bits : Program memory code protection off
#pragma config FOSC = ERCLK, WDTE = ON, PWRTE = OFF, MCLRE = ON, BOREN = ON, LVP = ON, CPD = OFF, CP = OFF
#pragma config <setting>=<literal constant>
For example:
// Oscillator Selection bits : ER oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, Resistor on RA7/OSC1/CLKIN
// Watchdog Timer Enable bit : WDT enabled
// Power-up Timer Enable bit : PWRT disabled
// RA5/MCLR pin function select : RA5/MCLR pin function is MCLR
// Brown-out Reset Enable bit : BOD Reset enabled
// Low-Voltage Programming Enable bit : RB4/PGM pin has PGM function, low-voltage programming enabled
// Data Code Protection bit : Data memory code protection off
// Code Protection bits : Program memory code protection off
#pragma config FOSC = 0x13, WDTE = 0x1, PWRTE = 0x1, MCLRE = 0x1, BOREN = 0x1, LVP = 0x1, CPD = 0x1, CP = 0xF
#pragma config <register>=<literal constant>
For example:
// Oscillator Selection bits : ER oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, Resistor on RA7/OSC1/CLKIN
// Watchdog Timer Enable bit : WDT enabled
// Power-up Timer Enable bit : PWRT disabled
// RA5/MCLR pin function select : RA5/MCLR pin function is MCLR
// Brown-out Reset Enable bit : BOD Reset enabled
// Low-Voltage Programming Enable bit : RB4/PGM pin has PGM function, low-voltage programming enabled
// Data Code Protection bit : Data memory code protection off
// Code Protection bits : Program memory code protection off
#pragma config CONFIG = 0x3FFF
For example:
// IDLOC @ 0x2000
#pragma config IDLOC0 = 0x127

PIC-AS config Usage

config "<setting>"="<named value>"
For example:
; Oscillator Selection bits : ER oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, Resistor on RA7/OSC1/CLKIN
; Watchdog Timer Enable bit : WDT enabled
; Power-up Timer Enable bit : PWRT disabled
; RA5/MCLR pin function select : RA5/MCLR pin function is MCLR
; Brown-out Reset Enable bit : BOD Reset enabled
; Low-Voltage Programming Enable bit : RB4/PGM pin has PGM function, low-voltage programming enabled
; Data Code Protection bit : Data memory code protection off
; Code Protection bits : Program memory code protection off
config "FOSC" = "ERCLK", "WDTE" = "ON", "PWRTE" = "OFF", "MCLRE" = "ON", "BOREN" = "ON", "LVP" = "ON", "CPD" = "OFF", "CP" = "OFF"
config "<setting>"=<literal constant>
For example:
; Oscillator Selection bits : ER oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, Resistor on RA7/OSC1/CLKIN
; Watchdog Timer Enable bit : WDT enabled
; Power-up Timer Enable bit : PWRT disabled
; RA5/MCLR pin function select : RA5/MCLR pin function is MCLR
; Brown-out Reset Enable bit : BOD Reset enabled
; Low-Voltage Programming Enable bit : RB4/PGM pin has PGM function, low-voltage programming enabled
; Data Code Protection bit : Data memory code protection off
; Code Protection bits : Program memory code protection off
config "FOSC" = 0x13, "WDTE" = 0x1, "PWRTE" = 0x1, "MCLRE" = 0x1, "BOREN" = 0x1, "LVP" = 0x1, "CPD" = 0x1, "CP" = 0xF
config "<register>"=<literal constant>
For example:
; Oscillator Selection bits : ER oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, Resistor on RA7/OSC1/CLKIN
; Watchdog Timer Enable bit : WDT enabled
; Power-up Timer Enable bit : PWRT disabled
; RA5/MCLR pin function select : RA5/MCLR pin function is MCLR
; Brown-out Reset Enable bit : BOD Reset enabled
; Low-Voltage Programming Enable bit : RB4/PGM pin has PGM function, low-voltage programming enabled
; Data Code Protection bit : Data memory code protection off
; Code Protection bits : Program memory code protection off
config "CONFIG" = 0x3FFF
For example:
; IDLOC @ 0x2000
config "IDLOC0" = 0x127

Configuration Registers & Settings

Register: CONFIG @ 0x2007
FOSC Oscillator Selection bits
ERCLK ER oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, Resistor on RA7/OSC1/CLKIN
ERIO ER oscillator: I/O function on RA6/OSC2/CLKOUT pin, Resistor on RA7/OSC1/CLKIN
INTOSCCLK INTRC oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN
INTOSCIO INTRC oscillator: I/O function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN
ECIO EC: I/O function on RA6/OSC2/CLKOUT pin, CLKIN on RA7/OSC1/CLKIN
HS HS oscillator: High-speed crystal/resonator on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN
XT XT oscillator: Crystal/resonator on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN
LP LP oscillator: Low-power crystal on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN
WDTE Watchdog Timer Enable bit
ON WDT enabled
OFF WDT disabled
PWRTE Power-up Timer Enable bit
OFF PWRT disabled
ON PWRT enabled
MCLRE RA5/MCLR pin function select
ON RA5/MCLR pin function is MCLR
OFF RA5/MCLR pin function is digital input, MCLR internally tied to VDD
BOREN Brown-out Reset Enable bit
ON BOD Reset enabled
OFF BOD Reset disabled
LVP Low-Voltage Programming Enable bit
ON RB4/PGM pin has PGM function, low-voltage programming enabled
OFF RB4/PGM pin has digital I/O function, HV on MCLR must be used for programming
CPD Data Code Protection bit
OFF Data memory code protection off
ON Data memory code protected
CP Code Protection bits
OFF Program memory code protection off
50 Program memory code protection off
75 0200h-03FFh code protected
ALL 0000h-03FFh code protected
Register: IDLOC0 @ 0x2000
Register: IDLOC1 @ 0x2001
Register: IDLOC2 @ 0x2002
Register: IDLOC3 @ 0x2003