3
;==========================================================================
4
; $Id: p18f85j15.inc,v 1.2 2005/03/24 04:08:47 craigfranklin Exp $
5
; MPASM PIC18F85J15 processor include
7
; (c) Copyright 1999-2005 Microchip Technology, All rights reserved
8
;==========================================================================
12
;==========================================================================
13
; This header file defines configurations, registers, and other useful
14
; bits of information for the PIC18F85J15 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 /PIC18F85J15
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 -----------------------------------------------------
249
;----- SSP2CON2 Bits -----------------------------------------------------
260
;----- SSP2CON1 Bits -----------------------------------------------------
271
;----- SSP2STAT Bits -----------------------------------------------------
282
I2C_START EQU H'0003'
289
NOT_WRITE EQU H'0002'
290
NOT_ADDRESS EQU H'0005'
292
READ_WRITE EQU H'0002'
293
DATA_ADDRESS EQU H'0005'
299
;----- ECCP2DEL Bits -----------------------------------------------------
310
;----- ECCP2AS Bits -----------------------------------------------------
321
;----- ECCP3DEL Bits -----------------------------------------------------
332
;----- ECCP3AS Bits -----------------------------------------------------
343
;----- RCSTA2 Bits -----------------------------------------------------
361
;----- TXSTA2 Bits -----------------------------------------------------
377
;----- CCP5CON Bits -----------------------------------------------------
389
;----- CCP4CON Bits -----------------------------------------------------
401
;----- T4CON Bits -----------------------------------------------------
411
;----- ECCP1DEL Bits -----------------------------------------------------
422
;----- BAUDCON2 Bits -----------------------------------------------------
431
;----- BAUDCON1 Bits -----------------------------------------------------
440
;----- PORTA Bits -----------------------------------------------------
461
;----- PORTB Bits -----------------------------------------------------
485
;----- PORTC Bits -----------------------------------------------------
509
; DT is a reserved word
513
;----- PORTD Bits -----------------------------------------------------
550
;----- PORTE Bits -----------------------------------------------------
574
;----- PORTF Bits -----------------------------------------------------
594
;----- PORTG Bits -----------------------------------------------------
611
;----- PORTH Bits -----------------------------------------------------
631
;----- PORTJ Bits -----------------------------------------------------
651
;----- LATA Bits -----------------------------------------------------
660
;----- LATB Bits -----------------------------------------------------
671
;----- LATC Bits -----------------------------------------------------
682
;----- LATD Bits -----------------------------------------------------
693
;----- LATE Bits -----------------------------------------------------
704
;----- LATF Bits -----------------------------------------------------
714
;----- LATG Bits -----------------------------------------------------
722
;----- LATH Bits -----------------------------------------------------
733
;----- LATJ Bits -----------------------------------------------------
744
;----- DDRA Bits -----------------------------------------------------
753
;----- TRISA Bits -----------------------------------------------------
762
;----- DDRB Bits -----------------------------------------------------
773
;----- TRISB Bits -----------------------------------------------------
784
;----- DDRC Bits -----------------------------------------------------
795
;----- TRISC Bits -----------------------------------------------------
806
;----- DDRD Bits -----------------------------------------------------
817
;----- TRISD Bits -----------------------------------------------------
828
;----- DDRE Bits -----------------------------------------------------
839
;----- TRISE Bits -----------------------------------------------------
850
;----- DDRF Bits -----------------------------------------------------
860
;----- TRISF Bits -----------------------------------------------------
870
;----- DDRG Bits -----------------------------------------------------
878
;----- TRISG Bits -----------------------------------------------------
886
;----- DDRH Bits -----------------------------------------------------
897
;----- TRISH Bits -----------------------------------------------------
908
;----- DDRJ Bits -----------------------------------------------------
919
;----- TRISJ Bits -----------------------------------------------------
930
;----- OSCTUNE Bits -----------------------------------------------------
934
;----- MEMCON Bits -----------------------------------------------------
942
;----- PIE1 Bits -----------------------------------------------------
957
;----- PIR1 Bits -----------------------------------------------------
972
;----- IPR1 Bits -----------------------------------------------------
987
;----- PIE2 Bits -----------------------------------------------------
997
;----- PIR2 Bits -----------------------------------------------------
1007
;----- IPR2 Bits -----------------------------------------------------
1017
;----- PIE3 Bits -----------------------------------------------------
1028
;----- PIR3 Bits -----------------------------------------------------
1039
;----- IPR3 Bits -----------------------------------------------------
1050
;----- RCSTA Bits -----------------------------------------------------
1068
;----- RCSTA1 Bits -----------------------------------------------------
1086
;----- TXSTA Bits -----------------------------------------------------
1102
;----- TXSTA1 Bits -----------------------------------------------------
1118
;----- PSPCON Bits -----------------------------------------------------
1125
;----- T3CON Bits -----------------------------------------------------
1135
T3INSYNC EQU H'0002'
1137
NOT_T3SYNC EQU H'0002'
1140
;----- CMCON Bits -----------------------------------------------------
1151
;----- CVRCON Bits -----------------------------------------------------
1162
;----- ECCP1AS Bits -----------------------------------------------------
1173
;----- CCP3CON Bits -----------------------------------------------------
1182
;----- ECCP3CON Bits -----------------------------------------------------
1196
;----- CCP2CON Bits -----------------------------------------------------
1205
;----- ECCP2CON Bits -----------------------------------------------------
1219
;----- CCP1CON Bits -----------------------------------------------------
1231
;----- ECCP1CON Bits -----------------------------------------------------
1245
;----- ADCON2 Bits -----------------------------------------------------
1255
;----- ADCON1 Bits -----------------------------------------------------
1264
;----- ADCON0 Bits -----------------------------------------------------
1276
NOT_DONE EQU H'0001'
1279
;----- SSP1CON2 Bits -----------------------------------------------------
1290
;----- SSPCON2 Bits -----------------------------------------------------
1301
;----- SSP1CON1 Bits -----------------------------------------------------
1312
;----- SSPCON1 Bits -----------------------------------------------------
1323
;----- SSP1STAT Bits -----------------------------------------------------
1333
I2C_READ EQU H'0002'
1334
I2C_START EQU H'0003'
1335
I2C_STOP EQU H'0004'
1341
NOT_WRITE EQU H'0002'
1342
NOT_ADDRESS EQU H'0005'
1344
READ_WRITE EQU H'0002'
1345
DATA_ADDRESS EQU H'0005'
1351
;----- SSPSTAT Bits -----------------------------------------------------
1361
I2C_READ EQU H'0002'
1362
I2C_START EQU H'0003'
1363
I2C_STOP EQU H'0004'
1369
NOT_WRITE EQU H'0002'
1370
NOT_ADDRESS EQU H'0005'
1372
READ_WRITE EQU H'0002'
1373
DATA_ADDRESS EQU H'0005'
1379
;----- T2CON Bits -----------------------------------------------------
1383
T2OUTPS0 EQU H'0003'
1384
T2OUTPS1 EQU H'0004'
1385
T2OUTPS2 EQU H'0005'
1386
T2OUTPS3 EQU H'0006'
1389
;----- T1CON Bits -----------------------------------------------------
1399
T1INSYNC EQU H'0002'
1401
NOT_T1SYNC EQU H'0002'
1404
;----- RCON Bits -----------------------------------------------------
1419
;----- WDTCON Bits -----------------------------------------------------
1425
;----- OSCCON Bits -----------------------------------------------------
1432
;----- T0CON Bits -----------------------------------------------------
1443
;----- STATUS Bits -----------------------------------------------------
1451
;----- INTCON3 Bits -----------------------------------------------------
1471
;----- INTCON2 Bits -----------------------------------------------------
1479
NOT_RBPU EQU H'0007'
1485
;----- INTCON Bits -----------------------------------------------------
1503
;----- STKPTR Bits -----------------------------------------------------
1514
;==========================================================================
1518
;==========================================================================
1520
__BADRAM H'0800'-H'0F5F'
1521
__BADRAM H'0F7A'-H'0F7B'
1522
__BADRAM H'0FA6'-H'0FAA'
1526
;==========================================================================
1528
; IMPORTANT: For the PIC18 devices, the __CONFIG directive has been
1529
; superseded by the CONFIG directive. The following settings
1530
; are available for this device.
1532
; Background Debugger Enable:
1533
; DEBUG = ON Enabled
1534
; DEBUG = OFF Disabled
1536
; Extended Instruction Set Enable:
1537
; XINST = OFF Disabled
1538
; XINST = ON Enabled
1540
; Stack Overflow Reset:
1541
; STVR = OFF Disabled
1545
; LVP = OFF Disabled
1549
; WDT = OFF Disabled
1552
; Configuration Word Signature:
1558
; CP0 = OFF Disabled
1560
; Fail Safe Clock Monitor:
1561
; FCMEM = OFF Disabled
1562
; FCMEM = ON Enabled
1564
; Internal/External Switch Over:
1565
; IESO = OFF Disabled
1568
; Oscillator Selection bits:
1569
; FOSC = HS HS oscillator
1570
; FOSC = HSPLL HS oscillator, Software Controlled PLL
1571
; FOSC = EC External Clock
1572
; FOSC = ECPLL External Clock, Software Controlled PLL
1574
; Watchdog Postscaler:
1585
; WDTPS = 1024 1:1024
1586
; WDTPS = 2048 1:2048
1587
; WDTPS = 4096 1:4096
1588
; WDTPS = 8192 1:8192
1589
; WDTPS = 16384 1:16384
1590
; WDTPS = 32768 1:32768
1592
; External Bus Data Wait:
1594
; WAIT = OFF Disabled
1596
; Data Bus Width Select:
1597
; BW = 8 8-bit external bus
1598
; BW = 16 16-bit external bus
1600
; Processor Mode Selection:
1601
; MODE = MM Microcontroller Mode - External bus disabled
1602
; MODE = XM12 Extended Microcontroller Mode - 12-bit address mode
1603
; MODE = XM16 Extended Microcontroller Mode - 16-bit address mode
1604
; MODE = XM20 Extended Microcontroller Mode - 20-bit address mode
1606
; External Address Bus Shift Enable:
1607
; EASHIFT = OFF External bus reflects PC value
1608
; EASHIFT = ON External bus starts at 000000h
1611
; ECCPMUX = OFF Disabled
1612
; ECCPMUX = ON Enabled
1615
; CCP2MUX = OFF Disabled
1616
; CCP2MUX = ON Enabled
1618
;==========================================================================
1619
;==========================================================================
1621
; Configuration Bits
1631
;==========================================================================
1633
; The following is an assignment of address values for all of the
1634
; configuration registers for the purpose of table reads
1635
_CONFIG1L EQU H'300000'
1636
_CONFIG1H EQU H'300001'
1637
_CONFIG2L EQU H'300002'
1638
_CONFIG2H EQU H'300003'
1639
_CONFIG3L EQU H'300004'
1640
_CONFIG3H EQU H'300005'
1642
;----- CONFIG1L Options --------------------------------------------------
1643
_DEBUG_ON_1L EQU H'7F' ; Enabled
1644
_DEBUG_OFF_1L EQU H'FF' ; Disabled
1646
_XINST_OFF_1L EQU H'BF' ; Disabled
1647
_XINST_ON_1L EQU H'FF' ; Enabled
1649
_STVR_OFF_1L EQU H'DF' ; Disabled
1650
_STVR_ON_1L EQU H'FF' ; Enabled
1652
_LVP_OFF_1L EQU H'EF' ; Disabled
1653
_LVP_ON_1L EQU H'FF' ; Enabled
1655
_WDT_OFF_1L EQU H'FE' ; Disabled
1656
_WDT_ON_1L EQU H'FF' ; Enabled
1658
;----- CONFIG1H Options --------------------------------------------------
1659
_SIGN_CLR_1H EQU H'F7' ; Clear
1660
_SIGN_SET_1H EQU H'FF' ; Set
1662
_CP0_ON_1H EQU H'FB' ; Enabled
1663
_CP0_OFF_1H EQU H'FF' ; Disabled
1665
;----- CONFIG2L Options --------------------------------------------------
1666
_FCMEM_OFF_2L EQU H'BF' ; Disabled
1667
_FCMEM_ON_2L EQU H'FF' ; Enabled
1669
_IESO_OFF_2L EQU H'7F' ; Disabled
1670
_IESO_ON_2L EQU H'FF' ; Enabled
1672
_FOSC_HS_2L EQU H'FC' ; HS oscillator
1673
_FOSC_HSPLL_2L EQU H'FD' ; HS oscillator, Software Controlled PLL
1674
_FOSC_EC_2L EQU H'FE' ; External Clock
1675
_FOSC_ECPLL_2L EQU H'FF' ; External Clock, Software Controlled PLL
1677
;----- CONFIG2H Options --------------------------------------------------
1678
_WDTPS_1_2H EQU H'E1' ; 1:1
1679
_WDTPS_2_2H EQU H'E3' ; 1:2
1680
_WDTPS_4_2H EQU H'E5' ; 1:4
1681
_WDTPS_8_2H EQU H'E7' ; 1:8
1682
_WDTPS_16_2H EQU H'E9' ; 1:16
1683
_WDTPS_32_2H EQU H'EB' ; 1:32
1684
_WDTPS_64_2H EQU H'ED' ; 1:64
1685
_WDTPS_128_2H EQU H'EF' ; 1:128
1686
_WDTPS_256_2H EQU H'F1' ; 1:256
1687
_WDTPS_512_2H EQU H'F3' ; 1:512
1688
_WDTPS_1024_2H EQU H'F5' ; 1:1024
1689
_WDTPS_2048_2H EQU H'F7' ; 1:2048
1690
_WDTPS_4096_2H EQU H'F9' ; 1:4096
1691
_WDTPS_8192_2H EQU H'FB' ; 1:8192
1692
_WDTPS_16384_2H EQU H'FD' ; 1:16384
1693
_WDTPS_32768_2H EQU H'FF' ; 1:32768
1695
;----- CONFIG3L Options --------------------------------------------------
1696
_WAIT_ON_3L EQU H'7F' ; Enabled
1697
_WAIT_OFF_3L EQU H'FF' ; Disabled
1699
_BW_8_3L EQU H'BF' ; 8-bit external bus
1700
_BW_16_3L EQU H'FF' ; 16-bit external bus
1702
_MODE_MM_3L EQU H'CF' ; Microcontroller Mode - External bus disabled
1703
_MODE_XM12_3L EQU H'DF' ; Extended Microcontroller Mode - 12-bit address mode
1704
_MODE_XM16_3L EQU H'EF' ; Extended Microcontroller Mode - 16-bit address mode
1705
_MODE_XM20_3L EQU H'FF' ; Extended Microcontroller Mode - 20-bit address mode
1707
_EASHIFT_OFF_3L EQU H'F7' ; External bus reflects PC value
1708
_EASHIFT_ON_3L EQU H'FF' ; External bus starts at 000000h
1710
;----- CONFIG3H Options --------------------------------------------------
1711
_ECCPMUX_OFF_3H EQU H'FD' ; Disabled
1712
_ECCPMUX_ON_3H EQU H'FF' ; Enabled
1714
_CCP2MUX_OFF_3H EQU H'FE' ; Disabled
1715
_CCP2MUX_ON_3H EQU H'FF' ; Enabled
1718
_DEVID1 EQU H'3FFFFE'
1719
_DEVID2 EQU H'3FFFFF'