LIST ;========================================================================== ; MPASM PIC16C642 processor include ; ; (c) Copyright 1999-2013 Microchip Technology, All rights reserved ;========================================================================== NOLIST ;========================================================================== ; This header file defines configurations, registers, and other useful ; bits of information for the PIC16C642 microcontroller. These names ; are taken to match the data sheets as closely as possible. ; ; Note that the processor must be selected before this file is included. ; The processor may be selected the following ways: ; ; 1. Command line switch: ; C:\MPASM MYFILE.ASM /PIC16C642 ; 2. LIST directive in the source file ; LIST P=PIC16C642 ; 3. Processor Type entry in the MPASM full-screen interface ; 4. Setting the processor in the MPLAB Project Dialog ;========================================================================== ;========================================================================== ; ; Verify Processor ; ;========================================================================== IFNDEF __16C642 MESSG "Processor-header file mismatch. Verify selected processor." ENDIF ;========================================================================== ; ; Register Definitions ; ;========================================================================== W EQU H'0000' F EQU H'0001' ;----- Register Files ----------------------------------------------------- ;-----Bank0------------------ INDF EQU H'0000' TMR0 EQU H'0001' PCL EQU H'0002' STATUS EQU H'0003' FSR EQU H'0004' PORTA EQU H'0005' PORTB EQU H'0006' PORTC EQU H'0007' PCLATH EQU H'000A' INTCON EQU H'000B' PIR1 EQU H'000C' CMCON EQU H'001F' ;-----Bank1------------------ OPTION_REG EQU H'0081' TRISA EQU H'0085' TRISB EQU H'0086' TRISC EQU H'0087' PIE1 EQU H'008C' PCON EQU H'008E' VRCON EQU H'009F' ;----- STATUS Bits ----------------------------------------------------- C EQU H'0000' DC EQU H'0001' Z EQU H'0002' NOT_PD EQU H'0003' NOT_TO EQU H'0004' IRP EQU H'0007' RP0 EQU H'0005' RP1 EQU H'0006' ;----- PORTA Bits ----------------------------------------------------- RA0 EQU H'0000' RA1 EQU H'0001' RA2 EQU H'0002' RA3 EQU H'0003' RA4 EQU H'0004' RA5 EQU H'0005' ;----- PORTB Bits ----------------------------------------------------- RB0 EQU H'0000' RB1 EQU H'0001' RB2 EQU H'0002' RB3 EQU H'0003' RB4 EQU H'0004' RB5 EQU H'0005' RB6 EQU H'0006' RB7 EQU H'0007' ;----- PORTC Bits ----------------------------------------------------- RC0 EQU H'0000' RC1 EQU H'0001' RC2 EQU H'0002' RC3 EQU H'0003' RC4 EQU H'0004' RC5 EQU H'0005' RC6 EQU H'0006' RC7 EQU H'0007' ;----- INTCON Bits ----------------------------------------------------- RBIF EQU H'0000' INTF EQU H'0001' T0IF EQU H'0002' RBIE EQU H'0003' INTE EQU H'0004' T0IE EQU H'0005' PEIE EQU H'0006' GIE EQU H'0007' ;----- PIR1 Bits ----------------------------------------------------- CMIF EQU H'0006' ;----- CMCON Bits ----------------------------------------------------- CIS EQU H'0003' C1OUT EQU H'0006' C2OUT EQU H'0007' CM0 EQU H'0000' CM1 EQU H'0001' CM2 EQU H'0002' ;----- OPTION_REG Bits ----------------------------------------------------- PSA EQU H'0003' T0SE EQU H'0004' T0CS EQU H'0005' INTEDG EQU H'0006' NOT_RBPU EQU H'0007' PS0 EQU H'0000' PS1 EQU H'0001' PS2 EQU H'0002' ;----- TRISA Bits ----------------------------------------------------- TRISA0 EQU H'0000' TRISA1 EQU H'0001' TRISA2 EQU H'0002' TRISA3 EQU H'0003' TRISA4 EQU H'0004' TRISA5 EQU H'0005' ;----- TRISB Bits ----------------------------------------------------- TRISB0 EQU H'0000' TRISB1 EQU H'0001' TRISB2 EQU H'0002' TRISB3 EQU H'0003' TRISB4 EQU H'0004' TRISB5 EQU H'0005' TRISB6 EQU H'0006' TRISB7 EQU H'0007' ;----- TRISC Bits ----------------------------------------------------- TRISC0 EQU H'0000' TRISC1 EQU H'0001' TRISC2 EQU H'0002' TRISC3 EQU H'0003' TRISC4 EQU H'0004' TRISC5 EQU H'0005' TRISC6 EQU H'0006' TRISC7 EQU H'0007' ;----- PIE1 Bits ----------------------------------------------------- CMIE EQU H'0006' ;----- PCON Bits ----------------------------------------------------- NOT_BOR EQU H'0000' NOT_POR EQU H'0001' NOT_PER EQU H'0002' MPEEN EQU H'0007' ;----- VRCON Bits ----------------------------------------------------- VRR EQU H'0005' VROE EQU H'0006' VREN EQU H'0007' VR0 EQU H'0000' VR1 EQU H'0001' VR2 EQU H'0002' VR3 EQU H'0003' ;========================================================================== ; ; RAM Definitions ; ;========================================================================== __MAXRAM H'00FF' __BADRAM H'0008'-H'0009' __BADRAM H'000D'-H'001E' __BADRAM H'0088'-H'0089' __BADRAM H'008D' __BADRAM H'008F'-H'009E' ;========================================================================== ; ; Configuration Bits ; ; NAME Address ; CONFIG 2007h ; ;========================================================================== ; The following is an assignment of address values for all of the ; configuration registers for the purpose of table reads _CONFIG EQU H'2007' ;----- CONFIG Options -------------------------------------------------- _FOSC_LP EQU H'3FFC' ; LP oscillator _LP_OSC EQU H'3FFC' ; LP oscillator _FOSC_XT EQU H'3FFD' ; XT oscillator _XT_OSC EQU H'3FFD' ; XT oscillator _FOSC_HS EQU H'3FFE' ; HS oscillator _HS_OSC EQU H'3FFE' ; HS oscillator _FOSC_RC EQU H'3FFF' ; RC oscillator _RC_OSC EQU H'3FFF' ; RC oscillator _WDTE_OFF EQU H'3FFB' ; WDT disabled _WDT_OFF EQU H'3FFB' ; WDT disabled _WDTE_ON EQU H'3FFF' ; WDT enabled _WDT_ON EQU H'3FFF' ; WDT enabled _PWRTE_ON EQU H'3FF7' ; PWRT enabled _PWRTE_OFF EQU H'3FFF' ; PWRT disabled _CP_ALL EQU H'00CF' ; All memory is code protected _CP_75 EQU H'15DF' ; 0400h-0FFFh code protected _CP_50 EQU H'2AEF' ; 0800h-0FFFh code protected _CP_OFF EQU H'3FFF' ; Code protection off _BOREN_OFF EQU H'3FBF' ; BOR disabled _BODEN_OFF EQU H'3FBF' ; BOR disabled _BOREN_ON EQU H'3FFF' ; BOR enabled _BODEN_ON EQU H'3FFF' ; BOR enabled _MPEEN_OFF EQU H'3F7F' ; Memory Parity Checking is disabled _MPEEN_ON EQU H'3FFF' ; Memory Parity Checking is enabled ;----- IDLOC Equates -------------------------------------------------- _IDLOC0 EQU H'2000' _IDLOC1 EQU H'2001' _IDLOC2 EQU H'2002' _IDLOC3 EQU H'2003' LIST