16F1459 Support Information

XC8-CC #pragma config Usage

#pragma config <setting>=<named value>
For example:
// Oscillator Selection Bits : ECH, External Clock, High Power Mode (4-20 MHz): device clock supplied to CLKIN pins
// Watchdog Timer Enable : WDT enabled
// Power-up Timer Enable : PWRT disabled
// MCLR Pin Function Select : MCLR/VPP pin function is MCLR
// Flash Program Memory Code Protection : Program memory code protection is disabled
// Brown-out Reset Enable : Brown-out Reset enabled
// Clock Out Enable : CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin
// Internal/External Switchover Mode : Internal/External Switchover Mode is enabled
// Fail-Safe Clock Monitor Enable : Fail-Safe Clock Monitor is enabled
#pragma config FOSC = ECH, WDTE = ON, PWRTE = OFF, MCLRE = ON, CP = OFF, BOREN = ON, CLKOUTEN = OFF, IESO = ON, FCMEN = ON
#pragma config <setting>=<literal constant>
For example:
// Oscillator Selection Bits : ECH, External Clock, High Power Mode (4-20 MHz): device clock supplied to CLKIN pins
// Watchdog Timer Enable : WDT enabled
// Power-up Timer Enable : PWRT disabled
// MCLR Pin Function Select : MCLR/VPP pin function is MCLR
// Flash Program Memory Code Protection : Program memory code protection is disabled
// Brown-out Reset Enable : Brown-out Reset enabled
// Clock Out Enable : CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin
// Internal/External Switchover Mode : Internal/External Switchover Mode is enabled
// Fail-Safe Clock Monitor Enable : Fail-Safe Clock Monitor is enabled
#pragma config FOSC = 0x7, WDTE = 0x3, PWRTE = 0x1, MCLRE = 0x1, CP = 0x1, BOREN = 0x3, CLKOUTEN = 0x1, IESO = 0x1, FCMEN = 0x1
#pragma config <register>=<literal constant>
For example:
// Oscillator Selection Bits : ECH, External Clock, High Power Mode (4-20 MHz): device clock supplied to CLKIN pins
// Watchdog Timer Enable : WDT enabled
// Power-up Timer Enable : PWRT disabled
// MCLR Pin Function Select : MCLR/VPP pin function is MCLR
// Flash Program Memory Code Protection : Program memory code protection is disabled
// Brown-out Reset Enable : Brown-out Reset enabled
// Clock Out Enable : CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin
// Internal/External Switchover Mode : Internal/External Switchover Mode is enabled
// Fail-Safe Clock Monitor Enable : Fail-Safe Clock Monitor is enabled
#pragma config CONFIG1 = 0x3FFF
For example:
// IDLOC @ 0x8000
#pragma config IDLOC0 = 0x127

PIC-AS config Usage

config "<setting>"="<named value>"
For example:
; Oscillator Selection Bits : ECH, External Clock, High Power Mode (4-20 MHz): device clock supplied to CLKIN pins
; Watchdog Timer Enable : WDT enabled
; Power-up Timer Enable : PWRT disabled
; MCLR Pin Function Select : MCLR/VPP pin function is MCLR
; Flash Program Memory Code Protection : Program memory code protection is disabled
; Brown-out Reset Enable : Brown-out Reset enabled
; Clock Out Enable : CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin
; Internal/External Switchover Mode : Internal/External Switchover Mode is enabled
; Fail-Safe Clock Monitor Enable : Fail-Safe Clock Monitor is enabled
config "FOSC" = "ECH", "WDTE" = "ON", "PWRTE" = "OFF", "MCLRE" = "ON", "CP" = "OFF", "BOREN" = "ON", "CLKOUTEN" = "OFF", "IESO" = "ON", "FCMEN" = "ON"
config "<setting>"=<literal constant>
For example:
; Oscillator Selection Bits : ECH, External Clock, High Power Mode (4-20 MHz): device clock supplied to CLKIN pins
; Watchdog Timer Enable : WDT enabled
; Power-up Timer Enable : PWRT disabled
; MCLR Pin Function Select : MCLR/VPP pin function is MCLR
; Flash Program Memory Code Protection : Program memory code protection is disabled
; Brown-out Reset Enable : Brown-out Reset enabled
; Clock Out Enable : CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin
; Internal/External Switchover Mode : Internal/External Switchover Mode is enabled
; Fail-Safe Clock Monitor Enable : Fail-Safe Clock Monitor is enabled
config "FOSC" = 0x7, "WDTE" = 0x3, "PWRTE" = 0x1, "MCLRE" = 0x1, "CP" = 0x1, "BOREN" = 0x3, "CLKOUTEN" = 0x1, "IESO" = 0x1, "FCMEN" = 0x1
config "<register>"=<literal constant>
For example:
; Oscillator Selection Bits : ECH, External Clock, High Power Mode (4-20 MHz): device clock supplied to CLKIN pins
; Watchdog Timer Enable : WDT enabled
; Power-up Timer Enable : PWRT disabled
; MCLR Pin Function Select : MCLR/VPP pin function is MCLR
; Flash Program Memory Code Protection : Program memory code protection is disabled
; Brown-out Reset Enable : Brown-out Reset enabled
; Clock Out Enable : CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin
; Internal/External Switchover Mode : Internal/External Switchover Mode is enabled
; Fail-Safe Clock Monitor Enable : Fail-Safe Clock Monitor is enabled
config "CONFIG1" = 0x3FFF
For example:
; IDLOC @ 0x8000
config "IDLOC0" = 0x127

