18F4553 Support Information

XC8-CC #pragma config Usage

#pragma config <setting>=<named value>
For example:
// PLL Prescaler Selection bits : No prescale (4 MHz oscillator input drives PLL directly)
// System Clock Postscaler Selection bits : [Primary Oscillator Src: /1][96 MHz PLL Src: /2]
// USB Clock Selection bit (used in Full-Speed USB mode only; UCFG:FSEN = 1) : USB clock source comes directly from the primary oscillator block with no postscale
#pragma config PLLDIV = 1, CPUDIV = OSC1_PLL2, USBDIV = 1
#pragma config <setting>=<literal constant>
For example:
// PLL Prescaler Selection bits : No prescale (4 MHz oscillator input drives PLL directly)
// System Clock Postscaler Selection bits : [Primary Oscillator Src: /1][96 MHz PLL Src: /2]
// USB Clock Selection bit (used in Full-Speed USB mode only; UCFG:FSEN = 1) : USB clock source comes directly from the primary oscillator block with no postscale
#pragma config PLLDIV = 0x0, CPUDIV = 0x0, USBDIV = 0x0
#pragma config <register>=<literal constant>
For example:
// PLL Prescaler Selection bits : No prescale (4 MHz oscillator input drives PLL directly)
// System Clock Postscaler Selection bits : [Primary Oscillator Src: /1][96 MHz PLL Src: /2]
// USB Clock Selection bit (used in Full-Speed USB mode only; UCFG:FSEN = 1) : USB clock source comes directly from the primary oscillator block with no postscale
#pragma config CONFIG1L = 0x0
For example:
// IDLOC @ 0x200000
#pragma config IDLOC0 = 0x255

PIC-AS config Usage

config "<setting>"="<named value>"
For example:
; PLL Prescaler Selection bits : No prescale (4 MHz oscillator input drives PLL directly)
; System Clock Postscaler Selection bits : [Primary Oscillator Src: /1][96 MHz PLL Src: /2]
; USB Clock Selection bit (used in Full-Speed USB mode only; UCFG:FSEN = 1) : USB clock source comes directly from the primary oscillator block with no postscale
config "PLLDIV" = "1", "CPUDIV" = "OSC1_PLL2", "USBDIV" = "1"
config "<setting>"=<literal constant>
For example:
; PLL Prescaler Selection bits : No prescale (4 MHz oscillator input drives PLL directly)
; System Clock Postscaler Selection bits : [Primary Oscillator Src: /1][96 MHz PLL Src: /2]
; USB Clock Selection bit (used in Full-Speed USB mode only; UCFG:FSEN = 1) : USB clock source comes directly from the primary oscillator block with no postscale
config "PLLDIV" = 0x0, "CPUDIV" = 0x0, "USBDIV" = 0x0
config "<register>"=<literal constant>
For example:
; PLL Prescaler Selection bits : No prescale (4 MHz oscillator input drives PLL directly)
; System Clock Postscaler Selection bits : [Primary Oscillator Src: /1][96 MHz PLL Src: /2]
; USB Clock Selection bit (used in Full-Speed USB mode only; UCFG:FSEN = 1) : USB clock source comes directly from the primary oscillator block with no postscale
config "CONFIG1L" = 0x0
For example:
; IDLOC @ 0x200000
config "IDLOC0" = 0x255

Configuration Registers & Settings

