18F26Q43 Support Information

XC8-CC #pragma config Usage

#pragma config <setting>=<named value>
For example:
// External Oscillator Selection : EC (external clock) above 8 MHz
// Reset Oscillator Selection : EXTOSC operating per FEXTOSC bits (device manufacturing default)
#pragma config FEXTOSC = ECH, RSTOSC = EXTOSC
#pragma config <setting>=<literal constant>
For example:
// External Oscillator Selection : EC (external clock) above 8 MHz
// Reset Oscillator Selection : EXTOSC operating per FEXTOSC bits (device manufacturing default)
#pragma config FEXTOSC = 0x7, RSTOSC = 0x7
#pragma config <register>=<literal constant>
For example:
// External Oscillator Selection : EC (external clock) above 8 MHz
// Reset Oscillator Selection : EXTOSC operating per FEXTOSC bits (device manufacturing default)
#pragma config CONFIG1 = 0xFF
For example:
// IDLOC @ 0x200000
#pragma config IDLOC0 = 0x65535

PIC-AS config Usage

config "<setting>"="<named value>"
For example:
; External Oscillator Selection : EC (external clock) above 8 MHz
; Reset Oscillator Selection : EXTOSC operating per FEXTOSC bits (device manufacturing default)
config "FEXTOSC" = "ECH", "RSTOSC" = "EXTOSC"
config "<setting>"=<literal constant>
For example:
; External Oscillator Selection : EC (external clock) above 8 MHz
; Reset Oscillator Selection : EXTOSC operating per FEXTOSC bits (device manufacturing default)
config "FEXTOSC" = 0x7, "RSTOSC" = 0x7
config "<register>"=<literal constant>
For example:
; External Oscillator Selection : EC (external clock) above 8 MHz
; Reset Oscillator Selection : EXTOSC operating per FEXTOSC bits (device manufacturing default)
config "CONFIG1" = 0xFF
For example:
; IDLOC @ 0x200000
config "IDLOC0" = 0x65535

Configuration Registers & Settings

