18F65J50 Support Information

XC8-CC #pragma config Usage

#pragma config <setting>=<named value>
For example:
// Watchdog Timer Enable bit : WDT enabled
// PLL Prescaler Selection bits : No prescale (4 MHz oscillator input drives PLL directly)
// Stack Overflow/Underflow Reset Enable bit : Reset on stack overflow/underflow enabled
// Extended Instruction Set Enable bit : Instruction set extension and Indexed Addressing mode enabled
// Background Debugger Enable bit : Background debugger disabled; RB6 and RB7 configured as general purpose I/O pins
#pragma config WDTEN = ON, PLLDIV = 1, STVREN = ON, XINST = ON, DEBUG = OFF
#pragma config <setting>=<literal constant>
For example:
// Watchdog Timer Enable bit : WDT enabled
// PLL Prescaler Selection bits : No prescale (4 MHz oscillator input drives PLL directly)
// Stack Overflow/Underflow Reset Enable bit : Reset on stack overflow/underflow enabled
// Extended Instruction Set Enable bit : Instruction set extension and Indexed Addressing mode enabled
// Background Debugger Enable bit : Background debugger disabled; RB6 and RB7 configured as general purpose I/O pins
#pragma config WDTEN = 0x1, PLLDIV = 0x7, STVREN = 0x1, XINST = 0x1, DEBUG = 0x1
#pragma config <register>=<literal constant>
For example:
// Watchdog Timer Enable bit : WDT enabled
// PLL Prescaler Selection bits : No prescale (4 MHz oscillator input drives PLL directly)
// Stack Overflow/Underflow Reset Enable bit : Reset on stack overflow/underflow enabled
// Extended Instruction Set Enable bit : Instruction set extension and Indexed Addressing mode enabled
// Background Debugger Enable bit : Background debugger disabled; RB6 and RB7 configured as general purpose I/O pins
#pragma config CONFIG1L = 0xEF

PIC-AS config Usage

config "<setting>"="<named value>"
For example:
; Watchdog Timer Enable bit : WDT enabled
; PLL Prescaler Selection bits : No prescale (4 MHz oscillator input drives PLL directly)
; Stack Overflow/Underflow Reset Enable bit : Reset on stack overflow/underflow enabled
; Extended Instruction Set Enable bit : Instruction set extension and Indexed Addressing mode enabled
; Background Debugger Enable bit : Background debugger disabled; RB6 and RB7 configured as general purpose I/O pins
config "WDTEN" = "ON", "PLLDIV" = "1", "STVREN" = "ON", "XINST" = "ON", "DEBUG" = "OFF"
config "<setting>"=<literal constant>
For example:
; Watchdog Timer Enable bit : WDT enabled
; PLL Prescaler Selection bits : No prescale (4 MHz oscillator input drives PLL directly)
; Stack Overflow/Underflow Reset Enable bit : Reset on stack overflow/underflow enabled
; Extended Instruction Set Enable bit : Instruction set extension and Indexed Addressing mode enabled
; Background Debugger Enable bit : Background debugger disabled; RB6 and RB7 configured as general purpose I/O pins
config "WDTEN" = 0x1, "PLLDIV" = 0x7, "STVREN" = 0x1, "XINST" = 0x1, "DEBUG" = 0x1
config "<register>"=<literal constant>
For example:
; Watchdog Timer Enable bit : WDT enabled
; PLL Prescaler Selection bits : No prescale (4 MHz oscillator input drives PLL directly)
; Stack Overflow/Underflow Reset Enable bit : Reset on stack overflow/underflow enabled
; Extended Instruction Set Enable bit : Instruction set extension and Indexed Addressing mode enabled
; Background Debugger Enable bit : Background debugger disabled; RB6 and RB7 configured as general purpose I/O pins
config "CONFIG1L" = 0xEF

Configuration Registers & Settings

Register: CONFIG1L @ 0x7FF8
WDTEN Watchdog Timer Enable bit
ON WDT enabled
OFF WDT disabled (control is placed on SWDTEN bit)
PLLDIV PLL Prescaler Selection bits
1 No prescale (4 MHz oscillator input drives PLL directly)
2 Divide by 2 (8 MHz oscillator input)
3 Divide by 3 (12 MHz oscillator input)
4 Divide by 4 (16 MHz oscillator input)
5 Divide by 5 (20 MHz oscillator input)
6 Divide by 6 (24 MHz oscillator input)
10 Divide by 10 (40 MHz oscillator input)
12 Divide by 12 (48 MHz oscillator input)
STVREN Stack Overflow/Underflow Reset Enable bit
ON Reset on stack overflow/underflow enabled
OFF Reset on stack overflow/underflow 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 (Legacy mode)
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: CONFIG1H @ 0x7FF9
CPUDIV CPU System Clock Postscaler
OSC1 No CPU system clock divide
OSC2_PLL2 CPU system clock divide by 2
OSC3_PLL3 CPU system clock divide by 3
OSC4_PLL6 CPU system clock divide by 6
CP0 Code Protection bit
OFF Program memory is not code-protected
ON Program memory is code-protected
Register: CONFIG2L @ 0x7FFA
FOSC Oscillator Selection bits
ECPLL EC Oscillator with PLL, CLKO on RA6, ECPLL used by USB
EC EC Oscillator with CLKO on RA6, EC used by USB
HSPLL HS oscillator, PLL enabled, HSPLL used by USB
HS HS oscillator, HS used by USB
INTOSCPLLO INTOSC with PLL enabled, CLKO on RA6 and Port function on RA7
INTOSCPLL INTOSC with PLL enabled, Port function on RA6 and RA7
INTOSCO INTOSC, CLKO on RA6 and Port function on RA7
INTOSC INTOSC, Port function on RA6 and RA7
FCMEN Fail-Safe Clock Monitor Enable bit
OFF Fail-Safe Clock Monitor disabled
ON Fail-Safe Clock Monitor enabled
IESO Two-Speed Start-up (Internal/External Oscillator Switchover) Control bit
OFF Two-Speed Start-up disabled
ON Two-Speed Start-up enabled
Register: CONFIG2H @ 0x7FFB
WDTPS Watchdog Timer Postscaler Select bits
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: CONFIG3L @ 0x7FFC
Register: CONFIG3H @ 0x7FFD
CCP2MX ECCP2 MUX bit
DEFAULT ECCP2/P2A is multiplexed with RC1
ALTERNATE ECCP2/P2A is multiplexed with RE7
MSSPMSK MSSP Address Masking Mode Select bit
MSK7 7-Bit Address Masking mode enable
MSK5 5-Bit Address Masking mode enable