1 LIST 2 3;========================================================================== 4; Build date : Oct 21 2015 5; MPASM PIC16F88 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 PIC16F88 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 /PIC16F88 22; 2. LIST directive in the source file 23; LIST P=PIC16F88 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 __16F88 34 MESSG "Processor-header file mismatch. Verify selected processor." 35 ENDIF 36 37 38 39;========================================================================== 40; 41; Register Definitions 42; 43;========================================================================== 44 45W EQU H'0000' 46F EQU H'0001' 47 48;----- Register Files ----------------------------------------------------- 49 50;-----Bank0------------------ 51INDF EQU H'0000' 52TMR0 EQU H'0001' 53PCL EQU H'0002' 54STATUS EQU H'0003' 55FSR EQU H'0004' 56PORTA EQU H'0005' 57PORTB EQU H'0006' 58PCLATH EQU H'000A' 59INTCON EQU H'000B' 60PIR1 EQU H'000C' 61PIR2 EQU H'000D' 62TMR1 EQU H'000E' 63TMR1L EQU H'000E' 64TMR1H EQU H'000F' 65T1CON EQU H'0010' 66TMR2 EQU H'0011' 67T2CON EQU H'0012' 68SSPBUF EQU H'0013' 69SSPCON EQU H'0014' 70CCPR1 EQU H'0015' 71CCPR1L EQU H'0015' 72CCPR1H EQU H'0016' 73CCP1CON EQU H'0017' 74RCSTA EQU H'0018' 75TXREG EQU H'0019' 76RCREG EQU H'001A' 77ADRESH EQU H'001E' 78ADCON0 EQU H'001F' 79 80;-----Bank1------------------ 81OPTION_REG EQU H'0081' 82TRISA EQU H'0085' 83TRISB EQU H'0086' 84PIE1 EQU H'008C' 85PIE2 EQU H'008D' 86PCON EQU H'008E' 87OSCCON EQU H'008F' 88OSCTUNE EQU H'0090' 89PR2 EQU H'0092' 90SSPADD EQU H'0093' 91SSPSTAT EQU H'0094' 92TXSTA EQU H'0098' 93SPBRG EQU H'0099' 94ANSEL EQU H'009B' 95CMCON EQU H'009C' 96CVRCON EQU H'009D' 97ADRESL EQU H'009E' 98ADCON1 EQU H'009F' 99 100;-----Bank2------------------ 101WDTCON EQU H'0105' 102EEDATA EQU H'010C' 103EEADR EQU H'010D' 104EEDATH EQU H'010E' 105EEADRH EQU H'010F' 106 107;-----Bank3------------------ 108EECON1 EQU H'018C' 109EECON2 EQU H'018D' 110 111;----- STATUS Bits ----------------------------------------------------- 112C EQU H'0000' 113DC EQU H'0001' 114Z EQU H'0002' 115NOT_PD EQU H'0003' 116NOT_TO EQU H'0004' 117IRP EQU H'0007' 118 119RP0 EQU H'0005' 120RP1 EQU H'0006' 121 122 123;----- PORTA Bits ----------------------------------------------------- 124RA0 EQU H'0000' 125RA1 EQU H'0001' 126RA2 EQU H'0002' 127RA3 EQU H'0003' 128RA4 EQU H'0004' 129RA5 EQU H'0005' 130RA6 EQU H'0006' 131RA7 EQU H'0007' 132 133 134;----- PORTB Bits ----------------------------------------------------- 135RB0 EQU H'0000' 136RB1 EQU H'0001' 137RB2 EQU H'0002' 138RB3 EQU H'0003' 139RB4 EQU H'0004' 140RB5 EQU H'0005' 141RB6 EQU H'0006' 142RB7 EQU H'0007' 143 144 145;----- INTCON Bits ----------------------------------------------------- 146RBIF EQU H'0000' 147INT0IF EQU H'0001' 148TMR0IF EQU H'0002' 149RBIE EQU H'0003' 150INT0IE EQU H'0004' 151TMR0IE EQU H'0005' 152PEIE EQU H'0006' 153GIE EQU H'0007' 154 155INTF EQU H'0001' 156INTE EQU H'0004' 157 158 159;----- PIR1 Bits ----------------------------------------------------- 160TMR1IF EQU H'0000' 161TMR2IF EQU H'0001' 162CCP1IF EQU H'0002' 163SSPIF EQU H'0003' 164TXIF EQU H'0004' 165RCIF EQU H'0005' 166ADIF EQU H'0006' 167 168 169;----- PIR2 Bits ----------------------------------------------------- 170EEIF EQU H'0004' 171CMIF EQU H'0006' 172OSFIF EQU H'0007' 173 174 175;----- T1CON Bits ----------------------------------------------------- 176TMR1ON EQU H'0000' 177TMR1CS EQU H'0001' 178NOT_T1SYNC EQU H'0002' 179T1OSCEN EQU H'0003' 180T1RUN EQU H'0006' 181 182T1INSYNC EQU H'0002' 183T1CKPS0 EQU H'0004' 184T1CKPS1 EQU H'0005' 185 186 187;----- T2CON Bits ----------------------------------------------------- 188TMR2ON EQU H'0002' 189 190T2CKPS0 EQU H'0000' 191T2CKPS1 EQU H'0001' 192TOUTPS0 EQU H'0003' 193TOUTPS1 EQU H'0004' 194TOUTPS2 EQU H'0005' 195TOUTPS3 EQU H'0006' 196 197 198;----- SSPCON Bits ----------------------------------------------------- 199CKP EQU H'0004' 200SSPEN EQU H'0005' 201SSPOV EQU H'0006' 202WCOL EQU H'0007' 203 204SSPM0 EQU H'0000' 205SSPM1 EQU H'0001' 206SSPM2 EQU H'0002' 207SSPM3 EQU H'0003' 208 209 210;----- CCP1CON Bits ----------------------------------------------------- 211CCP1Y EQU H'0004' 212CCP1X EQU H'0005' 213 214CCP1M0 EQU H'0000' 215CCP1M1 EQU H'0001' 216CCP1M2 EQU H'0002' 217CCP1M3 EQU H'0003' 218 219 220;----- RCSTA Bits ----------------------------------------------------- 221RX9D EQU H'0000' 222OERR EQU H'0001' 223FERR EQU H'0002' 224ADDEN EQU H'0003' 225CREN EQU H'0004' 226SREN EQU H'0005' 227RX9 EQU H'0006' 228SPEN EQU H'0007' 229 230RCD8 EQU H'0000' 231RC9 EQU H'0006' 232 233NOT_RC8 EQU H'0006' 234 235RC8_9 EQU H'0006' 236 237 238;----- ADCON0 Bits ----------------------------------------------------- 239ADON EQU H'0000' 240GO_NOT_DONE EQU H'0002' 241 242GO EQU H'0002' 243CHS0 EQU H'0003' 244CHS1 EQU H'0004' 245CHS2 EQU H'0005' 246ADCS0 EQU H'0006' 247ADCS1 EQU H'0007' 248 249NOT_DONE EQU H'0002' 250 251GO_DONE EQU H'0002' 252 253 254;----- OPTION_REG Bits ----------------------------------------------------- 255PSA EQU H'0003' 256T0SE EQU H'0004' 257T0CS EQU H'0005' 258INTEDG EQU H'0006' 259NOT_RBPU EQU H'0007' 260 261PS0 EQU H'0000' 262PS1 EQU H'0001' 263PS2 EQU H'0002' 264 265 266;----- TRISA Bits ----------------------------------------------------- 267TRISA0 EQU H'0000' 268TRISA1 EQU H'0001' 269TRISA2 EQU H'0002' 270TRISA3 EQU H'0003' 271TRISA4 EQU H'0004' 272TRISA5 EQU H'0005' 273TRISA6 EQU H'0006' 274TRISA7 EQU H'0007' 275 276 277;----- TRISB Bits ----------------------------------------------------- 278TRISB0 EQU H'0000' 279TRISB1 EQU H'0001' 280TRISB2 EQU H'0002' 281TRISB3 EQU H'0003' 282TRISB4 EQU H'0004' 283TRISB5 EQU H'0005' 284TRISB6 EQU H'0006' 285TRISB7 EQU H'0007' 286 287 288;----- PIE1 Bits ----------------------------------------------------- 289TMR1IE EQU H'0000' 290TMR2IE EQU H'0001' 291CCP1IE EQU H'0002' 292SSPIE EQU H'0003' 293TXIE EQU H'0004' 294RCIE EQU H'0005' 295ADIE EQU H'0006' 296 297 298;----- PIE2 Bits ----------------------------------------------------- 299EEIE EQU H'0004' 300CMIE EQU H'0006' 301OSFIE EQU H'0007' 302 303 304;----- PCON Bits ----------------------------------------------------- 305NOT_BOR EQU H'0000' 306NOT_POR EQU H'0001' 307 308NOT_BO EQU H'0000' 309 310 311;----- OSCCON Bits ----------------------------------------------------- 312IOFS EQU H'0002' 313OSTS EQU H'0003' 314 315SCS0 EQU H'0000' 316SCS1 EQU H'0001' 317IRCF0 EQU H'0004' 318IRCF1 EQU H'0005' 319IRCF2 EQU H'0006' 320 321 322;----- OSCTUNE Bits ----------------------------------------------------- 323TUN0 EQU H'0000' 324TUN1 EQU H'0001' 325TUN2 EQU H'0002' 326TUN3 EQU H'0003' 327TUN4 EQU H'0004' 328TUN5 EQU H'0005' 329 330 331;----- SSPSTAT Bits ----------------------------------------------------- 332BF EQU H'0000' 333UA EQU H'0001' 334R_NOT_W EQU H'0002' 335S EQU H'0003' 336P EQU H'0004' 337D_NOT_A EQU H'0005' 338CKE EQU H'0006' 339SMP EQU H'0007' 340 341R EQU H'0002' 342D EQU H'0005' 343 344I2C_READ EQU H'0002' 345I2C_START EQU H'0003' 346I2C_STOP EQU H'0004' 347I2C_DATA EQU H'0005' 348 349NOT_W EQU H'0002' 350NOT_A EQU H'0005' 351 352NOT_WRITE EQU H'0002' 353NOT_ADDRESS EQU H'0005' 354 355R_W EQU H'0002' 356D_A EQU H'0005' 357 358READ_WRITE EQU H'0002' 359DATA_ADDRESS EQU H'0005' 360 361 362;----- TXSTA Bits ----------------------------------------------------- 363TX9D EQU H'0000' 364TRMT EQU H'0001' 365BRGH EQU H'0002' 366SYNC EQU H'0004' 367TXEN EQU H'0005' 368TX9 EQU H'0006' 369CSRC EQU H'0007' 370 371TXD8 EQU H'0000' 372NOT_TX8 EQU H'0006' 373 374TX8_9 EQU H'0006' 375 376 377;----- ANSEL Bits ----------------------------------------------------- 378ANS0 EQU H'0000' 379ANS1 EQU H'0001' 380ANS2 EQU H'0002' 381ANS3 EQU H'0003' 382ANS4 EQU H'0004' 383ANS5 EQU H'0005' 384ANS6 EQU H'0006' 385 386 387;----- CMCON Bits ----------------------------------------------------- 388CIS EQU H'0003' 389C1INV EQU H'0004' 390C2INV EQU H'0005' 391C1OUT EQU H'0006' 392C2OUT EQU H'0007' 393 394CM0 EQU H'0000' 395CM1 EQU H'0001' 396CM2 EQU H'0002' 397 398 399;----- CVRCON Bits ----------------------------------------------------- 400CVRR EQU H'0005' 401CVROE EQU H'0006' 402CVREN EQU H'0007' 403 404CVR0 EQU H'0000' 405CVR1 EQU H'0001' 406CVR2 EQU H'0002' 407CVR3 EQU H'0003' 408 409 410;----- ADCON1 Bits ----------------------------------------------------- 411ADCS2 EQU H'0006' 412ADFM EQU H'0007' 413 414VCFG0 EQU H'0004' 415VCFG1 EQU H'0005' 416 417 418;----- WDTCON Bits ----------------------------------------------------- 419SWDTEN EQU H'0000' 420 421SWDTE EQU H'0000' 422WDTPS0 EQU H'0001' 423WDTPS1 EQU H'0002' 424WDTPS2 EQU H'0003' 425WDTPS3 EQU H'0004' 426 427 428;----- EECON1 Bits ----------------------------------------------------- 429RD EQU H'0000' 430WR EQU H'0001' 431WREN EQU H'0002' 432WRERR EQU H'0003' 433FREE EQU H'0004' 434EEPGD EQU H'0007' 435 436 437 438 439;========================================================================== 440; 441; RAM Definitions 442; 443;========================================================================== 444 __MAXRAM H'01FF' 445 __BADRAM H'0007'-H'0009' 446 __BADRAM H'001B'-H'001D' 447 __BADRAM H'0087'-H'0089' 448 __BADRAM H'0091' 449 __BADRAM H'0095'-H'0097' 450 __BADRAM H'009A' 451 __BADRAM H'0107'-H'0109' 452 __BADRAM H'0185' 453 __BADRAM H'0187'-H'0189' 454 __BADRAM H'018E'-H'018F' 455 456;========================================================================== 457; 458; Configuration Bits 459; 460; NAME Address 461; CONFIG1 2007h 462; CONFIG2 2008h 463; 464;========================================================================== 465 466; The following is an assignment of address values for all of the 467; configuration registers for the purpose of table reads 468_CONFIG1 EQU H'2007' 469_CONFIG2 EQU H'2008' 470 471;----- CONFIG1 Options -------------------------------------------------- 472_FOSC_LP EQU H'3FEC' ; LP oscillator 473_LP_OSC EQU H'3FEC' ; LP oscillator 474_FOSC_XT EQU H'3FED' ; XT oscillator 475_XT_OSC EQU H'3FED' ; XT oscillator 476_FOSC_HS EQU H'3FEE' ; HS oscillator 477_HS_OSC EQU H'3FEE' ; HS oscillator 478_FOSC_EC EQU H'3FEF' ; ECIO; port I/O function on RA6/OSC2/CLKO 479_EXTCLK EQU H'3FEF' ; ECIO; port I/O function on RA6/OSC2/CLKO 480_FOSC_INTOSCIO EQU H'3FFC' ; INTRC oscillator; port I/O function on both RA6/OSC2/CLKO pin and RA7/OSC1/CLKI pin 481_INTRC_IO EQU H'3FFC' ; INTRC oscillator; port I/O function on both RA6/OSC2/CLKO pin and RA7/OSC1/CLKI pin 482_FOSC_INTOSCCLK EQU H'3FFD' ; INTRC oscillator; CLKO function on RA6/OSC2/CLKO pin and port I/O function on RA7/OSC1/CLKI pin 483_INTRC_CLKOUT EQU H'3FFD' ; INTRC oscillator; CLKO function on RA6/OSC2/CLKO pin and port I/O function on RA7/OSC1/CLKI pin 484_FOSC_EXTRCIO EQU H'3FFE' ; EXTRC oscillator; port I/O function on RA6/OSC2/CLKO 485_EXTRC_IO EQU H'3FFE' ; EXTRC oscillator; port I/O function on RA6/OSC2/CLKO 486_FOSC_EXTRCCLK EQU H'3FFF' ; EXTRC oscillator; CLKO function on RA6/OSC2/CLKO 487_EXTRC_CLKOUT EQU H'3FFF' ; EXTRC oscillator; CLKO function on RA6/OSC2/CLKO 488 489_WDTE_OFF EQU H'3FFB' ; WDT disabled 490_WDT_OFF EQU H'3FFB' ; WDT disabled 491_WDTE_ON EQU H'3FFF' ; WDT enabled 492_WDT_ON EQU H'3FFF' ; WDT enabled 493 494_PWRTE_ON EQU H'3FF7' ; PWRT enabled 495_PWRTE_OFF EQU H'3FFF' ; PWRT disabled 496 497_MCLRE_OFF EQU H'3FDF' ; RA5/MCLR/VPP pin function is digital I/O, MCLR internally tied to VDD 498_MCLR_OFF EQU H'3FDF' ; RA5/MCLR/VPP pin function is digital I/O, MCLR internally tied to VDD 499_MCLRE_ON EQU H'3FFF' ; RA5/MCLR/VPP pin function is MCLR 500_MCLR_ON EQU H'3FFF' ; RA5/MCLR/VPP pin function is MCLR 501 502_BOREN_OFF EQU H'3FBF' ; BOR disabled 503_BODEN_OFF EQU H'3FBF' ; BOR disabled 504_BOREN_ON EQU H'3FFF' ; BOR enabled 505_BODEN_ON EQU H'3FFF' ; BOR enabled 506 507_LVP_OFF EQU H'3F7F' ; RB3 is digital I/O, HV on MCLR must be used for programming 508_LVP_ON EQU H'3FFF' ; RB3/PGM pin has PGM function, Low-Voltage Programming enabled 509 510_CPD_ON EQU H'3EFF' ; Data EE memory code-protected 511_CPD_OFF EQU H'3FFF' ; Code protection off 512 513_WRT_ALL EQU H'39FF' ; 0000h to 0FFFh write-protected 514_WRT_PROTECT_ALL EQU H'39FF' ; 0000h to 0FFFh write-protected 515_WRT_2048 EQU H'3BFF' ; 0000h to 07FFh write-protected, 0800h to 0FFFh may be modified by EECON control 516_WRT_PROTECT_2048 EQU H'3BFF' ; 0000h to 07FFh write-protected, 0800h to 0FFFh may be modified by EECON control 517_WRT_256 EQU H'3DFF' ; 0000h to 00FFh write-protected, 0100h to 0FFFh may be modified by EECON control 518_WRT_PROTECT_256 EQU H'3DFF' ; 0000h to 00FFh write-protected, 0100h to 0FFFh may be modified by EECON control 519_WRT_OFF EQU H'3FFF' ; Write protection off 520_WRT_PROTECT_OFF EQU H'3FFF' ; Write protection off 521 522_DEBUG_ON EQU H'37FF' ; In-Circuit Debugger enabled, RB6 and RB7 are dedicated to the debugger 523_DEBUG_OFF EQU H'3FFF' ; In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins 524 525_CCPMX_RB3 EQU H'2FFF' ; CCP1 function on RB3 526_CCP1_RB3 EQU H'2FFF' ; CCP1 function on RB3 527_CCPMX_RB0 EQU H'3FFF' ; CCP1 function on RB0 528_CCP1_RB0 EQU H'3FFF' ; CCP1 function on RB0 529 530_CP_ON EQU H'1FFF' ; 0000h to 0FFFh code-protected (all protected) 531_CP_ALL EQU H'1FFF' ; 0000h to 0FFFh code-protected (all protected) 532_CP_OFF EQU H'3FFF' ; Code protection off 533 534;----- CONFIG2 Options -------------------------------------------------- 535_FCMEN_OFF EQU H'3FFE' ; Fail-Safe Clock Monitor disabled 536_FCMEN_ON EQU H'3FFF' ; Fail-Safe Clock Monitor enabled 537 538_IESO_OFF EQU H'3FFD' ; Internal External Switchover mode disabled 539_IESO_ON EQU H'3FFF' ; Internal External Switchover mode enabled 540 541;----- DEVID Equates -------------------------------------------------- 542_DEVID1 EQU H'2006' 543 544;----- IDLOC Equates -------------------------------------------------- 545_IDLOC0 EQU H'2000' 546_IDLOC1 EQU H'2001' 547_IDLOC2 EQU H'2002' 548_IDLOC3 EQU H'2003' 549 550 LIST 551