Register: CONFIG1 @ 0x300000
FEXTOSC External Oscillator Selection
LP LP (crystal oscillator) optimized for 32.768 kHz
XT XT (crystal oscillator) above 100 kHz, below 8 MHz
HS HS (crystal oscillator) above 8 MHz
OFF Oscillator not enabled
ECL EC (external clock) below 100 kHz
ECM EC (external clock) for 500 kHz to 8 MHz
ECH EC (external clock) above 8 MHz
RSTOSC Reset Oscillator Selection
HFINTOSC_64MHZ HFINTOSC with HFFRQ = 64 MHz and CDIV = 1:1
EXTOSC_4PLL EXTOSC with 4x PLL, with EXTOSC operating per FEXTOSC bits
SOSC Secondary Oscillator
LFINTOSC Low-Frequency Oscillator
HFINTOSC_1MHZ HFINTOSC with HFFRQ = 4 MHz and CDIV = 4:1
EXTOSC EXTOSC operating per FEXTOSC bits (device manufacturing default)
Register: CONFIG2 @ 0x300001
CLKOUTEN Clock out Enable bit
OFF CLKOUT function is disabled
ON CLKOUT function is enabled
PR1WAY PRLOCKED One-Way Set Enable bit
ON PRLOCKED bit can be cleared and set only once
OFF PRLOCKED bit can be set and cleared repeatedly
CSWEN Clock Switch Enable bit
OFF The NOSC and NDIV bits cannot be changed by user software
ON Writing to NOSC and NDIV is allowed
FCMEN Fail-Safe Clock Monitor Enable bit
OFF Fail-Safe Clock Monitor disabled
ON Fail-Safe Clock Monitor enabled
Register: CONFIG3 @ 0x300002
MCLRE MCLR Enable bit
EXTMCLR If LVP = 0, MCLR pin is MCLR; If LVP = 1, RE3 pin function is MCLR
INTMCLR If LVP = 0, MCLR pin function is port defined function; If LVP =1, RE3 pin fuction is MCLR
PWRTS Power-up timer selection bits
PWRT_OFF PWRT is disabled
PWRT_64 PWRT set at 64ms
PWRT_16 PWRT set at 16ms
PWRT_1 PWRT set at 1ms
MVECEN Multi-vector enable bit
ON Multi-vector enabled, Vector table used for interrupts
OFF Interrupt contoller does not use vector table to prioritze interrupts
IVT1WAY IVTLOCK bit One-way set enable bit
ON IVTLOCKED bit can be cleared and set only once
OFF IVTLOCKED bit can be cleared and set repeatedly
LPBOREN Low Power BOR Enable bit
OFF Low-Power BOR disabled
ON Low-Power BOR enabled
BOREN Brown-out Reset Enable bits
SBORDIS Brown-out Reset enabled , SBOREN bit is ignored
NOSLP Brown-out Reset enabled while running, disabled in Sleep; SBOREN is ignored
ON Brown-out Reset enabled according to SBOREN
OFF Brown-out Reset disabled
Register: CONFIG4 @ 0x300003
BORV Brown-out Reset Voltage Selection bits
VBOR_1P9 Brown-out Reset Voltage (VBOR) set to 1.9V
VBOR_2P45 Brown-out Reset Voltage (VBOR) set to 2.45V
VBOR_2P7 Brown-out Reset Voltage (VBOR) set to 2.7V
VBOR_2P85 Brown-out Reset Voltage (VBOR) set to 2.8V
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 PPSLOCK bit One-Way Set Enable bit
ON PPSLOCKED bit can be cleared and set only once; PPS registers remain locked after one clear/set cycle
OFF PPSLOCKED bit can be set and cleared repeatedly (subject to the unlock sequence)
STVREN Stack Full/Underflow Reset Enable bit
ON Stack full/underflow will cause Reset
OFF Stack full/underflow will not cause Reset
LVP Low Voltage Programming Enable bit
ON Low voltage programming enabled. MCLR/VPP pin function is MCLR. MCLRE configuration bit is ignored
OFF HV on MCLR/VPP must be used for programming
XINST Extended Instruction Set Enable bit
OFF Extended Instruction Set and Indexed Addressing Mode disabled
ON Extended Instruction Set and Indexed Addressing Mode enabled
Register: CONFIG5 @ 0x300004
WDTCPS WDT Period selection 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
OFF WDT Disabled; SWDTEN is ignored
SWDTEN WDT enabled/disabled by SWDTEN bit
NSLEEP WDT enabled while sleep=0, suspended when sleep=1; SWDTEN ignored
ON WDT enabled regardless of sleep; SWDTEN is ignored
Register: CONFIG6 @ 0x300005
WDTCWS WDT Window Select bits
WDTCWS_0 window delay = 87.5; 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 selector
LFINTOSC WDT reference clock is the 31.0 kHz LFINTOSC
MFINTOSC WDT reference clock is the 32kHz MFINTOSC output
SOSC WDT reference clock is SOSC
SC Software Control
Register: CONFIG7 @ 0x300006
BBSIZE Boot Block Size selection bits
BBSIZE_512 Boot Block size is 512 words
BBSIZE_1024 Boot Block size is 1024 words
BBSIZE_2048 Boot Block size is 2048 words
BBSIZE_4096 Boot Block size is 4096 words
BBSIZE_8192 Boot Block size is 8192 words
BBSIZE_16384 Boot Block size is 16384 words
BBEN Boot Block enable bit
OFF Boot block disabled
ON Boot block enabled
SAFEN Storage Area Flash enable bit
OFF SAF disabled
ON SAF enabled
DEBUG Background Debugger
OFF Background Debugger disabled
ON Background Debugger enabled
Register: CONFIG8 @ 0x300007
WRTB Boot Block Write Protection bit
OFF Boot Block not Write protected
ON Boot Block Write protected
WRTC Configuration Register Write Protection bit
OFF Configuration registers not Write protected
ON Configuration registers Write protected
WRTD Data EEPROM Write Protection bit
OFF Data EEPROM not Write protected
ON Data EEPROM Write protected
WRTSAF SAF Write protection bit
OFF SAF not Write Protected
ON SAF Write Protected
WRTAPP Application Block write protection bit
OFF Application Block not write protected
ON Application Block write protected
Register: CONFIG10 @ 0x300009
CP PFM and Data EEPROM Code Protection bit
OFF PFM and Data EEPROM code protection disabled
ON PFM and Data EEPROM code protection enabled
Register: IDLOC0 @ 0x200000
Register: IDLOC1 @ 0x200002
Register: IDLOC2 @ 0x200004
Register: IDLOC3 @ 0x200006
Register: IDLOC4 @ 0x200008
Register: IDLOC5 @ 0x20000A
Register: IDLOC6 @ 0x20000C
Register: IDLOC7 @ 0x20000E
Register: IDLOC8 @ 0x200010
Register: IDLOC9 @ 0x200012
Register: IDLOC10 @ 0x200014
Register: IDLOC11 @ 0x200016
Register: IDLOC12 @ 0x200018
Register: IDLOC13 @ 0x20001A
Register: IDLOC14 @ 0x20001C
Register: IDLOC15 @ 0x20001E
Register: IDLOC16 @ 0x200020
Register: IDLOC17 @ 0x200022
Register: IDLOC18 @ 0x200024
Register: IDLOC19 @ 0x200026
Register: IDLOC20 @ 0x200028
Register: IDLOC21 @ 0x20002A
Register: IDLOC22 @ 0x20002C
Register: IDLOC23 @ 0x20002E
Register: IDLOC24 @ 0x200030
Register: IDLOC25 @ 0x200032
Register: IDLOC26 @ 0x200034
Register: IDLOC27 @ 0x200036
Register: IDLOC28 @ 0x200038
Register: IDLOC29 @ 0x20003A
Register: IDLOC30 @ 0x20003C
Register: IDLOC31 @ 0x20003E