Register: CONFIG1L @ 0x300000
PLLDIV PLL Prescaler Selection bits
12 Divide by 12 (48 MHz oscillator input)
10 Divide by 10 (40 MHz oscillator input)
6 Divide by 6 (24 MHz oscillator input)
5 Divide by 5 (20 MHz oscillator input)
4 Divide by 4 (16 MHz oscillator input)
3 Divide by 3 (12 MHz oscillator input)
2 Divide by 2 (8 MHz oscillator input)
1 No prescale (4 MHz oscillator input drives PLL directly)
CPUDIV System Clock Postscaler Selection bits
OSC4_PLL6 [Primary Oscillator Src: /4][96 MHz PLL Src: /6]
OSC3_PLL4 [Primary Oscillator Src: /3][96 MHz PLL Src: /4]
OSC2_PLL3 [Primary Oscillator Src: /2][96 MHz PLL Src: /3]
OSC1_PLL2 [Primary Oscillator Src: /1][96 MHz PLL Src: /2]
USBDIV USB Clock Selection bit (used in Full-Speed USB mode only; UCFG:FSEN = 1)
2 USB clock source comes from the 96 MHz PLL divided by 2
1 USB clock source comes directly from the primary oscillator block with no postscale
Register: CONFIG1H @ 0x300001
FOSC Oscillator Selection bits
HSPLL_HS HS oscillator, PLL enabled (HSPLL)
HS HS oscillator (HS)
INTOSC_HS Internal oscillator, HS oscillator used by USB (INTHS)
INTOSC_XT Internal oscillator, XT used by USB (INTXT)
INTOSC_EC Internal oscillator, CLKO function on RA6, EC used by USB (INTCKO)
INTOSCIO_EC Internal oscillator, port function on RA6, EC used by USB (INTIO)
ECPLL_EC EC oscillator, PLL enabled, CLKO function on RA6 (ECPLL)
ECPLLIO_EC EC oscillator, PLL enabled, port function on RA6 (ECPIO)
EC_EC EC oscillator, CLKO function on RA6 (EC)
ECIO_EC EC oscillator, port function on RA6 (ECIO)
XTPLL_XT XT oscillator, PLL enabled (XTPLL)
XT_XT XT oscillator (XT)
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
ON Brown-out Reset enabled in hardware only (SBOREN is disabled)
ON_ACTIVE Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled)
SOFT 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
VREGEN USB Voltage Regulator Enable bit
ON USB voltage regulator enabled
OFF USB voltage regulator disabled
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: CONFIG3H @ 0x300005
CCP2MX CCP2 MUX bit
ON CCP2 input/output is multiplexed with RC1
OFF CCP2 input/output is multiplexed with RB3
PBADEN PORTB A/D Enable bit
ON PORTB<4:0> pins are configured as analog input channels on Reset
OFF PORTB<4:0> pins are configured as digital I/O on Reset
LPT1OSC Low-Power Timer 1 Oscillator Enable bit
ON Timer1 configured for low-power operation
OFF Timer1 configured for higher power operation
MCLRE MCLR Pin Enable bit
ON MCLR pin enabled; RE3 input pin disabled
OFF RE3 input pin enabled; MCLR pin disabled
Register: CONFIG4L @ 0x300006
STVREN Stack Full/Underflow Reset Enable bit
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
OFF Single-Supply ICSP disabled
ICPRT Dedicated In-Circuit Debug/Programming Port (ICPORT) Enable bit
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 (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: CONFIG5L @ 0x300008
CP0 Code Protection bit
OFF Block 0 (000800-001FFFh) is not code-protected
ON Block 0 (000800-001FFFh) is code-protected
CP1 Code Protection bit
OFF Block 1 (002000-003FFFh) is not code-protected
ON Block 1 (002000-003FFFh) is code-protected
CP2 Code Protection bit
OFF Block 2 (004000-005FFFh) is not code-protected
ON Block 2 (004000-005FFFh) is code-protected
CP3 Code Protection bit
OFF Block 3 (006000-007FFFh) is not code-protected
ON Block 3 (006000-007FFFh) is code-protected
Register: CONFIG5H @ 0x300009
CPB Boot Block Code Protection bit
OFF Boot block (000000-0007FFh) is not code-protected
ON Boot block (000000-0007FFh) is code-protected
CPD Data EEPROM Code Protection bit
OFF Data EEPROM is not code-protected
ON Data EEPROM is code-protected
Register: CONFIG6L @ 0x30000A
WRT0 Write Protection bit
OFF Block 0 (000800-001FFFh) is not write-protected
ON Block 0 (000800-001FFFh) is write-protected
WRT1 Write Protection bit
OFF Block 1 (002000-003FFFh) is not write-protected
ON Block 1 (002000-003FFFh) is write-protected
WRT2 Write Protection bit
OFF Block 2 (004000-005FFFh) is not write-protected
ON Block 2 (004000-005FFFh) is write-protected
WRT3 Write Protection bit
OFF Block 3 (006000-007FFFh) is not write-protected
ON Block 3 (006000-007FFFh) is write-protected
Register: CONFIG6H @ 0x30000B
WRTC Configuration Register Write Protection bit
OFF Configuration registers (300000-3000FFh) are not write-protected
ON Configuration registers (300000-3000FFh) are write-protected
WRTB Boot Block Write Protection bit
OFF Boot block (000000-0007FFh) is not write-protected
ON Boot block (000000-0007FFh) is write-protected
WRTD Data EEPROM Write Protection bit
OFF Data EEPROM is not write-protected
ON Data EEPROM is write-protected
Register: CONFIG7L @ 0x30000C
EBTR0 Table Read Protection bit
OFF Block 0 (000800-001FFFh) is not protected from table reads executed in other blocks
ON Block 0 (000800-001FFFh) is protected from table reads executed in other blocks
EBTR1 Table Read Protection bit
OFF Block 1 (002000-003FFFh) is not protected from table reads executed in other blocks
ON Block 1 (002000-003FFFh) is protected from table reads executed in other blocks
EBTR2 Table Read Protection bit
OFF Block 2 (004000-005FFFh) is not protected from table reads executed in other blocks
ON Block 2 (004000-005FFFh) is protected from table reads executed in other blocks
EBTR3 Table Read Protection bit
OFF Block 3 (006000-007FFFh) is not protected from table reads executed in other blocks
ON Block 3 (006000-007FFFh) is protected from table reads executed in other blocks
Register: CONFIG7H @ 0x30000D
EBTRB Boot Block Table Read Protection bit
OFF Boot block (000000-0007FFh) is not protected from table reads executed in other blocks
ON Boot block (000000-0007FFh) 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