16LF873A Support Information

XC8-CC #pragma config Usage

#pragma config <setting>=<named value>
For example:
// Oscillator Selection bits : RC oscillator
// Watchdog Timer Enable bit : WDT enabled
// Power-up Timer Enable bit : PWRT disabled
// Brown-out Reset Enable bit : BOR enabled
// Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit : RB3/PGM pin has PGM function; low-voltage programming enabled
// Data EEPROM Memory Code Protection bit : Data EEPROM code protection off
// Flash Program Memory Write Enable bits : Write protection off; all program memory may be written to by EECON control
// In-Circuit Debugger Mode bit : In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
// Flash Program Memory Code Protection bit : Code protection off
#pragma config FOSC = EXTRC, WDTE = ON, PWRTE = OFF, BOREN = ON, LVP = ON, CPD = OFF, WRT = OFF, DEBUG = OFF, CP = OFF
#pragma config <setting>=<literal constant>
For example:
// Oscillator Selection bits : RC oscillator
// Watchdog Timer Enable bit : WDT enabled
// Power-up Timer Enable bit : PWRT disabled
// Brown-out Reset Enable bit : BOR enabled
// Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit : RB3/PGM pin has PGM function; low-voltage programming enabled
// Data EEPROM Memory Code Protection bit : Data EEPROM code protection off
// Flash Program Memory Write Enable bits : Write protection off; all program memory may be written to by EECON control
// In-Circuit Debugger Mode bit : In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
// Flash Program Memory Code Protection bit : Code protection off
#pragma config FOSC = 0x3, WDTE = 0x1, PWRTE = 0x1, BOREN = 0x1, LVP = 0x1, CPD = 0x1, WRT = 0x3, DEBUG = 0x1, CP = 0x1
#pragma config <register>=<literal constant>
For example:
// Oscillator Selection bits : RC oscillator
// Watchdog Timer Enable bit : WDT enabled
// Power-up Timer Enable bit : PWRT disabled
// Brown-out Reset Enable bit : BOR enabled
// Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit : RB3/PGM pin has PGM function; low-voltage programming enabled
// Data EEPROM Memory Code Protection bit : Data EEPROM code protection off
// Flash Program Memory Write Enable bits : Write protection off; all program memory may be written to by EECON control
// In-Circuit Debugger Mode bit : In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
// Flash Program Memory Code Protection bit : 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 : RC oscillator
; Watchdog Timer Enable bit : WDT enabled
; Power-up Timer Enable bit : PWRT disabled
; Brown-out Reset Enable bit : BOR enabled
; Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit : RB3/PGM pin has PGM function; low-voltage programming enabled
; Data EEPROM Memory Code Protection bit : Data EEPROM code protection off
; Flash Program Memory Write Enable bits : Write protection off; all program memory may be written to by EECON control
; In-Circuit Debugger Mode bit : In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
; Flash Program Memory Code Protection bit : Code protection off
config "FOSC" = "EXTRC", "WDTE" = "ON", "PWRTE" = "OFF", "BOREN" = "ON", "LVP" = "ON", "CPD" = "OFF", "WRT" = "OFF", "DEBUG" = "OFF", "CP" = "OFF"
config "<setting>"=<literal constant>
For example:
; Oscillator Selection bits : RC oscillator
; Watchdog Timer Enable bit : WDT enabled
; Power-up Timer Enable bit : PWRT disabled
; Brown-out Reset Enable bit : BOR enabled
; Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit : RB3/PGM pin has PGM function; low-voltage programming enabled
; Data EEPROM Memory Code Protection bit : Data EEPROM code protection off
; Flash Program Memory Write Enable bits : Write protection off; all program memory may be written to by EECON control
; In-Circuit Debugger Mode bit : In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
; Flash Program Memory Code Protection bit : Code protection off
config "FOSC" = 0x3, "WDTE" = 0x1, "PWRTE" = 0x1, "BOREN" = 0x1, "LVP" = 0x1, "CPD" = 0x1, "WRT" = 0x3, "DEBUG" = 0x1, "CP" = 0x1
config "<register>"=<literal constant>
For example:
; Oscillator Selection bits : RC oscillator
; Watchdog Timer Enable bit : WDT enabled
; Power-up Timer Enable bit : PWRT disabled
; Brown-out Reset Enable bit : BOR enabled
; Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit : RB3/PGM pin has PGM function; low-voltage programming enabled
; Data EEPROM Memory Code Protection bit : Data EEPROM code protection off
; Flash Program Memory Write Enable bits : Write protection off; all program memory may be written to by EECON control
; In-Circuit Debugger Mode bit : In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
; Flash Program Memory Code Protection bit : Code protection off
config "CONFIG" = 0x3FFF
For example:
; IDLOC @ 0x2000
config "IDLOC0" = 0x127

Configuration Registers & Settings

Register: CONFIG @ 0x2007
FOSC Oscillator Selection bits
EXTRC RC oscillator
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
BOREN Brown-out Reset Enable bit
ON BOR enabled
OFF BOR disabled
LVP Low-Voltage (Single-Supply) In-Circuit Serial 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 EEPROM Memory Code Protection bit
OFF Data EEPROM code protection off
ON Data EEPROM code-protected
WRT Flash Program Memory Write Enable bits
OFF Write protection off; all program memory may be written to by EECON control
256 0000h to 00FFh write-protected; 0100h to 0FFFh may be written to by EECON control
1FOURTH 0000h to 03FFh write-protected; 0400h to 0FFFh may be written to by EECON control
HALF 0000h to 07FFh write-protected; 0800h to 0FFFh may be written to by EECON control
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
CP Flash Program Memory Code Protection bit
OFF Code protection off
ON All program memory code-protected
Register: IDLOC0 @ 0x2000
Register: IDLOC1 @ 0x2001
Register: IDLOC2 @ 0x2002
Register: IDLOC3 @ 0x2003