16LF747 Support Information

XC8-CC #pragma config Usage

#pragma config <setting>=<named value>
For example:
// Oscillator Selection bits : EXTRC oscillator; CLKO function on OSC2/CLKO/RA6
// Watchdog Timer Enable bit : WDT enabled
// Power-up Timer Enable bit : PWRT disabled
// MCLR/VPP/RE3 Pin Function Select bit : MCLR/VPP/RE3 pin function is MCLR
// Brown-out Reset Enable bit : Enabled
// Brown-out Reset Voltage bits : VBOR set to 2.0V
// In-Circuit Debugger Mode bit : In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
// CCP2 Multiplex bit : CCP2 is on RC1
// Flash Program Memory Code Protection bits : Code protection off
#pragma config FOSC = EXTRCCLK, WDTE = ON, PWRTE = OFF, MCLRE = ON, BOREN = ON, BORV = 20, DEBUG = OFF, CCP2MX = RC1, CP = OFF
#pragma config <setting>=<literal constant>
For example:
// Oscillator Selection bits : EXTRC oscillator; CLKO function on OSC2/CLKO/RA6
// Watchdog Timer Enable bit : WDT enabled
// Power-up Timer Enable bit : PWRT disabled
// MCLR/VPP/RE3 Pin Function Select bit : MCLR/VPP/RE3 pin function is MCLR
// Brown-out Reset Enable bit : Enabled
// Brown-out Reset Voltage bits : VBOR set to 2.0V
// In-Circuit Debugger Mode bit : In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
// CCP2 Multiplex bit : CCP2 is on RC1
// Flash Program Memory Code Protection bits : Code protection off
#pragma config FOSC = 0x13, WDTE = 0x1, PWRTE = 0x1, MCLRE = 0x1, BOREN = 0x1, BORV = 0x3, DEBUG = 0x1, CCP2MX = 0x1, CP = 0x1
#pragma config <register>=<literal constant>
For example:
// Oscillator Selection bits : EXTRC oscillator; CLKO function on OSC2/CLKO/RA6
// Watchdog Timer Enable bit : WDT enabled
// Power-up Timer Enable bit : PWRT disabled
// MCLR/VPP/RE3 Pin Function Select bit : MCLR/VPP/RE3 pin function is MCLR
// Brown-out Reset Enable bit : Enabled
// Brown-out Reset Voltage bits : VBOR set to 2.0V
// In-Circuit Debugger Mode bit : In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
// CCP2 Multiplex bit : CCP2 is on RC1
// Flash Program Memory Code Protection bits : Code protection off
#pragma config CONFIG1 = 0x3FFF
For example:
// IDLOC @ 0x2000
#pragma config IDLOC0 = 0x127

PIC-AS config Usage

