CCS PCM C Compiler, Version 4.058s, 42064 30-III-08 22:54
Filename: main.lst
ROM used: 591 words (7%)
Largest free fragment is 2048
RAM used: 18 (5%) at main() level
42 (11%) worst case
Stack: 2 locations
*
0000: MOVLW 00
0001: MOVWF 0A
0002: GOTO 0BC
0003: NOP
.................... #include "C:\RS\Meric_casu\main.h"
.................... #include <16F877A.h>
.................... //////// Standard Header file for the PIC16F877A device ////////////////
.................... #device PIC16F877A
.................... #list
....................
.................... #device adc=8
....................
.................... #FUSES NOWDT //No Watch Dog Timer
.................... #FUSES XT //Crystal osc <= 4mhz
.................... #FUSES NOPUT //No Power Up Timer
.................... #FUSES NOPROTECT //Code not protected from reading
.................... #FUSES NODEBUG //No Debug mode for ICD
.................... #FUSES NOBROWNOUT //No brownout reset
.................... #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
.................... #FUSES NOCPD //No EE protection
.................... #FUSES NOWRT //Program memory not write protected
....................
.................... #use delay(clock=4000000,RESTART_WDT)
.................... #use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
....................
....................
.................... #define mic input(PIN_A4)
.................... #define POCET 10
.................... #define E1 3034
....................
.................... void main()
.................... {
00BC: CLRF 04
00BD: BCF 03.7
00BE: MOVLW 1F
00BF: ANDWF 03,F
00C0: MOVLW 19
00C1: BSF 03.5
00C2: MOVWF 19
00C3: MOVLW A6
00C4: MOVWF 18
00C5: MOVLW 90
00C6: BCF 03.5
00C7: MOVWF 18
00C8: BSF 03.5
00C9: BSF 1F.0
00CA: BSF 1F.1
00CB: BSF 1F.2
00CC: BCF 1F.3
00CD: MOVLW 07
00CE: MOVWF 1C
.................... int16 perioda;
.................... int8 i;
.................... int32 cas;
.................... signed int16 vysl;
....................
.................... setup_adc_ports(NO_ANALOGS);
*
00D2: BSF 03.5
00D3: BSF 1F.0
00D4: BSF 1F.1
00D5: BSF 1F.2
00D6: BCF 1F.3
.................... setup_adc(ADC_OFF);
00D7: BCF 03.5
00D8: BCF 1F.0
.................... setup_spi(SPI_SS_DISABLED);
*
00CF: MOVLW FF
00D0: BCF 03.5
00D1: MOVWF 20
*
00D9: BCF 14.5
00DA: BCF 20.5
00DB: MOVF 20,W
00DC: BSF 03.5
00DD: MOVWF 07
00DE: BCF 03.5
00DF: BSF 20.4
00E0: MOVF 20,W
00E1: BSF 03.5
00E2: MOVWF 07
00E3: BCF 03.5
00E4: BCF 20.3
00E5: MOVF 20,W
00E6: BSF 03.5
00E7: MOVWF 07
00E8: MOVLW 01
00E9: BCF 03.5
00EA: MOVWF 14
00EB: MOVLW 00
00EC: BSF 03.5
00ED: MOVWF 14
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
00EE: MOVF 01,W
00EF: ANDLW C7
00F0: IORLW 08
00F1: MOVWF 01
.................... setup_timer_1(T1_INTERNAL|T1_DIV_BY_1);
00F2: MOVLW 85
00F3: BCF 03.5
00F4: MOVWF 10
.................... setup_timer_2(T2_DISABLED,0,1);
00F5: MOVLW 00
00F6: MOVWF 78
00F7: MOVWF 12
00F8: MOVLW 00
00F9: BSF 03.5
00FA: MOVWF 12
.................... setup_comparator(NC_NC_NC_NC);
00FB: MOVLW 07
00FC: MOVWF 1C
00FD: MOVF 05,W
00FE: CLRWDT
00FF: MOVLW 02
0100: MOVWF 77
0101: DECFSZ 77,F
0102: GOTO 101
0103: GOTO 104
0104: MOVF 1C,W
0105: BCF 03.5
0106: BCF 0D.6
.................... setup_vref(FALSE);
0107: BSF 03.5
0108: CLRF 1D
.................... output_B(0xFF);
0109: CLRF 06
010A: MOVLW FF
010B: BCF 03.5
010C: MOVWF 06
....................
.................... while(TRUE)
.................... {
.................... cas=0;
010D: CLRF 27
010E: CLRF 26
010F: CLRF 25
0110: CLRF 24
.................... for(i=0;i<POCET;i++)
0111: CLRF 23
0112: MOVF 23,W
0113: SUBLW 09
0114: BTFSS 03.0
0115: GOTO 154
.................... {
.................... while(mic);
0116: BSF 03.5
0117: BSF 05.4
0118: BCF 03.5
0119: BTFSC 05.4
011A: GOTO 116
.................... while(!mic);
011B: BSF 03.5
011C: BSF 05.4
011D: BCF 03.5
011E: BTFSS 05.4
011F: GOTO 11B
.................... while(mic)
.................... {
0120: BSF 03.5
0121: BSF 05.4
0122: BCF 03.5
0123: BTFSS 05.4
0124: GOTO 12D
.................... set_timer1(0);
0125: CLRF 0F
0126: CLRF 0E
.................... //LED_ON;
.................... //delay_us(1400);
.................... while(mic);
0127: BSF 03.5
0128: BSF 05.4
0129: BCF 03.5
012A: BTFSC 05.4
012B: GOTO 127
.................... }
012C: GOTO 120
.................... while(!mic)
.................... {
012D: BSF 03.5
012E: BSF 05.4
012F: BCF 03.5
0130: BTFSC 05.4
0131: GOTO 138
.................... //LED_OFF;
.................... //delay_us(1400);
.................... while(!mic);
0132: BSF 03.5
0133: BSF 05.4
0134: BCF 03.5
0135: BTFSS 05.4
0136: GOTO 132
.................... }
0137: GOTO 12D
.................... perioda=get_timer1();
0138: MOVF 0F,W
0139: MOVWF 7A
013A: MOVF 0E,W
013B: MOVWF 77
013C: MOVF 0F,W
013D: SUBWF 7A,W
013E: BTFSS 03.2
013F: GOTO 138
0140: MOVF 77,W
0141: MOVWF 21
0142: MOVF 7A,W
0143: MOVWF 22
.................... //printf("Perioda %5Lu us.\n\r",perioda);
.................... cas+=perioda;
0144: MOVF 21,W
0145: ADDWF 24,F
0146: MOVF 22,W
0147: BTFSC 03.0
0148: INCFSZ 22,W
0149: ADDWF 25,F
014A: MOVLW 00
014B: BTFSC 03.0
014C: MOVLW 01
014D: ADDWF 26,F
014E: MOVLW 00
014F: BTFSC 03.0
0150: MOVLW 01
0151: ADDWF 27,F
.................... }
0152: INCF 23,F
0153: GOTO 112
.................... cas/=i;
0154: MOVF 27,W
0155: MOVWF 3A
0156: MOVF 26,W
0157: MOVWF 39
0158: MOVF 25,W
0159: MOVWF 38
015A: MOVF 24,W
015B: MOVWF 37
015C: CLRF 3E
015D: CLRF 3D
015E: CLRF 3C
015F: MOVF 23,W
0160: MOVWF 3B
0161: CALL 01B
0162: MOVF 7A,W
0163: MOVWF 27
0164: MOVF 79,W
0165: MOVWF 26
0166: MOVF 78,W
0167: MOVWF 25
0168: MOVF 77,W
0169: MOVWF 24
.................... printf("Perioda %5Lu us.\n\r",cas);
016A: CLRF 2A
016B: MOVF 2A,W
016C: CALL 004
016D: INCF 2A,F
016E: MOVWF 77
016F: MOVF 77,W
0170: BTFSS 0C.4
0171: GOTO 170
0172: MOVWF 19
0173: MOVLW 08
0174: SUBWF 2A,W
0175: BTFSS 03.2
0176: GOTO 16B
0177: MOVLW 05
0178: MOVWF 04
0179: MOVF 27,W
017A: MOVWF 2E
017B: MOVF 26,W
017C: MOVWF 2D
017D: MOVF 25,W
017E: MOVWF 2C
017F: MOVF 24,W
0180: MOVWF 2B
0181: GOTO 05D
0182: MOVLW 0C
0183: MOVWF 2B
0184: MOVF 2B,W
0185: CALL 004
0186: INCF 2B,F
0187: MOVWF 77
0188: MOVF 77,W
0189: BTFSS 0C.4
018A: GOTO 189
018B: MOVWF 19
018C: MOVLW 12
018D: SUBWF 2B,W
018E: BTFSS 03.2
018F: GOTO 184
.................... vysl=cas-E1;
0190: MOVLW DA
0191: SUBWF 24,W
0192: MOVWF 77
0193: MOVF 25,W
0194: MOVWF 78
0195: MOVLW 0B
0196: BTFSS 03.0
0197: MOVLW 0C
0198: SUBWF 78,F
0199: MOVF 26,W
019A: MOVWF 79
019B: MOVLW 00
019C: BTFSS 03.0
019D: MOVLW 01
019E: SUBWF 79,F
019F: MOVF 27,W
01A0: MOVWF 7A
01A1: MOVLW 00
01A2: BTFSS 03.0
01A3: MOVLW 01
01A4: SUBWF 7A,F
01A5: MOVF 78,W
01A6: MOVWF 29
01A7: MOVF 77,W
01A8: MOVWF 28
.................... if(vysl<-53)output_B(0b10111111);
01A9: BTFSS 29.7
01AA: GOTO 1BA
01AB: MOVF 29,W
01AC: SUBLW FF
01AD: BTFSS 03.0
01AE: GOTO 1BA
01AF: BTFSS 03.2
01B0: GOTO 1B5
01B1: MOVF 28,W
01B2: SUBLW CA
01B3: BTFSS 03.0
01B4: GOTO 1BA
01B5: BSF 03.5
01B6: CLRF 06
01B7: MOVLW BF
01B8: BCF 03.5
01B9: MOVWF 06
.................... if((vysl>-53)&&(vysl<-35))output_B(0b11011111);
01BA: BTFSS 29.7
01BB: GOTO 1C7
01BC: MOVF 29,W
01BD: SUBLW FE
01BE: BTFSC 03.0
01BF: GOTO 1D8
01C0: XORLW FF
01C1: BTFSS 03.2
01C2: GOTO 1C7
01C3: MOVF 28,W
01C4: SUBLW CB
01C5: BTFSC 03.0
01C6: GOTO 1D8
01C7: BTFSS 29.7
01C8: GOTO 1D8
01C9: MOVF 29,W
01CA: SUBLW FF
01CB: BTFSS 03.0
01CC: GOTO 1D8
01CD: BTFSS 03.2
01CE: GOTO 1D3
01CF: MOVF 28,W
01D0: SUBLW DC
01D1: BTFSS 03.0
01D2: GOTO 1D8
01D3: BSF 03.5
01D4: CLRF 06
01D5: MOVLW DF
01D6: BCF 03.5
01D7: MOVWF 06
.................... if((vysl>-35)&&(vysl<-17))output_B(0b11101111);
01D8: BTFSS 29.7
01D9: GOTO 1E5
01DA: MOVF 29,W
01DB: SUBLW FE
01DC: BTFSC 03.0
01DD: GOTO 1F6
01DE: XORLW FF
01DF: BTFSS 03.2
01E0: GOTO 1E5
01E1: MOVF 28,W
01E2: SUBLW DD
01E3: BTFSC 03.0
01E4: GOTO 1F6
01E5: BTFSS 29.7
01E6: GOTO 1F6
01E7: MOVF 29,W
01E8: SUBLW FF
01E9: BTFSS 03.0
01EA: GOTO 1F6
01EB: BTFSS 03.2
01EC: GOTO 1F1
01ED: MOVF 28,W
01EE: SUBLW EE
01EF: BTFSS 03.0
01F0: GOTO 1F6
01F1: BSF 03.5
01F2: CLRF 06
01F3: MOVLW EF
01F4: BCF 03.5
01F5: MOVWF 06
.................... if((vysl>-17)&&(vysl<17))output_B(0b11110111);
01F6: BTFSS 29.7
01F7: GOTO 203
01F8: MOVF 29,W
01F9: SUBLW FE
01FA: BTFSC 03.0
01FB: GOTO 211
01FC: XORLW FF
01FD: BTFSS 03.2
01FE: GOTO 203
01FF: MOVF 28,W
0200: SUBLW EF
0201: BTFSC 03.0
0202: GOTO 211
0203: BTFSC 29.7
0204: GOTO 20C
0205: MOVF 29,F
0206: BTFSS 03.2
0207: GOTO 211
0208: MOVF 28,W
0209: SUBLW 10
020A: BTFSS 03.0
020B: GOTO 211
020C: BSF 03.5
020D: CLRF 06
020E: MOVLW F7
020F: BCF 03.5
0210: MOVWF 06
.................... if((vysl>17)&&(vysl<35))output_B(0b11111011);
0211: BTFSC 29.7
0212: GOTO 228
0213: MOVF 29,F
0214: BTFSS 03.2
0215: GOTO 21A
0216: MOVF 28,W
0217: SUBLW 11
0218: BTFSC 03.0
0219: GOTO 228
021A: BTFSC 29.7
021B: GOTO 223
021C: MOVF 29,F
021D: BTFSS 03.2
021E: GOTO 228
021F: MOVF 28,W
0220: SUBLW 22
0221: BTFSS 03.0
0222: GOTO 228
0223: BSF 03.5
0224: CLRF 06
0225: MOVLW FB
0226: BCF 03.5
0227: MOVWF 06
.................... if((vysl>35)&&(vysl<52))output_B(0b111111101);
0228: BTFSC 29.7
0229: GOTO 23F
022A: MOVF 29,F
022B: BTFSS 03.2
022C: GOTO 231
022D: MOVF 28,W
022E: SUBLW 23
022F: BTFSC 03.0
0230: GOTO 23F
0231: BTFSC 29.7
0232: GOTO 23A
0233: MOVF 29,F
0234: BTFSS 03.2
0235: GOTO 23F
0236: MOVF 28,W
0237: SUBLW 33
0238: BTFSS 03.0
0239: GOTO 23F
023A: BSF 03.5
023B: CLRF 06
023C: MOVLW FD
023D: BCF 03.5
023E: MOVWF 06
.................... if(vysl>52)output_B(0b111111110);
023F: BTFSC 29.7
0240: GOTO 24D
0241: MOVF 29,F
0242: BTFSS 03.2
0243: GOTO 248
0244: MOVF 28,W
0245: SUBLW 34
0246: BTFSC 03.0
0247: GOTO 24D
0248: BSF 03.5
0249: CLRF 06
024A: MOVLW FE
024B: BCF 03.5
024C: MOVWF 06
.................... }
024D: GOTO 10D
.................... }
024E: SLEEP
Configuration Fuses:
Word 1: 3F39 XT NOWDT NOPUT NODEBUG NOPROTECT NOBROWNOUT NOLVP NOCPD NOWRT