1 LIST 2 3;========================================================================== 4; Build date : Oct 21 2015 5; MPASM PIC18F2320 processor include 6; 7; (c) Copyright 1999-2015 Microchip Technology, All rights reserved 8;========================================================================== 9 10 NOLIST 11 12;========================================================================== 13; This header file defines configurations, registers, and other useful 14; bits of information for the PIC18F2320 microcontroller. These names 15; are taken to match the data sheets as closely as possible. 16; 17; Note that the processor must be selected before this file is included. 18; The processor may be selected the following ways: 19; 20; 1. Command line switch: 21; C:\MPASM MYFILE.ASM /PIC18F2320 22; 2. LIST directive in the source file 23; LIST P=PIC18F2320 24; 3. Processor Type entry in the MPASM full-screen interface 25; 4. Setting the processor in the MPLAB Project Dialog 26;========================================================================== 27 28;========================================================================== 29; 30; Verify Processor 31; 32;========================================================================== 33 IFNDEF __18F2320 34 MESSG "Processor-header file mismatch. Verify selected processor." 35 ENDIF 36 37;========================================================================== 38; 18xxxx Family EQUates 39;========================================================================== 40FSR0 EQU 0 41FSR1 EQU 1 42FSR2 EQU 2 43 44FAST EQU 1 45 46W EQU 0 47A EQU 0 48ACCESS EQU 0 49BANKED EQU 1 50;========================================================================== 51 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 60 61;========================================================================== 62; 63; Register Definitions 64; 65;========================================================================== 66 67;----- Register Files ----------------------------------------------------- 68PORTA EQU H'0F80' 69PORTB EQU H'0F81' 70PORTC EQU H'0F82' 71LATA EQU H'0F89' 72LATB EQU H'0F8A' 73LATC EQU H'0F8B' 74DDRA EQU H'0F92' 75TRISA EQU H'0F92' 76DDRB EQU H'0F93' 77TRISB EQU H'0F93' 78DDRC EQU H'0F94' 79TRISC EQU H'0F94' 80OSCTUN2 EQU H'0F9A' 81OSCTUNE EQU H'0F9B' 82PIE1 EQU H'0F9D' 83PIR1 EQU H'0F9E' 84IPR1 EQU H'0F9F' 85PIE2 EQU H'0FA0' 86PIR2 EQU H'0FA1' 87IPR2 EQU H'0FA2' 88EECON1 EQU H'0FA6' 89EECON2 EQU H'0FA7' 90EEDATA EQU H'0FA8' 91EEADR EQU H'0FA9' 92RCSTA EQU H'0FAB' 93TXSTA EQU H'0FAC' 94TXREG EQU H'0FAD' 95RCREG EQU H'0FAE' 96SPBRG EQU H'0FAF' 97T3CON EQU H'0FB1' 98TMR3 EQU H'0FB2' 99TMR3L EQU H'0FB2' 100TMR3H EQU H'0FB3' 101CMCON EQU H'0FB4' 102CVRCON EQU H'0FB5' 103CCP2CON EQU H'0FBA' 104CCPR2 EQU H'0FBB' 105CCPR2L EQU H'0FBB' 106CCPR2H EQU H'0FBC' 107CCP1CON EQU H'0FBD' 108CCPR1 EQU H'0FBE' 109CCPR1L EQU H'0FBE' 110CCPR1H EQU H'0FBF' 111ADCON2 EQU H'0FC0' 112ADCON1 EQU H'0FC1' 113ADCON0 EQU H'0FC2' 114ADRES EQU H'0FC3' 115ADRESL EQU H'0FC3' 116ADRESH EQU H'0FC4' 117SSPCON2 EQU H'0FC5' 118SSPCON1 EQU H'0FC6' 119SSPSTAT EQU H'0FC7' 120SSPADD EQU H'0FC8' 121SSPBUF EQU H'0FC9' 122T2CON EQU H'0FCA' 123PR2 EQU H'0FCB' 124TMR2 EQU H'0FCC' 125T1CON EQU H'0FCD' 126TMR1 EQU H'0FCE' 127TMR1L EQU H'0FCE' 128TMR1H EQU H'0FCF' 129RCON EQU H'0FD0' 130WDTCON EQU H'0FD1' 131LVDCON EQU H'0FD2' 132OSCCON EQU H'0FD3' 133T0CON EQU H'0FD5' 134TMR0 EQU H'0FD6' 135TMR0L EQU H'0FD6' 136TMR0H EQU H'0FD7' 137STATUS EQU H'0FD8' 138FSR2L EQU H'0FD9' 139FSR2H EQU H'0FDA' 140PLUSW2 EQU H'0FDB' 141PREINC2 EQU H'0FDC' 142POSTDEC2 EQU H'0FDD' 143POSTINC2 EQU H'0FDE' 144INDF2 EQU H'0FDF' 145BSR EQU H'0FE0' 146FSR1L EQU H'0FE1' 147FSR1H EQU H'0FE2' 148PLUSW1 EQU H'0FE3' 149PREINC1 EQU H'0FE4' 150POSTDEC1 EQU H'0FE5' 151POSTINC1 EQU H'0FE6' 152INDF1 EQU H'0FE7' 153WREG EQU H'0FE8' 154FSR0L EQU H'0FE9' 155FSR0H EQU H'0FEA' 156PLUSW0 EQU H'0FEB' 157PREINC0 EQU H'0FEC' 158POSTDEC0 EQU H'0FED' 159POSTINC0 EQU H'0FEE' 160INDF0 EQU H'0FEF' 161INTCON3 EQU H'0FF0' 162INTCON2 EQU H'0FF1' 163INTCON EQU H'0FF2' 164PROD EQU H'0FF3' 165PRODL EQU H'0FF3' 166PRODH EQU H'0FF4' 167TABLAT EQU H'0FF5' 168TBLPTR EQU H'0FF6' 169TBLPTRL EQU H'0FF6' 170TBLPTRH EQU H'0FF7' 171TBLPTRU EQU H'0FF8' 172PC EQU H'0FF9' 173PCL EQU H'0FF9' 174PCLATH EQU H'0FFA' 175PCLATU EQU H'0FFB' 176STKPTR EQU H'0FFC' 177TOS EQU H'0FFD' 178TOSL EQU H'0FFD' 179TOSH EQU H'0FFE' 180TOSU EQU H'0FFF' 181 182;----- PORTA Bits ----------------------------------------------------- 183RA0 EQU H'0000' 184RA1 EQU H'0001' 185RA2 EQU H'0002' 186RA3 EQU H'0003' 187RA4 EQU H'0004' 188RA5 EQU H'0005' 189RA6 EQU H'0006' 190RA7 EQU H'0007' 191 192AN0 EQU H'0000' 193AN1 EQU H'0001' 194AN2 EQU H'0002' 195AN3 EQU H'0003' 196T0CKI EQU H'0004' 197AN4 EQU H'0005' 198CLKO EQU H'0006' 199CLKI EQU H'0007' 200 201VREFM EQU H'0002' 202VREFP EQU H'0003' 203SS EQU H'0005' 204OSC2 EQU H'0006' 205OSC1 EQU H'0007' 206 207CVREF EQU H'0002' 208NOT_SS EQU H'0005' 209 210LVDIN EQU H'0005' 211 212C1OUT_PORTA EQU H'0004' 213C2OUT_PORTA EQU H'0005' 214 215 216;----- PORTB Bits ----------------------------------------------------- 217RB0 EQU H'0000' 218RB1 EQU H'0001' 219RB2 EQU H'0002' 220RB3 EQU H'0003' 221RB4 EQU H'0004' 222RB5 EQU H'0005' 223RB6 EQU H'0006' 224RB7 EQU H'0007' 225 226INT0 EQU H'0000' 227INT1 EQU H'0001' 228INT2 EQU H'0002' 229CCP2_PORTB EQU H'0003' 230KBI0 EQU H'0004' 231KBI1 EQU H'0005' 232KBI2 EQU H'0006' 233KBI3 EQU H'0007' 234 235AN12 EQU H'0000' 236AN10 EQU H'0001' 237AN8 EQU H'0002' 238AN9 EQU H'0003' 239AN11 EQU H'0004' 240PGM EQU H'0005' 241PGC EQU H'0006' 242PGD EQU H'0007' 243 244CCP2A EQU H'0003' 245 246 247;----- PORTC Bits ----------------------------------------------------- 248RC0 EQU H'0000' 249RC1 EQU H'0001' 250RC2 EQU H'0002' 251RC3 EQU H'0003' 252RC4 EQU H'0004' 253RC5 EQU H'0005' 254RC6 EQU H'0006' 255RC7 EQU H'0007' 256 257T1OSO EQU H'0000' 258T1OSI EQU H'0001' 259CCP1 EQU H'0002' 260SCK EQU H'0003' 261SDI EQU H'0004' 262SDO EQU H'0005' 263TX EQU H'0006' 264RX EQU H'0007' 265 266T13CKI EQU H'0000' 267CCP2_PORTC EQU H'0001' 268P1A EQU H'0002' 269SCL EQU H'0003' 270SDA EQU H'0004' 271CK EQU H'0006' 272; DT is a reserved word 273; DT EQU H'0007' 274 275T1CKI EQU H'0000' 276 277 278;----- LATA Bits ----------------------------------------------------- 279LATA0 EQU H'0000' 280LATA1 EQU H'0001' 281LATA2 EQU H'0002' 282LATA3 EQU H'0003' 283LATA4 EQU H'0004' 284LATA5 EQU H'0005' 285LATA6 EQU H'0006' 286LATA7 EQU H'0007' 287 288 289;----- LATB Bits ----------------------------------------------------- 290LATB0 EQU H'0000' 291LATB1 EQU H'0001' 292LATB2 EQU H'0002' 293LATB3 EQU H'0003' 294LATB4 EQU H'0004' 295LATB5 EQU H'0005' 296LATB6 EQU H'0006' 297LATB7 EQU H'0007' 298 299 300;----- LATC Bits ----------------------------------------------------- 301LATC0 EQU H'0000' 302LATC1 EQU H'0001' 303LATC2 EQU H'0002' 304LATC3 EQU H'0003' 305LATC4 EQU H'0004' 306LATC5 EQU H'0005' 307LATC6 EQU H'0006' 308LATC7 EQU H'0007' 309 310 311;----- DDRA Bits ----------------------------------------------------- 312TRISA0 EQU H'0000' 313TRISA1 EQU H'0001' 314TRISA2 EQU H'0002' 315TRISA3 EQU H'0003' 316TRISA4 EQU H'0004' 317TRISA5 EQU H'0005' 318TRISA6 EQU H'0006' 319TRISA7 EQU H'0007' 320 321RA0 EQU H'0000' 322RA1 EQU H'0001' 323RA2 EQU H'0002' 324RA3 EQU H'0003' 325RA4 EQU H'0004' 326RA5 EQU H'0005' 327RA6 EQU H'0006' 328RA7 EQU H'0007' 329 330 331;----- TRISA Bits ----------------------------------------------------- 332TRISA0 EQU H'0000' 333TRISA1 EQU H'0001' 334TRISA2 EQU H'0002' 335TRISA3 EQU H'0003' 336TRISA4 EQU H'0004' 337TRISA5 EQU H'0005' 338TRISA6 EQU H'0006' 339TRISA7 EQU H'0007' 340 341RA0 EQU H'0000' 342RA1 EQU H'0001' 343RA2 EQU H'0002' 344RA3 EQU H'0003' 345RA4 EQU H'0004' 346RA5 EQU H'0005' 347RA6 EQU H'0006' 348RA7 EQU H'0007' 349 350 351;----- DDRB Bits ----------------------------------------------------- 352TRISB0 EQU H'0000' 353TRISB1 EQU H'0001' 354TRISB2 EQU H'0002' 355TRISB3 EQU H'0003' 356TRISB4 EQU H'0004' 357TRISB5 EQU H'0005' 358TRISB6 EQU H'0006' 359TRISB7 EQU H'0007' 360 361RB0 EQU H'0000' 362RB1 EQU H'0001' 363RB2 EQU H'0002' 364RB3 EQU H'0003' 365RB4 EQU H'0004' 366RB5 EQU H'0005' 367RB6 EQU H'0006' 368RB7 EQU H'0007' 369 370 371;----- TRISB Bits ----------------------------------------------------- 372TRISB0 EQU H'0000' 373TRISB1 EQU H'0001' 374TRISB2 EQU H'0002' 375TRISB3 EQU H'0003' 376TRISB4 EQU H'0004' 377TRISB5 EQU H'0005' 378TRISB6 EQU H'0006' 379TRISB7 EQU H'0007' 380 381RB0 EQU H'0000' 382RB1 EQU H'0001' 383RB2 EQU H'0002' 384RB3 EQU H'0003' 385RB4 EQU H'0004' 386RB5 EQU H'0005' 387RB6 EQU H'0006' 388RB7 EQU H'0007' 389 390 391;----- DDRC Bits ----------------------------------------------------- 392TRISC0 EQU H'0000' 393TRISC1 EQU H'0001' 394TRISC2 EQU H'0002' 395TRISC3 EQU H'0003' 396TRISC4 EQU H'0004' 397TRISC5 EQU H'0005' 398TRISC6 EQU H'0006' 399TRISC7 EQU H'0007' 400 401RC0 EQU H'0000' 402RC1 EQU H'0001' 403RC2 EQU H'0002' 404RC3 EQU H'0003' 405RC4 EQU H'0004' 406RC5 EQU H'0005' 407RC6 EQU H'0006' 408RC7 EQU H'0007' 409 410 411;----- TRISC Bits ----------------------------------------------------- 412TRISC0 EQU H'0000' 413TRISC1 EQU H'0001' 414TRISC2 EQU H'0002' 415TRISC3 EQU H'0003' 416TRISC4 EQU H'0004' 417TRISC5 EQU H'0005' 418TRISC6 EQU H'0006' 419TRISC7 EQU H'0007' 420 421RC0 EQU H'0000' 422RC1 EQU H'0001' 423RC2 EQU H'0002' 424RC3 EQU H'0003' 425RC4 EQU H'0004' 426RC5 EQU H'0005' 427RC6 EQU H'0006' 428RC7 EQU H'0007' 429 430 431;----- OSCTUN2 Bits ----------------------------------------------------- 432TUNSEL EQU H'0007' 433 434TUN0 EQU H'0000' 435TUN1 EQU H'0001' 436TUN2 EQU H'0002' 437TUN3 EQU H'0003' 438TUN4 EQU H'0004' 439TUN5 EQU H'0005' 440 441 442;----- OSCTUNE Bits ----------------------------------------------------- 443TUN0 EQU H'0000' 444TUN1 EQU H'0001' 445TUN2 EQU H'0002' 446TUN3 EQU H'0003' 447TUN4 EQU H'0004' 448TUN5 EQU H'0005' 449 450 451;----- PIE1 Bits ----------------------------------------------------- 452TMR1IE EQU H'0000' 453TMR2IE EQU H'0001' 454CCP1IE EQU H'0002' 455SSPIE EQU H'0003' 456TXIE EQU H'0004' 457RCIE EQU H'0005' 458ADIE EQU H'0006' 459 460 461;----- PIR1 Bits ----------------------------------------------------- 462TMR1IF EQU H'0000' 463TMR2IF EQU H'0001' 464CCP1IF EQU H'0002' 465SSPIF EQU H'0003' 466TXIF EQU H'0004' 467RCIF EQU H'0005' 468ADIF EQU H'0006' 469 470 471;----- IPR1 Bits ----------------------------------------------------- 472TMR1IP EQU H'0000' 473TMR2IP EQU H'0001' 474CCP1IP EQU H'0002' 475SSPIP EQU H'0003' 476TXIP EQU H'0004' 477RCIP EQU H'0005' 478ADIP EQU H'0006' 479 480 481;----- PIE2 Bits ----------------------------------------------------- 482CCP2IE EQU H'0000' 483TMR3IE EQU H'0001' 484LVDIE EQU H'0002' 485BCLIE EQU H'0003' 486EEIE EQU H'0004' 487CMIE EQU H'0006' 488OSCFIE EQU H'0007' 489 490 491;----- PIR2 Bits ----------------------------------------------------- 492CCP2IF EQU H'0000' 493TMR3IF EQU H'0001' 494LVDIF EQU H'0002' 495BCLIF EQU H'0003' 496EEIF EQU H'0004' 497CMIF EQU H'0006' 498OSCFIF EQU H'0007' 499 500 501;----- IPR2 Bits ----------------------------------------------------- 502CCP2IP EQU H'0000' 503TMR3IP EQU H'0001' 504LVDIP EQU H'0002' 505BCLIP EQU H'0003' 506EEIP EQU H'0004' 507CMIP EQU H'0006' 508OSCFIP EQU H'0007' 509 510 511;----- EECON1 Bits ----------------------------------------------------- 512RD EQU H'0000' 513WR EQU H'0001' 514WREN EQU H'0002' 515WRERR EQU H'0003' 516FREE EQU H'0004' 517CFGS EQU H'0006' 518EEPGD EQU H'0007' 519 520 521;----- RCSTA Bits ----------------------------------------------------- 522RX9D EQU H'0000' 523OERR EQU H'0001' 524FERR EQU H'0002' 525ADDEN EQU H'0003' 526CREN EQU H'0004' 527SREN EQU H'0005' 528RX9 EQU H'0006' 529SPEN EQU H'0007' 530 531ADEN EQU H'0003' 532 533 534;----- TXSTA Bits ----------------------------------------------------- 535TX9D EQU H'0000' 536TRMT EQU H'0001' 537BRGH EQU H'0002' 538SYNC EQU H'0004' 539TXEN EQU H'0005' 540TX9 EQU H'0006' 541CSRC EQU H'0007' 542 543 544;----- T3CON Bits ----------------------------------------------------- 545TMR3ON EQU H'0000' 546TMR3CS EQU H'0001' 547NOT_T3SYNC EQU H'0002' 548T3CCP1 EQU H'0003' 549T3CCP2 EQU H'0006' 550RD16 EQU H'0007' 551 552T3SYNC EQU H'0002' 553T3CKPS0 EQU H'0004' 554T3CKPS1 EQU H'0005' 555 556 557;----- CMCON Bits ----------------------------------------------------- 558CIS EQU H'0003' 559C1INV EQU H'0004' 560C2INV EQU H'0005' 561C1OUT_CMCON EQU H'0006' 562C2OUT_CMCON EQU H'0007' 563 564CM0 EQU H'0000' 565CM1 EQU H'0001' 566CM2 EQU H'0002' 567 568 569;----- CVRCON Bits ----------------------------------------------------- 570CVRR EQU H'0005' 571CVROE EQU H'0006' 572CVREN EQU H'0007' 573 574CVR0 EQU H'0000' 575CVR1 EQU H'0001' 576CVR2 EQU H'0002' 577CVR3 EQU H'0003' 578 579 580;----- CCP2CON Bits ----------------------------------------------------- 581CCP2M0 EQU H'0000' 582CCP2M1 EQU H'0001' 583CCP2M2 EQU H'0002' 584CCP2M3 EQU H'0003' 585DC2B0 EQU H'0004' 586DC2B1 EQU H'0005' 587 588CCP2Y EQU H'0004' 589CCP2X EQU H'0005' 590 591DCP2Y EQU H'0004' 592DCP2X EQU H'0005' 593 594 595;----- CCP1CON Bits ----------------------------------------------------- 596CCP1M0 EQU H'0000' 597CCP1M1 EQU H'0001' 598CCP1M2 EQU H'0002' 599CCP1M3 EQU H'0003' 600DC1B0 EQU H'0004' 601DC1B1 EQU H'0005' 602 603CCP1Y EQU H'0004' 604CCP1X EQU H'0005' 605 606DCP1Y EQU H'0004' 607DCP1X EQU H'0005' 608 609 610;----- ADCON2 Bits ----------------------------------------------------- 611ADFM EQU H'0007' 612 613ADCS0 EQU H'0000' 614ADCS1 EQU H'0001' 615ADCS2 EQU H'0002' 616ACQT0 EQU H'0003' 617ACQT1 EQU H'0004' 618ACQT2 EQU H'0005' 619 620 621;----- ADCON1 Bits ----------------------------------------------------- 622PCFG0 EQU H'0000' 623PCFG1 EQU H'0001' 624PCFG2 EQU H'0002' 625PCFG3 EQU H'0003' 626VCFG0 EQU H'0004' 627VCFG1 EQU H'0005' 628 629 630;----- ADCON0 Bits ----------------------------------------------------- 631ADON EQU H'0000' 632GO_NOT_DONE EQU H'0001' 633 634GO EQU H'0001' 635CHS0 EQU H'0002' 636CHS1 EQU H'0003' 637CHS2 EQU H'0004' 638CHS3 EQU H'0005' 639 640DONE EQU H'0001' 641 642NOT_DONE EQU H'0001' 643 644GO_DONE EQU H'0001' 645 646 647;----- SSPCON2 Bits ----------------------------------------------------- 648SEN EQU H'0000' 649RSEN EQU H'0001' 650PEN EQU H'0002' 651RCEN EQU H'0003' 652ACKEN EQU H'0004' 653ACKDT EQU H'0005' 654ACKSTAT EQU H'0006' 655GCEN EQU H'0007' 656 657 658;----- SSPCON1 Bits ----------------------------------------------------- 659CKP EQU H'0004' 660SSPEN EQU H'0005' 661SSPOV EQU H'0006' 662WCOL EQU H'0007' 663 664SSPM0 EQU H'0000' 665SSPM1 EQU H'0001' 666SSPM2 EQU H'0002' 667SSPM3 EQU H'0003' 668 669 670;----- SSPSTAT Bits ----------------------------------------------------- 671BF EQU H'0000' 672UA EQU H'0001' 673R_NOT_W EQU H'0002' 674S EQU H'0003' 675P EQU H'0004' 676D_NOT_A EQU H'0005' 677CKE EQU H'0006' 678SMP EQU H'0007' 679 680I2C_READ EQU H'0002' 681I2C_START EQU H'0003' 682I2C_STOP EQU H'0004' 683I2C_DATA EQU H'0005' 684 685R EQU H'0002' 686D EQU H'0005' 687 688READ_WRITE EQU H'0002' 689DATA_ADDRESS EQU H'0005' 690 691NOT_WRITE EQU H'0002' 692NOT_ADDRESS EQU H'0005' 693 694NOT_W EQU H'0002' 695NOT_A EQU H'0005' 696 697R_W EQU H'0002' 698D_A EQU H'0005' 699 700I2C_DAT EQU H'0005' 701 702 703;----- T2CON Bits ----------------------------------------------------- 704TMR2ON EQU H'0002' 705 706T2CKPS0 EQU H'0000' 707T2CKPS1 EQU H'0001' 708TOUTPS0 EQU H'0003' 709TOUTPS1 EQU H'0004' 710TOUTPS2 EQU H'0005' 711TOUTPS3 EQU H'0006' 712 713 714;----- T1CON Bits ----------------------------------------------------- 715TMR1ON EQU H'0000' 716TMR1CS EQU H'0001' 717NOT_T1SYNC EQU H'0002' 718T1OSCEN EQU H'0003' 719T1RUN EQU H'0006' 720RD16 EQU H'0007' 721 722T1SYNC EQU H'0002' 723T1CKPS0 EQU H'0004' 724T1CKPS1 EQU H'0005' 725 726 727;----- RCON Bits ----------------------------------------------------- 728NOT_BOR EQU H'0000' 729NOT_POR EQU H'0001' 730NOT_PD EQU H'0002' 731NOT_TO EQU H'0003' 732NOT_RI EQU H'0004' 733IPEN EQU H'0007' 734 735BOR EQU H'0000' 736POR EQU H'0001' 737PD EQU H'0002' 738TO EQU H'0003' 739RI EQU H'0004' 740 741 742;----- WDTCON Bits ----------------------------------------------------- 743SWDTEN EQU H'0000' 744 745SWDTE EQU H'0000' 746 747 748;----- LVDCON Bits ----------------------------------------------------- 749LVDEN EQU H'0004' 750IRVST EQU H'0005' 751 752LVDL0 EQU H'0000' 753LVDL1 EQU H'0001' 754LVDL2 EQU H'0002' 755LVDL3 EQU H'0003' 756IVRST EQU H'0005' 757 758 759;----- OSCCON Bits ----------------------------------------------------- 760SCS0 EQU H'0000' 761SCS1 EQU H'0001' 762IOFS EQU H'0002' 763OSTS EQU H'0003' 764IDLEN EQU H'0007' 765 766SCS EQU H'0000' 767FLTS EQU H'0002' 768IRCF0 EQU H'0004' 769IRCF1 EQU H'0005' 770IRCF2 EQU H'0006' 771 772 773;----- T0CON Bits ----------------------------------------------------- 774PSA EQU H'0003' 775T0SE EQU H'0004' 776T0CS EQU H'0005' 777T08BIT EQU H'0006' 778TMR0ON EQU H'0007' 779 780T0PS0 EQU H'0000' 781T0PS1 EQU H'0001' 782T0PS2 EQU H'0002' 783T0PS3 EQU H'0003' 784T016BIT EQU H'0006' 785 786 787;----- STATUS Bits ----------------------------------------------------- 788C EQU H'0000' 789DC EQU H'0001' 790Z EQU H'0002' 791OV EQU H'0003' 792N EQU H'0004' 793 794 795;----- INTCON3 Bits ----------------------------------------------------- 796INT1IF EQU H'0000' 797INT2IF EQU H'0001' 798INT1IE EQU H'0003' 799INT2IE EQU H'0004' 800INT1IP EQU H'0006' 801INT2IP EQU H'0007' 802 803INT1F EQU H'0000' 804INT2F EQU H'0001' 805INT1E EQU H'0003' 806INT2E EQU H'0004' 807INT1P EQU H'0006' 808INT2P EQU H'0007' 809 810 811;----- INTCON2 Bits ----------------------------------------------------- 812RBIP EQU H'0000' 813TMR0IP EQU H'0002' 814INTEDG2 EQU H'0004' 815INTEDG1 EQU H'0005' 816INTEDG0 EQU H'0006' 817NOT_RBPU EQU H'0007' 818 819T0IP EQU H'0002' 820RBPU EQU H'0007' 821 822 823;----- INTCON Bits ----------------------------------------------------- 824RBIF EQU H'0000' 825INT0IF EQU H'0001' 826TMR0IF EQU H'0002' 827RBIE EQU H'0003' 828INT0IE EQU H'0004' 829TMR0IE EQU H'0005' 830PEIE_GIEL EQU H'0006' 831GIE_GIEH EQU H'0007' 832 833INT0F EQU H'0001' 834T0IF EQU H'0002' 835INT0E EQU H'0004' 836T0IE EQU H'0005' 837PEIE EQU H'0006' 838GIE EQU H'0007' 839 840INTF EQU H'0001' 841INTE EQU H'0004' 842GIEL EQU H'0006' 843GIEH EQU H'0007' 844 845 846;----- STKPTR Bits ----------------------------------------------------- 847STKUNF EQU H'0006' 848STKFUL EQU H'0007' 849 850STKPTR0 EQU H'0000' 851STKPTR1 EQU H'0001' 852STKPTR2 EQU H'0002' 853STKPTR3 EQU H'0003' 854STKPTR4 EQU H'0004' 855STKOVF EQU H'0007' 856 857SP0 EQU H'0000' 858SP1 EQU H'0001' 859SP2 EQU H'0002' 860SP3 EQU H'0003' 861SP4 EQU H'0004' 862 863 864 865;========================================================================== 866; 867; RAM Definitions 868; 869;========================================================================== 870 __MAXRAM H'0FFF' 871 __BADRAM H'0200'-H'0F7F' 872 __BADRAM H'0F83'-H'0F88' 873 __BADRAM H'0F8C'-H'0F91' 874 __BADRAM H'0F95'-H'0F99' 875 __BADRAM H'0F9C' 876 __BADRAM H'0FA3'-H'0FA5' 877 __BADRAM H'0FAA' 878 __BADRAM H'0FB0' 879 __BADRAM H'0FB6'-H'0FB9' 880 __BADRAM H'0FD4' 881 882;========================================================================== 883; 884; IMPORTANT: For the PIC18 devices, the __CONFIG directive has been 885; superseded by the CONFIG directive. The following settings 886; are available for this device. 887; 888; Oscillator Selection bits: 889; OSC = LP LP Oscillator 890; OSC = XT XT Oscillator 891; OSC = HS HS Oscillator 892; OSC = EC EC oscillator, CLKO function on RA6 893; OSC = ECIO EC oscillator, port function on RA6 894; OSC = HSPLL HS oscillator, PLL enabled (clock frequency = 4 x FOSC1) 895; OSC = RCIO External RC oscillator, port function on RA6 896; OSC = INTIO2 Internal RC oscillator, port function on RA6 and port function on RA7 897; OSC = INTIO1 Internal RC oscillator, CLKO function on RA6 and port function on RA7 898; OSC = RC External RC oscillator, CLKO function on RA6 899; 900; Fail-Safe Clock Monitor Enable bit: 901; FSCM = OFF Fail-Safe Clock Monitor disabled 902; FSCM = ON Fail-Safe Clock Monitor enabled 903; 904; Internal/External Switchover bit: 905; IESO = OFF Internal/External Switchover mode disabled 906; IESO = ON Internal/External Switchover mode enabled 907; 908; Power-up Timer enable bit: 909; PWRT = ON PWRT enabled 910; PWRT = OFF PWRT disabled 911; 912; Brown-out Reset enable bit: 913; BOR = OFF Brown-out Reset disabled 914; BOR = ON Brown-out Reset enabled 915; 916; Brown-out Reset Voltage bits: 917; BORV = 45 VBOR set to 4.5V 918; BORV = 42 VBOR set to 4.2V 919; BORV = 27 VBOR set to 2.7V 920; BORV = 20 VBOR set to 2.0V 921; 922; Watchdog Timer Enable bit: 923; WDT = OFF WDT disabled (control is placed on the SWDTEN bit) 924; WDT = ON WDT enabled 925; 926; Watchdog Timer Postscale Select bits: 927; WDTPS = 1 1:1 928; WDTPS = 2 1:2 929; WDTPS = 4 1:4 930; WDTPS = 8 1:8 931; WDTPS = 16 1:16 932; WDTPS = 32 1:32 933; WDTPS = 64 1:64 934; WDTPS = 128 1:128 935; WDTPS = 256 1:256 936; WDTPS = 512 1:512 937; WDTPS = 1024 1:1024 938; WDTPS = 2048 1:2048 939; WDTPS = 4096 1:4096 940; WDTPS = 8192 1:8192 941; WDTPS = 16384 1:16384 942; WDTPS = 32768 1:32768 943; 944; CCP2 MUX bit: 945; CCP2MX = OFF CCP2 input/output is multiplexed with RB3 946; CCP2MX = ON CCP2 input/output is multiplexed with RC1 947; 948; PORTB A/D Enable bit: 949; PBAD = DIG PORTB<4:0> pins are configured as digital I/O on Reset 950; PBAD = ANA PORTB<4:0> pins are configured as analog input channels on Reset 951; 952; MCLR Pin Enable bit: 953; MCLRE = OFF MCLR disabled; RE3 input is enabled in 40-pin devices only (PIC18F4X20) 954; MCLRE = ON MCLR pin enabled; RE3 input pin disabled 955; 956; Stack Full/Underflow Reset Enable bit: 957; STVR = OFF Stack full/underflow will not cause Reset 958; STVR = ON Stack full/underflow will cause Reset 959; 960; Single-Supply ICSP Enable bit: 961; LVP = OFF Single-Supply ICSP disabled 962; LVP = ON Single-Supply ICSP enabled 963; 964; Background Debugger Enable bit: 965; DEBUG = ON Background debugger enabled, RB6 and RB7 are dedicated to In-Circuit Debug 966; DEBUG = OFF Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins 967; 968; Code Protection bit: 969; CP0 = ON Block 0 (000200-0007FFh) code-protected 970; CP0 = OFF Block 0 (000200-0007FFh) not code-protected 971; 972; Code Protection bit: 973; CP1 = ON Block 1 (000800-000FFFh) code-protected 974; CP1 = OFF Block 1 (000800-000FFFh) not code-protected 975; 976; Code Protection bit: 977; CP2 = ON Block 2 (001000-0017FFh) code-protected 978; CP2 = OFF Block 2 (001000-0017FFh) not code-protected 979; 980; Code Protection bit: 981; CP3 = ON Block 3 (001800-001FFFh) code-protected 982; CP3 = OFF Block 3 (001800-001FFFh) not code-protected 983; 984; Boot Block Code Protection bit: 985; CPB = ON Boot block (000000-0001FFh) is code-protected 986; CPB = OFF Boot block (000000-0001FFh) is not code-protected 987; 988; Data EEPROM Code Protection bit: 989; CPD = ON Data EEPROM is code-protected 990; CPD = OFF Data EEPROM is not code-protected 991; 992; Write Protection bit: 993; WRT0 = ON Block 0 (000200-0007FFh) write-protected 994; WRT0 = OFF Block 0 (000200-0007FFh) not write-protected 995; 996; Write Protection bit: 997; WRT1 = ON Block 1 (000800-000FFFh) write-protected 998; WRT1 = OFF Block 1 (000800-000FFFh) not write-protected 999; 1000; Write Protection bit: 1001; WRT2 = ON Block 2 (001000-0017FFh) write-protected 1002; WRT2 = OFF Block 2 (001000-0017FFh) not write-protected 1003; 1004; Write Protection bit: 1005; WRT3 = ON Block 3 (001800-001FFFh) write-protected 1006; WRT3 = OFF Block 3 (001800-001FFFh) not write-protected 1007; 1008; Configuration Register Write Protection bit: 1009; WRTC = ON Configuration registers (300000-3000FFh) are write-protected 1010; WRTC = OFF Configuration registers (300000-3000FFh) are not write-protected 1011; 1012; Boot Block Write Protection bit: 1013; WRTB = ON Boot block (000000-0001FFh) is write-protected 1014; WRTB = OFF Boot block (000000-0001FFh) is not write-protected 1015; 1016; Data EEPROM Write Protection bit: 1017; WRTD = ON Data EEPROM is write-protected 1018; WRTD = OFF Data EEPROM is not write-protected 1019; 1020; Table Read Protection bit: 1021; EBTR0 = ON Block 0 (000200-0007FFh) protected from table reads executed in other blocks 1022; EBTR0 = OFF Block 0 (000200-0007FFh) not protected from table reads executed in other blocks 1023; 1024; Table Read Protection bit: 1025; EBTR1 = ON Block 1 (000800-000FFFh) protected from table reads executed in other blocks 1026; EBTR1 = OFF Block 1 (000800-000FFFh) not protected from table reads executed in other blocks 1027; 1028; Table Read Protection bit: 1029; EBTR2 = ON Block 2 (001000-0017FFh) protected from table reads executed in other blocks 1030; EBTR2 = OFF Block 2 (001000-0017FFh) not protected from table reads executed in other blocks 1031; 1032; Table Read Protection bit: 1033; EBTR3 = ON Block 3 (001800-001FFFh) protected from table reads executed in other blocks 1034; EBTR3 = OFF Block 3 (001800-001FFFh) not protected from table reads executed in other blocks 1035; 1036; Boot Block Table Read Protection bit: 1037; EBTRB = ON Boot block (000000-0001FFh) is protected from table reads executed in other blocks 1038; EBTRB = OFF Boot block (000000-0001FFh) is not protected from table reads executed in other blocks 1039; 1040;========================================================================== 1041;========================================================================== 1042; 1043; Configuration Bits 1044; 1045; NAME Address 1046; CONFIG1H 300001h 1047; CONFIG2L 300002h 1048; CONFIG2H 300003h 1049; CONFIG3H 300005h 1050; CONFIG4L 300006h 1051; CONFIG5L 300008h 1052; CONFIG5H 300009h 1053; CONFIG6L 30000Ah 1054; CONFIG6H 30000Bh 1055; CONFIG7L 30000Ch 1056; CONFIG7H 30000Dh 1057; 1058;========================================================================== 1059 1060; The following is an assignment of address values for all of the 1061; configuration registers for the purpose of table reads 1062_CONFIG1H EQU H'300001' 1063_CONFIG2L EQU H'300002' 1064_CONFIG2H EQU H'300003' 1065_CONFIG3H EQU H'300005' 1066_CONFIG4L EQU H'300006' 1067_CONFIG5L EQU H'300008' 1068_CONFIG5H EQU H'300009' 1069_CONFIG6L EQU H'30000A' 1070_CONFIG6H EQU H'30000B' 1071_CONFIG7L EQU H'30000C' 1072_CONFIG7H EQU H'30000D' 1073 1074;----- CONFIG1H Options -------------------------------------------------- 1075_LP_OSC EQU H'F0' ; LP Oscillator 1076_LP_OSC_1H EQU H'F0' ; LP Oscillator 1077_XT_OSC EQU H'F1' ; XT Oscillator 1078_XT_OSC_1H EQU H'F1' ; XT Oscillator 1079_HS_OSC EQU H'F2' ; HS Oscillator 1080_HS_OSC_1H EQU H'F2' ; HS Oscillator 1081_EC_OSC EQU H'F4' ; EC oscillator, CLKO function on RA6 1082_EC_OSC_1H EQU H'F4' ; EC oscillator, CLKO function on RA6 1083_ECIOP_OSC EQU H'F5' ; EC oscillator, port function on RA6 1084_ECIOP_OSC_1H EQU H'F5' ; EC oscillator, port function on RA6 1085_ECIO_OSC_1H EQU H'F5' ; EC oscillator, port function on RA6 1086_HSPLL_OSC EQU H'F6' ; HS oscillator, PLL enabled (clock frequency = 4 x FOSC1) 1087_HSPLL_OSC_1H EQU H'F6' ; HS oscillator, PLL enabled (clock frequency = 4 x FOSC1) 1088_RCIO_OSC EQU H'F7' ; External RC oscillator, port function on RA6 1089_RCIO_OSC_1H EQU H'F7' ; External RC oscillator, port function on RA6 1090_INTIO2_OSC EQU H'F8' ; Internal RC oscillator, port function on RA6 and port function on RA7 1091_INTIO2_OSC_1H EQU H'F8' ; Internal RC oscillator, port function on RA6 and port function on RA7 1092_INTIO1_OSC EQU H'F9' ; Internal RC oscillator, CLKO function on RA6 and port function on RA7 1093_INTIO1_OSC_1H EQU H'F9' ; Internal RC oscillator, CLKO function on RA6 and port function on RA7 1094_RC_OSC EQU H'FC' ; External RC oscillator, CLKO function on RA6 1095_RC_OSC_1H EQU H'FC' ; External RC oscillator, CLKO function on RA6 1096 1097_FSCM_OFF_1H EQU H'BF' ; Fail-Safe Clock Monitor disabled 1098_FSCM_ON_1H EQU H'FF' ; Fail-Safe Clock Monitor enabled 1099 1100_IESO_OFF_1H EQU H'7F' ; Internal/External Switchover mode disabled 1101_IESO_ON_1H EQU H'FF' ; Internal/External Switchover mode enabled 1102 1103;----- CONFIG2L Options -------------------------------------------------- 1104_PWRT_ON_2L EQU H'FE' ; PWRT enabled 1105_PWRT_OFF_2L EQU H'FF' ; PWRT disabled 1106 1107_BOR_OFF_2L EQU H'FD' ; Brown-out Reset disabled 1108_BOR_ON_2L EQU H'FF' ; Brown-out Reset enabled 1109 1110_BORV_45_2L EQU H'F3' ; VBOR set to 4.5V 1111_BORV_42_2L EQU H'F7' ; VBOR set to 4.2V 1112_BORV_27_2L EQU H'FB' ; VBOR set to 2.7V 1113_BORV_20_2L EQU H'FF' ; VBOR set to 2.0V 1114 1115;----- CONFIG2H Options -------------------------------------------------- 1116_WDT_OFF_2H EQU H'FE' ; WDT disabled (control is placed on the SWDTEN bit) 1117_WDT_ON_2H EQU H'FF' ; WDT enabled 1118 1119_WDTPS_1_2H EQU H'E1' ; 1:1 1120_WDTPS_2_2H EQU H'E3' ; 1:2 1121_WDTPS_4_2H EQU H'E5' ; 1:4 1122_WDTPS_8_2H EQU H'E7' ; 1:8 1123_WDTPS_16_2H EQU H'E9' ; 1:16 1124_WDTPS_32_2H EQU H'EB' ; 1:32 1125_WDTPS_64_2H EQU H'ED' ; 1:64 1126_WDTPS_128_2H EQU H'EF' ; 1:128 1127_WDTPS_256_2H EQU H'F1' ; 1:256 1128_WDTPS_512_2H EQU H'F3' ; 1:512 1129_1K EQU H'F5' ; 1:1024 1130_WDTPS_1K_2H EQU H'F5' ; 1:1024 1131_2K EQU H'F7' ; 1:2048 1132_WDTPS_2K_2H EQU H'F7' ; 1:2048 1133_4K EQU H'F9' ; 1:4096 1134_WDTPS_4K_2H EQU H'F9' ; 1:4096 1135_8K EQU H'FB' ; 1:8192 1136_WDTPS_8K_2H EQU H'FB' ; 1:8192 1137_16K EQU H'FD' ; 1:16384 1138_WDTPS_16K_2H EQU H'FD' ; 1:16384 1139_32K EQU H'FF' ; 1:32768 1140_WDTPS_32K_2H EQU H'FF' ; 1:32768 1141 1142;----- CONFIG3H Options -------------------------------------------------- 1143_CCP2MX_OFF EQU H'FE' ; CCP2 input/output is multiplexed with RB3 1144_CCP2MX_OFF_3H EQU H'FE' ; CCP2 input/output is multiplexed with RB3 1145_CCP2MX_B3 EQU H'FE' ; CCP2 input/output is multiplexed with RB3 1146_CCP2MX_B3_3H EQU H'FE' ; CCP2 input/output is multiplexed with RB3 1147_CCP2MX_ON EQU H'FF' ; CCP2 input/output is multiplexed with RC1 1148_CCP2MX_ON_3H EQU H'FF' ; CCP2 input/output is multiplexed with RC1 1149_CCP2MX_C1 EQU H'FF' ; CCP2 input/output is multiplexed with RC1 1150_CCP2MX_C1_3H EQU H'FF' ; CCP2 input/output is multiplexed with RC1 1151 1152_PBAD_DIG_3H EQU H'FD' ; PORTB<4:0> pins are configured as digital I/O on Reset 1153_PBAD_ANA_3H EQU H'FF' ; PORTB<4:0> pins are configured as analog input channels on Reset 1154 1155_MCLRE_OFF_3H EQU H'7F' ; MCLR disabled; RE3 input is enabled in 40-pin devices only (PIC18F4X20) 1156_MCLRE_ON_3H EQU H'FF' ; MCLR pin enabled; RE3 input pin disabled 1157 1158;----- CONFIG4L Options -------------------------------------------------- 1159_STVR_OFF_4L EQU H'FE' ; Stack full/underflow will not cause Reset 1160_STVR_ON_4L EQU H'FF' ; Stack full/underflow will cause Reset 1161 1162_LVP_OFF_4L EQU H'FB' ; Single-Supply ICSP disabled 1163_LVP_ON_4L EQU H'FF' ; Single-Supply ICSP enabled 1164 1165_DEBUG_ON_4L EQU H'7F' ; Background debugger enabled, RB6 and RB7 are dedicated to In-Circuit Debug 1166_DEBUG_OFF_4L EQU H'FF' ; Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins 1167 1168;----- CONFIG5L Options -------------------------------------------------- 1169_CP0_ON_5L EQU H'FE' ; Block 0 (000200-0007FFh) code-protected 1170_CP0_OFF_5L EQU H'FF' ; Block 0 (000200-0007FFh) not code-protected 1171 1172_CP1_ON_5L EQU H'FD' ; Block 1 (000800-000FFFh) code-protected 1173_CP1_OFF_5L EQU H'FF' ; Block 1 (000800-000FFFh) not code-protected 1174 1175_CP2_ON_5L EQU H'FB' ; Block 2 (001000-0017FFh) code-protected 1176_CP2_OFF_5L EQU H'FF' ; Block 2 (001000-0017FFh) not code-protected 1177 1178_CP3_ON_5L EQU H'F7' ; Block 3 (001800-001FFFh) code-protected 1179_CP3_OFF_5L EQU H'FF' ; Block 3 (001800-001FFFh) not code-protected 1180 1181;----- CONFIG5H Options -------------------------------------------------- 1182_CPB_ON_5H EQU H'BF' ; Boot block (000000-0001FFh) is code-protected 1183_CPB_OFF_5H EQU H'FF' ; Boot block (000000-0001FFh) is not code-protected 1184 1185_CPD_ON_5H EQU H'7F' ; Data EEPROM is code-protected 1186_CPD_OFF_5H EQU H'FF' ; Data EEPROM is not code-protected 1187 1188;----- CONFIG6L Options -------------------------------------------------- 1189_WRT0_ON_6L EQU H'FE' ; Block 0 (000200-0007FFh) write-protected 1190_WRT0_OFF_6L EQU H'FF' ; Block 0 (000200-0007FFh) not write-protected 1191 1192_WRT1_ON_6L EQU H'FD' ; Block 1 (000800-000FFFh) write-protected 1193_WRT1_OFF_6L EQU H'FF' ; Block 1 (000800-000FFFh) not write-protected 1194 1195_WRT2_ON_6L EQU H'FB' ; Block 2 (001000-0017FFh) write-protected 1196_WRT2_OFF_6L EQU H'FF' ; Block 2 (001000-0017FFh) not write-protected 1197 1198_WRT3_ON_6L EQU H'F7' ; Block 3 (001800-001FFFh) write-protected 1199_WRT3_OFF_6L EQU H'FF' ; Block 3 (001800-001FFFh) not write-protected 1200 1201;----- CONFIG6H Options -------------------------------------------------- 1202_WRTC_ON_6H EQU H'DF' ; Configuration registers (300000-3000FFh) are write-protected 1203_WRTC_OFF_6H EQU H'FF' ; Configuration registers (300000-3000FFh) are not write-protected 1204 1205_WRTB_ON_6H EQU H'BF' ; Boot block (000000-0001FFh) is write-protected 1206_WRTB_OFF_6H EQU H'FF' ; Boot block (000000-0001FFh) is not write-protected 1207 1208_WRTD_ON_6H EQU H'7F' ; Data EEPROM is write-protected 1209_WRTD_OFF_6H EQU H'FF' ; Data EEPROM is not write-protected 1210 1211;----- CONFIG7L Options -------------------------------------------------- 1212_EBTR0_ON_7L EQU H'FE' ; Block 0 (000200-0007FFh) protected from table reads executed in other blocks 1213_EBTR0_OFF_7L EQU H'FF' ; Block 0 (000200-0007FFh) not protected from table reads executed in other blocks 1214 1215_EBTR1_ON_7L EQU H'FD' ; Block 1 (000800-000FFFh) protected from table reads executed in other blocks 1216_EBTR1_OFF_7L EQU H'FF' ; Block 1 (000800-000FFFh) not protected from table reads executed in other blocks 1217 1218_EBTR2_ON_7L EQU H'FB' ; Block 2 (001000-0017FFh) protected from table reads executed in other blocks 1219_EBTR2_OFF_7L EQU H'FF' ; Block 2 (001000-0017FFh) not protected from table reads executed in other blocks 1220 1221_EBTR3_ON_7L EQU H'F7' ; Block 3 (001800-001FFFh) protected from table reads executed in other blocks 1222_EBTR3_OFF_7L EQU H'FF' ; Block 3 (001800-001FFFh) not protected from table reads executed in other blocks 1223 1224;----- CONFIG7H Options -------------------------------------------------- 1225_EBTRB_ON_7H EQU H'BF' ; Boot block (000000-0001FFh) is protected from table reads executed in other blocks 1226_EBTRB_OFF_7H EQU H'FF' ; Boot block (000000-0001FFh) is not protected from table reads executed in other blocks 1227 1228 1229;----- DEVID Equates -------------------------------------------------- 1230_DEVID1 EQU H'3FFFFE' 1231_DEVID2 EQU H'3FFFFF' 1232 1233;----- IDLOC Equates -------------------------------------------------- 1234_IDLOC0 EQU H'200000' 1235_IDLOC1 EQU H'200001' 1236_IDLOC2 EQU H'200002' 1237_IDLOC3 EQU H'200003' 1238_IDLOC4 EQU H'200004' 1239_IDLOC5 EQU H'200005' 1240_IDLOC6 EQU H'200006' 1241_IDLOC7 EQU H'200007' 1242 1243 LIST 1244