16F18344 Support Information

XC8-CC #pragma config Usage

#pragma config <setting>=<named value>
For example:
// FEXTOSC External Oscillator mode Selection bits : EC (external clock) above 8 MHz
// Power-up default value for COSC bits : EXTOSC operating per FEXTOSC bits
// Clock Out Enable bit : CLKOUT function is disabled; I/O or oscillator function on OSC2
// Clock Switch Enable bit : Writing to NOSC and NDIV is allowed
// Fail-Safe Clock Monitor Enable : Fail-Safe Clock Monitor is enabled
#pragma config FEXTOSC = ECH, RSTOSC = EXT1X, CLKOUTEN = OFF, CSWEN = ON, FCMEN = ON
#pragma config <setting>=<literal constant>
For example:
// FEXTOSC External Oscillator mode Selection bits : EC (external clock) above 8 MHz
// Power-up default value for COSC bits : EXTOSC operating per FEXTOSC bits
// Clock Out Enable bit : CLKOUT function is disabled; I/O or oscillator function on OSC2
// Clock Switch Enable bit : Writing to NOSC and NDIV is allowed
// Fail-Safe Clock Monitor Enable : Fail-Safe Clock Monitor is enabled
#pragma config FEXTOSC = 0x7, RSTOSC = 0x7, CLKOUTEN = 0x1, CSWEN = 0x1, FCMEN = 0x1
#pragma config <register>=<literal constant>
For example:
// FEXTOSC External Oscillator mode Selection bits : EC (external clock) above 8 MHz
// Power-up default value for COSC bits : EXTOSC operating per FEXTOSC bits
// Clock Out Enable bit : CLKOUT function is disabled; I/O or oscillator function on OSC2
// Clock Switch Enable bit : Writing to NOSC and NDIV is allowed
// Fail-Safe Clock Monitor Enable : Fail-Safe Clock Monitor is enabled
#pragma config CONFIG1 = 0x3FFF
For example:
// IDLOC @ 0x8000
#pragma config IDLOC0 = 0x16383

PIC-AS config Usage

config "<setting>"="<named value>"
For example:
; FEXTOSC External Oscillator mode Selection bits : EC (external clock) above 8 MHz
; Power-up default value for COSC bits : EXTOSC operating per FEXTOSC bits
; Clock Out Enable bit : CLKOUT function is disabled; I/O or oscillator function on OSC2
; Clock Switch Enable bit : Writing to NOSC and NDIV is allowed
; Fail-Safe Clock Monitor Enable : Fail-Safe Clock Monitor is enabled
config "FEXTOSC" = "ECH", "RSTOSC" = "EXT1X", "CLKOUTEN" = "OFF", "CSWEN" = "ON", "FCMEN" = "ON"
config "<setting>"=<literal constant>
For example:
; FEXTOSC External Oscillator mode Selection bits : EC (external clock) above 8 MHz
; Power-up default value for COSC bits : EXTOSC operating per FEXTOSC bits
; Clock Out Enable bit : CLKOUT function is disabled; I/O or oscillator function on OSC2
; Clock Switch Enable bit : Writing to NOSC and NDIV is allowed
; Fail-Safe Clock Monitor Enable : Fail-Safe Clock Monitor is enabled
config "FEXTOSC" = 0x7, "RSTOSC" = 0x7, "CLKOUTEN" = 0x1, "CSWEN" = 0x1, "FCMEN" = 0x1
config "<register>"=<literal constant>
For example:
; FEXTOSC External Oscillator mode Selection bits : EC (external clock) above 8 MHz
; Power-up default value for COSC bits : EXTOSC operating per FEXTOSC bits
; Clock Out Enable bit : CLKOUT function is disabled; I/O or oscillator function on OSC2
; Clock Switch Enable bit : Writing to NOSC and NDIV is allowed
; Fail-Safe Clock Monitor Enable : Fail-Safe Clock Monitor is enabled
config "CONFIG1" = 0x3FFF
For example:
; IDLOC @ 0x8000
config "IDLOC0" = 0x16383

Configuration Registers & Settings

