16LF87 Support Information

XC8-CC #pragma config Usage

#pragma config <setting>=<named value>
For example:
// Oscillator Selection bits : EXTRC oscillator; CLKO function on RA6/OSC2/CLKO
// Watchdog Timer Enable bit : WDT enabled
// Power-up Timer Enable bit : PWRT disabled
// RA5/MCLR/VPP Pin Function Select bit : RA5/MCLR/VPP pin function is MCLR
// Brown-out Reset Enable bit : BOR enabled
// Low-Voltage Programming Enable bit : RB3/PGM pin has PGM function, Low-Voltage Programming enabled
// Data EE Memory Code Protection bit : Code protection off
// Flash Program Memory Write Enable bits : Write protection off
// In-Circuit Debugger Mode bit : In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
// CCP1 Pin Selection bit : CCP1 function on RB0
// Flash Program Memory Code Protection bit : Code protection off
#pragma config FOSC = EXTRCCLK, WDTE = ON, PWRTE = OFF, MCLRE = ON, BOREN = ON, LVP = ON, CPD = OFF, WRT = OFF, DEBUG = OFF, CCPMX = RB0, CP = OFF
#pragma config <setting>=<literal constant>
For example:
// Oscillator Selection bits : EXTRC oscillator; CLKO function on RA6/OSC2/CLKO
// Watchdog Timer Enable bit : WDT enabled
// Power-up Timer Enable bit : PWRT disabled
// RA5/MCLR/VPP Pin Function Select bit : RA5/MCLR/VPP pin function is MCLR
// Brown-out Reset Enable bit : BOR enabled
// Low-Voltage Programming Enable bit : RB3/PGM pin has PGM function, Low-Voltage Programming enabled
// Data EE Memory Code Protection bit : Code protection off
// Flash Program Memory Write Enable bits : Write protection off
// In-Circuit Debugger Mode bit : In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
// CCP1 Pin Selection bit : CCP1 function on RB0
// Flash Program Memory Code Protection bit : Code protection off
#pragma config FOSC = 0x13, WDTE = 0x1, PWRTE = 0x1, MCLRE = 0x1, BOREN = 0x1, LVP = 0x1, CPD = 0x1, WRT = 0x3, DEBUG = 0x1, CCPMX = 0x1, CP = 0x1
#pragma config <register>=<literal constant>
For example:
// Oscillator Selection bits : EXTRC oscillator; CLKO function on RA6/OSC2/CLKO
// Watchdog Timer Enable bit : WDT enabled
// Power-up Timer Enable bit : PWRT disabled
// RA5/MCLR/VPP Pin Function Select bit : RA5/MCLR/VPP pin function is MCLR
// Brown-out Reset Enable bit : BOR enabled
// Low-Voltage Programming Enable bit : RB3/PGM pin has PGM function, Low-Voltage Programming enabled
// Data EE Memory Code Protection bit : Code protection off
// Flash Program Memory Write Enable bits : Write protection off
// In-Circuit Debugger Mode bit : In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
// CCP1 Pin Selection bit : CCP1 function on RB0
// Flash Program Memory Code Protection bit : 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 RA6/OSC2/CLKO
; Watchdog Timer Enable bit : WDT enabled
; Power-up Timer Enable bit : PWRT disabled
; RA5/MCLR/VPP Pin Function Select bit : RA5/MCLR/VPP pin function is MCLR
; Brown-out Reset Enable bit : BOR enabled
; Low-Voltage Programming Enable bit : RB3/PGM pin has PGM function, Low-Voltage Programming enabled
; Data EE Memory Code Protection bit : Code protection off
; Flash Program Memory Write Enable bits : Write protection off
; In-Circuit Debugger Mode bit : In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
; CCP1 Pin Selection bit : CCP1 function on RB0
; Flash Program Memory Code Protection bit : Code protection off
config "FOSC" = "EXTRCCLK", "WDTE" = "ON", "PWRTE" = "OFF", "MCLRE" = "ON", "BOREN" = "ON", "LVP" = "ON", "CPD" = "OFF", "WRT" = "OFF", "DEBUG" = "OFF", "CCPMX" = "RB0", "CP" = "OFF"
config "<setting>"=<literal constant>
For example:
; Oscillator Selection bits : EXTRC oscillator; CLKO function on RA6/OSC2/CLKO
; Watchdog Timer Enable bit : WDT enabled
; Power-up Timer Enable bit : PWRT disabled
; RA5/MCLR/VPP Pin Function Select bit : RA5/MCLR/VPP pin function is MCLR
; Brown-out Reset Enable bit : BOR enabled
; Low-Voltage Programming Enable bit : RB3/PGM pin has PGM function, Low-Voltage Programming enabled
; Data EE Memory Code Protection bit : Code protection off
; Flash Program Memory Write Enable bits : Write protection off
; In-Circuit Debugger Mode bit : In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
; CCP1 Pin Selection bit : CCP1 function on RB0
; Flash Program Memory Code Protection bit : Code protection off
config "FOSC" = 0x13, "WDTE" = 0x1, "PWRTE" = 0x1, "MCLRE" = 0x1, "BOREN" = 0x1, "LVP" = 0x1, "CPD" = 0x1, "WRT" = 0x3, "DEBUG" = 0x1, "CCPMX" = 0x1, "CP" = 0x1
config "<register>"=<literal constant>
For example:
; Oscillator Selection bits : EXTRC oscillator; CLKO function on RA6/OSC2/CLKO
; Watchdog Timer Enable bit : WDT enabled
; Power-up Timer Enable bit : PWRT disabled
; RA5/MCLR/VPP Pin Function Select bit : RA5/MCLR/VPP pin function is MCLR
; Brown-out Reset Enable bit : BOR enabled
; Low-Voltage Programming Enable bit : RB3/PGM pin has PGM function, Low-Voltage Programming enabled
; Data EE Memory Code Protection bit : Code protection off
; Flash Program Memory Write Enable bits : Write protection off
; In-Circuit Debugger Mode bit : In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
; CCP1 Pin Selection bit : CCP1 function on RB0
; Flash Program Memory Code Protection bit : 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 RA6/OSC2/CLKO
EXTRCIO EXTRC oscillator; port I/O function on RA6/OSC2/CLKO
INTOSCCLK INTRC oscillator; CLKO function on RA6/OSC2/CLKO pin and port I/O function on RA7/OSC1/CLKI pin
INTOSCIO INTRC oscillator; port I/O function on both RA6/OSC2/CLKO pin and RA7/OSC1/CLKI pin
EC ECIO; port I/O function on RA6/OSC2/CLKO
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 RA5/MCLR/VPP Pin Function Select bit
ON RA5/MCLR/VPP pin function is MCLR
OFF RA5/MCLR/VPP pin function is digital I/O, MCLR internally tied to VDD
BOREN Brown-out Reset Enable bit
ON BOR enabled
OFF BOR disabled
LVP Low-Voltage Programming Enable bit
ON RB3/PGM pin has PGM function, Low-Voltage Programming enabled
OFF RB3 is digital I/O, HV on MCLR must be used for programming
CPD Data EE Memory Code Protection bit
OFF Code protection off
ON Data EE memory code-protected
WRT Flash Program Memory Write Enable bits
OFF Write protection off
256 0000h to 00FFh write-protected, 0100h to 0FFFh may be modified by EECON control
2048 0000h to 07FFh write-protected, 0800h to 0FFFh may be modified by EECON control
ALL 0000h to 0FFFh write-protected
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
CCPMX CCP1 Pin Selection bit
RB0 CCP1 function on RB0
RB3 CCP1 function on RB3
CP Flash Program Memory Code Protection bit
OFF Code protection off
ON 0000h to 0FFFh code-protected (all 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
Register: IDLOC0 @ 0x2000
Register: IDLOC1 @ 0x2001
Register: IDLOC2 @ 0x2002
Register: IDLOC3 @ 0x2003