Configuration Registers & Settings

Register: CONFIG1 @ 0x8007
FOSC Oscillator Selection Bits
ECH ECH, External Clock, High Power Mode (4-20 MHz): device clock supplied to CLKIN pins
ECM ECM, External Clock, Medium Power Mode (0.5-4 MHz): device clock supplied to CLKIN pins
ECL ECL, External Clock, Low Power Mode (0-0.5 MHz): device clock supplied to CLKIN pins
INTOSC INTOSC oscillator: I/O function on CLKIN pin
EXTRC EXTRC oscillator: External RC circuit connected to CLKIN pin
HS HS Oscillator, High-speed crystal/resonator connected between OSC1 and OSC2 pins
XT XT Oscillator, Crystal/resonator connected between OSC1 and OSC2 pins
LP LP Oscillator, Low-power crystal connected between OSC1 and OSC2 pins
WDTE Watchdog Timer Enable
ON WDT enabled
NSLEEP WDT enabled while running and disabled in Sleep
SWDTEN WDT controlled by the SWDTEN bit in the WDTCON register
OFF WDT disabled
PWRTE Power-up Timer Enable
OFF PWRT disabled
ON PWRT enabled
MCLRE MCLR Pin Function Select
ON MCLR/VPP pin function is MCLR
OFF MCLR/VPP pin function is digital input
CP Flash Program Memory Code Protection
OFF Program memory code protection is disabled
ON Program memory code protection is enabled
BOREN Brown-out Reset Enable
ON Brown-out Reset enabled
NSLEEP Brown-out Reset enabled while running and disabled in Sleep
SBODEN Brown-out Reset controlled by the SBOREN bit in the BORCON register
OFF Brown-out Reset disabled
CLKOUTEN Clock Out Enable
OFF CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin
ON CLKOUT function is enabled on the CLKOUT pin
IESO Internal/External Switchover Mode
ON Internal/External Switchover Mode is enabled
OFF Internal/External Switchover Mode is disabled
FCMEN Fail-Safe Clock Monitor Enable
ON Fail-Safe Clock Monitor is enabled
OFF Fail-Safe Clock Monitor is disabled
Register: CONFIG2 @ 0x8008
WRT Flash Memory Self-Write Protection
OFF Write protection off
BOOT 000h to 1FFh write protected, 200h to 1FFFh may be modified by PMCON control
HALF 000h to 0FFFh write protected, 1000h to 1FFFh may be modified by PMCON control
ALL 000h to 1FFFh write protected, no addresses may be modified by PMCON control
CPUDIV CPU System Clock Selection Bit
CLKDIV6 CPU system clock divided by 6
CLKDIV3 CPU system clock divided by 3
CLKDIV2 CPU system clock divided by 2
NOCLKDIV NO CPU system divide
USBLSCLK USB Low SPeed Clock Selection bit
48MHz System clock expects 48 MHz, FS/LS USB CLKENs divide-by is set to 8.
24MHz System clock expects 24 MHz, FS/LS USB CLKENs divide-by is set to 4.
PLLMULT PLL Multipler Selection Bit
3x 3x Output Frequency Selected
4x 4x Output Frequency Selected
PLLEN PLL Enable Bit
ENABLED 3x or 4x PLL Enabled
DISABLED 3x or 4x PLL Disabled
STVREN Stack Overflow/Underflow Reset Enable
ON Stack Overflow or Underflow will cause a Reset
OFF Stack Overflow or Underflow will not cause a Reset
BORV Brown-out Reset Voltage Selection
LO Brown-out Reset Voltage (Vbor), low trip point selected.
HI Brown-out Reset Voltage (Vbor), high trip point selected.
LPBOR Low-Power Brown Out Reset
OFF Low-Power BOR is disabled
ON Low-Power BOR is enabled
LVP Low-Voltage Programming Enable
ON Low-voltage programming enabled
OFF High-voltage on MCLR/VPP must be used for programming
Register: IDLOC0 @ 0x8000
Register: IDLOC1 @ 0x8001
Register: IDLOC2 @ 0x8002
Register: IDLOC3 @ 0x8003