Register: CONFIG1 @ 0x8007
FEXTOSC FEXTOSC External Oscillator mode Selection bits
ECH EC (external clock) above 8 MHz
ECM EC (external clock) for 100 kHz to 8 MHz
ECL EC (external clock) below 100 kHz
OFF Oscillator not enabled
HS HS (crystal oscillator) above 4 MHz
XT XT (crystal oscillator) from 100 kHz to 4 MHz
LP LP (crystal oscillator) optimized for 32.768 kHz
RSTOSC Power-up default value for COSC bits
EXT1X EXTOSC operating per FEXTOSC bits
HFINT1 HFINTOSC (1MHz)
LFINT LFINTOSC (31kHz)
SOSC SOSC (31kHz)
EXT4X EXTOSC with 4x PLL, with EXTOSC operating per FEXTOSC bits
HFINT32 HFINTOSC with 2x PLL (32MHz)
CLKOUTEN Clock Out Enable bit
OFF CLKOUT function is disabled; I/O or oscillator function on OSC2
ON CLKOUT function is enabled; FOSC/4 clock appears at OSC2
CSWEN Clock Switch Enable bit
ON Writing to NOSC and NDIV is allowed
OFF The NOSC and NDIV bits cannot be changed by user software
FCMEN Fail-Safe Clock Monitor Enable
ON Fail-Safe Clock Monitor is enabled
OFF Fail-Safe Clock Monitor is disabled
Register: CONFIG2 @ 0x8008
MCLRE Master Clear Enable bit
ON MCLR/VPP pin function is MCLR; Weak pull-up enabled
OFF MCLR/VPP pin function is digital input; MCLR internally disabled; Weak pull-up under control of port pin's WPU control bit.
PWRTE Power-up Timer Enable bit
OFF PWRT disabled
ON PWRT enabled
WDTE Watchdog Timer Enable bits
ON WDT enabled, SWDTEN is ignored
SLEEP WDT enabled while running and disabled in SLEEP/IDLE; SWDTEN is ignored
SWDTEN WDT controlled by the SWDTEN bit in the WDTCON register
OFF WDT disabled; SWDTEN is ignored
LPBOREN Low-power BOR enable bit
OFF ULPBOR disabled
ON ULPBOR enabled
BOREN Brown-out Reset Enable bits
ON Brown-out Reset enabled, SBOREN bit ignored
SLEEP Brown-out Reset enabled while running, disabled in Sleep; SBOREN is ignored
SBOREN Brown-out Reset enabled according to SBOREN
OFF Brown-out Reset disabled
BORV Brown-out Reset Voltage selection bit
LOW Brown-out voltage (Vbor) set to 2.45V
HIGH Brown-out voltage (Vbor) set to 2.7V
PPS1WAY PPSLOCK bit One-Way Set Enable bit
ON The PPSLOCK bit can be cleared and set only once; PPS registers remain locked after one clear/set cycle
OFF The PPSLOCK bit can be set and cleared repeatedly (subject to the unlock sequence)
STVREN Stack Overflow/Underflow Reset Enable bit
ON Stack Overflow or Underflow will cause a Reset
OFF Stack Overflow or Underflow will not cause a Reset
DEBUG Debugger enable bit
OFF Background debugger disabled
ON Background debugger enabled
Register: CONFIG3 @ 0x8009
WRT User NVM self-write protection bits
OFF Write protection off
BOOT 0000h to 01FFh write-protected, 0200h to 0FFFh may be modified
HALF 0000h to 07FFh write-protected, 0800h to 0FFFh may be modified
ALL 0000h to 0FFFh write protected, no addresses may be modified
LVP Low Voltage Programming Enable bit
ON Low Voltage programming enabled. MCLR/VPP pin function is MCLR. MCLRE configuration bit is ignored.
OFF High Voltage on MCLR/VPP must be used for programming.
Register: CONFIG4 @ 0x800A
CP User NVM Program Memory Code Protection bit
OFF User NVM code protection disabled
ON User NVM code protection enabled
CPD Data NVM Memory Code Protection bit
OFF Data NVM code protection disabled
ON Data NVM code protection enabled
Register: IDLOC0 @ 0x8000
Register: IDLOC1 @ 0x8001
Register: IDLOC2 @ 0x8002
Register: IDLOC3 @ 0x8003