16F18154 Support Information

XC8-CC #pragma config Usage

#pragma config <setting>=<named value>
For example:
// External Oscillator Selection bits : EC (external clock) above 16 MHz
// Reset Oscillator Selection bits : EXTOSC operating per FEXTOSC bits
// Clock Out Enable bit : CLKOUT function is disabled; i/o or oscillator function on OSC2
// Clock Switch Enable bit : Writing to NOSC and NDIV is allowed
// VDD Range Analog Calibration Selection bit : Internal analog systems are calibrated for operation between VDD = 2.3 - 5.5V
// Fail-Safe Clock Monitor Enable bit : Fail-Safe Clock Monitor enabled
#pragma config FEXTOSC = ECH, RSTOSC = EXTOSC, CLKOUTEN = OFF, CSWEN = ON, VDDAR = HI, FCMEN = ON
#pragma config <setting>=<literal constant>
For example:
// External Oscillator Selection bits : EC (external clock) above 16 MHz
// Reset Oscillator Selection bits : EXTOSC operating per FEXTOSC bits
// Clock Out Enable bit : CLKOUT function is disabled; i/o or oscillator function on OSC2
// Clock Switch Enable bit : Writing to NOSC and NDIV is allowed
// VDD Range Analog Calibration Selection bit : Internal analog systems are calibrated for operation between VDD = 2.3 - 5.5V
// Fail-Safe Clock Monitor Enable bit : Fail-Safe Clock Monitor enabled
#pragma config FEXTOSC = 0x7, RSTOSC = 0x7, CLKOUTEN = 0x1, CSWEN = 0x1, VDDAR = 0x1, FCMEN = 0x1
#pragma config <register>=<literal constant>
For example:
// External Oscillator Selection bits : EC (external clock) above 16 MHz
// Reset Oscillator Selection bits : EXTOSC operating per FEXTOSC bits
// Clock Out Enable bit : CLKOUT function is disabled; i/o or oscillator function on OSC2
// Clock Switch Enable bit : Writing to NOSC and NDIV is allowed
// VDD Range Analog Calibration Selection bit : Internal analog systems are calibrated for operation between VDD = 2.3 - 5.5V
// Fail-Safe Clock Monitor Enable bit : Fail-Safe Clock Monitor enabled
#pragma config CONFIG1 = 0x3FFF
For example:
// IDLOC @ 0x8000
#pragma config IDLOC0 = 0x16383

PIC-AS config Usage

config "<setting>"="<named value>"
For example:
; External Oscillator Selection bits : EC (external clock) above 16 MHz
; Reset Oscillator Selection bits : EXTOSC operating per FEXTOSC bits
; Clock Out Enable bit : CLKOUT function is disabled; i/o or oscillator function on OSC2
; Clock Switch Enable bit : Writing to NOSC and NDIV is allowed
; VDD Range Analog Calibration Selection bit : Internal analog systems are calibrated for operation between VDD = 2.3 - 5.5V
; Fail-Safe Clock Monitor Enable bit : Fail-Safe Clock Monitor enabled
config "FEXTOSC" = "ECH", "RSTOSC" = "EXTOSC", "CLKOUTEN" = "OFF", "CSWEN" = "ON", "VDDAR" = "HI", "FCMEN" = "ON"
config "<setting>"=<literal constant>
For example:
; External Oscillator Selection bits : EC (external clock) above 16 MHz
; Reset Oscillator Selection bits : EXTOSC operating per FEXTOSC bits
; Clock Out Enable bit : CLKOUT function is disabled; i/o or oscillator function on OSC2
; Clock Switch Enable bit : Writing to NOSC and NDIV is allowed
; VDD Range Analog Calibration Selection bit : Internal analog systems are calibrated for operation between VDD = 2.3 - 5.5V
; Fail-Safe Clock Monitor Enable bit : Fail-Safe Clock Monitor enabled
config "FEXTOSC" = 0x7, "RSTOSC" = 0x7, "CLKOUTEN" = 0x1, "CSWEN" = 0x1, "VDDAR" = 0x1, "FCMEN" = 0x1
config "<register>"=<literal constant>
For example:
; External Oscillator Selection bits : EC (external clock) above 16 MHz
; Reset Oscillator Selection bits : EXTOSC operating per FEXTOSC bits
; Clock Out Enable bit : CLKOUT function is disabled; i/o or oscillator function on OSC2
; Clock Switch Enable bit : Writing to NOSC and NDIV is allowed
; VDD Range Analog Calibration Selection bit : Internal analog systems are calibrated for operation between VDD = 2.3 - 5.5V
; Fail-Safe Clock Monitor Enable bit : Fail-Safe Clock Monitor enabled
config "CONFIG1" = 0x3FFF
For example:
; IDLOC @ 0x8000
config "IDLOC0" = 0x16383

Configuration Registers & Settings

