1 LIST 2 3;========================================================================== 4; Build date : Aug 13 2015 5; MPASM PIC16F1823 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 PIC16F1823 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 /PIC16F1823 22; 2. LIST directive in the source file 23; LIST P=PIC16F1823 24; 3. Processor Type entry in the MPASM full-screen interface 25; 4. Setting the processor in the MPLAB Project Dialog 26;========================================================================== 27;;;; Begin: Added in gputils 28 29;========================================================================== 30; 31; Gputils Specific Revision History 32; 33;========================================================================== 34 35; 19 Jun 2012 Removed CCP1SEL and P1BSEL bits from "APFCON Bits". 36; Removed CCP1SEL and P1BSEL bits from "APFCON0 Bits". 37; 12 Jul 2014 Added the _DEBUG_ON and _DEBUG_OFF config options. 38;;;; End: Added in gputils 39 40;========================================================================== 41; 42; Verify Processor 43; 44;========================================================================== 45 IFNDEF __16F1823 46 MESSG "Processor-header file mismatch. Verify selected processor." 47 ENDIF 48 49 50 51;========================================================================== 52; 53; Register Definitions 54; 55;========================================================================== 56 57W EQU H'0000' 58F EQU H'0001' 59 60;----- Register Files ----------------------------------------------------- 61 62;-----Bank0------------------ 63INDF0 EQU H'0000' 64INDF1 EQU H'0001' 65PCL EQU H'0002' 66STATUS EQU H'0003' 67FSR0 EQU H'0004' 68FSR0L EQU H'0004' 69FSR0H EQU H'0005' 70FSR1 EQU H'0006' 71FSR1L EQU H'0006' 72FSR1H EQU H'0007' 73BSR EQU H'0008' 74WREG EQU H'0009' 75PCLATH EQU H'000A' 76INTCON EQU H'000B' 77PORTA EQU H'000C' 78PORTC EQU H'000E' 79PIR1 EQU H'0011' 80PIR2 EQU H'0012' 81TMR0 EQU H'0015' 82TMR1 EQU H'0016' 83TMR1L EQU H'0016' 84TMR1H EQU H'0017' 85T1CON EQU H'0018' 86T1GCON EQU H'0019' 87TMR2 EQU H'001A' 88PR2 EQU H'001B' 89T2CON EQU H'001C' 90CPSCON0 EQU H'001E' 91CPSCON1 EQU H'001F' 92 93;-----Bank1------------------ 94TRISA EQU H'008C' 95TRISC EQU H'008E' 96PIE1 EQU H'0091' 97PIE2 EQU H'0092' 98OPTION_REG EQU H'0095' 99PCON EQU H'0096' 100WDTCON EQU H'0097' 101OSCTUNE EQU H'0098' 102OSCCON EQU H'0099' 103OSCSTAT EQU H'009A' 104ADRES EQU H'009B' 105ADRESL EQU H'009B' 106ADRESH EQU H'009C' 107ADCON0 EQU H'009D' 108ADCON1 EQU H'009E' 109 110;-----Bank2------------------ 111LATA EQU H'010C' 112LATC EQU H'010E' 113CM1CON0 EQU H'0111' 114CM1CON1 EQU H'0112' 115CM2CON0 EQU H'0113' 116CM2CON1 EQU H'0114' 117CMOUT EQU H'0115' 118BORCON EQU H'0116' 119FVRCON EQU H'0117' 120DACCON0 EQU H'0118' 121DACCON1 EQU H'0119' 122SRCON0 EQU H'011A' 123SRCON1 EQU H'011B' 124APFCON EQU H'011D' 125APFCON0 EQU H'011D' 126 127;-----Bank3------------------ 128ANSELA EQU H'018C' 129ANSELC EQU H'018E' 130EEADR EQU H'0191' 131EEADRL EQU H'0191' 132EEADRH EQU H'0192' 133EEDAT EQU H'0193' 134EEDATL EQU H'0193' 135EEDATH EQU H'0194' 136EECON1 EQU H'0195' 137EECON2 EQU H'0196' 138RCREG EQU H'0199' 139TXREG EQU H'019A' 140SP1BRG EQU H'019B' 141SP1BRGL EQU H'019B' 142SPBRG EQU H'019B' 143SPBRGL EQU H'019B' 144SP1BRGH EQU H'019C' 145SPBRGH EQU H'019C' 146RCSTA EQU H'019D' 147TXSTA EQU H'019E' 148BAUDCON EQU H'019F' 149 150;-----Bank4------------------ 151WPUA EQU H'020C' 152WPUC EQU H'020E' 153SSP1BUF EQU H'0211' 154SSPBUF EQU H'0211' 155SSP1ADD EQU H'0212' 156SSPADD EQU H'0212' 157SSP1MSK EQU H'0213' 158SSPMSK EQU H'0213' 159SSP1STAT EQU H'0214' 160SSPSTAT EQU H'0214' 161SSP1CON1 EQU H'0215' 162SSPCON EQU H'0215' 163SSPCON1 EQU H'0215' 164SSP1CON2 EQU H'0216' 165SSPCON2 EQU H'0216' 166SSP1CON3 EQU H'0217' 167SSPCON3 EQU H'0217' 168 169;-----Bank5------------------ 170CCPR1 EQU H'0291' 171CCPR1L EQU H'0291' 172CCPR1H EQU H'0292' 173CCP1CON EQU H'0293' 174PWM1CON EQU H'0294' 175CCP1AS EQU H'0295' 176ECCP1AS EQU H'0295' 177PSTR1CON EQU H'0296' 178 179;-----Bank7------------------ 180IOCAP EQU H'0391' 181IOCAN EQU H'0392' 182IOCAF EQU H'0393' 183CLKRCON EQU H'039A' 184MDCON EQU H'039C' 185MDSRC EQU H'039D' 186MDCARL EQU H'039E' 187MDCARH EQU H'039F' 188 189;-----Bank31------------------ 190STATUS_SHAD EQU H'0FE4' 191WREG_SHAD EQU H'0FE5' 192BSR_SHAD EQU H'0FE6' 193PCLATH_SHAD EQU H'0FE7' 194FSR0L_SHAD EQU H'0FE8' 195FSR0H_SHAD EQU H'0FE9' 196FSR1L_SHAD EQU H'0FEA' 197FSR1H_SHAD EQU H'0FEB' 198STKPTR EQU H'0FED' 199TOSL EQU H'0FEE' 200TOSH EQU H'0FEF' 201 202;----- STATUS Bits ----------------------------------------------------- 203C EQU H'0000' 204DC EQU H'0001' 205Z EQU H'0002' 206NOT_PD EQU H'0003' 207NOT_TO EQU H'0004' 208 209 210;----- BSR Bits ----------------------------------------------------- 211BSR0 EQU H'0000' 212BSR1 EQU H'0001' 213BSR2 EQU H'0002' 214BSR3 EQU H'0003' 215BSR4 EQU H'0004' 216 217 218 219;----- INTCON Bits ----------------------------------------------------- 220IOCIF EQU H'0000' 221INTF EQU H'0001' 222TMR0IF EQU H'0002' 223IOCIE EQU H'0003' 224INTE EQU H'0004' 225TMR0IE EQU H'0005' 226PEIE EQU H'0006' 227GIE EQU H'0007' 228 229T0IF EQU H'0002' 230T0IE EQU H'0005' 231 232 233;----- PORTA Bits ----------------------------------------------------- 234RA0 EQU H'0000' 235RA1 EQU H'0001' 236RA2 EQU H'0002' 237RA3 EQU H'0003' 238RA4 EQU H'0004' 239RA5 EQU H'0005' 240 241AN0 EQU H'0000' 242AN1 EQU H'0001' 243AN2 EQU H'0002' 244AN3 EQU H'0004' 245 246CPS0 EQU H'0000' 247CPS1 EQU H'0001' 248CPS2 EQU H'0002' 249CPS3 EQU H'0004' 250 251C1INP EQU H'0000' 252C12IN0N EQU H'0001' 253C1OUT_PORTA EQU H'0002' 254NOT_SS EQU H'0003' 255SDO_PORTA EQU H'0004' 256 257TX_PORTA EQU H'0000' 258RX_PORTA EQU H'0001' 259T0CKI EQU H'0002' 260NOT_MCLR EQU H'0003' 261CLKR EQU H'0004' 262T1OSI EQU H'0005' 263 264CK_PORTA EQU H'0000' 265DT_PORTA EQU H'0001' 266FLT0 EQU H'0002' 267T1OSO EQU H'0004' 268T1CKI EQU H'0005' 269 270DACOUT EQU H'0000' 271SRI EQU H'0001' 272SRQ EQU H'0002' 273OSC2 EQU H'0004' 274OSC1 EQU H'0005' 275 276CLKOUT EQU H'0004' 277CLKIN EQU H'0005' 278 279 280;----- PORTC Bits ----------------------------------------------------- 281RC0 EQU H'0000' 282RC1 EQU H'0001' 283RC2 EQU H'0002' 284RC3 EQU H'0003' 285RC4 EQU H'0004' 286RC5 EQU H'0005' 287 288AN4 EQU H'0000' 289AN5 EQU H'0001' 290AN6 EQU H'0002' 291AN7 EQU H'0003' 292 293CPS4 EQU H'0000' 294CPS5 EQU H'0001' 295CPS6 EQU H'0002' 296CPS7 EQU H'0003' 297 298C2INP EQU H'0000' 299C12IN1N EQU H'0001' 300C12IN2N EQU H'0002' 301C12IN3N EQU H'0003' 302C2OUT_PORTC EQU H'0004' 303 304SCL EQU H'0000' 305SDA EQU H'0001' 306P1D EQU H'0002' 307P1C EQU H'0003' 308P1B EQU H'0004' 309P1A EQU H'0005' 310 311SCK EQU H'0000' 312SDI EQU H'0001' 313SDO_PORTC EQU H'0002' 314NOT_SS EQU H'0003' 315SRNQ EQU H'0004' 316CCP1 EQU H'0005' 317 318MDCIN1 EQU H'0002' 319MDMIN EQU H'0003' 320MDOUT_PORTC EQU H'0004' 321MDCIN2 EQU H'0005' 322 323TX_PORTC EQU H'0004' 324RX_PORTC EQU H'0005' 325 326CK_PORTC EQU H'0004' 327DT_PORTC EQU H'0005' 328 329 330;----- PIR1 Bits ----------------------------------------------------- 331TMR1IF EQU H'0000' 332TMR2IF EQU H'0001' 333CCP1IF EQU H'0002' 334SSP1IF EQU H'0003' 335TXIF EQU H'0004' 336RCIF EQU H'0005' 337ADIF EQU H'0006' 338TMR1GIF EQU H'0007' 339 340 341;----- PIR2 Bits ----------------------------------------------------- 342BCL1IF EQU H'0003' 343EEIF EQU H'0004' 344C1IF EQU H'0005' 345C2IF EQU H'0006' 346OSFIF EQU H'0007' 347 348 349;----- T1CON Bits ----------------------------------------------------- 350TMR1ON EQU H'0000' 351NOT_T1SYNC EQU H'0002' 352T1OSCEN EQU H'0003' 353T1CKPS0 EQU H'0004' 354T1CKPS1 EQU H'0005' 355TMR1CS0 EQU H'0006' 356TMR1CS1 EQU H'0007' 357 358 359 360;----- T1GCON Bits ----------------------------------------------------- 361T1GSS0 EQU H'0000' 362T1GSS1 EQU H'0001' 363T1GVAL EQU H'0002' 364T1GGO_NOT_DONE EQU H'0003' 365T1GSPM EQU H'0004' 366T1GTM EQU H'0005' 367T1GPOL EQU H'0006' 368TMR1GE EQU H'0007' 369 370T1GGO EQU H'0003' 371 372 373;----- T2CON Bits ----------------------------------------------------- 374T2CKPS0 EQU H'0000' 375T2CKPS1 EQU H'0001' 376TMR2ON EQU H'0002' 377T2OUTPS0 EQU H'0003' 378T2OUTPS1 EQU H'0004' 379T2OUTPS2 EQU H'0005' 380T2OUTPS3 EQU H'0006' 381 382 383 384;----- CPSCON0 Bits ----------------------------------------------------- 385T0XCS EQU H'0000' 386CPSOUT EQU H'0001' 387CPSRNG0 EQU H'0002' 388CPSRNG1 EQU H'0003' 389CPSRM EQU H'0006' 390CPSON EQU H'0007' 391 392 393 394;----- CPSCON1 Bits ----------------------------------------------------- 395CPSCH0 EQU H'0000' 396CPSCH1 EQU H'0001' 397CPSCH2 EQU H'0002' 398CPSCH3 EQU H'0003' 399 400 401 402;----- TRISA Bits ----------------------------------------------------- 403TRISA0 EQU H'0000' 404TRISA1 EQU H'0001' 405TRISA2 EQU H'0002' 406TRISA3 EQU H'0003' 407TRISA4 EQU H'0004' 408TRISA5 EQU H'0005' 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' 418 419 420;----- PIE1 Bits ----------------------------------------------------- 421TMR1IE EQU H'0000' 422TMR2IE EQU H'0001' 423CCP1IE EQU H'0002' 424SSP1IE EQU H'0003' 425TXIE EQU H'0004' 426RCIE EQU H'0005' 427ADIE EQU H'0006' 428TMR1GIE EQU H'0007' 429 430 431;----- PIE2 Bits ----------------------------------------------------- 432BCL1IE EQU H'0003' 433EEIE EQU H'0004' 434C1IE EQU H'0005' 435C2IE EQU H'0006' 436OSFIE EQU H'0007' 437 438 439;----- OPTION_REG Bits ----------------------------------------------------- 440PS0 EQU H'0000' 441PS1 EQU H'0001' 442PS2 EQU H'0002' 443PSA EQU H'0003' 444TMR0SE EQU H'0004' 445TMR0CS EQU H'0005' 446INTEDG EQU H'0006' 447NOT_WPUEN EQU H'0007' 448 449T0SE EQU H'0004' 450T0CS EQU H'0005' 451 452 453;----- PCON Bits ----------------------------------------------------- 454NOT_BOR EQU H'0000' 455NOT_POR EQU H'0001' 456NOT_RI EQU H'0002' 457NOT_RMCLR EQU H'0003' 458STKUNF EQU H'0006' 459STKOVF EQU H'0007' 460 461 462;----- WDTCON Bits ----------------------------------------------------- 463SWDTEN EQU H'0000' 464WDTPS0 EQU H'0001' 465WDTPS1 EQU H'0002' 466WDTPS2 EQU H'0003' 467WDTPS3 EQU H'0004' 468WDTPS4 EQU H'0005' 469 470 471 472;----- OSCTUNE Bits ----------------------------------------------------- 473TUN0 EQU H'0000' 474TUN1 EQU H'0001' 475TUN2 EQU H'0002' 476TUN3 EQU H'0003' 477TUN4 EQU H'0004' 478TUN5 EQU H'0005' 479 480 481 482;----- OSCCON Bits ----------------------------------------------------- 483SCS0 EQU H'0000' 484SCS1 EQU H'0001' 485IRCF0 EQU H'0003' 486IRCF1 EQU H'0004' 487IRCF2 EQU H'0005' 488IRCF3 EQU H'0006' 489SPLLEN EQU H'0007' 490 491 492 493;----- OSCSTAT Bits ----------------------------------------------------- 494HFIOFS EQU H'0000' 495LFIOFR EQU H'0001' 496MFIOFR EQU H'0002' 497HFIOFL EQU H'0003' 498HFIOFR EQU H'0004' 499OSTS EQU H'0005' 500PLLR EQU H'0006' 501T1OSCR EQU H'0007' 502 503 504;----- ADCON0 Bits ----------------------------------------------------- 505ADON EQU H'0000' 506GO_NOT_DONE EQU H'0001' 507CHS0 EQU H'0002' 508CHS1 EQU H'0003' 509CHS2 EQU H'0004' 510CHS3 EQU H'0005' 511CHS4 EQU H'0006' 512 513ADGO EQU H'0001' 514 515GO EQU H'0001' 516 517NOT_DONE EQU H'0001' 518 519 520;----- ADCON1 Bits ----------------------------------------------------- 521ADPREF0 EQU H'0000' 522ADPREF1 EQU H'0001' 523ADCS0 EQU H'0004' 524ADCS1 EQU H'0005' 525ADCS2 EQU H'0006' 526ADFM EQU H'0007' 527 528 529 530;----- LATA Bits ----------------------------------------------------- 531LATA0 EQU H'0000' 532LATA1 EQU H'0001' 533LATA2 EQU H'0002' 534LATA4 EQU H'0004' 535LATA5 EQU H'0005' 536 537 538;----- LATC Bits ----------------------------------------------------- 539LATC0 EQU H'0000' 540LATC1 EQU H'0001' 541LATC2 EQU H'0002' 542LATC3 EQU H'0003' 543LATC4 EQU H'0004' 544LATC5 EQU H'0005' 545 546 547;----- CM1CON0 Bits ----------------------------------------------------- 548C1SYNC EQU H'0000' 549C1HYS EQU H'0001' 550C1SP EQU H'0002' 551C1POL EQU H'0004' 552C1OE EQU H'0005' 553C1OUT_CM1CON0 EQU H'0006' 554C1ON EQU H'0007' 555 556 557;----- CM1CON1 Bits ----------------------------------------------------- 558C1NCH0 EQU H'0000' 559C1NCH1 EQU H'0001' 560C1PCH0 EQU H'0004' 561C1PCH1 EQU H'0005' 562C1INTN EQU H'0006' 563C1INTP EQU H'0007' 564 565 566 567;----- CM2CON0 Bits ----------------------------------------------------- 568C2SYNC EQU H'0000' 569C2HYS EQU H'0001' 570C2SP EQU H'0002' 571C2POL EQU H'0004' 572C2OE EQU H'0005' 573C2OUT_CM2CON0 EQU H'0006' 574C2ON EQU H'0007' 575 576 577;----- CM2CON1 Bits ----------------------------------------------------- 578C2NCH0 EQU H'0000' 579C2NCH1 EQU H'0001' 580C2PCH0 EQU H'0004' 581C2PCH1 EQU H'0005' 582C2INTN EQU H'0006' 583C2INTP EQU H'0007' 584 585 586 587;----- CMOUT Bits ----------------------------------------------------- 588MC1OUT EQU H'0000' 589MC2OUT EQU H'0001' 590 591 592;----- BORCON Bits ----------------------------------------------------- 593BORRDY EQU H'0000' 594SBOREN EQU H'0007' 595 596 597;----- FVRCON Bits ----------------------------------------------------- 598ADFVR0 EQU H'0000' 599ADFVR1 EQU H'0001' 600CDAFVR0 EQU H'0002' 601CDAFVR1 EQU H'0003' 602TSRNG EQU H'0004' 603TSEN EQU H'0005' 604FVRRDY EQU H'0006' 605FVREN EQU H'0007' 606 607 608 609;----- DACCON0 Bits ----------------------------------------------------- 610DACPSS0 EQU H'0002' 611DACPSS1 EQU H'0003' 612DACOE EQU H'0005' 613DACLPS EQU H'0006' 614DACEN EQU H'0007' 615 616 617 618;----- DACCON1 Bits ----------------------------------------------------- 619DACR0 EQU H'0000' 620DACR1 EQU H'0001' 621DACR2 EQU H'0002' 622DACR3 EQU H'0003' 623DACR4 EQU H'0004' 624 625 626 627;----- SRCON0 Bits ----------------------------------------------------- 628SRPR EQU H'0000' 629SRPS EQU H'0001' 630SRNQEN EQU H'0002' 631SRQEN EQU H'0003' 632SRCLK0 EQU H'0004' 633SRCLK1 EQU H'0005' 634SRCLK2 EQU H'0006' 635SRLEN EQU H'0007' 636 637 638 639;----- SRCON1 Bits ----------------------------------------------------- 640SRRC1E EQU H'0000' 641SRRC2E EQU H'0001' 642SRRCKE EQU H'0002' 643SRRPE EQU H'0003' 644SRSC1E EQU H'0004' 645SRSC2E EQU H'0005' 646SRSCKE EQU H'0006' 647SRSPE EQU H'0007' 648 649 650;----- APFCON Bits ----------------------------------------------------- 651;;;; Begin: Removed in gputils 652;;;;CCP1SEL EQU H'0000' 653;;;;P1BSEL EQU H'0001' 654;;;; End: Removed in gputils 655TXCKSEL EQU H'0002' 656T1GSEL EQU H'0003' 657SSSEL EQU H'0005' 658SDOSEL EQU H'0006' 659RXDTSEL EQU H'0007' 660 661SS1SEL EQU H'0005' 662SDO1SEL EQU H'0006' 663 664 665;----- APFCON0 Bits ----------------------------------------------------- 666;;;; Begin: Removed in gputils 667;;;;CCP1SEL EQU H'0000' 668;;;;P1BSEL EQU H'0001' 669;;;; End: Removed in gputils 670TXCKSEL EQU H'0002' 671T1GSEL EQU H'0003' 672SSSEL EQU H'0005' 673SDOSEL EQU H'0006' 674RXDTSEL EQU H'0007' 675 676SS1SEL EQU H'0005' 677SDO1SEL EQU H'0006' 678 679 680;----- ANSELA Bits ----------------------------------------------------- 681ANSA0 EQU H'0000' 682ANSA1 EQU H'0001' 683ANSA2 EQU H'0002' 684ANSA4 EQU H'0004' 685 686 687 688;----- ANSELC Bits ----------------------------------------------------- 689ANSC0 EQU H'0000' 690ANSC1 EQU H'0001' 691ANSC2 EQU H'0002' 692ANSC3 EQU H'0003' 693 694 695 696;----- EECON1 Bits ----------------------------------------------------- 697RD EQU H'0000' 698WR EQU H'0001' 699WREN EQU H'0002' 700WRERR EQU H'0003' 701FREE EQU H'0004' 702LWLO EQU H'0005' 703CFGS EQU H'0006' 704EEPGD EQU H'0007' 705 706 707;----- RCSTA Bits ----------------------------------------------------- 708RX9D EQU H'0000' 709OERR EQU H'0001' 710FERR EQU H'0002' 711ADDEN EQU H'0003' 712CREN EQU H'0004' 713SREN EQU H'0005' 714RX9 EQU H'0006' 715SPEN EQU H'0007' 716 717 718;----- TXSTA Bits ----------------------------------------------------- 719TX9D EQU H'0000' 720TRMT EQU H'0001' 721BRGH EQU H'0002' 722SENDB EQU H'0003' 723SYNC EQU H'0004' 724TXEN EQU H'0005' 725TX9 EQU H'0006' 726CSRC EQU H'0007' 727 728 729;----- BAUDCON Bits ----------------------------------------------------- 730ABDEN EQU H'0000' 731WUE EQU H'0001' 732BRG16 EQU H'0003' 733SCKP EQU H'0004' 734RCIDL EQU H'0006' 735ABDOVF EQU H'0007' 736 737 738;----- WPUA Bits ----------------------------------------------------- 739WPUA0 EQU H'0000' 740WPUA1 EQU H'0001' 741WPUA2 EQU H'0002' 742WPUA3 EQU H'0003' 743WPUA4 EQU H'0004' 744WPUA5 EQU H'0005' 745 746 747 748;----- WPUC Bits ----------------------------------------------------- 749WPUC0 EQU H'0000' 750WPUC1 EQU H'0001' 751WPUC2 EQU H'0002' 752WPUC3 EQU H'0003' 753WPUC4 EQU H'0004' 754WPUC5 EQU H'0005' 755 756 757 758;----- SSP1STAT Bits ----------------------------------------------------- 759BF EQU H'0000' 760UA EQU H'0001' 761R_NOT_W EQU H'0002' 762S EQU H'0003' 763P EQU H'0004' 764D_NOT_A EQU H'0005' 765CKE EQU H'0006' 766SMP EQU H'0007' 767 768 769;----- SSPSTAT Bits ----------------------------------------------------- 770BF EQU H'0000' 771UA EQU H'0001' 772R_NOT_W EQU H'0002' 773S EQU H'0003' 774P EQU H'0004' 775D_NOT_A EQU H'0005' 776CKE EQU H'0006' 777SMP EQU H'0007' 778 779 780;----- SSP1CON1 Bits ----------------------------------------------------- 781SSPM0 EQU H'0000' 782SSPM1 EQU H'0001' 783SSPM2 EQU H'0002' 784SSPM3 EQU H'0003' 785CKP EQU H'0004' 786SSPEN EQU H'0005' 787SSPOV EQU H'0006' 788WCOL EQU H'0007' 789 790 791 792;----- SSPCON Bits ----------------------------------------------------- 793SSPM0 EQU H'0000' 794SSPM1 EQU H'0001' 795SSPM2 EQU H'0002' 796SSPM3 EQU H'0003' 797CKP EQU H'0004' 798SSPEN EQU H'0005' 799SSPOV EQU H'0006' 800WCOL EQU H'0007' 801 802 803 804;----- SSPCON1 Bits ----------------------------------------------------- 805SSPM0 EQU H'0000' 806SSPM1 EQU H'0001' 807SSPM2 EQU H'0002' 808SSPM3 EQU H'0003' 809CKP EQU H'0004' 810SSPEN EQU H'0005' 811SSPOV EQU H'0006' 812WCOL EQU H'0007' 813 814 815 816;----- SSP1CON2 Bits ----------------------------------------------------- 817SEN EQU H'0000' 818RSEN EQU H'0001' 819PEN EQU H'0002' 820RCEN EQU H'0003' 821ACKEN EQU H'0004' 822ACKDT EQU H'0005' 823ACKSTAT EQU H'0006' 824GCEN EQU H'0007' 825 826 827;----- SSPCON2 Bits ----------------------------------------------------- 828SEN EQU H'0000' 829RSEN EQU H'0001' 830PEN EQU H'0002' 831RCEN EQU H'0003' 832ACKEN EQU H'0004' 833ACKDT EQU H'0005' 834ACKSTAT EQU H'0006' 835GCEN EQU H'0007' 836 837 838;----- SSP1CON3 Bits ----------------------------------------------------- 839DHEN EQU H'0000' 840AHEN EQU H'0001' 841SBCDE EQU H'0002' 842SDAHT EQU H'0003' 843BOEN EQU H'0004' 844SCIE EQU H'0005' 845PCIE EQU H'0006' 846ACKTIM EQU H'0007' 847 848 849;----- SSPCON3 Bits ----------------------------------------------------- 850DHEN EQU H'0000' 851AHEN EQU H'0001' 852SBCDE EQU H'0002' 853SDAHT EQU H'0003' 854BOEN EQU H'0004' 855SCIE EQU H'0005' 856PCIE EQU H'0006' 857ACKTIM EQU H'0007' 858 859 860;----- CCP1CON Bits ----------------------------------------------------- 861CCP1M0 EQU H'0000' 862CCP1M1 EQU H'0001' 863CCP1M2 EQU H'0002' 864CCP1M3 EQU H'0003' 865DC1B0 EQU H'0004' 866DC1B1 EQU H'0005' 867P1M0 EQU H'0006' 868P1M1 EQU H'0007' 869 870 871 872;----- PWM1CON Bits ----------------------------------------------------- 873P1DC0 EQU H'0000' 874P1DC1 EQU H'0001' 875P1DC2 EQU H'0002' 876P1DC3 EQU H'0003' 877P1DC4 EQU H'0004' 878P1DC5 EQU H'0005' 879P1DC6 EQU H'0006' 880P1RSEN EQU H'0007' 881 882 883 884;----- CCP1AS Bits ----------------------------------------------------- 885PSS1BD0 EQU H'0000' 886PSS1BD1 EQU H'0001' 887PSS1AC0 EQU H'0002' 888PSS1AC1 EQU H'0003' 889CCP1AS0 EQU H'0004' 890CCP1AS1 EQU H'0005' 891CCP1AS2 EQU H'0006' 892CCP1ASE EQU H'0007' 893 894 895 896;----- ECCP1AS Bits ----------------------------------------------------- 897PSS1BD0 EQU H'0000' 898PSS1BD1 EQU H'0001' 899PSS1AC0 EQU H'0002' 900PSS1AC1 EQU H'0003' 901CCP1AS0 EQU H'0004' 902CCP1AS1 EQU H'0005' 903CCP1AS2 EQU H'0006' 904CCP1ASE EQU H'0007' 905 906 907 908;----- PSTR1CON Bits ----------------------------------------------------- 909STR1A EQU H'0000' 910STR1B EQU H'0001' 911STR1C EQU H'0002' 912STR1D EQU H'0003' 913STR1SYNC EQU H'0004' 914 915 916;----- IOCAP Bits ----------------------------------------------------- 917IOCAP0 EQU H'0000' 918IOCAP1 EQU H'0001' 919IOCAP2 EQU H'0002' 920IOCAP3 EQU H'0003' 921IOCAP4 EQU H'0004' 922IOCAP5 EQU H'0005' 923 924 925 926;----- IOCAN Bits ----------------------------------------------------- 927IOCAN0 EQU H'0000' 928IOCAN1 EQU H'0001' 929IOCAN2 EQU H'0002' 930IOCAN3 EQU H'0003' 931IOCAN4 EQU H'0004' 932IOCAN5 EQU H'0005' 933 934 935 936;----- IOCAF Bits ----------------------------------------------------- 937IOCAF0 EQU H'0000' 938IOCAF1 EQU H'0001' 939IOCAF2 EQU H'0002' 940IOCAF3 EQU H'0003' 941IOCAF4 EQU H'0004' 942IOCAF5 EQU H'0005' 943 944 945 946;----- CLKRCON Bits ----------------------------------------------------- 947CLKRDIV0 EQU H'0000' 948CLKRDIV1 EQU H'0001' 949CLKRDIV2 EQU H'0002' 950CLKRDC0 EQU H'0003' 951CLKRDC1 EQU H'0004' 952CLKRSLR EQU H'0005' 953CLKROE EQU H'0006' 954CLKREN EQU H'0007' 955 956 957 958;----- MDCON Bits ----------------------------------------------------- 959MDBIT EQU H'0000' 960MDOUT_MDCON EQU H'0003' 961MDOPOL EQU H'0004' 962MDSLR EQU H'0005' 963MDOE EQU H'0006' 964MDEN EQU H'0007' 965 966 967;----- MDSRC Bits ----------------------------------------------------- 968MDMS0 EQU H'0000' 969MDMS1 EQU H'0001' 970MDMS2 EQU H'0002' 971MDMS3 EQU H'0003' 972MDMSODIS EQU H'0007' 973 974 975 976;----- MDCARL Bits ----------------------------------------------------- 977MDCL0 EQU H'0000' 978MDCL1 EQU H'0001' 979MDCL2 EQU H'0002' 980MDCL3 EQU H'0003' 981MDCLSYNC EQU H'0005' 982MDCLPOL EQU H'0006' 983MDCLODIS EQU H'0007' 984 985 986 987;----- MDCARH Bits ----------------------------------------------------- 988MDCH0 EQU H'0000' 989MDCH1 EQU H'0001' 990MDCH2 EQU H'0002' 991MDCH3 EQU H'0003' 992MDCHSYNC EQU H'0005' 993MDCHPOL EQU H'0006' 994MDCHODIS EQU H'0007' 995 996 997 998;----- STATUS_SHAD Bits ----------------------------------------------------- 999C_SHAD EQU H'0000' 1000DC_SHAD EQU H'0001' 1001Z_SHAD EQU H'0002' 1002 1003 1004 1005;========================================================================== 1006; 1007; RAM Definitions 1008; 1009;========================================================================== 1010 __MAXRAM H'0FFF' 1011 __BADRAM H'000D' 1012 __BADRAM H'000F'-H'0010' 1013 __BADRAM H'0013'-H'0014' 1014 __BADRAM H'001D' 1015 __BADRAM H'008D' 1016 __BADRAM H'008F'-H'0090' 1017 __BADRAM H'0093'-H'0094' 1018 __BADRAM H'009F' 1019 __BADRAM H'00C0'-H'00EF' 1020 __BADRAM H'010D' 1021 __BADRAM H'010F'-H'0110' 1022 __BADRAM H'011C' 1023 __BADRAM H'011E'-H'011F' 1024 __BADRAM H'0120'-H'016F' 1025 __BADRAM H'018D' 1026 __BADRAM H'018F'-H'0190' 1027 __BADRAM H'0197'-H'0198' 1028 __BADRAM H'01A0'-H'01EF' 1029 __BADRAM H'020D' 1030 __BADRAM H'020F'-H'0210' 1031 __BADRAM H'0218'-H'021F' 1032 __BADRAM H'0220'-H'026F' 1033 __BADRAM H'028C'-H'0290' 1034 __BADRAM H'0297'-H'029F' 1035 __BADRAM H'02A0'-H'02EF' 1036 __BADRAM H'030C'-H'031F' 1037 __BADRAM H'0320'-H'036F' 1038 __BADRAM H'038C'-H'0390' 1039 __BADRAM H'0394'-H'0399' 1040 __BADRAM H'039B' 1041 __BADRAM H'03A0'-H'03EF' 1042 __BADRAM H'040C'-H'041F' 1043 __BADRAM H'0420'-H'046F' 1044 __BADRAM H'048C'-H'049F' 1045 __BADRAM H'04A0'-H'04EF' 1046 __BADRAM H'050C'-H'051F' 1047 __BADRAM H'0520'-H'056F' 1048 __BADRAM H'058C'-H'059F' 1049 __BADRAM H'05A0'-H'05EF' 1050 __BADRAM H'060C'-H'061F' 1051 __BADRAM H'0620'-H'066F' 1052 __BADRAM H'068C'-H'069F' 1053 __BADRAM H'06A0'-H'06EF' 1054 __BADRAM H'070C'-H'071F' 1055 __BADRAM H'0720'-H'076F' 1056 __BADRAM H'078C'-H'079F' 1057 __BADRAM H'07A0'-H'07EF' 1058 __BADRAM H'080C'-H'081F' 1059 __BADRAM H'0820'-H'086F' 1060 __BADRAM H'088C'-H'089F' 1061 __BADRAM H'08A0'-H'08EF' 1062 __BADRAM H'090C'-H'091F' 1063 __BADRAM H'0920'-H'096F' 1064 __BADRAM H'098C'-H'099F' 1065 __BADRAM H'09A0'-H'09EF' 1066 __BADRAM H'0A0C'-H'0A1F' 1067 __BADRAM H'0A20'-H'0A6F' 1068 __BADRAM H'0A8C'-H'0A9F' 1069 __BADRAM H'0AA0'-H'0AEF' 1070 __BADRAM H'0B0C'-H'0B1F' 1071 __BADRAM H'0B20'-H'0B6F' 1072 __BADRAM H'0B8C'-H'0B9F' 1073 __BADRAM H'0BA0'-H'0BEF' 1074 __BADRAM H'0C0C'-H'0C1F' 1075 __BADRAM H'0C20'-H'0C6F' 1076 __BADRAM H'0C8C'-H'0C9F' 1077 __BADRAM H'0CA0'-H'0CEF' 1078 __BADRAM H'0D0C'-H'0D1F' 1079 __BADRAM H'0D20'-H'0D6F' 1080 __BADRAM H'0D8C'-H'0D9F' 1081 __BADRAM H'0DA0'-H'0DEF' 1082 __BADRAM H'0E0C'-H'0E1F' 1083 __BADRAM H'0E20'-H'0E6F' 1084 __BADRAM H'0E8C'-H'0E9F' 1085 __BADRAM H'0EA0'-H'0EEF' 1086 __BADRAM H'0F0C'-H'0F1F' 1087 __BADRAM H'0F20'-H'0F6F' 1088 __BADRAM H'0F8C'-H'0FE3' 1089 __BADRAM H'0FEC' 1090 1091;========================================================================== 1092; 1093; Configuration Bits 1094; 1095; NAME Address 1096; CONFIG1 8007h 1097; CONFIG2 8008h 1098; 1099;========================================================================== 1100 1101; The following is an assignment of address values for all of the 1102; configuration registers for the purpose of table reads 1103_CONFIG1 EQU H'8007' 1104_CONFIG2 EQU H'8008' 1105 1106;----- CONFIG1 Options -------------------------------------------------- 1107_FOSC_LP EQU H'3FF8' ; LP Oscillator, Low-power crystal connected between OSC1 and OSC2 pins 1108_FOSC_XT EQU H'3FF9' ; XT Oscillator, Crystal/resonator connected between OSC1 and OSC2 pins 1109_FOSC_HS EQU H'3FFA' ; HS Oscillator, High-speed crystal/resonator connected between OSC1 and OSC2 pins 1110_FOSC_EXTRC EQU H'3FFB' ; EXTRC oscillator: External RC circuit connected to CLKIN pin 1111_FOSC_INTOSC EQU H'3FFC' ; INTOSC oscillator: I/O function on CLKIN pin 1112_FOSC_ECL EQU H'3FFD' ; ECL, External Clock, Low Power Mode (0-0.5 MHz): device clock supplied to CLKIN pin 1113_FOSC_ECM EQU H'3FFE' ; ECM, External Clock, Medium Power Mode (0.5-4 MHz): device clock supplied to CLKIN pin 1114_FOSC_ECH EQU H'3FFF' ; ECH, External Clock, High Power Mode (4-32 MHz): device clock supplied to CLKIN pin 1115 1116_WDTE_OFF EQU H'3FE7' ; WDT disabled 1117_WDTE_SWDTEN EQU H'3FEF' ; WDT controlled by the SWDTEN bit in the WDTCON register 1118_WDTE_NSLEEP EQU H'3FF7' ; WDT enabled while running and disabled in Sleep 1119_WDTE_ON EQU H'3FFF' ; WDT enabled 1120 1121_PWRTE_ON EQU H'3FDF' ; PWRT enabled 1122_PWRTE_OFF EQU H'3FFF' ; PWRT disabled 1123 1124_MCLRE_OFF EQU H'3FBF' ; MCLR/VPP pin function is digital input 1125_MCLRE_ON EQU H'3FFF' ; MCLR/VPP pin function is MCLR 1126 1127_CP_ON EQU H'3F7F' ; Program memory code protection is enabled 1128_CP_OFF EQU H'3FFF' ; Program memory code protection is disabled 1129 1130_CPD_ON EQU H'3EFF' ; Data memory code protection is enabled 1131_CPD_OFF EQU H'3FFF' ; Data memory code protection is disabled 1132 1133_BOREN_OFF EQU H'39FF' ; Brown-out Reset disabled 1134_BOREN_SBODEN EQU H'3BFF' ; Brown-out Reset controlled by the SBOREN bit in the BORCON register 1135_BOREN_NSLEEP EQU H'3DFF' ; Brown-out Reset enabled while running and disabled in Sleep 1136_BOREN_ON EQU H'3FFF' ; Brown-out Reset enabled 1137 1138_CLKOUTEN_ON EQU H'37FF' ; CLKOUT function is enabled on the CLKOUT pin 1139_CLKOUTEN_OFF EQU H'3FFF' ; CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin 1140 1141_IESO_OFF EQU H'2FFF' ; Internal/External Switchover mode is disabled 1142_IESO_ON EQU H'3FFF' ; Internal/External Switchover mode is enabled 1143 1144_FCMEN_OFF EQU H'1FFF' ; Fail-Safe Clock Monitor is disabled 1145_FCMEN_ON EQU H'3FFF' ; Fail-Safe Clock Monitor is enabled 1146 1147;----- CONFIG2 Options -------------------------------------------------- 1148_WRT_ALL EQU H'3FFC' ; 000h to 7FFh write protected, no addresses may be modified by EECON control 1149_WRT_HALF EQU H'3FFD' ; 000h to 3FFh write protected, 400h to 7FFh may be modified by EECON control 1150_WRT_BOOT EQU H'3FFE' ; 000h to 1FFh write protected, 200h to 7FFh may be modified by EECON control 1151_WRT_OFF EQU H'3FFF' ; Write protection off 1152 1153_PLLEN_OFF EQU H'3EFF' ; 4x PLL disabled 1154_PLLEN_ON EQU H'3FFF' ; 4x PLL enabled 1155 1156_STVREN_OFF EQU H'3DFF' ; Stack Overflow or Underflow will not cause a Reset 1157_STVREN_ON EQU H'3FFF' ; Stack Overflow or Underflow will cause a Reset 1158 1159_BORV_HI EQU H'3BFF' ; Brown-out Reset Voltage (Vbor), high trip point selected. 1160_BORV_LO EQU H'3FFF' ; Brown-out Reset Voltage (Vbor), low trip point selected. 1161 1162;;;; Begin: Added in gputils 1163_DEBUG_ON EQU H'2FFF' ; In-Circuit Debugger enabled, ICSPCLK and ICSPDAT are dedicated to the debugger. 1164_DEBUG_OFF EQU H'3FFF' ; In-Circuit Debugger disabled, ICSPCLK and ICSPDAT are general purpose I/O pins. 1165 1166;;;; End: Added in gputils 1167_LVP_OFF EQU H'1FFF' ; High-voltage on MCLR/VPP must be used for programming 1168_LVP_ON EQU H'3FFF' ; Low-voltage programming enabled 1169 1170;----- DEVID Equates -------------------------------------------------- 1171_DEVID1 EQU H'8006' 1172 1173;----- IDLOC Equates -------------------------------------------------- 1174_IDLOC0 EQU H'8000' 1175_IDLOC1 EQU H'8001' 1176_IDLOC2 EQU H'8002' 1177_IDLOC3 EQU H'8003' 1178 1179 LIST 1180