16F913 Support Information

XC8-CC #pragma config Usage

#pragma config <setting>=<named value>
For example:
// Oscillator Selection bits : RC oscillator: CLKOUT function on RA6/OSC2/CLKOUT/T1OSO pin, RC on RA7/OSC1/CLKIN/T1OSI
// Watchdog Timer Enable bit : WDT enabled
// Power Up Timer Enable bit : PWRT disabled
// RE3/MCLR pin function select bit : RE3/MCLR pin function is MCLR
// Code Protection bit : Program memory code protection is disabled
// Data Code Protection bit : Data memory code protection is disabled
// Brown-out Reset Selection bits : BOR enabled
// Internal External Switchover bit : Internal/External Switchover mode is enabled
// Fail-Safe Clock Monitor Enabled bit : Fail-Safe Clock Monitor is enabled
// In-Circuit Debugger Mode bit : In-Circuit Debugger disabled, RB6/ISCPCLK and RB7/ICSPDAT are general purpose I/O pins
#pragma config FOSC = EXTRCCLK, WDTE = ON, PWRTE = OFF, MCLRE = ON, CP = OFF, CPD = OFF, BOREN = ON, IESO = ON, FCMEN = ON, DEBUG = OFF
#pragma config <setting>=<literal constant>
For example:
// Oscillator Selection bits : RC oscillator: CLKOUT function on RA6/OSC2/CLKOUT/T1OSO pin, RC on RA7/OSC1/CLKIN/T1OSI
// Watchdog Timer Enable bit : WDT enabled
// Power Up Timer Enable bit : PWRT disabled
// RE3/MCLR pin function select bit : RE3/MCLR pin function is MCLR
// Code Protection bit : Program memory code protection is disabled
// Data Code Protection bit : Data memory code protection is disabled
// Brown-out Reset Selection bits : BOR enabled
// Internal External Switchover bit : Internal/External Switchover mode is enabled
// Fail-Safe Clock Monitor Enabled bit : Fail-Safe Clock Monitor is enabled
// In-Circuit Debugger Mode bit : In-Circuit Debugger disabled, RB6/ISCPCLK and RB7/ICSPDAT are general purpose I/O pins
#pragma config FOSC = 0x7, WDTE = 0x1, PWRTE = 0x1, MCLRE = 0x1, CP = 0x1, CPD = 0x1, BOREN = 0x3, IESO = 0x1, FCMEN = 0x1, DEBUG = 0x1
#pragma config <register>=<literal constant>
For example:
// Oscillator Selection bits : RC oscillator: CLKOUT function on RA6/OSC2/CLKOUT/T1OSO pin, RC on RA7/OSC1/CLKIN/T1OSI
// Watchdog Timer Enable bit : WDT enabled
// Power Up Timer Enable bit : PWRT disabled
// RE3/MCLR pin function select bit : RE3/MCLR pin function is MCLR
// Code Protection bit : Program memory code protection is disabled
// Data Code Protection bit : Data memory code protection is disabled
// Brown-out Reset Selection bits : BOR enabled
// Internal External Switchover bit : Internal/External Switchover mode is enabled
// Fail-Safe Clock Monitor Enabled bit : Fail-Safe Clock Monitor is enabled
// In-Circuit Debugger Mode bit : In-Circuit Debugger disabled, RB6/ISCPCLK and RB7/ICSPDAT 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: CLKOUT function on RA6/OSC2/CLKOUT/T1OSO pin, RC on RA7/OSC1/CLKIN/T1OSI
; Watchdog Timer Enable bit : WDT enabled
; Power Up Timer Enable bit : PWRT disabled
; RE3/MCLR pin function select bit : RE3/MCLR pin function is MCLR
; Code Protection bit : Program memory code protection is disabled
; Data Code Protection bit : Data memory code protection is disabled
; Brown-out Reset Selection bits : BOR enabled
; Internal External Switchover bit : Internal/External Switchover mode is enabled
; Fail-Safe Clock Monitor Enabled bit : Fail-Safe Clock Monitor is enabled
; In-Circuit Debugger Mode bit : In-Circuit Debugger disabled, RB6/ISCPCLK and RB7/ICSPDAT are general purpose I/O pins
config "FOSC" = "EXTRCCLK", "WDTE" = "ON", "PWRTE" = "OFF", "MCLRE" = "ON", "CP" = "OFF", "CPD" = "OFF", "BOREN" = "ON", "IESO" = "ON", "FCMEN" = "ON", "DEBUG" = "OFF"
config "<setting>"=<literal constant>
For example:
; Oscillator Selection bits : RC oscillator: CLKOUT function on RA6/OSC2/CLKOUT/T1OSO pin, RC on RA7/OSC1/CLKIN/T1OSI
; Watchdog Timer Enable bit : WDT enabled
; Power Up Timer Enable bit : PWRT disabled
; RE3/MCLR pin function select bit : RE3/MCLR pin function is MCLR
; Code Protection bit : Program memory code protection is disabled
; Data Code Protection bit : Data memory code protection is disabled
; Brown-out Reset Selection bits : BOR enabled
; Internal External Switchover bit : Internal/External Switchover mode is enabled
; Fail-Safe Clock Monitor Enabled bit : Fail-Safe Clock Monitor is enabled
; In-Circuit Debugger Mode bit : In-Circuit Debugger disabled, RB6/ISCPCLK and RB7/ICSPDAT are general purpose I/O pins
config "FOSC" = 0x7, "WDTE" = 0x1, "PWRTE" = 0x1, "MCLRE" = 0x1, "CP" = 0x1, "CPD" = 0x1, "BOREN" = 0x3, "IESO" = 0x1, "FCMEN" = 0x1, "DEBUG" = 0x1
config "<register>"=<literal constant>
For example:
; Oscillator Selection bits : RC oscillator: CLKOUT function on RA6/OSC2/CLKOUT/T1OSO pin, RC on RA7/OSC1/CLKIN/T1OSI
; Watchdog Timer Enable bit : WDT enabled
; Power Up Timer Enable bit : PWRT disabled
; RE3/MCLR pin function select bit : RE3/MCLR pin function is MCLR
; Code Protection bit : Program memory code protection is disabled
; Data Code Protection bit : Data memory code protection is disabled
; Brown-out Reset Selection bits : BOR enabled
; Internal External Switchover bit : Internal/External Switchover mode is enabled
; Fail-Safe Clock Monitor Enabled bit : Fail-Safe Clock Monitor is enabled
; In-Circuit Debugger Mode bit : In-Circuit Debugger disabled, RB6/ISCPCLK and RB7/ICSPDAT 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
EXTRCCLK RC oscillator: CLKOUT function on RA6/OSC2/CLKOUT/T1OSO pin, RC on RA7/OSC1/CLKIN/T1OSI
EXTRCIO RCIO oscillator: I/O function on RA6/OSC2/CLKOUT/T1OSO pin, RC on RA7/OSC1/CLKIN/T1OSI
INTOSCCLK INTOSC oscillator: CLKOUT function on RA6/OSC2/CLKOUT/T1OSO pin, I/O function on RA7/OSC1/CLKIN/T1OSI
INTOSCIO INTOSCIO oscillator: I/O function on RA6/OSC2/CLKOUT/T1OSO pin, I/O function on RA7/OSC1/CLKIN/T1OSI
EC EC: I/O function on RA6/OSC2/CLKOUT/T1OSO pin, CLKIN on RA7/OSC1/CLKIN/T1OSI
HS HS oscillator: High-speed crystal/resonator on RA6/OSC2/CLKOUT/T1OSO and RA7/OSC1/CLKIN/T1OSI
XT XT oscillator: Crystal/resonator on RA6/OSC2/CLKOUT/T1OSO and RA7/OSC1/CLKIN/T1OSI
LP LP oscillator: Low-power crystal on RA6/OSC2/CLKOUT/T1OSO and RA7/OSC1/CLKIN/T1OSI
WDTE Watchdog Timer Enable bit
ON WDT enabled
OFF WDT disabled and can be enabled by SWDTEN bit of the WDTCON register
PWRTE Power Up Timer Enable bit
OFF PWRT disabled
ON PWRT enabled
MCLRE RE3/MCLR pin function select bit
ON RE3/MCLR pin function is MCLR
OFF RE3/MCLR pin function is digital input, MCLR internally tied to VDD
CP Code Protection bit
OFF Program memory code protection is disabled
ON Program memory code protection is enabled
CPD Data Code Protection bit
OFF Data memory code protection is disabled
ON Data memory code protection is enabled
BOREN Brown-out Reset Selection bits
ON BOR enabled
NSLEEP BOR enabled during operation and disabled in Sleep
SBODEN BOR controlled by SBOREN bit of the PCON register
OFF BOR disabled
IESO Internal External Switchover bit
ON Internal/External Switchover mode is enabled
OFF Internal/External Switchover mode is disabled
FCMEN Fail-Safe Clock Monitor Enabled bit
ON Fail-Safe Clock Monitor is enabled
OFF Fail-Safe Clock Monitor is disabled
DEBUG In-Circuit Debugger Mode bit
OFF In-Circuit Debugger disabled, RB6/ISCPCLK and RB7/ICSPDAT are general purpose I/O pins
ON In-Circuit Debugger enabled, RB6/ICSPCLK and RB7/ICSPDAT are dedicated to the debugger
Register: IDLOC0 @ 0x2000
Register: IDLOC1 @ 0x2001
Register: IDLOC2 @ 0x2002
Register: IDLOC3 @ 0x2003