Register: CONFIG1 @ 0x8007
FEXTOSC External Oscillator Selection bits
ECH EC (external clock) above 16 MHz
ECL EC (external clock) below 16 MHz
OFF Oscillator not enabled
HS HS (crystal oscillator) above 4MHz
XT XT (crystal oscillator) above 100kHz, below 4MHz
LP LP (crystal oscillator) optimized for 32.768kHz
RSTOSC Reset Oscillator Selection bits
EXTOSC EXTOSC operating per FEXTOSC bits
HFINTOSC_1MHz HFINTOSC (1MHz)
LFINTOSC LFINTOSC
SOSC SOSC
EXTOSC_4PLL EXTOSC with 4x PLL, with EXTOSC operating per FEXTOSC bits
HFINTOSC_16MHz HFINTOSC (16 MHz)
HFINTOSC_32MHz HFINTOSC (32 MHz)
CLKOUTEN Clock Out Enable bit
ON CLKOUT function is enabled; FOSC/4 clock appears at OSC2
OFF CLKOUT function is disabled; i/o or oscillator function on OSC2
CSWEN Clock Switch Enable bit
ON Writing to NOSC and NDIV is allowed
OFF The NOSC and NDIV bits cannot be changed by user software
VDDAR VDD Range Analog Calibration Selection bit
HI Internal analog systems are calibrated for operation between VDD = 2.3 - 5.5V
LO Internal analog systems are calibrated for operation between VDD = 1.8 - 3.6V
FCMEN Fail-Safe Clock Monitor Enable bit
ON Fail-Safe Clock Monitor enabled
OFF Fail-Safe Clock Monitor disabled
Register: CONFIG2 @ 0x8008
MCLRE Master Clear Enable bit
EXTMCLR If LVP = 0, MCLR pin is MCLR; If LVP = 1, RA3 pin function is MCLR
INTMCLR If LVP = 0, MCLR is port-defined function; If LVP = 1, RA3 pin function is MCLR
PWRTS Power-up Timer Selection bits
PWRT_OFF PWRT is disabled
PWRT_64 PWRT set at 64 ms
PWRT_16 PWRT set at 16 ms
PWRT_1 PWRT set at 1 ms
LPBOREN Low-Power BOR Enable bit
OFF ULPBOR disabled
ON ULPBOR enabled
BOREN Brown-out Reset Enable bits
ON Brown-out Reset enabled, SBOREN bit is ignored
NSLEEP Brown-out Reset enabled while running, disabled in sleep; SBOREN is ignored
SBOREN Brown-out reset enabled according to SBOREN bit
OFF Brown-out reset disabled
DACAUTOEN DAC Buffer Automatic Range Select Enable bit
OFF DAC Buffer reference range is determined by the REFRNG bit
ON DAC Buffer reference range is automatically determined by module hardware
BORV Brown-out Reset Voltage Selection bit
LO Brown-out Reset Voltage (VBOR) set to 1.9V
HI Brown-out Reset Voltage (VBOR) is set to 2.85V
ZCD ZCD Disable bit
OFF ZCD module is disabled; ZCD can be enabled by setting the ZCDSEN bit of ZCDCON
ON ZCD module is always enabled; ZCDMD and ZCDSEN bits are ignored
PPS1WAY PPSLOCKED One-Way Set Enable bit
ON The PPSLOCKED bit can be cleared and set only once after an unlocking sequence is executed; once PPSLOCKED is set, all future changes to PPS registers are prevented
OFF The PPSLOCKED bit can be set and cleared as needed (unlocking sequence is required)
STVREN Stack Overflow/Underflow Reset Enable bit
ON Stack Overflow or Underflow will cause a reset
OFF Stack Overflow or Underflow will not cause a reset
DEBUG Background Debugger
OFF Background Debugger disabled
ON background debugger enabled
Register: CONFIG3 @ 0x8009
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 bits
OFF WDT Disabled, SEN is ignored
SWDTEN WDT enabled/disabled by SEN bit
NSLEEP WDT enabled while Sleep = 0, suspended when Sleep = 1; SEN is ignored
ON WDT enabled regardless of Sleep; SEN bit is ignored
WDTCWS WDT Window Select bits
WDTCWS_0 window delay = 87.5 percent of time; 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 Select bits
LFINTOSC WDT reference clock is the 31.0 kHz LFINTOSC
MFINTOSC WDT reference clock is the 32 kHz MFINTOSC
SOSC WDT reference clock is the 32kHz secondary oscillator
SC Software Control
Register: CONFIG4 @ 0x800A
BBSIZE Boot Block Size Selection bits
BB512 512 words boot block size
BB1K 1024 words boot block size
BB2K 2048 words boot block size
BB4K * half of user program memory
BB8K * half of user program memory
BB16K * half of user program memory
BB32K * half of user program memory
BB64K * half of user program memory
BBEN Boot Block Enable bit
OFF Boot Block disabled
ON Boot Block enabled
SAFEN Storage Area Flash (SAF) Enable bit
OFF SAF disabled
ON SAF enabled
WRTAPP Application Block Write Protection bit
OFF Application Block is NOT write protected
ON Application Block is write protected
WRTB Boot Block Write Protection bit
OFF Boot Block is NOT write protected
ON Boot Block is write protected
WRTC Configuration Register Write Protection bit
OFF Configuration Register is NOT write protected
ON Configuration Register is write protected
WRTD Data EEPROM Write Protection bit
OFF Data EEPROM is NOT write protected
ON Data EEPROM is write protected
WRTSAF Storage Area Flash (SAF) Write Protection bit
OFF SAF is NOT write protected
ON SAF is write protected
LVP Low Voltage Programming Enable bit
ON Low Voltage programming enabled. MCLR/Vpp pin function is MCLR. MCLRE Configuration bit is ignored
OFF High Voltage on MCLR/Vpp must be used for programming
Register: CONFIG5 @ 0x800B
CP Program Flash Memory Code Protection bit
OFF Program Flash Memory code protection is disabled
ON Program Flash Memory code protection is enabled
CPD Data EEPROM Code Protection bit
OFF Data EEPROM code protection is disabled
ON Data EEPROM code protection is enabled
Register: IDLOC0 @ 0x8000
Register: IDLOC1 @ 0x8001
Register: IDLOC2 @ 0x8002
Register: IDLOC3 @ 0x8003