MPASM 03.70.01 Released TENBIT.ASM 3-28-2006 22:41:23 PAGE 1 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00001 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 00002 ; 00003 ; Project: Interfacing PICs 00004 ; Source File Name: TENBIT.ASM 00005 ; Devised by: MPB 00006 ; Date: 27-6-05 00007 ; Status: Working 00008 ; 00009 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 00010 ; 00011 ; Demonstrates 10-bit voltage measurement 00012 ; using an external reference voltage of 4.096V, 00013 ; giving 4mV per bit, and an resolution of 0.1%. 00014 ; The result is converted to BCD for display 00015 ; as a voltage using the standard LCD routines. 00016 ; 00017 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 00018 00019 PROCESSOR 16F877 00020 ; Clock = XT 4MHz, standard fuse settings 2007 3731 00021 __CONFIG 0x3731 00022 00023 ; LABEL EQUATES ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 00024 00025 INCLUDE "P16F877A.INC" 00001 LIST 00002 ; P16F877A.INC Standard Header File, Version 1.00 Microchip Technology, Inc. Message[301]: MESSAGE: (Processor-header file mismatch. Verify selected processor.) 00398 LIST 00026 ; standard register labels 00027 00028 ;---------------------------------------------------------- 00029 ; User register labels 00030 ;---------------------------------------------------------- 00031 ; GPR 20 - 2F allocated to included LCD display routine 00032 00000030 00033 count EQU 30 ; Counter for ADC setup delay 00000031 00034 ADhi EQU 31 ; Binary input high byte 00000032 00035 ADlo EQU 32 ; Binary input low byte 00000033 00036 thos EQU 33 ; Thousands digit in decimal 00000034 00037 huns EQU 34 ; Hundreds digit in decimal value 00000035 00038 tens EQU 35 ; Tens digit in decimal value 00000036 00039 ones EQU 36 ; Ones digit in decimal value 00040 00041 ;---------------------------------------------------------- 00042 ; PROGRAM BEGINS 00043 ;---------------------------------------------------------- 00044 0000 00045 ORG 0 ; Default start address 0000 0000 00046 NOP ; required for ICD mode 00047 00048 ;---------------------------------------------------------- 00049 ; Port & display setup MPASM 03.70.01 Released TENBIT.ASM 3-28-2006 22:41:23 PAGE 2 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00050 0001 1683 1303 00051 BANKSEL TRISC ; Select bank 1 Message[302]: Register in operand not in bank 0. Ensure that bank bits are correct. 0003 0188 00052 CLRF TRISD ; Display port is output 0004 3083 00053 MOVLW B'10000011' ; Analogue input setup code Message[302]: Register in operand not in bank 0. Ensure that bank bits are correct. 0005 009F 00054 MOVWF ADCON1 ; Right justify result, 00055 ; Port A = analogue inputs 00056 ; with external reference 00057 0006 1283 1303 00058 BANKSEL PORTC ; Select bank 0 0008 0188 00059 CLRF PORTD ; Clear display outputs 0009 3041 00060 MOVLW B'01000001' ; Analogue input setup code 000A 009F 00061 MOVWF ADCON0 ; f/8, RA0, done, enable 00062 000B 209E 00063 CALL inid ; Initialise the display 00064 00065 ;---------------------------------------------------------- 00066 ; MAIN LOOP 00067 ;---------------------------------------------------------- 00068 000C 2010 00069 start CALL getADC ; read input 000D 2018 00070 CALL con4 ; convert to decimal 000E 205E 00071 CALL putLCD ; display input 000F 280C 00072 GOTO start ; jump to main loop 00073 00074 ;----------------------------------------------------------- 00075 ; SUBROUTINES 00076 ;----------------------------------------------------------- 00077 ; Read ADC input and store 00078 ;----------------------------------------------------------- 00079 0010 3007 00080 getADC MOVLW 007 ; load counter 0011 00B0 00081 MOVWF count Message[305]: Using default destination of 1 (file). 0012 0BB0 00082 down DECFSZ count ; and delay 20us 0013 2812 00083 GOTO down 00084 0014 151F 00085 BSF ADCON0,GO ; start ADC.. 0015 191F 00086 wait BTFSC ADCON0,GO ; ..and wait for finish 0016 2815 00087 GOTO wait 0017 0008 00088 RETURN 00089 00090 ;----------------------------------------------------------- 00091 ; Convert 10-bit input to decimal 00092 ;----------------------------------------------------------- 00093 0018 081E 00094 con4 MOVF ADRESH,W ; get ADC result 0019 00B1 00095 MOVWF ADhi ; high bits 001A 1683 1303 00096 BANKSEL ADRESL ; in bank 1 Message[302]: Register in operand not in bank 0. Ensure that bank bits are correct. 001C 081E 00097 MOVF ADRESL,W ; get ADC result 001D 1283 1303 00098 BANKSEL ADRESH ; default bank 0 MPASM 03.70.01 Released TENBIT.ASM 3-28-2006 22:41:23 PAGE 3 LOC OBJECT CODE LINE SOURCE TEXT VALUE 001F 00B2 00099 MOVWF ADlo ; low byte 00100 00101 ; Multiply by 4 for result 0 - 4096 by shifting left......... 00102 0020 1003 00103 BCF STATUS,C ; rotate 0 into LSB and Message[305]: Using default destination of 1 (file). 0021 0DB2 00104 RLF ADlo ; shift low byte left 0022 1C03 00105 BTFSS STATUS,C ; carry out? 0023 2825 00106 GOTO rot1 ; no, leave carry clear 0024 1403 00107 BSF STATUS,C ; rotate 1 into LSB and Message[305]: Using default destination of 1 (file). 0025 0DB1 00108 rot1 RLF ADhi ; shift high byte left 00109 0026 1003 00110 BCF STATUS,C ; rotate 0 into LSB Message[305]: Using default destination of 1 (file). 0027 0DB2 00111 RLF ADlo ; rotate low byte left again 0028 1C03 00112 BTFSS STATUS,C ; carry out? 0029 282B 00113 GOTO rot2 ; no, leave carry clear 002A 1403 00114 BSF STATUS,C ; rotate 1 into LSB and Message[305]: Using default destination of 1 (file). 002B 0DB1 00115 rot2 RLF ADhi ; shift high byte left 00116 00117 00118 ; Clear BCD registers........................................ 00119 002C 01B3 00120 clrbcd CLRF thos ; zero thousands digit 002D 01B4 00121 CLRF huns ; zero hundreds digit 002E 01B5 00122 CLRF tens ; zero tens digit 002F 01B6 00123 CLRF ones ; zero ones digit 00124 00125 00126 ; Calclulate thousands low byte ............................. 00127 0030 08B1 00128 tholo MOVF ADhi,F ; check high byte 0031 1903 00129 BTFSC STATUS,Z ; high byte zero? 0032 2847 00130 GOTO hunlo ; yes, next digit 00131 0033 1403 00132 BSF STATUS,C ; set carry for subtract 0034 30E8 00133 MOVLW 0E8 ; load low byte of 1000 Message[305]: Using default destination of 1 (file). 0035 02B2 00134 SUBWF ADlo ; and subtract low byte 0036 1803 00135 BTFSC STATUS,C ; borrow from high bits? 0037 2839 00136 GOTO thohi ; no, do high byte Message[305]: Using default destination of 1 (file). 0038 03B1 00137 DECF ADhi ; yes, subtract borrow 00138 00139 ; Calculate thousands high byte.............................. 00140 0039 1403 00141 thohi BSF STATUS,C ; set carry for subtract 003A 3003 00142 MOVLW 003 ; load high byte of 1000 Message[305]: Using default destination of 1 (file). 003B 02B1 00143 SUBWF ADhi ; subtract from high byte 003C 1803 00144 BTFSC STATUS,C ; result negative? MPASM 03.70.01 Released TENBIT.ASM 3-28-2006 22:41:23 PAGE 4 LOC OBJECT CODE LINE SOURCE TEXT VALUE 003D 2845 00145 GOTO incth ; no, inc digit and repeat Message[305]: Using default destination of 1 (file). 003E 07B1 00146 ADDWF ADhi ; yes, restore high byte 00147 00148 ; Restore remainder when done ............................... 00149 003F 1003 00150 BCF STATUS,C ; clear carry for add 0040 30E8 00151 MOVLW 0E8 ; load low byte of 1000 Message[305]: Using default destination of 1 (file). 0041 07B2 00152 ADDWF ADlo ; add to low byte 0042 1803 00153 BTFSC STATUS,C ; carry out? Message[305]: Using default destination of 1 (file). 0043 0AB1 00154 INCF ADhi ; yes, inc high byte 0044 2847 00155 GOTO hunlo ; and do next digit 00156 00157 ; Increment thousands digit and repeat....................... 00158 Message[305]: Using default destination of 1 (file). 0045 0AB3 00159 incth INCF thos ; inc digit 0046 2830 00160 GOTO tholo ; and repeat 00161 00162 ; Calclulate hundreds ....................................... 00163 0047 3064 00164 hunlo MOVLW 064 ; load 100 0048 1403 00165 BSF STATUS,C ; set carry for subtract Message[305]: Using default destination of 1 (file). 0049 02B2 00166 SUBWF ADlo ; and subtract low byte 004A 1803 00167 BTFSC STATUS,C ; result negative? 004B 2850 00168 GOTO inch ; no, inc hundreds & repeat 00169 004C 08B1 00170 MOVF ADhi,F ; yes, test high byte 004D 1903 00171 BTFSC STATUS,Z ; zero? 004E 2852 00172 GOTO remh ; yes, done Message[305]: Using default destination of 1 (file). 004F 03B1 00173 DECF ADhi ; no, subtract borrow Message[305]: Using default destination of 1 (file). 0050 0AB4 00174 inch INCF huns ; inc hundreds digit 0051 2847 00175 GOTO hunlo ; and repeat 00176 Message[305]: Using default destination of 1 (file). 0052 07B2 00177 remh ADDWF ADlo ; restore onto low byte 00178 00179 00180 ; Calculate tens digit...................................... 00181 0053 300A 00182 subt MOVLW D'10' ; load 10 0054 1403 00183 BSF STATUS,C ; set carry for subtract Message[305]: Using default destination of 1 (file). 0055 02B2 00184 SUBWF ADlo ; and subtract from result 0056 1C03 00185 BTFSS STATUS,C ; and check if done 0057 285A 00186 GOTO remt ; yes, restore remainder Message[305]: Using default destination of 1 (file). 0058 0AB5 00187 INCF tens ; no, count number of loops MPASM 03.70.01 Released TENBIT.ASM 3-28-2006 22:41:23 PAGE 5 LOC OBJECT CODE LINE SOURCE TEXT VALUE 0059 2853 00188 GOTO subt ; and repeat 00189 00190 00191 ; Restore remainder......................................... 00192 Message[305]: Using default destination of 1 (file). 005A 07B2 00193 remt ADDWF ADlo ; yes, add 10 back on 005B 0832 00194 MOVF ADlo,W ; load remainder 005C 00B6 00195 MOVWF ones ; and store as ones digit 00196 005D 0008 00197 RETURN ; done 00198 00199 00200 ;----------------------------------------------------------- 00201 ; Output to display 00202 ;----------------------------------------------------------- 00203 005E 10F4 00204 putLCD BCF Select,RS ; set display command mode 005F 3080 00205 MOVLW 080 ; code to home cursor 0060 208E 00206 CALL send ; output it to display 0061 14F4 00207 BSF Select,RS ; and restore data mode 00208 00209 ; Convert digits to ASCII and display....................... 00210 0062 3030 00211 MOVLW 030 ; load ASCII offset Message[305]: Using default destination of 1 (file). 0063 07B3 00212 ADDWF thos ; convert thousands to ASCII Message[305]: Using default destination of 1 (file). 0064 07B4 00213 ADDWF huns ; convert hundreds to ASCII Message[305]: Using default destination of 1 (file). 0065 07B5 00214 ADDWF tens ; convert tens to ASCII Message[305]: Using default destination of 1 (file). 0066 07B6 00215 ADDWF ones ; convert ones to ASCII 00216 0067 0833 00217 MOVF thos,W ; load thousands code 0068 208E 00218 CALL send ; and send to display 0069 302E 00219 MOVLW '.' ; load point code 006A 208E 00220 CALL send ; and output 006B 0834 00221 MOVF huns,W ; load hundreds code 006C 208E 00222 CALL send ; and send to display 006D 0835 00223 MOVF tens,W ; load tens code 006E 208E 00224 CALL send ; and output 006F 0836 00225 MOVF ones,W ; load ones code 0070 208E 00226 CALL send ; and output 0071 3020 00227 MOVLW ' ' ; load space code 0072 208E 00228 CALL send ; and output 0073 3056 00229 MOVLW 'V' ; load volts code 0074 208E 00230 CALL send ; and output 0075 306F 00231 MOVLW 'o' ; load volts code 0076 208E 00232 CALL send ; and output 0077 306C 00233 MOVLW 'l' ; load volts code 0078 208E 00234 CALL send ; and output 0079 3074 00235 MOVLW 't' ; load volts code MPASM 03.70.01 Released TENBIT.ASM 3-28-2006 22:41:23 PAGE 6 LOC OBJECT CODE LINE SOURCE TEXT VALUE 007A 208E 00236 CALL send ; and output 007B 3073 00237 MOVLW 's' ; load volts code 007C 208E 00238 CALL send ; and output 00239 007D 0008 00240 RETURN ; done 00241 00242 ;---------------------------------------------------------- 00243 ; INCLUDED ROUTINES 00244 ;---------------------------------------------------------- 00245 ; Include LCD driver routine 00246 ; 00247 INCLUDE "LCDIS.INC" 00001 ; LCDIS.INC MPB 19-12-05 00002 ; 00003 ; Include file to operate 16x2 LCD display 00004 ; Uses GPR 70 - 75 00005 ; 00006 ; Final version 00007 ;------------------------------------------------------------------------------------------- 00008 00000070 00009 Timer1 EQU 70 ; 1ms count register 00000071 00010 TimerX EQU 71 ; Xms count register 00000072 00011 Var EQU 72 ; Output variable 00000073 00012 Point EQU 73 ; Program table pointer 00000074 00013 Select EQU 74 ; Used to set or clear RS bit 00000075 00014 OutCod EQU 75 ; Temp store for output code 00015 00000001 00016 RS EQU 1 ; Register select output bit 00000002 00017 E EQU 2 ; Enable output clocks display input 00018 00019 00020 ;-------------------------------------------------------------------------------------------- 00021 ; 1ms delay with 1us cycle time (1000 cycles) 00022 ;-------------------------------------------------------------------------------------------- 007E 30F9 00023 onems MOVLW D'249' ; Count for 1ms delay 007F 00F0 00024 MOVWF Timer1 ; Load count 0080 0000 00025 loop1 NOP ; Pad for 4 cycle loop Message[305]: Using default destination of 1 (file). 0081 0BF0 00026 DECFSZ Timer1 ; Count 0082 2880 00027 GOTO loop1 ; until Z 0083 0008 00028 RETURN ; and finish 00029 00030 ;--------------------------------------------------------------------------------------------- 00031 ; Delay Xms 00032 ; Receives count in W, uses Onems 00033 ;--------------------------------------------------------------------------------------------- 0084 00F1 00034 xms MOVWF TimerX ; Count for X ms 0085 207E 00035 loopX CALL onems ; Delay 1ms Message[305]: Using default destination of 1 (file). 0086 0BF1 00036 DECFSZ TimerX ; Repeat X times 0087 2885 00037 GOTO loopX ; until Z 0088 0008 00038 RETURN ; and finish 00039 MPASM 03.70.01 Released TENBIT.ASM 3-28-2006 22:41:23 PAGE 7 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00040 ;--------------------------------------------------------------------------------------------- 00041 ; Generate data/command clock siganl E 00042 ;--------------------------------------------------------------------------------------------- 0089 1508 00043 pulseE BSF PORTD,E ; Set E high 008A 207E 00044 CALL onems ; Delay 1ms 008B 1108 00045 BCF PORTD,E ; Reset E low 008C 207E 00046 CALL onems ; Delay 1ms 008D 0008 00047 RETURN ; done 00048 00049 ;--------------------------------------------------------------------------------------------- 00050 ; Send a command byte in two nibbles from RB4 - RB7 00051 ; Receives command in W, uses PulseE and Onems 00052 ;--------------------------------------------------------------------------------------------- 008E 00F5 00053 send MOVWF OutCod ; Store output code 008F 39F0 00054 ANDLW 0F0 ; Clear low nybble 0090 0088 00055 MOVWF PORTD ; Output high nybble 0091 18F4 00056 BTFSC Select,RS ; Test RS bit 0092 1488 00057 BSF PORTD,RS ; and set for data 0093 2089 00058 CALL pulseE ; and clock display register 0094 207E 00059 CALL onems ; wait 1ms for display to complete 00060 Message[305]: Using default destination of 1 (file). 0095 0EF5 00061 SWAPF OutCod ; Swap low and high nybbles 0096 0875 00062 MOVF OutCod,W ; Retrieve output code 0097 39F0 00063 ANDLW 0F0 ; Clear low nybble 0098 0088 00064 MOVWF PORTD ; Output low nybble 0099 18F4 00065 BTFSC Select,RS ; Test RS bit 009A 1488 00066 BSF PORTD,RS ; and set for data 009B 2089 00067 CALL pulseE ; and clock display register 009C 207E 00068 CALL onems ; wait 1ms for display to complete 009D 0008 00069 RETURN ; done 00070 00071 ;--------------------------------------------------------------------------------------------- 00072 ; Initialise the display 00073 ; Uses Send 00074 ;--------------------------------------------------------------------------------------------- 009E 3064 00075 inid MOVLW D'100' ; Load count for 100ms delay 009F 2084 00076 CALL xms ; and wait for display start 00A0 30F0 00077 MOVLW 0F0 ; Mask for select code 00A1 00F4 00078 MOVWF Select ; High nybble not masked 00079 00A2 3030 00080 MOVLW 0x30 ; Load initial nibble 00A3 0088 00081 MOVWF PORTD ; and output it to display 00A4 2089 00082 CALL pulseE ; Latch initial code 00A5 3005 00083 MOVLW D'5' ; Set delay 5ms 00A6 2084 00084 CALL xms ; and wait 00A7 2089 00085 CALL pulseE ; Latch initial code again 00A8 207E 00086 CALL onems ; Wait 1ms 00A9 2089 00087 CALL pulseE ; Latch initial code again 00AA 1208 00088 BCF PORTD,4 ; Set 4-bit mode 00AB 2089 00089 CALL pulseE ; Latch it 00090 00AC 3028 00091 MOVLW 0x28 ; Set 4-bit mode, 2 lines MPASM 03.70.01 Released TENBIT.ASM 3-28-2006 22:41:23 PAGE 8 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00AD 208E 00092 CALL send ; and send code 00AE 3008 00093 MOVLW 0x08 ; Switch off display 00AF 208E 00094 CALL send ; and send code 00B0 3001 00095 MOVLW 0x01 ; Code to clear display 00B1 208E 00096 CALL send ; and send code 00B2 3006 00097 MOVLW 0x06 ; Enable cursor auto inc 00B3 208E 00098 CALL send ; and send code 00B4 3080 00099 MOVLW 0x80 ; Zero display address 00B5 208E 00100 CALL send ; and send code 00B6 300C 00101 MOVLW 0x0C ; Turn on display 00B7 208E 00102 CALL send ; and send code 00103 00B8 0008 00104 RETURN ; Done 00105 00248 ; 00249 ; Contains routines: 00250 ; init: Initialises display 00251 ; onems: 1 ms delay 00252 ; xms: X ms delay 00253 ; Receives X in W 00254 ; send: sends a character to display 00255 ; Receives: Control code in W (Select,RS=0) 00256 ; ASCII character code in W (RS=1) 00257 ; 00258 ;---------------------------------------------------------- 00259 END ; of source code MPASM 03.70.01 Released TENBIT.ASM 3-28-2006 22:41:23 PAGE 9 SYMBOL TABLE LABEL VALUE ACKDT 00000005 ACKEN 00000004 ACKSTAT 00000006 ADCON0 0000001F ADCON1 0000009F ADCS0 00000006 ADCS1 00000007 ADDEN 00000003 ADFM 00000007 ADIE 00000006 ADIF 00000006 ADON 00000000 ADRESH 0000001E ADRESL 0000009E ADhi 00000031 ADlo 00000032 BCLIE 00000003 BCLIF 00000003 BF 00000000 BRGH 00000002 C 00000000 C1INV 00000004 C1OUT 00000006 C2INV 00000005 C2OUT 00000007 CCP1CON 00000017 CCP1IE 00000002 CCP1IF 00000002 CCP1M0 00000000 CCP1M1 00000001 CCP1M2 00000002 CCP1M3 00000003 CCP1X 00000005 CCP1Y 00000004 CCP2CON 0000001D CCP2IE 00000000 CCP2IF 00000000 CCP2M0 00000000 CCP2M1 00000001 CCP2M2 00000002 CCP2M3 00000003 CCP2X 00000005 CCP2Y 00000004 CCPR1H 00000016 CCPR1L 00000015 CCPR2H 0000001C CCPR2L 0000001B CHS0 00000003 CHS1 00000004 CHS2 00000005 CIS 00000003 CKE 00000006 CKP 00000004 MPASM 03.70.01 Released TENBIT.ASM 3-28-2006 22:41:23 PAGE 10 SYMBOL TABLE LABEL VALUE CM0 00000000 CM1 00000001 CM2 00000002 CMCON 0000009C CMIE 00000006 CMIF 00000006 CREN 00000004 CSRC 00000007 CVR0 00000000 CVR1 00000001 CVR2 00000002 CVR3 00000003 CVRCON 0000009D CVREN 00000007 CVROE 00000006 CVRR 00000005 D 00000005 DATA_ADDRESS 00000005 DC 00000001 D_A 00000005 E 00000002 EEADR 0000010D EEADRH 0000010F EECON1 0000018C EECON2 0000018D EEDATA 0000010C EEDATH 0000010E EEIE 00000004 EEIF 00000004 EEPGD 00000007 F 00000001 FERR 00000002 FSR 00000004 GCEN 00000007 GIE 00000007 GO 00000002 GO_DONE 00000002 I2C_DATA 00000005 I2C_READ 00000002 I2C_START 00000003 I2C_STOP 00000004 IBF 00000007 IBOV 00000005 INDF 00000000 INTCON 0000000B INTE 00000004 INTEDG 00000006 INTF 00000001 IRP 00000007 NOT_A 00000005 NOT_ADDRESS 00000005 NOT_BO 00000000 NOT_BOR 00000000 MPASM 03.70.01 Released TENBIT.ASM 3-28-2006 22:41:23 PAGE 11 SYMBOL TABLE LABEL VALUE NOT_DONE 00000002 NOT_PD 00000003 NOT_POR 00000001 NOT_RBPU 00000007 NOT_RC8 00000006 NOT_T1SYNC 00000002 NOT_TO 00000004 NOT_TX8 00000006 NOT_W 00000002 NOT_WRITE 00000002 OBF 00000006 OERR 00000001 OPTION_REG 00000081 OutCod 00000075 P 00000004 PCFG0 00000000 PCFG1 00000001 PCFG2 00000002 PCFG3 00000003 PCL 00000002 PCLATH 0000000A PCON 0000008E PEIE 00000006 PEN 00000002 PIE1 0000008C PIE2 0000008D PIR1 0000000C PIR2 0000000D PORTA 00000005 PORTB 00000006 PORTC 00000007 PORTD 00000008 PORTE 00000009 PR2 00000092 PS0 00000000 PS1 00000001 PS2 00000002 PSA 00000003 PSPIE 00000007 PSPIF 00000007 PSPMODE 00000004 Point 00000073 R 00000002 RBIE 00000003 RBIF 00000000 RC8_9 00000006 RC9 00000006 RCD8 00000000 RCEN 00000003 RCIE 00000005 RCIF 00000005 RCREG 0000001A RCSTA 00000018 MPASM 03.70.01 Released TENBIT.ASM 3-28-2006 22:41:23 PAGE 12 SYMBOL TABLE LABEL VALUE RD 00000000 READ_WRITE 00000002 RP0 00000005 RP1 00000006 RS 00000001 RSEN 00000001 RX9 00000006 RX9D 00000000 R_W 00000002 S 00000003 SEN 00000000 SMP 00000007 SPBRG 00000099 SPEN 00000007 SREN 00000005 SSPADD 00000093 SSPBUF 00000013 SSPCON 00000014 SSPCON2 00000091 SSPEN 00000005 SSPIE 00000003 SSPIF 00000003 SSPM0 00000000 SSPM1 00000001 SSPM2 00000002 SSPM3 00000003 SSPOV 00000006 SSPSTAT 00000094 STATUS 00000003 SYNC 00000004 Select 00000074 T0CS 00000005 T0IE 00000005 T0IF 00000002 T0SE 00000004 T1CKPS0 00000004 T1CKPS1 00000005 T1CON 00000010 T1INSYNC 00000002 T1OSCEN 00000003 T1SYNC 00000002 T2CKPS0 00000000 T2CKPS1 00000001 T2CON 00000012 TMR0 00000001 TMR0IE 00000005 TMR0IF 00000002 TMR1CS 00000001 TMR1H 0000000F TMR1IE 00000000 TMR1IF 00000000 TMR1L 0000000E TMR1ON 00000000 MPASM 03.70.01 Released TENBIT.ASM 3-28-2006 22:41:23 PAGE 13 SYMBOL TABLE LABEL VALUE TMR2 00000011 TMR2IE 00000001 TMR2IF 00000001 TMR2ON 00000002 TOUTPS0 00000003 TOUTPS1 00000004 TOUTPS2 00000005 TOUTPS3 00000006 TRISA 00000085 TRISB 00000086 TRISC 00000087 TRISD 00000088 TRISE 00000089 TRISE0 00000000 TRISE1 00000001 TRISE2 00000002 TRMT 00000001 TX8_9 00000006 TX9 00000006 TX9D 00000000 TXD8 00000000 TXEN 00000005 TXIE 00000004 TXIF 00000004 TXREG 00000019 TXSTA 00000098 Timer1 00000070 TimerX 00000071 UA 00000001 Var 00000072 W 00000000 WCOL 00000007 WR 00000001 WREN 00000002 WRERR 00000003 Z 00000002 _BODEN_OFF 00003FBF _BODEN_ON 00003FFF _CPD_OFF 00003FFF _CPD_ON 00003EFF _CP_ALL 00001FFF _CP_OFF 00003FFF _DEBUG_OFF 00003FFF _DEBUG_ON 000037FF _HS_OSC 00003FFE _LP_OSC 00003FFC _LVP_OFF 00003F7F _LVP_ON 00003FFF _PWRTE_OFF 00003FFF _PWRTE_ON 00003FF7 _RC_OSC 00003FFF _WDT_OFF 00003FFB _WDT_ON 00003FFF MPASM 03.70.01 Released TENBIT.ASM 3-28-2006 22:41:23 PAGE 14 SYMBOL TABLE LABEL VALUE _WRT_1FOURTH 00003BFF _WRT_256 00003DFF _WRT_HALF 000039FF _WRT_OFF 00003FFF _XT_OSC 00003FFD __16F877 00000001 clrbcd 0000002C con4 00000018 count 00000030 down 00000012 getADC 00000010 hunlo 00000047 huns 00000034 inch 00000050 incth 00000045 inid 0000009E loop1 00000080 loopX 00000085 onems 0000007E ones 00000036 pulseE 00000089 putLCD 0000005E remh 00000052 remt 0000005A rot1 00000025 rot2 0000002B send 0000008E start 0000000C subt 00000053 tens 00000035 thohi 00000039 tholo 00000030 thos 00000033 wait 00000015 xms 00000084 MEMORY USAGE MAP ('X' = Used, '-' = Unused) 0000 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0040 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0080 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXX------- 2000 : -------X-------- ---------------- ---------------- ---------------- All other memory blocks unused. Program Memory Words Used: 185 Program Memory Words Free: 8007 MPASM 03.70.01 Released TENBIT.ASM 3-28-2006 22:41:23 PAGE 15 Errors : 0 Warnings : 0 reported, 0 suppressed Messages : 30 reported, 0 suppressed Error[173] : source file path exceeds 62 characters (C:\A PIC INTERFACING BOOK PROJECT\PIC INTERFACING BOOK APPLICATIONS MARCH 06\A PPLICATIONS\CHAP07\TENBIT\TENBIT.ASM) Error[173] : source file path exceeds 62 characters (C:\A PIC INTERFACING BOOK PROJECT\PIC INTERFACING BOOK APPLICATIONS MARCH 06\A PPLICATIONS\CHAP07\TENBIT\P16F877A.INC) Error[173] : source file path exceeds 62 characters (C:\A PIC INTERFACING BOOK PROJECT\PIC INTERFACING BOOK APPLICATIONS MARCH 06\A PPLICATIONS\CHAP07\TENBIT\LCDIS.INC)