18F1230 Support Information

XC8-CC #pragma config Usage

#pragma config <setting>=<named value>
For example:
// Oscillator : External RC oscillator, port function on RA6
// Fail-Safe Clock Monitor Enable bit : Fail-Safe Clock Monitor disabled
// Internal/External Oscillator Switchover bit : Oscillator Switchover mode disabled
#pragma config OSC = RCIO, FCMEN = OFF, IESO = OFF
#pragma config <setting>=<literal constant>
For example:
// Oscillator : External RC oscillator, port function on RA6
// Fail-Safe Clock Monitor Enable bit : Fail-Safe Clock Monitor disabled
// Internal/External Oscillator Switchover bit : Oscillator Switchover mode disabled
#pragma config OSC = 0x7, FCMEN = 0x0, IESO = 0x0
#pragma config <register>=<literal constant>
For example:
// Oscillator : External RC oscillator, port function on RA6
// Fail-Safe Clock Monitor Enable bit : Fail-Safe Clock Monitor disabled
// Internal/External Oscillator Switchover bit : Oscillator Switchover mode disabled
#pragma config CONFIG1H = 0x7
For example:
// IDLOC @ 0x200000
#pragma config IDLOC0 = 0x255

PIC-AS config Usage

config "<setting>"="<named value>"
For example:
; Oscillator : External RC oscillator, port function on RA6
; Fail-Safe Clock Monitor Enable bit : Fail-Safe Clock Monitor disabled
; Internal/External Oscillator Switchover bit : Oscillator Switchover mode disabled
config "OSC" = "RCIO", "FCMEN" = "OFF", "IESO" = "OFF"
config "<setting>"=<literal constant>
For example:
; Oscillator : External RC oscillator, port function on RA6
; Fail-Safe Clock Monitor Enable bit : Fail-Safe Clock Monitor disabled
; Internal/External Oscillator Switchover bit : Oscillator Switchover mode disabled
config "OSC" = 0x7, "FCMEN" = 0x0, "IESO" = 0x0
config "<register>"=<literal constant>
For example:
; Oscillator : External RC oscillator, port function on RA6
; Fail-Safe Clock Monitor Enable bit : Fail-Safe Clock Monitor disabled
; Internal/External Oscillator Switchover bit : Oscillator Switchover mode disabled
config "CONFIG1H" = 0x7
For example:
; IDLOC @ 0x200000
config "IDLOC0" = 0x255

Configuration Registers & Settings

Register: CONFIG1H @ 0x300001
OSC Oscillator
INTIO1 Internal oscillator, CLKO function on RA6, port function on RA7
INTIO2 Internal oscillator, port function on RA6 and RA7
RCIO External RC oscillator, port function on RA6
HSPLL HS oscillator, PLL enabled (Clock Frequency = 4 x FOSC1)
ECIO EC oscillator, port function on RA6
EC EC oscillator, CLKO function on RA6
RC External RC oscillator, CLKO function on RA6
HS HS Oscillator
XT XT Oscillator
LP LP Oscillator
FCMEN Fail-Safe Clock Monitor Enable bit
ON Fail-Safe Clock Monitor enabled
OFF Fail-Safe Clock Monitor disabled
IESO Internal/External Oscillator Switchover bit
ON Oscillator Switchover mode enabled
OFF Oscillator Switchover mode disabled
Register: CONFIG2L @ 0x300002
PWRT Power-up Timer Enable bit
OFF PWRT disabled
ON PWRT enabled
BOR Brown-out Reset Enable bits
BOHW Brown-out Reset enabled in hardware only (SBOREN is disabled)
BOACTIVE Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled)
SBORENCTRL Brown-out Reset enabled and controlled by software (SBOREN is enabled)
OFF Brown-out Reset disabled in hardware and software
BORV Brown-out Reset Voltage bits
3 Minimum setting
2
1
0 Maximum setting
Register: CONFIG2H @ 0x300003
WDT Watchdog Timer Enable bit
ON WDT enabled
OFF WDT disabled (control is placed on the SWDTEN bit)
WDTPS Watchdog Timer Postscale 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 @ 0x300004
PWMPIN PWM Output Pins Reset State Control bit
OFF PWM outputs disabled upon Reset
ON PWM outputs drive active states upon Reset
LPOL Low-Side Transistors Polarity bit (Even PWM Output Polarity Control bit)
HIGH PWM0, PWM2 and PWM4 are active-high (default)
LOW PWM0, PWM2 and PWM4 are active-low
HPOL High Side Transistors Polarity bit (Odd PWM Output Polarity Control bit)
HIGH PWM1, PWM3 and PWM5 are active-high (default)
LOW PWM1, PWM3 and PWM5 are active-low
Register: CONFIG3H @ 0x300005
FLTAMX FLTA Mux bit
RA5 FLTA input is muxed onto RA5
RA7 FLTA input is muxed onto RA7
T1OSCMX T1OSO/T1CKI MUX bit
HIGH T1OSO/T1CKI pin resides on RA6
LOW T1OSO/T1CKI pin resides on RB2
MCLRE Master Clear Enable bit
ON MCLR pin enabled, RA5 input pin disabled
OFF RA5 input pin enabled, MCLR pin disabled
Register: CONFIG4L @ 0x300006
STVREN Stack Overflow/Underflow Reset Enable bit
ON Reset on stack overflow/underflow enabled
OFF Reset on stack overflow/underflow disabled
BBSIZ Boot Block Size Select bits
BB512 512 Words (1024 Bytes) Boot Block size
BB256 256 Words (512 Bytes) Boot Block size
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 Code Protection bit Block 0 (000400-0007FF)
OFF Block 0 is not code-protected
ON Block 0 is code-protected
CP1 Code Protection bit Block 1 (000800-000FFF)
OFF Block 1 is not code-protected
ON Block 1 is code-protected
Register: CONFIG5H @ 0x300009
CPB Code Protection bit (Boot Block Memory Area)
OFF Boot Block is not code-protected
ON Boot Block is code-protected
CPD Code Protection bit (Data EEPROM)
OFF Data EEPROM is not code-protected
ON Data EEPROM is code-protected
Register: CONFIG6L @ 0x30000A
WRT0 Write Protection bit Block 0 (000400-0007FF)
OFF Block 0 is not write-protected
ON Block 0 is write-protected
WRT1 Write Protection bit Block 1 (000800-000FFF)
OFF Block 1 is not write-protected
ON Block 1 is write-protected
Register: CONFIG6H @ 0x30000B
WRTC Write Protection bit (Configuration Registers)
OFF Configuration registers are not write-protected
ON Configuration registers are write-protected
WRTB Write Protection bit (Boot Block Memory Area)
OFF Boot Block is not write-protected
ON Boot Block is write-protected
WRTD Write Protection bit (Data EEPROM)
OFF Data EEPROM is not write-protected
ON Data EEPROM is write-protected
Register: CONFIG7L @ 0x30000C
EBTR0 Table Read Protection bit Block 0 (000400-0007FF)
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 Table Read Protection bit Block 1 (000800-000FFF)
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
Register: CONFIG7H @ 0x30000D
EBTRB Table Read Protection bit (Boot Block Memory Area)
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