3
;==========================================================================
4
; MPASM PIC18LF45J11 processor include
6
; (c) Copyright 1999-2009 Microchip Technology, All rights reserved
7
;==========================================================================
11
;==========================================================================
12
; This header file defines configurations, registers, and other useful
13
; bits of information for the PIC18LF45J11 microcontroller. These names
14
; are taken to match the data sheets as closely as possible.
16
; Note that the processor must be selected before this file is included.
17
; The processor may be selected the following ways:
19
; 1. Command line switch:
20
; C:\MPASM MYFILE.ASM /PIC18LF45J11
21
; 2. LIST directive in the source file
23
; 3. Processor Type entry in the MPASM full-screen interface
24
; 4. Setting the processor in the MPLAB Project Dialog
25
;==========================================================================
27
;==========================================================================
31
;==========================================================================
33
MESSG "Processor-header file mismatch. Verify selected processor."
36
;==========================================================================
37
; 18xxxx Family EQUates
38
;==========================================================================
49
;==========================================================================
51
;==========================================================================
52
; 16Cxxx/17Cxxx Substitutions
53
;==========================================================================
54
#define DDRA TRISA ; PIC17Cxxx SFR substitution
55
#define DDRB TRISB ; PIC17Cxxx SFR substitution
56
#define DDRC TRISC ; PIC17Cxxx SFR substitution
57
#define DDRD TRISD ; PIC17Cxxx SFR substitution
58
#define DDRE TRISE ; PIC17Cxxx SFR substitution
60
;==========================================================================
62
; Register Definitions
64
;==========================================================================
66
;----- Register Files -----------------------------------------------------
319
;----- PPSCON Bits -----------------------------------------------------
323
;----- PADCFG1 Bits -----------------------------------------------------
325
RTSECSEL0 EQU H'0001'
326
RTSECSEL1 EQU H'0002'
329
;----- REFOCON Bits -----------------------------------------------------
340
;----- RTCCAL Bits -----------------------------------------------------
351
;----- RTCCFG Bits -----------------------------------------------------
361
;----- ODCON3 Bits -----------------------------------------------------
366
;----- ODCON2 Bits -----------------------------------------------------
371
;----- ODCON1 Bits -----------------------------------------------------
376
;----- ANCON0 Bits -----------------------------------------------------
387
;----- ANCON1 Bits -----------------------------------------------------
397
;----- DSWAKEL Bits -----------------------------------------------------
406
;----- DSWAKEH Bits -----------------------------------------------------
410
;----- DSCONL Bits -----------------------------------------------------
416
;----- DSCONH Bits -----------------------------------------------------
422
;----- TCLKCON Bits -----------------------------------------------------
428
;----- CVRCON Bits -----------------------------------------------------
440
;----- PMSTATL Bits -----------------------------------------------------
449
;----- PMSTATH Bits -----------------------------------------------------
458
;----- PMEL Bits -----------------------------------------------------
469
;----- PMEH Bits -----------------------------------------------------
480
;----- PMMODEL Bits -----------------------------------------------------
491
;----- PMMODEH Bits -----------------------------------------------------
502
;----- PMCONL Bits -----------------------------------------------------
513
;----- PMCONH Bits -----------------------------------------------------
523
;----- PMADDRH Bits -----------------------------------------------------
527
;----- CMSTAT Bits -----------------------------------------------------
532
;----- CMSTATUS Bits -----------------------------------------------------
537
;----- SSP2CON2 Bits -----------------------------------------------------
554
;----- SSP2CON1 Bits -----------------------------------------------------
566
;----- SSP2STAT Bits -----------------------------------------------------
577
;----- SSP2ADD Bits -----------------------------------------------------
588
;----- T4CON Bits -----------------------------------------------------
599
;----- T3CON Bits -----------------------------------------------------
610
;----- BAUDCON2 Bits -----------------------------------------------------
620
;----- BAUDCON Bits -----------------------------------------------------
630
;----- BAUDCON1 Bits -----------------------------------------------------
640
;----- BAUDCTL Bits -----------------------------------------------------
650
;----- PORTA Bits -----------------------------------------------------
670
VREF_MINUS EQU H'0002'
671
VREF_PLUS EQU H'0003'
678
CVREF_MINUS EQU H'0002'
691
;----- PORTB Bits -----------------------------------------------------
737
;----- PORTC Bits -----------------------------------------------------
776
;----- PORTD Bits -----------------------------------------------------
806
;----- PORTE Bits -----------------------------------------------------
823
;----- HLVDCON Bits -----------------------------------------------------
835
;----- DMACON2 Bits -----------------------------------------------------
846
;----- DMACON1 Bits -----------------------------------------------------
857
;----- LATA Bits -----------------------------------------------------
868
;----- LATB Bits -----------------------------------------------------
880
;----- LATC Bits -----------------------------------------------------
892
;----- LATD Bits -----------------------------------------------------
904
;----- LATE Bits -----------------------------------------------------
911
;----- ALRMRPT Bits -----------------------------------------------------
922
;----- ALRMCFG Bits -----------------------------------------------------
934
;----- TRISA Bits -----------------------------------------------------
945
;----- TRISB Bits -----------------------------------------------------
957
;----- TRISC Bits -----------------------------------------------------
969
;----- TRISD Bits -----------------------------------------------------
981
;----- TRISE Bits -----------------------------------------------------
988
;----- T3GCON Bits -----------------------------------------------------
992
T3GGO_T3DONE EQU H'0003'
1003
;----- T1GCON Bits -----------------------------------------------------
1007
T1GGO_T1DONE EQU H'0003'
1018
;----- OSCTUNE Bits -----------------------------------------------------
1030
;----- RCSTA2 Bits -----------------------------------------------------
1041
;----- PIE1 Bits -----------------------------------------------------
1056
;----- PIR1 Bits -----------------------------------------------------
1071
;----- IPR1 Bits -----------------------------------------------------
1086
;----- PIE2 Bits -----------------------------------------------------
1098
;----- PIR2 Bits -----------------------------------------------------
1110
;----- IPR2 Bits -----------------------------------------------------
1122
;----- PIE3 Bits -----------------------------------------------------
1133
;----- PIR3 Bits -----------------------------------------------------
1144
;----- IPR3 Bits -----------------------------------------------------
1155
;----- EECON1 Bits -----------------------------------------------------
1163
;----- TXSTA2 Bits -----------------------------------------------------
1174
;----- RCSTA Bits -----------------------------------------------------
1193
;----- RCSTA1 Bits -----------------------------------------------------
1212
;----- TXSTA Bits -----------------------------------------------------
1228
;----- TXSTA1 Bits -----------------------------------------------------
1244
;----- CTMUICON Bits -----------------------------------------------------
1255
;----- CTMUCONL Bits -----------------------------------------------------
1256
EDG1STAT EQU H'0000'
1257
EDG2STAT EQU H'0001'
1258
EDG1SEL0 EQU H'0002'
1259
EDG1SEL1 EQU H'0003'
1261
EDG2SEL0 EQU H'0005'
1262
EDG2SEL1 EQU H'0006'
1266
;----- CTMUCONH Bits -----------------------------------------------------
1269
EDGSEQEN EQU H'0002'
1272
CTMUSIDL EQU H'0005'
1276
;----- CCP2CON Bits -----------------------------------------------------
1290
;----- ECCP2CON Bits -----------------------------------------------------
1304
;----- ECCP2DEL Bits -----------------------------------------------------
1316
;----- PWM2CON Bits -----------------------------------------------------
1328
;----- ECCP2AS Bits -----------------------------------------------------
1329
ECCP2ASE EQU H'0007'
1335
ECCP2AS0 EQU H'0004'
1336
ECCP2AS1 EQU H'0005'
1337
ECCP2AS2 EQU H'0006'
1340
;----- PSTR2CON Bits -----------------------------------------------------
1358
;----- CCP1CON Bits -----------------------------------------------------
1372
;----- ECCP1CON Bits -----------------------------------------------------
1386
;----- ECCP1DEL Bits -----------------------------------------------------
1398
;----- PWM1CON Bits -----------------------------------------------------
1410
;----- ECCP1AS Bits -----------------------------------------------------
1411
ECCP1ASE EQU H'0007'
1417
ECCP1AS0 EQU H'0004'
1418
ECCP1AS1 EQU H'0005'
1419
ECCP1AS2 EQU H'0006'
1422
;----- PSTR1CON Bits -----------------------------------------------------
1432
;----- WDTCON Bits -----------------------------------------------------
1444
;----- ADCON1 Bits -----------------------------------------------------
1456
;----- ADCON0 Bits -----------------------------------------------------
1458
GO_NOT_DONE EQU H'0001'
1472
NOT_DONE EQU H'0001'
1475
;----- SSP1CON2 Bits -----------------------------------------------------
1492
;----- SSPCON2 Bits -----------------------------------------------------
1509
;----- SSP1CON1 Bits -----------------------------------------------------
1521
;----- SSPCON1 Bits -----------------------------------------------------
1533
;----- SSP1STAT Bits -----------------------------------------------------
1552
NOT_WRITE EQU H'0002'
1553
NOT_ADDRESS EQU H'0005'
1555
READ_WRITE EQU H'0002'
1556
DATA_ADDRESS EQU H'0005'
1558
I2C_READ EQU H'0002'
1559
I2C_START EQU H'0003'
1560
I2C_STOP EQU H'0004'
1564
;----- SSPSTAT Bits -----------------------------------------------------
1583
NOT_WRITE EQU H'0002'
1584
NOT_ADDRESS EQU H'0005'
1586
READ_WRITE EQU H'0002'
1587
DATA_ADDRESS EQU H'0005'
1589
I2C_READ EQU H'0002'
1590
I2C_START EQU H'0003'
1591
I2C_STOP EQU H'0004'
1595
;----- SSP1ADD Bits -----------------------------------------------------
1606
;----- SSPADD Bits -----------------------------------------------------
1617
;----- T2CON Bits -----------------------------------------------------
1622
T2OUTPS0 EQU H'0003'
1623
T2OUTPS1 EQU H'0004'
1624
T2OUTPS2 EQU H'0005'
1625
T2OUTPS3 EQU H'0006'
1628
;----- T1CON Bits -----------------------------------------------------
1640
;----- RCON Bits -----------------------------------------------------
1657
;----- CM2CON Bits -----------------------------------------------------
1669
;----- CM2CON1 Bits -----------------------------------------------------
1681
;----- CM1CON Bits -----------------------------------------------------
1693
;----- CM1CON1 Bits -----------------------------------------------------
1705
;----- OSCCON Bits -----------------------------------------------------
1716
;----- T0CON Bits -----------------------------------------------------
1728
;----- STATUS Bits -----------------------------------------------------
1736
;----- INTCON3 Bits -----------------------------------------------------
1756
;----- INTCON2 Bits -----------------------------------------------------
1764
NOT_RBPU EQU H'0007'
1771
;----- INTCON Bits -----------------------------------------------------
1778
PEIE_GIEL EQU H'0006'
1779
GIE_GIEH EQU H'0007'
1792
;----- STKPTR Bits -----------------------------------------------------
1804
;==========================================================================
1808
;==========================================================================
1810
__BADRAM H'0EDF'-H'0EE6'
1812
__BADRAM H'0EEF'-H'0EF1'
1813
__BADRAM H'0EF4'-H'0EF5'
1814
__BADRAM H'0EF8'-H'0EFA'
1815
__BADRAM H'0F00'-H'0F3B'
1816
__BADRAM H'0F43'-H'0F47'
1817
__BADRAM H'0F50'-H'0F51'
1818
__BADRAM H'0F60'-H'0F65'
1822
;==========================================================================
1824
; IMPORTANT: For the PIC18 devices, the __CONFIG directive has been
1825
; superseded by the CONFIG directive. The following settings
1826
; are available for this device.
1829
; WDTEN = OFF Disabled - Controlled by SWDTEN bit
1830
; WDTEN = ON Enabled
1832
; Stack Overflow/Underflow Reset:
1833
; STVREN = OFF Disabled
1834
; STVREN = ON Enabled
1836
; Extended Instruction Set:
1837
; XINST = OFF Disabled
1838
; XINST = ON Enabled
1841
; CP0 = ON Program memory is code-protected
1842
; CP0 = OFF Program memory is not code-protected
1845
; OSC = INTOSC INTOSC
1846
; OSC = INTOSCO INTOSCO (CLKO-RA6)
1847
; OSC = INTOSCPLL INTOSCPLL
1848
; OSC = INTOSCPLLO INTOSCPLLO (CLKO-RA6)
1850
; OSC = HSPLL HS+PLL
1851
; OSC = EC EC (CLKO-RA6)
1852
; OSC = ECPLL EC+PLL (CLKO-RA6)
1854
; T1OSCEN Enforcement:
1855
; T1DIG = OFF Secondary Oscillator clock source may not be selected
1856
; T1DIG = ON Secondary Oscillator clock source may be selected
1858
; Low-Power Timer1 Oscillator:
1859
; LPT1OSC = ON Low-power operation
1860
; LPT1OSC = OFF High-power operation
1862
; Fail-Safe Clock Monitor:
1863
; FCMEN = OFF Disabled
1864
; FCMEN = ON Enabled
1866
; Internal External Oscillator Switch Over Mode:
1867
; IESO = OFF Disabled
1870
; Watchdog Postscaler:
1881
; WDTPS = 1024 1:1024
1882
; WDTPS = 2048 1:2048
1883
; WDTPS = 4096 1:4096
1884
; WDTPS = 8192 1:8192
1885
; WDTPS = 16384 1:16384
1886
; WDTPS = 32768 1:32768
1888
; RTCC Clock Select:
1889
; RTCOSC = INTOSCREF RTCC uses INTRC
1890
; RTCOSC = T1OSCREF RTCC uses T1OSC/T1CKI
1892
; IOLOCK One-Way Set Enable bit:
1893
; IOL1WAY = OFF The IOLOCK bit (PPSCON<0>) can be set and cleared as needed
1894
; IOL1WAY = ON The IOLOCK bit (PPSCON<0>) can be set once
1896
; MSSP address masking:
1897
; MSSP7B_EN = MSK5 5 Bit address masking mode
1898
; MSSP7B_EN = MSK7 7 Bit address masking mode
1900
; Write/Erase Protect Page Start/End Location:
1901
; WPFP = PAGE_0 Write Protect Program Flash Page 0
1902
; WPFP = PAGE_1 Write Protect Program Flash Page 1
1903
; WPFP = PAGE_2 Write Protect Program Flash Page 2
1904
; WPFP = PAGE_3 Write Protect Program Flash Page 3
1905
; WPFP = PAGE_4 Write Protect Program Flash Page 4
1906
; WPFP = PAGE_5 Write Protect Program Flash Page 5
1907
; WPFP = PAGE_6 Write Protect Program Flash Page 6
1908
; WPFP = PAGE_7 Write Protect Program Flash Page 7
1909
; WPFP = PAGE_8 Write Protect Program Flash Page 8
1910
; WPFP = PAGE_9 Write Protect Program Flash Page 9
1911
; WPFP = PAGE_10 Write Protect Program Flash Page 10
1912
; WPFP = PAGE_11 Write Protect Program Flash Page 11
1913
; WPFP = PAGE_12 Write Protect Program Flash Page 12
1914
; WPFP = PAGE_13 Write Protect Program Flash Page 13
1915
; WPFP = PAGE_14 Write Protect Program Flash Page 14
1916
; WPFP = PAGE_15 Write Protect Program Flash Page 15
1917
; WPFP = PAGE_16 Write Protect Program Flash Page 16
1918
; WPFP = PAGE_17 Write Protect Program Flash Page 17
1919
; WPFP = PAGE_18 Write Protect Program Flash Page 18
1920
; WPFP = PAGE_19 Write Protect Program Flash Page 19
1921
; WPFP = PAGE_20 Write Protect Program Flash Page 20
1922
; WPFP = PAGE_21 Write Protect Program Flash Page 21
1923
; WPFP = PAGE_22 Write Protect Program Flash Page 22
1924
; WPFP = PAGE_23 Write Protect Program Flash Page 23
1925
; WPFP = PAGE_24 Write Protect Program Flash Page 24
1926
; WPFP = PAGE_25 Write Protect Program Flash Page 25
1927
; WPFP = PAGE_26 Write Protect Program Flash Page 26
1928
; WPFP = PAGE_27 Write Protect Program Flash Page 27
1929
; WPFP = PAGE_28 Write Protect Program Flash Page 28
1930
; WPFP = PAGE_29 Write Protect Program Flash Page 29
1931
; WPFP = PAGE_30 Write Protect Program Flash Page 30
1932
; WPFP = PAGE_31 Write Protect Program Flash Page 31
1934
; Write/Erase Protect Region Select bit (valid when WPDIS = 0):
1935
; WPEND = PAGE_0 Page 0 to WPFP<5:0> erase/write-protected
1936
; WPEND = PAGE_WPFP Pages WPFP<5:0> to (Configuration Words page) write/erase protected
1938
; Write/Erase Protect Configuration Region :
1939
; WPCFG = ON Configuration Words page erase/write-protected
1940
; WPCFG = OFF Configuration Words page not erase/write-protected
1942
; Write Protect Disable bit:
1943
; WPDIS = ON WPFP[5:0], WPEND, and WPCFG bits enabled
1944
; WPDIS = OFF WPFP[5:0], WPEND, and WPCFG bits ignored
1946
;==========================================================================
1947
_DEVID1 EQU H'3FFFFE'
1948
_DEVID2 EQU H'3FFFFF'