CCS PCM C Compiler, Version 4.059d, 15399 20-IV-06 14:11
Filename: main.lst
ROM used: 335 words (16%)
Largest free fragment is 1713
RAM used: 11 (3%) at main() level
15 (4%) worst case
Stack: 2 locations
*
0000: MOVLW 00
0001: MOVWF 0A
0002: GOTO 081
0003: NOP
.................... #include "C:\RS\gmc\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 WRT_50% //Lower half of Program Memory is Write Protected
....................
.................... #use delay(clock=4000000)
*
001F: MOVLW 25
0020: MOVWF 04
0021: BCF 03.7
0022: MOVF 00,W
0023: BTFSC 03.2
0024: GOTO 033
0025: MOVLW 01
0026: MOVWF 78
0027: CLRF 77
0028: DECFSZ 77,F
0029: GOTO 028
002A: DECFSZ 78,F
002B: GOTO 027
002C: MOVLW 4A
002D: MOVWF 77
002E: DECFSZ 77,F
002F: GOTO 02E
0030: GOTO 031
0031: DECFSZ 00,F
0032: GOTO 025
0033: RETLW 00
.................... #use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
....................
....................
.................... //#define PIP1 output_high(PIN_A2)
.................... //#define PIP2 output_low(PIN_A3)
....................
.................... void main()
.................... {
*
0081: CLRF 04
0082: BCF 03.7
0083: MOVLW 1F
0084: ANDWF 03,F
0085: MOVLW 19
0086: BSF 03.5
0087: MOVWF 19
0088: MOVLW A6
0089: MOVWF 18
008A: MOVLW 90
008B: BCF 03.5
008C: MOVWF 18
008D: BSF 03.5
008E: BSF 1F.0
008F: BSF 1F.1
0090: BSF 1F.2
0091: BCF 1F.3
0092: MOVLW 07
0093: MOVWF 1C
....................
.................... unsigned int8 poc;
.................... //int8 delay;
.................... int cas;
.................... int b;
....................
.................... b=0;
*
0097: CLRF 23
....................
....................
.................... setup_adc_ports(NO_ANALOGS);
0098: BSF 03.5
0099: BSF 1F.0
009A: BSF 1F.1
009B: BSF 1F.2
009C: BCF 1F.3
.................... setup_adc(ADC_OFF);
009D: BCF 03.5
009E: BCF 1F.0
.................... setup_psp(PSP_DISABLED);
009F: BSF 03.5
00A0: BCF 09.4
.................... setup_spi(SPI_SS_DISABLED);
*
0094: MOVLW FF
0095: BCF 03.5
0096: MOVWF 20
*
00A1: BCF 03.5
00A2: BCF 14.5
00A3: BCF 20.5
00A4: MOVF 20,W
00A5: BSF 03.5
00A6: MOVWF 07
00A7: BCF 03.5
00A8: BSF 20.4
00A9: MOVF 20,W
00AA: BSF 03.5
00AB: MOVWF 07
00AC: BCF 03.5
00AD: BCF 20.3
00AE: MOVF 20,W
00AF: BSF 03.5
00B0: MOVWF 07
00B1: MOVLW 01
00B2: BCF 03.5
00B3: MOVWF 14
00B4: MOVLW 00
00B5: BSF 03.5
00B6: MOVWF 14
.................... setup_timer_0(RTCC_EXT_L_TO_H|RTCC_DIV_1);
00B7: MOVF 01,W
00B8: ANDLW C7
00B9: IORLW 28
00BA: MOVWF 01
.................... setup_timer_1(T1_EXTERNAL|T1_DIV_BY_8);
00BB: MOVLW B7
00BC: BCF 03.5
00BD: MOVWF 10
.................... setup_timer_2(T2_DIV_BY_1,1023,1);
00BE: MOVLW 00
00BF: MOVWF 78
00C0: IORLW 04
00C1: MOVWF 12
00C2: MOVLW FF
00C3: BSF 03.5
00C4: MOVWF 12
.................... setup_ccp1(CCP_PWM);
00C5: BCF 03.5
00C6: BCF 20.2
00C7: MOVF 20,W
00C8: BSF 03.5
00C9: MOVWF 07
00CA: BCF 03.5
00CB: BCF 07.2
00CC: MOVLW 0C
00CD: MOVWF 17
.................... setup_ccp2(CCP_PWM);
00CE: BCF 20.1
00CF: MOVF 20,W
00D0: BSF 03.5
00D1: MOVWF 07
00D2: BCF 03.5
00D3: BCF 07.1
00D4: MOVLW 0C
00D5: MOVWF 1D
.................... set_pwm1_duty(265);
00D6: MOVLW 42
00D7: MOVWF 15
00D8: MOVF 17,W
00D9: ANDLW CF
00DA: IORLW 10
00DB: MOVWF 17
.................... set_pwm2_duty(265);
00DC: MOVLW 42
00DD: MOVWF 1B
00DE: MOVF 1D,W
00DF: ANDLW CF
00E0: IORLW 10
00E1: MOVWF 1D
.................... setup_comparator(NC_NC_NC_NC);
00E2: MOVLW 07
00E3: BSF 03.5
00E4: MOVWF 1C
00E5: MOVF 05,W
00E6: MOVLW 03
00E7: MOVWF 77
00E8: DECFSZ 77,F
00E9: GOTO 0E8
00EA: MOVF 1C,W
00EB: BCF 03.5
00EC: BCF 0D.6
.................... setup_vref(FALSE);
00ED: BSF 03.5
00EE: CLRF 1D
....................
....................
....................
....................
.................... while(TRUE)
.................... {
.................... //set_timer0(0);
.................... for(b=0;b<5;b++)
00EF: BCF 03.5
00F0: CLRF 23
00F1: MOVF 23,W
00F2: SUBLW 04
00F3: BTFSS 03.0
00F4: GOTO 132
....................
.................... {
.................... //delay=read_adc(); //pwm-ka je nastavena na pevnou hodnotu
.................... // set_pwm1_duty(delay);
.................... //set_pwm2_duty(delay);
....................
....................
.................... poc=get_timer0();
00F5: MOVF 01,W
00F6: MOVWF 21
.................... if (poc!=poc)
00F7: MOVF 21,W
00F8: SUBWF 21,W
00F9: BTFSC 03.2
00FA: GOTO 129
.................... {
.................... poc++;
00FB: INCF 21,F
....................
.................... cas=get_timer1();
00FC: MOVF 0F,W
00FD: MOVWF 7A
00FE: MOVF 0E,W
00FF: MOVWF 77
0100: MOVF 0F,W
0101: SUBWF 7A,W
0102: BTFSS 03.2
0103: GOTO 0FC
0104: MOVF 77,W
0105: MOVWF 22
.................... cas++;
0106: INCF 22,F
.................... /*output_low(PIN_A2);
.................... output_high(PIN_A3);
.................... delay_us(500);
.................... output_high(PIN_A2);
.................... output_low(PIN_A3);*/
.................... if(cas=~cas)
0107: COMF 22,F
0108: BTFSC 03.2
0109: GOTO 129
.................... {
.................... output_low(PIN_C4);
010A: BCF 20.4
010B: MOVF 20,W
010C: BSF 03.5
010D: MOVWF 07
010E: BCF 03.5
010F: BCF 07.4
.................... output_high(PIN_C5);
0110: BCF 20.5
0111: MOVF 20,W
0112: BSF 03.5
0113: MOVWF 07
0114: BCF 03.5
0115: BSF 07.5
.................... delay_ms(300);
0116: MOVLW 02
0117: MOVWF 24
0118: MOVLW 96
0119: MOVWF 25
011A: CALL 01F
011B: DECFSZ 24,F
011C: GOTO 118
.................... output_high(PIN_C4);
011D: BCF 20.4
011E: MOVF 20,W
011F: BSF 03.5
0120: MOVWF 07
0121: BCF 03.5
0122: BSF 07.4
.................... output_low(PIN_C5);
0123: BCF 20.5
0124: MOVF 20,W
0125: BSF 03.5
0126: MOVWF 07
0127: BCF 03.5
0128: BCF 07.5
.................... }
.................... //!PIP1;
.................... //!PIP2;
.................... //delay_cycles(300);
.................... //PIP1;
.................... //PIP2;
.................... //delay_ms(110);
.................... }
....................
....................
....................
.................... delay_ms(500);
0129: MOVLW 02
012A: MOVWF 24
012B: MOVLW FA
012C: MOVWF 25
012D: CALL 01F
012E: DECFSZ 24,F
012F: GOTO 12B
.................... }
0130: INCF 23,F
0131: GOTO 0F1
....................
....................
.................... printf("\n\r");
0132: MOVLW 0A
0133: BTFSS 0C.4
0134: GOTO 133
0135: MOVWF 19
0136: MOVLW 0D
0137: BTFSS 0C.4
0138: GOTO 137
0139: MOVWF 19
.................... printf("sum of peaks per 1s:\n\r");
013A: CLRF 24
013B: MOVF 24,W
013C: CALL 004
013D: INCF 24,F
013E: MOVWF 77
013F: MOVF 77,W
0140: BTFSS 0C.4
0141: GOTO 140
0142: MOVWF 19
0143: MOVLW 16
0144: SUBWF 24,W
0145: BTFSS 03.2
0146: GOTO 13B
.................... printf("%u",poc);
0147: MOVF 21,W
0148: MOVWF 24
0149: MOVLW 1B
014A: MOVWF 25
014B: GOTO 049
.................... set_timer0(0);
014C: CLRF 01
....................
....................
.................... }
014D: GOTO 0F0
....................
....................
.................... }
014E: SLEEP
Configuration Fuses:
Word 1: 3939 XT NOWDT NOPUT NODEBUG NOPROTECT NOBROWNOUT NOLVP NOCPD WRT_50%