18LF26K40 Support Information

XC8-CC #pragma config Usage

#pragma config <setting>=<named value>
For example:
// External Oscillator mode Selection bits : EC (external clock) above 8 MHz; PFM set to high power
// Power-up default value for COSC bits : EXTOSC operating per FEXTOSC bits (device manufacturing default)
#pragma config FEXTOSC = ECH, RSTOSC = EXTOSC
#pragma config <setting>=<literal constant>
For example:
// External Oscillator mode Selection bits : EC (external clock) above 8 MHz; PFM set to high power
// Power-up default value for COSC bits : EXTOSC operating per FEXTOSC bits (device manufacturing default)
#pragma config FEXTOSC = 0x7, RSTOSC = 0x7
#pragma config <register>=<literal constant>
For example:
// External Oscillator mode Selection bits : EC (external clock) above 8 MHz; PFM set to high power
// Power-up default value for COSC bits : EXTOSC operating per FEXTOSC bits (device manufacturing default)
#pragma config CONFIG1L = 0xFF
For example:
// IDLOC @ 0x200000
#pragma config IDLOC0 = 0x65535

PIC-AS config Usage

config "<setting>"="<named value>"
For example:
; External Oscillator mode Selection bits : EC (external clock) above 8 MHz; PFM set to high power
; Power-up default value for COSC bits : EXTOSC operating per FEXTOSC bits (device manufacturing default)
config "FEXTOSC" = "ECH", "RSTOSC" = "EXTOSC"
config "<setting>"=<literal constant>
For example:
; External Oscillator mode Selection bits : EC (external clock) above 8 MHz; PFM set to high power
; Power-up default value for COSC bits : EXTOSC operating per FEXTOSC bits (device manufacturing default)
config "FEXTOSC" = 0x7, "RSTOSC" = 0x7
config "<register>"=<literal constant>
For example:
; External Oscillator mode Selection bits : EC (external clock) above 8 MHz; PFM set to high power
; Power-up default value for COSC bits : EXTOSC operating per FEXTOSC bits (device manufacturing default)
config "CONFIG1L" = 0xFF
For example:
; IDLOC @ 0x200000
config "IDLOC0" = 0x65535

Configuration Registers & Settings

