16F876 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
// FLASH Program Memory Code Protection bits : Code protection off
// Brown-out Reset Enable bit : BOR enabled
// Low Voltage In-Circuit Serial Programming Enable bit : RB3/PGM pin has PGM function; low-voltage programming enabled
// Data EE Memory Code Protection : Code Protection off
// FLASH Program Memory Write Enable : Unprotected 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
#pragma config FOSC = EXTRC, WDTE = ON, PWRTE = OFF, CP = OFF, BOREN = ON, LVP = ON, CPD = OFF, WRT = ON, DEBUG = 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
// FLASH Program Memory Code Protection bits : Code protection off
// Brown-out Reset Enable bit : BOR enabled
// Low Voltage In-Circuit Serial Programming Enable bit : RB3/PGM pin has PGM function; low-voltage programming enabled
// Data EE Memory Code Protection : Code Protection off
// FLASH Program Memory Write Enable : Unprotected 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
#pragma config FOSC = 0x3, WDTE = 0x1, PWRTE = 0x1, CP = 0x303, BOREN = 0x1, LVP = 0x1, CPD = 0x1, WRT = 0x1, DEBUG = 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
// FLASH Program Memory Code Protection bits : Code protection off
// Brown-out Reset Enable bit : BOR enabled
// Low Voltage In-Circuit Serial Programming Enable bit : RB3/PGM pin has PGM function; low-voltage programming enabled
// Data EE Memory Code Protection : Code Protection off
// FLASH Program Memory Write Enable : Unprotected 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
#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
; FLASH Program Memory Code Protection bits : Code protection off
; Brown-out Reset Enable bit : BOR enabled
; Low Voltage In-Circuit Serial Programming Enable bit : RB3/PGM pin has PGM function; low-voltage programming enabled
; Data EE Memory Code Protection : Code Protection off
; FLASH Program Memory Write Enable : Unprotected 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
config "FOSC" = "EXTRC", "WDTE" = "ON", "PWRTE" = "OFF", "CP" = "OFF", "BOREN" = "ON", "LVP" = "ON", "CPD" = "OFF", "WRT" = "ON", "DEBUG" = "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
; FLASH Program Memory Code Protection bits : Code protection off
; Brown-out Reset Enable bit : BOR enabled
; Low Voltage In-Circuit Serial Programming Enable bit : RB3/PGM pin has PGM function; low-voltage programming enabled
; Data EE Memory Code Protection : Code Protection off
; FLASH Program Memory Write Enable : Unprotected 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
config "FOSC" = 0x3, "WDTE" = 0x1, "PWRTE" = 0x1, "CP" = 0x303, "BOREN" = 0x1, "LVP" = 0x1, "CPD" = 0x1, "WRT" = 0x1, "DEBUG" = 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
; FLASH Program Memory Code Protection bits : Code protection off
; Brown-out Reset Enable bit : BOR enabled
; Low Voltage In-Circuit Serial Programming Enable bit : RB3/PGM pin has PGM function; low-voltage programming enabled
; Data EE Memory Code Protection : Code Protection off
; FLASH Program Memory Write Enable : Unprotected 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
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
CP FLASH Program Memory Code Protection bits
OFF Code protection off
UPPER_256 1F00h to 1FFFh code protected
HALF 1000h to 1FFFh code protected
ALL 0000h to 1FFFh code protected
BOREN Brown-out Reset Enable bit
ON BOR enabled
OFF BOR disabled
LVP Low Voltage 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 EE Memory Code Protection
OFF Code Protection off
ON Data EEPROM memory code-protected
WRT FLASH Program Memory Write Enable
ON Unprotected program memory may be written to by EECON control
OFF Unprotected program memory may not 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
Register: IDLOC0 @ 0x2000
Register: IDLOC1 @ 0x2001
Register: IDLOC2 @ 0x2002
Register: IDLOC3 @ 0x2003