3
;==========================================================================
4
; $Id: p18f86j55.inc,v 1.1 2006/08/19 02:52:41 craigfranklin Exp $
5
; MPASM PIC18F86J55 processor include
7
; (c) Copyright 1999-2006 Microchip Technology, All rights reserved
8
;==========================================================================
12
;==========================================================================
13
; This header file defines configurations, registers, and other useful
14
; bits of information for the PIC18F86J55 microcontroller. These names
15
; are taken to match the data sheets as closely as possible.
17
; Note that the processor must be selected before this file is included.
18
; The processor may be selected the following ways:
20
; 1. Command line switch:
21
; C:\MPASM MYFILE.ASM /PIC18F86J55
22
; 2. LIST directive in the source file
24
; 3. Processor Type entry in the MPASM full-screen interface
25
; 4. Setting the processor in the MPLAB Project Dialog
26
;==========================================================================
28
;==========================================================================
32
;==========================================================================
34
MESSG "Processor-header file mismatch. Verify selected processor."
37
;==========================================================================
38
; 18xxxx Family EQUates
39
;==========================================================================
50
;==========================================================================
52
;==========================================================================
53
; 16Cxxx/17Cxxx Substitutions
54
;==========================================================================
55
#define DDRA TRISA ; PIC17Cxxx SFR substitution
56
#define DDRB TRISB ; PIC17Cxxx SFR substitution
57
#define DDRC TRISC ; PIC17Cxxx SFR substitution
58
#define DDRD TRISD ; PIC17Cxxx SFR substitution
59
#define DDRE TRISE ; PIC17Cxxx SFR substitution
61
;==========================================================================
63
; Register Definitions
65
;==========================================================================
67
;----- Register Files -----------------------------------------------------
113
PMPDATA1L EQU H'0F66'
114
PMPDATA1H EQU H'0F67'
315
;----- PMSTATL Bits -----------------------------------------------------
324
;----- PMSTATH Bits -----------------------------------------------------
333
;----- PMPENL Bits -----------------------------------------------------
344
;----- PMPENH Bits -----------------------------------------------------
355
;----- PMPMODEL Bits -----------------------------------------------------
366
;----- PMPMODEH Bits -----------------------------------------------------
377
;----- PMPCONL Bits -----------------------------------------------------
388
;----- PMPCONH Bits -----------------------------------------------------
399
;----- UEP0 Bits -----------------------------------------------------
407
;----- UEP1 Bits -----------------------------------------------------
415
;----- UEP2 Bits -----------------------------------------------------
423
;----- UEP3 Bits -----------------------------------------------------
431
;----- UEP4 Bits -----------------------------------------------------
439
;----- UEP5 Bits -----------------------------------------------------
447
;----- UEP6 Bits -----------------------------------------------------
455
;----- UEP7 Bits -----------------------------------------------------
463
;----- UEP8 Bits -----------------------------------------------------
471
;----- UEP9 Bits -----------------------------------------------------
479
;----- UEP10 Bits -----------------------------------------------------
487
;----- UEP11 Bits -----------------------------------------------------
495
;----- UEP12 Bits -----------------------------------------------------
503
;----- UEP13 Bits -----------------------------------------------------
511
;----- UEP14 Bits -----------------------------------------------------
519
;----- UEP15 Bits -----------------------------------------------------
527
;----- UIE Bits -----------------------------------------------------
537
;----- UEIE Bits -----------------------------------------------------
546
;----- UADDR Bits -----------------------------------------------------
556
;----- UCFG Bits -----------------------------------------------------
566
;----- UFRML Bits -----------------------------------------------------
577
;----- UFRMH Bits -----------------------------------------------------
583
;----- UIR Bits -----------------------------------------------------
593
;----- UEIR Bits -----------------------------------------------------
602
;----- USTAT Bits -----------------------------------------------------
611
;----- UCON Bits -----------------------------------------------------
620
;----- PMPADDRH Bits -----------------------------------------------------
625
;----- CMSTATUS Bits -----------------------------------------------------
630
;----- SSP2CON2 Bits -----------------------------------------------------
641
;----- SSP2CON1 Bits -----------------------------------------------------
652
;----- SSP2STAT Bits -----------------------------------------------------
663
I2C_START EQU H'0003'
670
NOT_WRITE EQU H'0002'
671
NOT_ADDRESS EQU H'0005'
673
READ_WRITE EQU H'0002'
674
DATA_ADDRESS EQU H'0005'
680
;----- SSP2MSK Bits -----------------------------------------------------
691
;----- CCP5CON Bits -----------------------------------------------------
703
;----- CCP4CON Bits -----------------------------------------------------
715
;----- T4CON Bits -----------------------------------------------------
725
;----- CVRCON Bits -----------------------------------------------------
736
;----- T3CON Bits -----------------------------------------------------
748
NOT_T3SYNC EQU H'0002'
751
;----- BAUDCON2 Bits -----------------------------------------------------
763
;----- BAUDCON1 Bits -----------------------------------------------------
775
;----- PORTA Bits -----------------------------------------------------
796
;----- PORTB Bits -----------------------------------------------------
820
;----- PORTC Bits -----------------------------------------------------
844
; DT is a reserved word
848
;----- PORTD Bits -----------------------------------------------------
885
;----- PORTE Bits -----------------------------------------------------
909
;----- PORTF Bits -----------------------------------------------------
936
;----- PORTG Bits -----------------------------------------------------
957
;----- PORTH Bits -----------------------------------------------------
977
;----- PORTJ Bits -----------------------------------------------------
997
;----- LATA Bits -----------------------------------------------------
1006
;----- LATB Bits -----------------------------------------------------
1017
;----- LATC Bits -----------------------------------------------------
1028
;----- LATD Bits -----------------------------------------------------
1039
;----- LATE Bits -----------------------------------------------------
1050
;----- LATF Bits -----------------------------------------------------
1057
;----- LATG Bits -----------------------------------------------------
1065
;----- LATH Bits -----------------------------------------------------
1076
;----- LATJ Bits -----------------------------------------------------
1087
;----- DDRA Bits -----------------------------------------------------
1096
;----- TRISA Bits -----------------------------------------------------
1105
;----- DDRB Bits -----------------------------------------------------
1116
;----- TRISB Bits -----------------------------------------------------
1127
;----- DDRC Bits -----------------------------------------------------
1138
;----- TRISC Bits -----------------------------------------------------
1149
;----- DDRD Bits -----------------------------------------------------
1160
;----- TRISD Bits -----------------------------------------------------
1171
;----- DDRE Bits -----------------------------------------------------
1182
;----- TRISE Bits -----------------------------------------------------
1193
;----- DDRF Bits -----------------------------------------------------
1203
;----- TRISF Bits -----------------------------------------------------
1212
;----- DDRG Bits -----------------------------------------------------
1220
;----- TRISG Bits -----------------------------------------------------
1228
;----- DDRH Bits -----------------------------------------------------
1239
;----- TRISH Bits -----------------------------------------------------
1250
;----- DDRJ Bits -----------------------------------------------------
1261
;----- TRISJ Bits -----------------------------------------------------
1272
;----- OSCTUNE Bits -----------------------------------------------------
1280
HF256DIV EQU H'0007'
1283
;----- RCSTA2 Bits -----------------------------------------------------
1301
;----- PIE1 Bits -----------------------------------------------------
1316
;----- PIR1 Bits -----------------------------------------------------
1331
;----- IPR1 Bits -----------------------------------------------------
1346
;----- PIE2 Bits -----------------------------------------------------
1359
;----- PIR2 Bits -----------------------------------------------------
1372
;----- IPR2 Bits -----------------------------------------------------
1385
;----- PIE3 Bits -----------------------------------------------------
1396
;----- PIR3 Bits -----------------------------------------------------
1407
;----- IPR3 Bits -----------------------------------------------------
1418
;----- EECON1 Bits -----------------------------------------------------
1426
;----- TXSTA2 Bits -----------------------------------------------------
1442
;----- RCSTA Bits -----------------------------------------------------
1460
;----- RCSTA1 Bits -----------------------------------------------------
1478
;----- TXSTA Bits -----------------------------------------------------
1494
;----- TXSTA1 Bits -----------------------------------------------------
1510
;----- CCP3CON Bits -----------------------------------------------------
1524
;----- ECCP3CON Bits -----------------------------------------------------
1538
;----- PWM3CON Bits -----------------------------------------------------
1549
;----- ECCP3AS Bits -----------------------------------------------------
1563
ECCP3AS0 EQU H'0004'
1564
ECCP3AS1 EQU H'0005'
1565
ECCP3AS2 EQU H'0006'
1566
ECCP3ASE EQU H'0007'
1569
;----- CCP2CON Bits -----------------------------------------------------
1583
;----- ECCP2CON Bits -----------------------------------------------------
1597
;----- PWM2CON Bits -----------------------------------------------------
1608
;----- ECCP2AS Bits -----------------------------------------------------
1622
ECCP2AS0 EQU H'0004'
1623
ECCP2AS1 EQU H'0005'
1624
ECCP2AS2 EQU H'0006'
1625
ECCP2ASE EQU H'0007'
1628
;----- CCP1CON Bits -----------------------------------------------------
1642
;----- ECCP1CON Bits -----------------------------------------------------
1656
;----- PWM1CON Bits -----------------------------------------------------
1667
;----- ECCP1AS Bits -----------------------------------------------------
1681
ECCP1AS0 EQU H'0004'
1682
ECCP1AS1 EQU H'0005'
1683
ECCP1AS2 EQU H'0006'
1684
ECCP1ASE EQU H'0007'
1687
;----- WDTCON Bits -----------------------------------------------------
1695
;----- ADCON2 Bits -----------------------------------------------------
1706
;----- ADPCFGL Bits -----------------------------------------------------
1717
;----- ADCON1 Bits -----------------------------------------------------
1731
NOT_DONE EQU H'0001'
1734
;----- ADPCFGH Bits -----------------------------------------------------
1745
;----- SSP1CON2 Bits -----------------------------------------------------
1756
;----- SSPCON2 Bits -----------------------------------------------------
1767
;----- SSP1CON1 Bits -----------------------------------------------------
1778
;----- SSPCON1 Bits -----------------------------------------------------
1789
;----- SSP1STAT Bits -----------------------------------------------------
1799
I2C_READ EQU H'0002'
1800
I2C_START EQU H'0003'
1801
I2C_STOP EQU H'0004'
1807
NOT_WRITE EQU H'0002'
1808
NOT_ADDRESS EQU H'0005'
1810
READ_WRITE EQU H'0002'
1811
DATA_ADDRESS EQU H'0005'
1817
;----- SSPSTAT Bits -----------------------------------------------------
1827
I2C_READ EQU H'0002'
1828
I2C_START EQU H'0003'
1829
I2C_STOP EQU H'0004'
1835
NOT_WRITE EQU H'0002'
1836
NOT_ADDRESS EQU H'0005'
1838
READ_WRITE EQU H'0002'
1839
DATA_ADDRESS EQU H'0005'
1845
;----- T2CON Bits -----------------------------------------------------
1849
T2OUTPS0 EQU H'0003'
1850
T2OUTPS1 EQU H'0004'
1851
T2OUTPS2 EQU H'0005'
1852
T2OUTPS3 EQU H'0006'
1855
;----- MEMCON Bits -----------------------------------------------------
1863
;----- PADCFG1 Bits -----------------------------------------------------
1867
;----- ODCON3 Bits -----------------------------------------------------
1872
;----- T1CON Bits -----------------------------------------------------
1882
T1INSYNC EQU H'0002'
1884
NOT_T1SYNC EQU H'0002'
1887
;----- ODCON2 Bits -----------------------------------------------------
1888
USART1OD EQU H'0000'
1889
USART2OD EQU H'0001'
1892
;----- ODCON1 Bits -----------------------------------------------------
1900
;----- RCON Bits -----------------------------------------------------
1917
;----- CM2CON1 Bits -----------------------------------------------------
1928
;----- CM1CON1 Bits -----------------------------------------------------
1939
;----- OSCCON Bits -----------------------------------------------------
1952
;----- RF0CON Bits -----------------------------------------------------
1962
;----- T0CON Bits -----------------------------------------------------
1975
;----- STATUS Bits -----------------------------------------------------
1983
;----- INTCON3 Bits -----------------------------------------------------
2003
;----- INTCON2 Bits -----------------------------------------------------
2011
NOT_RBPU EQU H'0007'
2018
;----- INTCON Bits -----------------------------------------------------
2036
;----- STKPTR Bits -----------------------------------------------------
2054
;==========================================================================
2058
;==========================================================================
2062
;==========================================================================
2064
; IMPORTANT: For the PIC18 devices, the __CONFIG directive has been
2065
; superseded by the CONFIG directive. The following settings
2066
; are available for this device.
2068
; Background Debugger Enable bit:
2069
; DEBUG = ON Background debugger enabled; RB6 and RB7 are dedicated to In-Circuit Debug
2070
; DEBUG = OFF Background debugger disabled; RB6 and RB7 configured as general purpose I/O pins
2072
; Extended Instruction Set Enable bit:
2073
; XINST = OFF Instruction set extension and Indexed Addressing mode disabled (Legacy mode)
2074
; XINST = ON Instruction set extension and Indexed Addressing mode enabled
2076
; Stack Overflow/Underflow Reset Enable bit:
2077
; STVREN = OFF Reset on stack overflow/underflow disabled
2078
; STVREN = ON Reset on stack overflow/underflow enabled
2080
; PLL Prescaler Selection bits:
2081
; PLLDIV = 12 Divide by 12 (48 MHz oscillator input)
2082
; PLLDIV = 10 Divide by 10 (40 MHz oscillator input)
2083
; PLLDIV = 6 Divide by 6 (24 MHz oscillator input)
2084
; PLLDIV = 5 Divide by 5 (20 MHz oscillator input)
2085
; PLLDIV = 4 Divide by 4 (16 MHz oscillator input)
2086
; PLLDIV = 3 Divide by 3 (12 MHz oscillator input)
2087
; PLLDIV = 2 Divide by 2 (8 MHz oscillator input)
2088
; PLLDIV = 1 No prescale (4 MHz oscillator input drives PLL directly)
2090
; Watchdog Timer Enable bit:
2091
; WDTEN = OFF WDT disabled (control is placed on SWDTEN bit)
2092
; WDTEN = ON WDT enabled
2094
; Code Protection bit:
2095
; CP0 = ON Program memory is code-protected
2096
; CP0 = OFF Program memory is not code-protected
2098
; CPU System Clock Postscaler:
2099
; CPUDIV = OSC1_PLL2 [OSC1/OSC2 Src: /1][96 MHz PLL Src: /2]
2100
; CPUDIV = OSC2_PLL3 [OSC1/OSC2 Src: /2][96 MHz PLL Src: /3]
2101
; CPUDIV = OSC3_PLL4 [OSC1/OSC2 Src: /3][96 MHz PLL Src: /4]
2102
; CPUDIV = OSC4_PLL6 [OSC1/OSC2 Src: /4][96 MHz PLL Src: /6]
2104
; Two-Speed Start-up (Internal/External Oscillator Switchover) Control bit:
2105
; IESO = OFF Two-Speed Start-up disabled
2106
; IESO = ON Two-Speed Start-up enabled
2108
; Fail-Safe Clock Monitor Enable bit:
2109
; FCMEN = OFF Fail-Safe Clock Monitor disabled
2110
; FCMEN = ON Fail-Safe Clock Monitor enabled
2112
; Oscillator Selection bits:
2113
; FOSC = INTOSCIO Internal oscillator, port function on RA6 and RA7
2114
; FOSC = INTOSC Internal oscillator, CLKOUT on RA6 and port function on RA7
2115
; FOSC = INTOSCPLLIO_HSINTOSC with PLL enabled, port function on RA6 and RA7, HS used by USB
2116
; FOSC = INTOSCPLL_HS INTOSC with PLL enabled,CLKOUT on RA6 and port function on RA7, HS used by USB
2117
; FOSC = HS HS oscillator, HS used by USB
2118
; FOSC = HSPLL_HS HS oscillator, PLL enabled, HS used by USB
2119
; FOSC = EC EC Oscillator with clock out on RA6, EC used by USB
2120
; FOSC = ECPLL_EC EC Oscillator with PLL , CLKOUT on RA6, EC used by USB
2122
; Watchdog Timer Postscaler Select bits:
2133
; WDTPS = 1024 1:1024
2134
; WDTPS = 2048 1:2048
2135
; WDTPS = 4096 1:4096
2136
; WDTPS = 8192 1:8192
2137
; WDTPS = 16384 1:16384
2138
; WDTPS = 32768 1:32768
2140
; External Bus Wait Enable bit:
2141
; WAIT = ON Wait states for operations on external memory bus enabled
2142
; WAIT = OFF Wait states for operations on external memory bus disabled
2144
; Data Bus Width Select bit:
2145
; BW = 8 8-bit external bus mode
2146
; BW = 16 16-bit external bus mode
2148
; Processor Mode Selection:
2149
; MODE = XM20 Extended Microcontroller mode - 20-bit Address mode
2150
; MODE = XM16 Extended Microcontroller mode - 16-bit Address mode
2151
; MODE = XM12 Extended Microcontroller mode - 12-bit Address mode
2152
; MODE = MM Microcontroller mode - External bus disabled
2154
; External Address Bus Shift Enable bit:
2155
; EASHFT = OFF Address shifting disabled, address on external bus reflects the PC value
2156
; EASHFT = ON Address shifting enabled, address on external bus is offset to start at 000000h
2158
; MSSP address select:
2159
; MSSPSEL = ALTERNATE 5 Bit address mode
2160
; MSSPSEL = MSSPPADDRX 7 Bit address mode
2163
; PMPMX = ALTERNATE PMP port pins not connected to EMB
2164
; PMPMX = DEFAULT PMP port pins connected to EMB
2167
; ECCPMX = ALTERNATE ECCP1 outputs (P1B/P1C) are multiplexed with RH7 and RH6; ECCP3 outputs (P3B/P3C) are multiplexed with RH5 and RH4
2168
; ECCPMX = DEFAULT ECCP1 outputs (P1B/P1C) are multiplexed with RE6 and RE5; ECCP3 outputs (P3B/P3C) are multiplexed with RE4 and RE3
2171
; CCP2MX = ALTERNATE ECCP2/P2A is multiplexed with RE7 in Microcontroller mode or with RB3 in Extended Microcontroller mode
2172
; CCP2MX = DEFAULT ECCP2/P2A is multiplexed with RC1
2174
;==========================================================================
2175
_DEVID1 EQU H'3FFFFE'
2176
_DEVID2 EQU H'3FFFFF'