18LF45K50 Support Information

XC8-CC #pragma config Usage

#pragma config <setting>=<named value>
For example:
// PLL Selection : 4x clock multiplier
// PLL Enable Configuration bit : PLL Disabled (firmware controlled)
// CPU System Clock Postscaler : CPU uses system clock (no divide)
// Low Speed USB mode with 48 MHz system clock : System clock at 24 MHz, USB clock divider is set to 4
#pragma config PLLSEL = PLL4X, CFGPLLEN = OFF, CPUDIV = NOCLKDIV, LS48MHZ = SYS24X4
#pragma config <setting>=<literal constant>
For example:
// PLL Selection : 4x clock multiplier
// PLL Enable Configuration bit : PLL Disabled (firmware controlled)
// CPU System Clock Postscaler : CPU uses system clock (no divide)
// Low Speed USB mode with 48 MHz system clock : System clock at 24 MHz, USB clock divider is set to 4
#pragma config PLLSEL = 0x0, CFGPLLEN = 0x0, CPUDIV = 0x0, LS48MHZ = 0x0
#pragma config <register>=<literal constant>
For example:
// PLL Selection : 4x clock multiplier
// PLL Enable Configuration bit : PLL Disabled (firmware controlled)
// CPU System Clock Postscaler : CPU uses system clock (no divide)
// Low Speed USB mode with 48 MHz system clock : System clock at 24 MHz, USB clock divider is set to 4
#pragma config CONFIG1L = 0x0
For example:
// IDLOC @ 0x200000
#pragma config IDLOC0 = 0x255

PIC-AS config Usage

config "<setting>"="<named value>"
For example:
; PLL Selection : 4x clock multiplier
; PLL Enable Configuration bit : PLL Disabled (firmware controlled)
; CPU System Clock Postscaler : CPU uses system clock (no divide)
; Low Speed USB mode with 48 MHz system clock : System clock at 24 MHz, USB clock divider is set to 4
config "PLLSEL" = "PLL4X", "CFGPLLEN" = "OFF", "CPUDIV" = "NOCLKDIV", "LS48MHZ" = "SYS24X4"
config "<setting>"=<literal constant>
For example:
; PLL Selection : 4x clock multiplier
; PLL Enable Configuration bit : PLL Disabled (firmware controlled)
; CPU System Clock Postscaler : CPU uses system clock (no divide)
; Low Speed USB mode with 48 MHz system clock : System clock at 24 MHz, USB clock divider is set to 4
config "PLLSEL" = 0x0, "CFGPLLEN" = 0x0, "CPUDIV" = 0x0, "LS48MHZ" = 0x0
config "<register>"=<literal constant>
For example:
; PLL Selection : 4x clock multiplier
; PLL Enable Configuration bit : PLL Disabled (firmware controlled)
; CPU System Clock Postscaler : CPU uses system clock (no divide)
; Low Speed USB mode with 48 MHz system clock : System clock at 24 MHz, USB clock divider is set to 4
config "CONFIG1L" = 0x0
For example:
; IDLOC @ 0x200000
config "IDLOC0" = 0x255

Configuration Registers & Settings