Register: CONFIG1L @ 0x300000
FEXTOSC External Oscillator mode Selection bits
LP LP (crystal oscillator) optimized for 32.768 kHz; PFM set to low power
XT XT (crystal oscillator) above 100 kHz, below 8 MHz; PFM set to medium power
HS HS (crystal oscillator) above 8 MHz; PFM set to high power
OFF Oscillator not enabled
ECL EC (external clock) below 100 kHz; PFM set to low power
ECM EC (external clock) for 500 kHz to 8 MHz; PFM set to medium power
ECH EC (external clock) above 8 MHz; PFM set to high power
RSTOSC Power-up default value for COSC bits
HFINTOSC_64MHZ HFINTOSC with HFFRQ = 64 MHz and CDIV = 1:1
EXTOSC_4PLL EXTOSC with 4x PLL, with EXTOSC operating per FEXTOSC bits
SOSC Secondary Oscillator
LFINTOSC Low-Frequency Oscillator
HFINTOSC_1MHZ HFINTOSC with HFFRQ = 4 MHz and CDIV = 4:1
EXTOSC EXTOSC operating per FEXTOSC bits (device manufacturing default)
Register: CONFIG1H @ 0x300001
CLKOUTEN Clock Out Enable bit
OFF CLKOUT function is disabled
ON CLKOUT function is enabled
CSWEN Clock Switch Enable bit
OFF The NOSC and NDIV bits cannot be changed by user software
ON Writing to NOSC and NDIV is allowed
FCMEN Fail-Safe Clock Monitor Enable bit
OFF Fail-Safe Clock Monitor disabled
ON Fail-Safe Clock Monitor enabled
Register: CONFIG2L @ 0x300002
MCLRE Master Clear Enable bit
EXTMCLR If LVP = 0, MCLR pin is MCLR; If LVP = 1, RE3 pin function is MCLR
INTMCLR If LVP = 0, MCLR pin function is port defined function; If LVP =1, RE3 pin fuction is MCLR
PWRTE Power-up Timer Enable bit
ON Power up timer enabled
OFF Power up timer disabled
LPBOREN Low-power BOR enable bit
OFF ULPBOR disabled
ON ULPBOR enabled
BOREN Brown-out Reset Enable bits
SBORDIS Brown-out Reset enabled , SBOREN bit is ignored
NOSLP Brown-out Reset enabled while running, disabled in Sleep; SBOREN is ignored
ON Brown-out Reset enabled according to SBOREN
OFF Brown-out Reset disabled
Register: CONFIG2H @ 0x300003
BORV Brown Out Reset Voltage selection bits
VBOR_190 Brown-out Reset Voltage (VBOR) set to 1.90V
VBOR_245 Brown-out Reset Voltage (VBOR) set to 2.45V
VBOR_270 Brown-out Reset Voltage (VBOR) set to 2.70V
VBOR_285 Brown-out Reset Voltage (VBOR) set to 2.85V
ZCD ZCD Disable bit
OFF ZCD disabled. ZCD can be enabled by setting the ZCDSEN bit of ZCDCON
ON ZCD always enabled
PPS1WAY PPSLOCK bit One-Way Set Enable bit
ON PPSLOCK bit can be cleared and set only once; PPS registers remain locked after one clear/set cycle
OFF PPSLOCK bit can be set and cleared repeatedly (subject to the unlock sequence)
STVREN Stack Full/Underflow Reset Enable bit
ON Stack full/underflow will cause Reset
OFF Stack full/underflow will not cause Reset
DEBUG Debugger Enable bit
OFF Background debugger disabled
ON Background debugger enabled
XINST Extended Instruction Set Enable bit
OFF Extended Instruction Set and Indexed Addressing Mode disabled
ON Extended Instruction Set and Indexed Addressing Mode enabled
Register: CONFIG3L @ 0x300004
WDTCPS WDT Period Select bits
WDTCPS_0 Divider ratio 1:32
WDTCPS_1 Divider ratio 1:64
WDTCPS_2 Divider ratio 1:128
WDTCPS_3 Divider ratio 1:256
WDTCPS_4 Divider ratio 1:512
WDTCPS_5 Divider ratio 1:1024
WDTCPS_6 Divider ratio 1:2048
WDTCPS_7 Divider ratio 1:4096
WDTCPS_8 Divider ratio 1:8192
WDTCPS_9 Divider ratio 1:16384
WDTCPS_10 Divider ratio 1:32768
WDTCPS_11 Divider ratio 1:65536
WDTCPS_12 Divider ratio 1:131072
WDTCPS_13 Divider ratio 1:262144
WDTCPS_14 Divider ratio 1:524299
WDTCPS_15 Divider ratio 1:1048576
WDTCPS_16 Divider ratio 1:2097152
WDTCPS_17 Divider ratio 1:4194304
WDTCPS_18 Divider ratio 1:8388608
WDTCPS_19 Divider ratio 1:32
WDTCPS_20 Divider ratio 1:32
WDTCPS_21 Divider ratio 1:32
WDTCPS_22 Divider ratio 1:32
WDTCPS_23 Divider ratio 1:32
WDTCPS_24 Divider ratio 1:32
WDTCPS_25 Divider ratio 1:32
WDTCPS_26 Divider ratio 1:32
WDTCPS_27 Divider ratio 1:32
WDTCPS_28 Divider ratio 1:32
WDTCPS_29 Divider ratio 1:32
WDTCPS_30 Divider ratio 1:32
WDTCPS_31 Divider ratio 1:65536; software control of WDTPS
WDTE WDT operating mode
OFF WDT Disabled
SWDTEN WDT enabled/disabled by SWDTEN bit
NSLEEP WDT enabled while sleep=0, suspended when sleep=1
ON WDT enabled regardless of sleep
Register: CONFIG3H @ 0x300005
WDTCWS WDT Window Select bits
WDTCWS_0 window delay = 87.5; no software control; keyed access required
WDTCWS_1 window delay = 75 percent of time; no software control; keyed access required
WDTCWS_2 window delay = 62.5 percent of time; no software control; keyed access required
WDTCWS_3 window delay = 50 percent of time; no software control; keyed access required
WDTCWS_4 window delay = 37.5 percent of time; no software control; keyed access required
WDTCWS_5 window delay = 25 percent of time; no software control; keyed access required
WDTCWS_6 window always open (100%); no software control; keyed access required
WDTCWS_7 window always open (100%); software control; keyed access not required
WDTCCS WDT input clock selector
HFINTOSC WDT reference clock is the 31.2kHz HFINTOSC output
LFINTOSC WDT reference clock is the 31.0 kHz LFINTOSC
SC Software Control
Register: CONFIG4L @ 0x300006
WRT0 Write Protection Block 0
OFF Block 0 (000800-003FFFh) not write-protected
ON Block 0 (000800-003FFFh) write-protected
WRT1 Write Protection Block 1
OFF Block 1 (004000-007FFFh) not write-protected
ON Block 1 (004000-007FFFh) write-protected
WRT2 Write Protection Block 2
OFF Block 2 (008000-00BFFFh) not write-protected
ON Block 2 (008000-00BFFFh) write-protected
WRT3 Write Protection Block 3
OFF Block 3 (00C000-00FFFFh) not write-protected
ON Block 3 (00C000-00FFFFh) write-protected
Register: CONFIG4H @ 0x300007
WRTC Configuration Register Write Protection bit
OFF Configuration registers (300000-30000Bh) not write-protected
ON Configuration registers (300000-30000Bh) write-protected
WRTB Boot Block Write Protection bit
OFF Boot Block (000000-0007FFh) not write-protected
ON Boot Block (000000-0007FFh) write-protected
WRTD Data EEPROM Write Protection bit
OFF Data EEPROM not write-protected
ON Data EEPROM write-protected
SCANE Scanner Enable bit
OFF Scanner module is NOT available for use, SCANMD bit is ignored
ON Scanner module is available for use, SCANMD bit can control the module
LVP Low Voltage Programming Enable bit
OFF HV on MCLR/VPP must be used for programming
ON Low voltage programming enabled. MCLR/VPP pin function is MCLR. MCLRE configuration bit is ignored
Register: CONFIG5L @ 0x300008
CP UserNVM Program Memory Code Protection bit
OFF UserNVM code protection disabled
ON UserNVM code protection enabled
CPD DataNVM Memory Code Protection bit
OFF DataNVM code protection disabled
ON DataNVM code protection enabled
Register: CONFIG5H @ 0x300009
Register: CONFIG6L @ 0x30000A
EBTR0 Table Read Protection Block 0
OFF Block 0 (000800-003FFFh) not protected from table reads executed in other blocks
ON Block 0 (000800-003FFFh) protected from table reads executed in other blocks
EBTR1 Table Read Protection Block 1
OFF Block 1 (004000-007FFFh) not protected from table reads executed in other blocks
ON Block 1 (004000-007FFFh) protected from table reads executed in other blocks
EBTR2 Table Read Protection Block 2
OFF Block 2 (008000-00BFFFh) not protected from table reads executed in other blocks
ON Block 2 (008000-00BFFFh) protected from table reads executed in other blocks
EBTR3 Table Read Protection Block 3
OFF Block 3 (00C000-00FFFFh) not protected from table reads executed in other blocks
ON Block 3 (00C000-00FFFFh) protected from table reads executed in other blocks
Register: CONFIG6H @ 0x30000B
EBTRB Boot Block Table Read Protection bit
OFF Boot Block (000000-0007FFh) not protected from table reads executed in other blocks
ON Boot Block (000000-0007FFh) protected from table reads executed in other blocks
Register: IDLOC0 @ 0x200000
Register: IDLOC1 @ 0x200002
Register: IDLOC2 @ 0x200004
Register: IDLOC3 @ 0x200006
Register: IDLOC4 @ 0x200008
Register: IDLOC5 @ 0x20000A
Register: IDLOC6 @ 0x20000C
Register: IDLOC7 @ 0x20000E