config "<setting>"="<named value>"
For example:
; Oscillator Selection bits : EXTRC oscillator; CLKO function on OSC2/CLKO/RA6
; Watchdog Timer Enable bit : WDT enabled
; Power-up Timer Enable bit : PWRT disabled
; MCLR/VPP/RE3 Pin Function Select bit : MCLR/VPP/RE3 pin function is MCLR
; Brown-out Reset Enable bit : Enabled
; Brown-out Reset Voltage bits : VBOR set to 2.0V
; In-Circuit Debugger Mode bit : In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
; CCP2 Multiplex bit : CCP2 is on RC1
; Flash Program Memory Code Protection bits : Code protection off
config "FOSC" = "EXTRCCLK", "WDTE" = "ON", "PWRTE" = "OFF", "MCLRE" = "ON", "BOREN" = "ON", "BORV" = "20", "DEBUG" = "OFF", "CCP2MX" = "RC1", "CP" = "OFF"
config "<setting>"=<literal constant>
For example:
; Oscillator Selection bits : EXTRC oscillator; CLKO function on OSC2/CLKO/RA6
; Watchdog Timer Enable bit : WDT enabled
; Power-up Timer Enable bit : PWRT disabled
; MCLR/VPP/RE3 Pin Function Select bit : MCLR/VPP/RE3 pin function is MCLR
; Brown-out Reset Enable bit : Enabled
; Brown-out Reset Voltage bits : VBOR set to 2.0V
; In-Circuit Debugger Mode bit : In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
; CCP2 Multiplex bit : CCP2 is on RC1
; Flash Program Memory Code Protection bits : Code protection off
config "FOSC" = 0x13, "WDTE" = 0x1, "PWRTE" = 0x1, "MCLRE" = 0x1, "BOREN" = 0x1, "BORV" = 0x3, "DEBUG" = 0x1, "CCP2MX" = 0x1, "CP" = 0x1
config "<register>"=<literal constant>
For example:
; Oscillator Selection bits : EXTRC oscillator; CLKO function on OSC2/CLKO/RA6
; Watchdog Timer Enable bit : WDT enabled
; Power-up Timer Enable bit : PWRT disabled
; MCLR/VPP/RE3 Pin Function Select bit : MCLR/VPP/RE3 pin function is MCLR
; Brown-out Reset Enable bit : Enabled
; Brown-out Reset Voltage bits : VBOR set to 2.0V
; In-Circuit Debugger Mode bit : In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
; CCP2 Multiplex bit : CCP2 is on RC1
; Flash Program Memory Code Protection bits : Code protection off
config "CONFIG1" = 0x3FFF
For example:
; IDLOC @ 0x2000
config "IDLOC0" = 0x127

Configuration Registers & Settings

Register: CONFIG1 @ 0x2007
FOSC Oscillator Selection bits
EXTRCCLK EXTRC oscillator; CLKO function on OSC2/CLKO/RA6
EXTRCIO EXTRC oscillator; port I/O function on OSC2/CLKO/RA6
INTOSCCLK INTRC oscillator; CLKO function on OSC2/CLKO/RA6 and port I/O function on OSC1/CLKI/RA7
INTOSCIO INTRC oscillator; port I/O function on OSC1/CLKI/RA7 and OSC2/CLKO/RA6
EC EXTCLK; port I/O function on OSC2/CLKO/RA6
HS HS oscillator
XT XT oscillator
LP LP oscillator
WDTE Watchdog Timer Enable bit
ON WDT enabled
OFF WDT disabled
PWRTE Power-up Timer Enable bit
OFF PWRT disabled
ON PWRT enabled
MCLRE MCLR/VPP/RE3 Pin Function Select bit
ON MCLR/VPP/RE3 pin function is MCLR
OFF MCLR/VPP/RE3 pin function is digital input only, MCLR gated to '1'
BOREN Brown-out Reset Enable bit
ON Enabled
OFF Disabled
BORV Brown-out Reset Voltage bits
20 VBOR set to 2.0V
27 VBOR set to 2.7V
42 VBOR set to 4.2V
45 VBOR set to 4.5V
DEBUG In-Circuit Debugger Mode bit
OFF In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
ON In-Circuit Debugger enabled, RB6 and RB7 are dedicated to the debugger
CCP2MX CCP2 Multiplex bit
RC1 CCP2 is on RC1
RB3 CCP2 is on RB3
CP Flash Program Memory Code Protection bits
OFF Code protection off
ON 0000h to 0FFFh code-protected
Register: CONFIG2 @ 0x2008
FCMEN Fail-Safe Clock Monitor Enable bit
ON Fail-Safe Clock Monitor enabled
OFF Fail-Safe Clock Monitor disabled
IESO Internal External Switchover bit
ON Internal External Switchover mode enabled
OFF Internal External Switchover mode disabled
BORSEN Brown-out Reset Software Enable bit
ON Enabled
OFF Disabled
Register: IDLOC0 @ 0x2000
Register: IDLOC1 @ 0x2001
Register: IDLOC2 @ 0x2002
Register: IDLOC3 @ 0x2003