Register: CONFIG1L @ 0x300000
PLLSEL PLL Selection
PLL3X 3x clock multiplier
PLL4X 4x clock multiplier
CFGPLLEN PLL Enable Configuration bit
ON PLL Enabled
OFF PLL Disabled (firmware controlled)
CPUDIV CPU System Clock Postscaler
CLKDIV6 CPU uses system clock divided by 6
CLKDIV3 CPU uses system clock divided by 3
CLKDIV2 CPU uses system clock divided by 2
NOCLKDIV CPU uses system clock (no divide)
LS48MHZ Low Speed USB mode with 48 MHz system clock
SYS48X8 System clock at 48 MHz, USB clock divider is set to 8
SYS24X4 System clock at 24 MHz, USB clock divider is set to 4
Register: CONFIG1H @ 0x300001
FOSC Oscillator Selection
ECLIO EC oscillator, low power <4MHz
ECLCLKO EC oscillator, low power <4MHz, clock output on OSC2
ECMIO EC oscillator, medium power 4MHz to 16MHz
ECMCLKO EC oscillator, medium power 4MHz to 16MHz, clock output on OSC2
ECHIO EC oscillator, high power 16MHz to 48MHz
ECHCLKO EC oscillator, high power 16MHz to 48MHz, clock output on OSC2
RCIO External RC oscillator
RCCLKO External RC oscillator, clock output on OSC2
INTOSCIO Internal oscillator
INTOSCCLKO Internal oscillator, clock output on OSC2
HSM HS oscillator, medium power 4MHz to 16MHz
HSH HS oscillator, high power 16MHz to 25MHz
XT XT oscillator
LP LP oscillator
PCLKEN Primary Oscillator Shutdown
ON Primary oscillator enabled
OFF Primary oscillator shutdown firmware controlled
FCMEN Fail-Safe Clock Monitor
ON Fail-Safe Clock Monitor enabled
OFF Fail-Safe Clock Monitor disabled
IESO Internal/External Oscillator Switchover
ON Oscillator Switchover mode enabled
OFF Oscillator Switchover mode disabled
Register: CONFIG2L @ 0x300002
nPWRTEN Power-up Timer Enable
OFF Power up timer disabled
ON Power up timer enabled
BOREN Brown-out Reset Enable
SBORDIS BOR enabled in hardware (SBOREN is ignored)
NOSLP BOR enabled in hardware, disabled in Sleep mode (SBOREN is ignored)
ON BOR controlled by firmware (SBOREN is enabled)
OFF BOR disabled in hardware (SBOREN is ignored)
BORV Brown-out Reset Voltage
190 BOR set to 1.9V nominal
220 BOR set to 2.2V nominal
250 BOR set to 2.5V nominal
285 BOR set to 2.85V nominal
nLPBOR Low-Power Brown-out Reset
OFF Low-Power Brown-out Reset disabled
ON Low-Power Brown-out Reset enabled
Register: CONFIG2H @ 0x300003
WDTEN Watchdog Timer Enable bits
ON WDT enabled in hardware (SWDTEN ignored)
SWON WDT controlled by firmware (SWDTEN enabled)
NOSLP WDT enabled in hardware, disabled in Sleep mode (SWDTEN ignored)
OFF WDT disabled in hardware (SWDTEN ignored)
WDTPS Watchdog Timer Postscaler
32768 1:32768
16384 1:16384
8192 1:8192
4096 1:4096
2048 1:2048
1024 1:1024
512 1:512
256 1:256
128 1:128
64 1:64
32 1:32
16 1:16
8 1:8
4 1:4
2 1:2
1 1:1
Register: CONFIG3H @ 0x300005
CCP2MX CCP2 MUX bit
RC1 CCP2 input/output is multiplexed with RC1
RB3 CCP2 input/output is multiplexed with RB3
PBADEN PORTB A/D Enable bit
ON PORTB<5:0> pins are configured as analog input channels on Reset
OFF PORTB<5:0> pins are configured as digital I/O on Reset
T3CMX Timer3 Clock Input MUX bit
RC0 T3CKI function is on RC0
RB5 T3CKI function is on RB5
SDOMX SDO Output MUX bit
RB3 SDO function is on RB3
RC7 SDO function is on RC7
MCLRE Master Clear Reset Pin Enable
ON MCLR pin enabled; RE3 input disabled
OFF RE3 input pin enabled; external MCLR disabled
Register: CONFIG4L @ 0x300006
STVREN Stack Full/Underflow Reset
ON Stack full/underflow will cause Reset
OFF Stack full/underflow will not cause Reset
LVP Single-Supply ICSP Enable bit
ON Single-Supply ICSP enabled if MCLRE is also 1
OFF Single-Supply ICSP disabled
ICPRT Dedicated In-Circuit Debug/Programming Port Enable
ON ICPORT enabled
OFF ICPORT disabled
XINST Extended Instruction Set Enable bit
ON Instruction set extension and Indexed Addressing mode enabled
OFF Instruction set extension and Indexed Addressing mode disabled
DEBUG Background Debugger Enable bit
OFF Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins
ON Background debugger enabled, RB6 and RB7 are dedicated to In-Circuit Debug
Register: CONFIG5L @ 0x300008
CP0 Block 0 Code Protect
OFF Block 0 is not code-protected
ON Block 0 is code-protected
CP1 Block 1 Code Protect
OFF Block 1 is not code-protected
ON Block 1 is code-protected
CP2 Block 2 Code Protect
OFF Block 2 is not code-protected
ON Block 2 is code-protected
CP3 Block 3 Code Protect
OFF Block 3 is not code-protected
ON Block 3 is code-protected
Register: CONFIG5H @ 0x300009
CPB Boot Block Code Protect
OFF Boot block is not code-protected
ON Boot block is code-protected
CPD Data EEPROM Code Protect
OFF Data EEPROM is not code-protected
ON Data EEPROM is code-protected
Register: CONFIG6L @ 0x30000A
WRT0 Block 0 Write Protect
OFF Block 0 (0800-1FFFh) is not write-protected
ON Block 0 (0800-1FFFh) is write-protected
WRT1 Block 1 Write Protect
OFF Block 1 (2000-3FFFh) is not write-protected
ON Block 1 (2000-3FFFh) is write-protected
WRT2 Block 2 Write Protect
OFF Block 2 (04000-5FFFh) is not write-protected
ON Block 2 (04000-5FFFh) is write-protected
WRT3 Block 3 Write Protect
OFF Block 3 (06000-7FFFh) is not write-protected
ON Block 3 (06000-7FFFh) is write-protected
Register: CONFIG6H @ 0x30000B
WRTC Configuration Registers Write Protect
OFF Configuration registers (300000-3000FFh) are not write-protected
ON Configuration registers (300000-3000FFh) are write-protected
WRTB Boot Block Write Protect
OFF Boot block (0000-7FFh) is not write-protected
ON Boot block (0000-7FFh) is write-protected
WRTD Data EEPROM Write Protect
OFF Data EEPROM is not write-protected
ON Data EEPROM is write-protected
Register: CONFIG7L @ 0x30000C
EBTR0 Block 0 Table Read Protect
OFF Block 0 is not protected from table reads executed in other blocks
ON Block 0 is protected from table reads executed in other blocks
EBTR1 Block 1 Table Read Protect
OFF Block 1 is not protected from table reads executed in other blocks
ON Block 1 is protected from table reads executed in other blocks
EBTR2 Block 2 Table Read Protect
OFF Block 2 is not protected from table reads executed in other blocks
ON Block 2 is protected from table reads executed in other blocks
EBTR3 Block 3 Table Read Protect
OFF Block 3 is not protected from table reads executed in other blocks
ON Block 3 is protected from table reads executed in other blocks
Register: CONFIG7H @ 0x30000D
EBTRB Boot Block Table Read Protect
OFF Boot block is not protected from table reads executed in other blocks
ON Boot block is protected from table reads executed in other blocks
Register: IDLOC0 @ 0x200000
Register: IDLOC1 @ 0x200001
Register: IDLOC2 @ 0x200002
Register: IDLOC3 @ 0x200003
Register: IDLOC4 @ 0x200004
Register: IDLOC5 @ 0x200005
Register: IDLOC6 @ 0x200006
Register: IDLOC7 @ 0x200007