Interrupt Sources

The following table enumerates the IRQ numbers for this device along with descriptions of the interrupt sources. Also shown are the corresponding symbols that can be used as an argument to irq() in the __interrupt() specifier and the macro names that can be used in C source.

For example: __interrupt() specifier usage.
	void __interrupt(irq(SWINT)) isr0(void) { 
		// do stuff
	}
For example: macro usage.
	void __interrupt(irq(default)) isr1(unsigned char irq) {
		switch (irq) {
			case IRQ_HLVD:
				// do HLVD Interrupt stuff
				break;
			case IRQ_OSF:
				// do Oscillator Failure Interrupt stuff
				break;
			case IRQ_CSW:
				// do Clock Switch Interrupt stuff
				break;
			default:
				// do any other stuff
				break;
		}
	}
IRQ __irq() Argument C Device-header Macro Description
0 SWINT IRQ_SWINT Software Interrupt
1 HLVD IRQ_HLVD HLVD Interrupt
2 OSF IRQ_OSF Oscillator Failure Interrupt
3 CSW IRQ_CSW Clock Switch Interrupt
5 CLC1 IRQ_CLC1 CLC1 Interrupt
7 IOC IRQ_IOC Interrupt on change
8 INT0 IRQ_INT0 External Interrupt 0
9 ZCD IRQ_ZCD ZCD Interrupt
10 AD IRQ_AD ADC Interrupt
11 ACT IRQ_ACT Active Clock Tuning Interrupt
12 CMP1 IRQ_CMP1 Comparator 1 Interrupt
13 SMT1 IRQ_SMT1 SMT1 Interrupt
14 SMT1PRA IRQ_SMT1PRA SMT1 Period acqusition Interrupt
15 SMT1PRW IRQ_SMT1PRW SMT1 Pulse width acqusition Interrupt
16 ADT IRQ_ADT ADC Treshold Interrupt
20 DMA1SCNT IRQ_DMA1SCNT DMA1 Source count Interrupt
21 DMA1DCNT IRQ_DMA1DCNT DMA1 Destination count Interrupt
22 DMA1OR IRQ_DMA1OR DMA1 Overflow Interrupt
23 DMA1A IRQ_DMA1A DMA1 Abort Interrupt
24 SPI1RX IRQ_SPI1RX SPI1 Receive Interrupt
25 SPI1TX IRQ_SPI1TX SPI1 Transmit Interrupt
26 SPI1 IRQ_SPI1 SPI1 Interrupt
27 TMR2 IRQ_TMR2 Timer2 Interrupt
28 TMR1 IRQ_TMR1 Timer1 Interrupt
29 TMR1G IRQ_TMR1G Timer1 Gate Interrupt
30 CCP1 IRQ_CCP1 CCP1 Interrupt
31 TMR0 IRQ_TMR0 Timer0 Interrupt
32 U1RX IRQ_U1RX UART1 Receive Interrupt
33 U1TX IRQ_U1TX UART1 Transmit Interrupt
34 U1E IRQ_U1E UART1 Error Interrupt
35 U1 IRQ_U1 UART1 Interrupt
38 PWM1PR IRQ_PWM1PR PWM1 Period Interrupt
39 PWM1 IRQ_PWM1 PWM1 Interrupt
40 SPI2RX IRQ_SPI2RX SPI2 Receive Interrupt
41 SPI2TX IRQ_SPI2TX SPI2 Transmit Interrupt
42 SPI2 IRQ_SPI2 SPI2 Interrupt
44 TMR3 IRQ_TMR3 Timer3 Interrupt
45 TMR3G IRQ_TMR3G Timer3 Gate Interrupt
46 PWM2PR IRQ_PWM2PR PWM2 Period Interrupt
47 PWM2 IRQ_PWM2 PWM2 Interrupt
48 INT1 IRQ_INT1 External Interrupt 1
49 CLC2 IRQ_CLC2 CLC2 Interrupt
50 CWG1 IRQ_CWG1 CWG1 Interrupt
51 NCO1 IRQ_NCO1 NCO1 Interrupt
52 DMA2SCNT IRQ_DMA2SCNT DMA2 Source count Interrupt
53 DMA2DCNT IRQ_DMA2DCNT DMA2 Destination count Interrupt
54 DMA2OR IRQ_DMA2OR DMA2 Overflow Interrupt
55 DMA2A IRQ_DMA2A DMA2 Abort Interrupt
56 I2C1RX IRQ_I2C1RX I2C1 Receive Interrupt
57 I2C1TX IRQ_I2C1TX I2C1 Transmit Interrupt
58 I2C1 IRQ_I2C1 I2C1 Interrupt
59 I2C1E IRQ_I2C1E I2C1 Error Interrupt
61 CLC3 IRQ_CLC3 CLC3 Interrupt
62 PWM3PR IRQ_PWM3PR PWM3 Period Interrupt
63 PWM3 IRQ_PWM3 PWM3 Interrupt
64 U2RX IRQ_U2RX UART2 Receive Interrupt
65 U2TX IRQ_U2TX UART2 Transmit Interrupt
66 U2E IRQ_U2E UART2 Error Interrupt
67 U2 IRQ_U2 UART2 Interrupt
68 TMR5 IRQ_TMR5 Timer5 Interrupt
69 TMR5G IRQ_TMR5G Timer5 Gate Interrupt
70 CCP2 IRQ_CCP2 CCP2 Interrupt
71 SCAN IRQ_SCAN Scanner Interrupt
72 U3RX IRQ_U3RX UART3 Receive Interrupt
73 U3TX IRQ_U3TX UART3 Transmit Interrupt
74 U3E IRQ_U3E UART3 Error Interrupt
75 U3 IRQ_U3 UART3 Interrupt
77 CLC4 IRQ_CLC4 CLC4 Interrupt
80 INT2 IRQ_INT2 External Interrupt 2
81 CLC5 IRQ_CLC5 CLC5 Interrupt
82 CWG2 IRQ_CWG2 CWG2 Interrupt
83 NCO2 IRQ_NCO2 NCO2 Interrupt
84 DMA3SCNT IRQ_DMA3SCNT DMA3 Source count Interrupt
85 DMA3DCNT IRQ_DMA3DCNT DMA3 Destination count Interrupt
86 DMA3OR IRQ_DMA3OR DMA3 Overflow Interrupt
87 DMA3A IRQ_DMA3A DMA3 Abort Interrupt
88 CCP3 IRQ_CCP3 CCP3 Interrupt
89 CLC6 IRQ_CLC6 CLC6 Interrupt
90 CWG3 IRQ_CWG3 CWG3 Interrupt
91 TMR4 IRQ_TMR4 Timer4 Interrupt
92 DMA4SCNT IRQ_DMA4SCNT DMA4 Source count Interrupt
93 DMA4DCNT IRQ_DMA4DCNT DMA4 Destination count Interrupt
94 DMA4OR IRQ_DMA4OR DMA4 Overflow Interrupt
95 DMA4A IRQ_DMA4A DMA4 Abort Interrupt
96 U4RX IRQ_U4RX UART4 Receive Interrupt
97 U4TX IRQ_U4TX UART4 Transmit Interrupt
98 U4E IRQ_U4E UART4 Error Interrupt
99 U4 IRQ_U4 UART4 Interrupt
100 DMA5SCNT IRQ_DMA5SCNT DMA5 Source count Interrupt
101 DMA5DCNT IRQ_DMA5DCNT DMA5 Destination count Interrupt
102 DMA5OR IRQ_DMA5OR DMA5 Overflow Interrupt
103 DMA5A IRQ_DMA5A DMA5 Abort Interrupt
104 U5RX IRQ_U5RX UART5 Receive Interrupt
105 U5TX IRQ_U5TX UART5 Transmit Interrupt
106 U5E IRQ_U5E UART5 Error Interrupt
107 U5 IRQ_U5 UART5 Interrupt
108 DMA6SCNT IRQ_DMA6SCNT DMA6 Source count Interrupt
109 DMA6DCNT IRQ_DMA6DCNT DMA6 Destination count Interrupt
110 DMA6OR IRQ_DMA6OR DMA6 Overflow Interrupt
111 DMA6A IRQ_DMA6A DMA6 Abort Interrupt
113 CLC7 IRQ_CLC7 CLC7 Interrupt
114 CMP2 IRQ_CMP2 Comparator 2 Interrupt
115 NCO3 IRQ_NCO3 NCO3 Interrupt
120 NVM IRQ_NVM NVM Interrupt
121 CLC8 IRQ_CLC8 CLC8 Interrupt
122 CRC IRQ_CRC CRC Interrupt
123 TMR6 IRQ_TMR6 Timer6 Interrupt