/Designs/Measuring_instruments/GM_counter/SW/counter/main.lst
1,11 → 1,11
CCS PCM C Compiler, Version 4.106, 47914 22-5-13 12:34
CCS PCM C Compiler, Version 4.106, 47914 23-V-13 16:19
 
Filename: D:\Honza\MLAB\Designs\Measuring_instruments\GM_counter\SW\counter\main.lst
Filename: Z:\home\kaklik\MLAB\Designs\Measuring_instruments\GM_counter\SW\counter\main.lst
 
ROM used: 2825 words (34%)
ROM used: 3009 words (37%)
Largest free fragment is 2048
RAM used: 36 (10%) at main() level
55 (15%) worst case
RAM used: 37 (10%) at main() level
56 (15%) worst case
Stack: 6 worst case (5 in main + 1 for interrupts)
 
*
89,80 → 89,80
....................
.................... #use delay(clock=8000000)
*
00A9: MOVLW 46
00AA: MOVWF 04
00AB: BCF 03.7
00AC: MOVF 00,W
00AD: BTFSC 03.2
00AE: GOTO 0BC
00AF: MOVLW 02
00B0: MOVWF 78
00B1: CLRF 77
00B2: DECFSZ 77,F
00B3: GOTO 0B2
00B4: DECFSZ 78,F
00B5: GOTO 0B1
00B6: MOVLW 97
00B7: MOVWF 77
00B8: DECFSZ 77,F
00B9: GOTO 0B8
00BA: DECFSZ 00,F
00BB: GOTO 0AF
00BC: RETURN
00A4: MOVLW 47
00A5: MOVWF 04
00A6: BCF 03.7
00A7: MOVF 00,W
00A8: BTFSC 03.2
00A9: GOTO 0B7
00AA: MOVLW 02
00AB: MOVWF 78
00AC: CLRF 77
00AD: DECFSZ 77,F
00AE: GOTO 0AD
00AF: DECFSZ 78,F
00B0: GOTO 0AC
00B1: MOVLW 97
00B2: MOVWF 77
00B3: DECFSZ 77,F
00B4: GOTO 0B3
00B5: DECFSZ 00,F
00B6: GOTO 0AA
00B7: RETURN
*
05FC: MOVLW 08
05FD: SUBWF 40,F
05FE: BTFSS 03.0
05FF: GOTO 60C
0600: MOVLW 40
0601: MOVWF 04
0602: BCF 03.7
0603: BCF 03.0
0604: RRF 00,F
0605: MOVF 00,W
0606: BTFSC 03.2
0607: GOTO 60C
0608: GOTO 60A
0609: NOP
060A: DECFSZ 00,F
060B: GOTO 609
060C: RETURN
0643: MOVLW 08
0644: SUBWF 41,F
0645: BTFSS 03.0
0646: GOTO 653
0647: MOVLW 41
0648: MOVWF 04
0649: BCF 03.7
064A: BCF 03.0
064B: RRF 00,F
064C: MOVF 00,W
064D: BTFSC 03.2
064E: GOTO 653
064F: GOTO 651
0650: NOP
0651: DECFSZ 00,F
0652: GOTO 650
0653: RETURN
.................... #use rs232(baud=9600,parity=N,xmit=PIN_B7,rcv=PIN_B6,bits=8)
*
0235: BSF 03.5
0236: BCF 06.7
0237: BCF 03.5
0238: BCF 06.7
0239: MOVLW 08
023A: MOVWF 78
023B: GOTO 23C
023C: NOP
023D: BSF 78.7
023E: GOTO 24D
023F: BCF 78.7
0240: RRF 45,F
0241: BTFSC 03.0
0242: BSF 06.7
0243: BTFSS 03.0
0244: BCF 06.7
0245: BSF 78.6
0246: GOTO 24D
0247: BCF 78.6
0248: DECFSZ 78,F
0249: GOTO 240
024A: GOTO 24B
024B: NOP
024C: BSF 06.7
024D: MOVLW 3F
024E: MOVWF 04
024F: DECFSZ 04,F
0250: GOTO 24F
0251: NOP
0252: BTFSC 78.7
0253: GOTO 23F
0254: BTFSC 78.6
0255: GOTO 247
0256: RETURN
0230: BSF 03.5
0231: BCF 06.7
0232: BCF 03.5
0233: BCF 06.7
0234: MOVLW 08
0235: MOVWF 78
0236: GOTO 237
0237: NOP
0238: BSF 78.7
0239: GOTO 248
023A: BCF 78.7
023B: RRF 46,F
023C: BTFSC 03.0
023D: BSF 06.7
023E: BTFSS 03.0
023F: BCF 06.7
0240: BSF 78.6
0241: GOTO 248
0242: BCF 78.6
0243: DECFSZ 78,F
0244: GOTO 23B
0245: GOTO 246
0246: NOP
0247: BSF 06.7
0248: MOVLW 3F
0249: MOVWF 04
024A: DECFSZ 04,F
024B: GOTO 24A
024C: NOP
024D: BTFSC 78.7
024E: GOTO 23A
024F: BTFSC 78.6
0250: GOTO 242
0251: RETURN
....................
....................
....................
384,13 → 384,13
.................... #if (defined(LCD_DATA4) && defined(LCD_DATA5) && defined(LCD_DATA6) && defined(LCD_DATA7))
.................... output_float(LCD_DATA4);
*
0122: BSF 08.4
011D: BSF 08.4
.................... output_float(LCD_DATA5);
0123: BSF 08.5
011E: BSF 08.5
.................... output_float(LCD_DATA6);
0124: BSF 08.6
011F: BSF 08.6
.................... output_float(LCD_DATA7);
0125: BSF 08.7
0120: BSF 08.7
.................... #else
.................... lcdtris.data = 0xF;
.................... #endif
397,48 → 397,48
.................... #endif
....................
.................... lcd_output_rw(1);
0121: BCF 03.5
0122: BSF 09.2
0123: BSF 03.5
0124: BCF 09.2
.................... delay_cycles(1);
0125: NOP
.................... lcd_output_enable(1);
0126: BCF 03.5
0127: BSF 09.2
0127: BSF 09.0
0128: BSF 03.5
0129: BCF 09.2
0129: BCF 09.0
.................... delay_cycles(1);
012A: NOP
.................... lcd_output_enable(1);
.................... high = lcd_read_nibble();
012B: BCF 03.5
012C: BSF 09.0
012D: BSF 03.5
012E: BCF 09.0
.................... delay_cycles(1);
012F: NOP
.................... high = lcd_read_nibble();
0130: BCF 03.5
0131: CALL 0E9
0132: MOVF 78,W
0133: MOVWF 4D
012C: CALL 0E4
012D: MOVF 78,W
012E: MOVWF 4E
....................
.................... lcd_output_enable(0);
0134: BCF 09.0
012F: BCF 09.0
0130: BSF 03.5
0131: BCF 09.0
.................... delay_cycles(1);
0132: NOP
.................... lcd_output_enable(1);
0133: BCF 03.5
0134: BSF 09.0
0135: BSF 03.5
0136: BCF 09.0
.................... delay_cycles(1);
0137: NOP
.................... lcd_output_enable(1);
0138: BCF 03.5
0139: BSF 09.0
013A: BSF 03.5
013B: BCF 09.0
.................... delay_us(1);
013C: GOTO 13D
0137: GOTO 138
.................... low = lcd_read_nibble();
013D: BCF 03.5
013E: CALL 0E9
013F: MOVF 78,W
0140: MOVWF 4C
0138: BCF 03.5
0139: CALL 0E4
013A: MOVF 78,W
013B: MOVWF 4D
....................
.................... lcd_output_enable(0);
0141: BCF 09.0
0142: BSF 03.5
0143: BCF 09.0
013C: BCF 09.0
013D: BSF 03.5
013E: BCF 09.0
....................
.................... #if defined(__PCB__)
.................... set_tris_lcd(LCD_OUTPUT_MAP);
445,13 → 445,13
.................... #else
.................... #if (defined(LCD_DATA4) && defined(LCD_DATA5) && defined(LCD_DATA6) && defined(LCD_DATA7))
.................... output_drive(LCD_DATA4);
0144: BCF 08.4
013F: BCF 08.4
.................... output_drive(LCD_DATA5);
0145: BCF 08.5
0140: BCF 08.5
.................... output_drive(LCD_DATA6);
0146: BCF 08.6
0141: BCF 08.6
.................... output_drive(LCD_DATA7);
0147: BCF 08.7
0142: BCF 08.7
.................... #else
.................... lcdtris.data = 0x0;
.................... #endif
458,14 → 458,14
.................... #endif
....................
.................... return( (high<<4) | low);
0148: BCF 03.5
0149: SWAPF 4D,W
014A: MOVWF 77
014B: MOVLW F0
014C: ANDWF 77,F
014D: MOVF 77,W
014E: IORWF 4C,W
014F: MOVWF 78
0143: BCF 03.5
0144: SWAPF 4E,W
0145: MOVWF 77
0146: MOVLW F0
0147: ANDWF 77,F
0148: MOVF 77,W
0149: IORWF 4D,W
014A: MOVWF 78
.................... }
....................
.................... BYTE lcd_read_nibble(void)
472,68 → 472,68
.................... {
.................... #if (defined(LCD_DATA4) && defined(LCD_DATA5) && defined(LCD_DATA6) && defined(LCD_DATA7))
*
00E9: CLRF 4E
00E4: CLRF 4F
.................... BYTE n = 0x00;
....................
.................... /* Read the data port */
.................... n |= input(LCD_DATA4);
00EA: BSF 03.5
00EB: BSF 08.4
00EC: MOVLW 00
00ED: BCF 03.5
00EE: BTFSC 08.4
00EF: MOVLW 01
00F0: IORWF 4E,F
00E5: BSF 03.5
00E6: BSF 08.4
00E7: MOVLW 00
00E8: BCF 03.5
00E9: BTFSC 08.4
00EA: MOVLW 01
00EB: IORWF 4F,F
.................... n |= input(LCD_DATA5) << 1;
00F1: BSF 03.5
00F2: BSF 08.5
00F3: MOVLW 00
00F4: BCF 03.5
00F5: BTFSC 08.5
00F6: MOVLW 01
00F7: MOVWF 77
00F8: BCF 03.0
00F9: RLF 77,F
00FA: MOVF 77,W
00FB: IORWF 4E,F
00EC: BSF 03.5
00ED: BSF 08.5
00EE: MOVLW 00
00EF: BCF 03.5
00F0: BTFSC 08.5
00F1: MOVLW 01
00F2: MOVWF 77
00F3: BCF 03.0
00F4: RLF 77,F
00F5: MOVF 77,W
00F6: IORWF 4F,F
.................... n |= input(LCD_DATA6) << 2;
00FC: BSF 03.5
00FD: BSF 08.6
00FE: MOVLW 00
00FF: BCF 03.5
0100: BTFSC 08.6
0101: MOVLW 01
0102: MOVWF 77
0103: RLF 77,F
0104: RLF 77,F
0105: MOVLW FC
0106: ANDWF 77,F
0107: MOVF 77,W
0108: IORWF 4E,F
00F7: BSF 03.5
00F8: BSF 08.6
00F9: MOVLW 00
00FA: BCF 03.5
00FB: BTFSC 08.6
00FC: MOVLW 01
00FD: MOVWF 77
00FE: RLF 77,F
00FF: RLF 77,F
0100: MOVLW FC
0101: ANDWF 77,F
0102: MOVF 77,W
0103: IORWF 4F,F
.................... n |= input(LCD_DATA7) << 3;
0109: BSF 03.5
010A: BSF 08.7
010B: MOVLW 00
010C: BCF 03.5
010D: BTFSC 08.7
010E: MOVLW 01
010F: MOVWF 77
0110: RLF 77,F
0111: RLF 77,F
0112: RLF 77,F
0113: MOVLW F8
0114: ANDWF 77,F
0115: MOVF 77,W
0116: IORWF 4E,F
0104: BSF 03.5
0105: BSF 08.7
0106: MOVLW 00
0107: BCF 03.5
0108: BTFSC 08.7
0109: MOVLW 01
010A: MOVWF 77
010B: RLF 77,F
010C: RLF 77,F
010D: RLF 77,F
010E: MOVLW F8
010F: ANDWF 77,F
0110: MOVF 77,W
0111: IORWF 4F,F
....................
.................... return(n);
0117: MOVF 4E,W
0118: MOVWF 78
0112: MOVF 4F,W
0113: MOVWF 78
.................... #else
.................... return(lcd.data);
.................... #endif
.................... }
0119: RETURN
0114: RETURN
....................
.................... void lcd_send_nibble(BYTE n)
.................... {
541,62 → 541,62
.................... /* Write to the data port */
.................... output_bit(LCD_DATA4, bit_test(n, 0));
*
00BD: BTFSC 4D.0
00BE: GOTO 0C1
00BF: BCF 08.4
00C0: GOTO 0C2
00C1: BSF 08.4
00C2: BSF 03.5
00C3: BCF 08.4
00B8: BTFSC 4E.0
00B9: GOTO 0BC
00BA: BCF 08.4
00BB: GOTO 0BD
00BC: BSF 08.4
00BD: BSF 03.5
00BE: BCF 08.4
.................... output_bit(LCD_DATA5, bit_test(n, 1));
00C4: BCF 03.5
00C5: BTFSC 4D.1
00C6: GOTO 0C9
00C7: BCF 08.5
00C8: GOTO 0CA
00C9: BSF 08.5
00CA: BSF 03.5
00CB: BCF 08.5
00BF: BCF 03.5
00C0: BTFSC 4E.1
00C1: GOTO 0C4
00C2: BCF 08.5
00C3: GOTO 0C5
00C4: BSF 08.5
00C5: BSF 03.5
00C6: BCF 08.5
.................... output_bit(LCD_DATA6, bit_test(n, 2));
00CC: BCF 03.5
00CD: BTFSC 4D.2
00CE: GOTO 0D1
00CF: BCF 08.6
00D0: GOTO 0D2
00D1: BSF 08.6
00D2: BSF 03.5
00D3: BCF 08.6
00C7: BCF 03.5
00C8: BTFSC 4E.2
00C9: GOTO 0CC
00CA: BCF 08.6
00CB: GOTO 0CD
00CC: BSF 08.6
00CD: BSF 03.5
00CE: BCF 08.6
.................... output_bit(LCD_DATA7, bit_test(n, 3));
00D4: BCF 03.5
00D5: BTFSC 4D.3
00D6: GOTO 0D9
00D7: BCF 08.7
00D8: GOTO 0DA
00D9: BSF 08.7
00DA: BSF 03.5
00DB: BCF 08.7
00CF: BCF 03.5
00D0: BTFSC 4E.3
00D1: GOTO 0D4
00D2: BCF 08.7
00D3: GOTO 0D5
00D4: BSF 08.7
00D5: BSF 03.5
00D6: BCF 08.7
.................... #else
.................... lcdlat.data = n;
.................... #endif
....................
.................... delay_cycles(1);
00DC: NOP
00D7: NOP
.................... lcd_output_enable(1);
00DD: BCF 03.5
00DE: BSF 09.0
00DF: BSF 03.5
00E0: BCF 09.0
00D8: BCF 03.5
00D9: BSF 09.0
00DA: BSF 03.5
00DB: BCF 09.0
.................... delay_us(2);
00E1: GOTO 0E2
00E2: GOTO 0E3
00DC: GOTO 0DD
00DD: GOTO 0DE
.................... lcd_output_enable(0);
00E3: BCF 03.5
00E4: BCF 09.0
00E5: BSF 03.5
00E6: BCF 09.0
00DE: BCF 03.5
00DF: BCF 09.0
00E0: BSF 03.5
00E1: BCF 09.0
.................... }
00E7: BCF 03.5
00E8: RETURN
00E2: BCF 03.5
00E3: RETURN
....................
.................... void lcd_send_byte(BYTE address, BYTE n)
.................... {
605,67 → 605,67
.................... #else
.................... lcd_enable_tris();
*
011A: BSF 03.5
011B: BCF 09.0
0115: BSF 03.5
0116: BCF 09.0
.................... lcd_rs_tris();
011C: BCF 09.1
0117: BCF 09.1
.................... lcd_rw_tris();
011D: BCF 09.2
0118: BCF 09.2
.................... #endif
....................
.................... lcd_output_rs(0);
011E: BCF 03.5
011F: BCF 09.1
0120: BSF 03.5
0121: BCF 09.1
0119: BCF 03.5
011A: BCF 09.1
011B: BSF 03.5
011C: BCF 09.1
.................... while ( bit_test(lcd_read_byte(),7) ) ;
*
0150: MOVF 78,W
0151: MOVWF 4C
0152: BTFSS 4C.7
014B: MOVF 78,W
014C: MOVWF 4D
014D: BTFSS 4D.7
014E: GOTO 151
014F: BSF 03.5
0150: GOTO 11D
.................... lcd_output_rs(address);
0151: MOVF 4B,F
0152: BTFSS 03.2
0153: GOTO 156
0154: BSF 03.5
0155: GOTO 122
.................... lcd_output_rs(address);
0156: MOVF 4A,F
0157: BTFSS 03.2
0158: GOTO 15B
0159: BCF 09.1
015A: GOTO 15C
015B: BSF 09.1
0154: BCF 09.1
0155: GOTO 157
0156: BSF 09.1
0157: BSF 03.5
0158: BCF 09.1
.................... delay_cycles(1);
0159: NOP
.................... lcd_output_rw(0);
015A: BCF 03.5
015B: BCF 09.2
015C: BSF 03.5
015D: BCF 09.1
015D: BCF 09.2
.................... delay_cycles(1);
015E: NOP
.................... lcd_output_rw(0);
.................... lcd_output_enable(0);
015F: BCF 03.5
0160: BCF 09.2
0160: BCF 09.0
0161: BSF 03.5
0162: BCF 09.2
.................... delay_cycles(1);
0163: NOP
.................... lcd_output_enable(0);
0164: BCF 03.5
0165: BCF 09.0
0166: BSF 03.5
0167: BCF 09.0
0162: BCF 09.0
.................... lcd_send_nibble(n >> 4);
0168: BCF 03.5
0169: SWAPF 4B,W
016A: MOVWF 4C
016B: MOVLW 0F
016C: ANDWF 4C,F
016D: MOVF 4C,W
016E: MOVWF 4D
016F: CALL 0BD
0163: BCF 03.5
0164: SWAPF 4C,W
0165: MOVWF 4D
0166: MOVLW 0F
0167: ANDWF 4D,F
0168: MOVF 4D,W
0169: MOVWF 4E
016A: CALL 0B8
.................... lcd_send_nibble(n & 0xf);
0170: MOVF 4B,W
0171: ANDLW 0F
0172: MOVWF 4C
0173: MOVWF 4D
0174: CALL 0BD
016B: MOVF 4C,W
016C: ANDLW 0F
016D: MOVWF 4D
016E: MOVWF 4E
016F: CALL 0B8
.................... }
0175: RETURN
0170: RETURN
....................
.................... #if defined(LCD_EXTENDED_NEWLINE)
.................... unsigned int8 g_LcdX, g_LcdY;
680,95 → 680,95
.................... #else
.................... #if (defined(LCD_DATA4) && defined(LCD_DATA5) && defined(LCD_DATA6) && defined(LCD_DATA7))
.................... output_drive(LCD_DATA4);
0176: BSF 03.5
0177: BCF 08.4
0171: BSF 03.5
0172: BCF 08.4
.................... output_drive(LCD_DATA5);
0178: BCF 08.5
0173: BCF 08.5
.................... output_drive(LCD_DATA6);
0179: BCF 08.6
0174: BCF 08.6
.................... output_drive(LCD_DATA7);
017A: BCF 08.7
0175: BCF 08.7
.................... #else
.................... lcdtris.data = 0x0;
.................... #endif
.................... lcd_enable_tris();
017B: BCF 09.0
0176: BCF 09.0
.................... lcd_rs_tris();
017C: BCF 09.1
0177: BCF 09.1
.................... lcd_rw_tris();
017D: BCF 09.2
0178: BCF 09.2
.................... #endif
....................
.................... lcd_output_rs(0);
017E: BCF 03.5
017F: BCF 09.1
0180: BSF 03.5
0181: BCF 09.1
0179: BCF 03.5
017A: BCF 09.1
017B: BSF 03.5
017C: BCF 09.1
.................... lcd_output_rw(0);
0182: BCF 03.5
0183: BCF 09.2
0184: BSF 03.5
0185: BCF 09.2
017D: BCF 03.5
017E: BCF 09.2
017F: BSF 03.5
0180: BCF 09.2
.................... lcd_output_enable(0);
0186: BCF 03.5
0187: BCF 09.0
0188: BSF 03.5
0189: BCF 09.0
0181: BCF 03.5
0182: BCF 09.0
0183: BSF 03.5
0184: BCF 09.0
....................
.................... delay_ms(15);
018A: MOVLW 0F
018B: BCF 03.5
018C: MOVWF 46
018D: CALL 0A9
0185: MOVLW 0F
0186: BCF 03.5
0187: MOVWF 47
0188: CALL 0A4
.................... for(i=1;i<=3;++i)
018E: MOVLW 01
018F: MOVWF 39
0190: MOVF 39,W
0191: SUBLW 03
0192: BTFSS 03.0
0193: GOTO 19C
0189: MOVLW 01
018A: MOVWF 3A
018B: MOVF 3A,W
018C: SUBLW 03
018D: BTFSS 03.0
018E: GOTO 197
.................... {
.................... lcd_send_nibble(3);
0194: MOVLW 03
0195: MOVWF 4D
0196: CALL 0BD
018F: MOVLW 03
0190: MOVWF 4E
0191: CALL 0B8
.................... delay_ms(5);
0197: MOVLW 05
0198: MOVWF 46
0199: CALL 0A9
0192: MOVLW 05
0193: MOVWF 47
0194: CALL 0A4
.................... }
019A: INCF 39,F
019B: GOTO 190
0195: INCF 3A,F
0196: GOTO 18B
....................
.................... lcd_send_nibble(2);
019C: MOVLW 02
019D: MOVWF 4D
019E: CALL 0BD
0197: MOVLW 02
0198: MOVWF 4E
0199: CALL 0B8
.................... for(i=0;i<=3;++i)
019F: CLRF 39
01A0: MOVF 39,W
01A1: SUBLW 03
01A2: BTFSS 03.0
01A3: GOTO 1AD
019A: CLRF 3A
019B: MOVF 3A,W
019C: SUBLW 03
019D: BTFSS 03.0
019E: GOTO 1A8
.................... lcd_send_byte(0,LCD_INIT_STRING[i]);
01A4: MOVF 39,W
01A5: CALL 038
01A6: MOVWF 3A
01A7: CLRF 4A
01A8: MOVF 3A,W
01A9: MOVWF 4B
01AA: CALL 11A
019F: MOVF 3A,W
01A0: CALL 038
01A1: MOVWF 3B
01A2: CLRF 4B
01A3: MOVF 3B,W
01A4: MOVWF 4C
01A5: CALL 115
....................
.................... #if defined(LCD_EXTENDED_NEWLINE)
01AB: INCF 39,F
01AC: GOTO 1A0
01A6: INCF 3A,F
01A7: GOTO 19B
.................... g_LcdX = 0;
.................... g_LcdY = 0;
.................... #endif
.................... }
01AD: BSF 0A.3
01AE: BCF 0A.4
01AF: GOTO 0B3 (RETURN)
01A8: BSF 0A.3
01A9: BCF 0A.4
01AA: GOTO 0BA (RETURN)
....................
.................... void lcd_gotoxy(BYTE x, BYTE y)
.................... {
775,29 → 775,29
.................... BYTE address;
....................
.................... if(y!=1)
01B0: DECFSZ 47,W
01B1: GOTO 1B3
01B2: GOTO 1B6
01AB: DECFSZ 48,W
01AC: GOTO 1AE
01AD: GOTO 1B1
.................... address=LCD_LINE_TWO;
01B3: MOVLW 40
01B4: MOVWF 48
01AE: MOVLW 40
01AF: MOVWF 49
.................... else
01B5: GOTO 1B7
01B0: GOTO 1B2
.................... address=0;
01B6: CLRF 48
01B1: CLRF 49
....................
.................... address+=x-1;
01B7: MOVLW 01
01B8: SUBWF 46,W
01B9: ADDWF 48,F
01B2: MOVLW 01
01B3: SUBWF 47,W
01B4: ADDWF 49,F
.................... lcd_send_byte(0,0x80|address);
01BA: MOVF 48,W
01BB: IORLW 80
01BC: MOVWF 49
01BD: CLRF 4A
01BE: MOVF 49,W
01BF: MOVWF 4B
01C0: CALL 11A
01B5: MOVF 49,W
01B6: IORLW 80
01B7: MOVWF 4A
01B8: CLRF 4B
01B9: MOVF 4A,W
01BA: MOVWF 4C
01BB: CALL 115
....................
.................... #if defined(LCD_EXTENDED_NEWLINE)
.................... g_LcdX = x - 1;
804,48 → 804,48
.................... g_LcdY = y - 1;
.................... #endif
.................... }
01C1: RETURN
01BC: RETURN
....................
.................... void lcd_putc(char c)
.................... {
.................... switch (c)
.................... {
01C2: MOVF 45,W
01C3: XORLW 07
01C4: BTFSC 03.2
01C5: GOTO 1D0
01C6: XORLW 0B
01C7: BTFSC 03.2
01C8: GOTO 1D5
01C9: XORLW 06
01CA: BTFSC 03.2
01CB: GOTO 1DD
01CC: XORLW 02
01CD: BTFSC 03.2
01CE: GOTO 1E3
01CF: GOTO 1E8
01BD: MOVF 46,W
01BE: XORLW 07
01BF: BTFSC 03.2
01C0: GOTO 1CB
01C1: XORLW 0B
01C2: BTFSC 03.2
01C3: GOTO 1D0
01C4: XORLW 06
01C5: BTFSC 03.2
01C6: GOTO 1D8
01C7: XORLW 02
01C8: BTFSC 03.2
01C9: GOTO 1DE
01CA: GOTO 1E3
.................... case '\a' : lcd_gotoxy(1,1); break;
01D0: MOVLW 01
01D1: MOVWF 46
01D2: MOVWF 47
01D3: CALL 1B0
01D4: GOTO 1EE
01CB: MOVLW 01
01CC: MOVWF 47
01CD: MOVWF 48
01CE: CALL 1AB
01CF: GOTO 1E9
....................
.................... case '\f' : lcd_send_byte(0,1);
01D5: CLRF 4A
01D6: MOVLW 01
01D7: MOVWF 4B
01D8: CALL 11A
01D0: CLRF 4B
01D1: MOVLW 01
01D2: MOVWF 4C
01D3: CALL 115
.................... delay_ms(2);
01D9: MOVLW 02
01DA: MOVWF 46
01DB: CALL 0A9
01D4: MOVLW 02
01D5: MOVWF 47
01D6: CALL 0A4
.................... #if defined(LCD_EXTENDED_NEWLINE)
.................... g_LcdX = 0;
.................... g_LcdY = 0;
.................... #endif
.................... break;
01DC: GOTO 1EE
01D7: GOTO 1E9
....................
.................... #if defined(LCD_EXTENDED_NEWLINE)
.................... case '\r' : lcd_gotoxy(1, g_LcdY+1); break;
858,20 → 858,20
.................... break;
.................... #else
.................... case '\n' : lcd_gotoxy(1,2); break;
01DD: MOVLW 01
01DE: MOVWF 46
01DF: MOVLW 02
01E0: MOVWF 47
01E1: CALL 1B0
01E2: GOTO 1EE
01D8: MOVLW 01
01D9: MOVWF 47
01DA: MOVLW 02
01DB: MOVWF 48
01DC: CALL 1AB
01DD: GOTO 1E9
.................... #endif
....................
.................... case '\b' : lcd_send_byte(0,0x10); break;
01E3: CLRF 4A
01E4: MOVLW 10
01E5: MOVWF 4B
01E6: CALL 11A
01E7: GOTO 1EE
01DE: CLRF 4B
01DF: MOVLW 10
01E0: MOVWF 4C
01E1: CALL 115
01E2: GOTO 1E9
....................
.................... #if defined(LCD_EXTENDED_NEWLINE)
.................... default :
883,16 → 883,16
.................... break;
.................... #else
.................... default : lcd_send_byte(1,c); break;
01E8: MOVLW 01
01E9: MOVWF 4A
01EA: MOVF 45,W
01EB: MOVWF 4B
01EC: CALL 11A
01ED: GOTO 1EE
01E3: MOVLW 01
01E4: MOVWF 4B
01E5: MOVF 46,W
01E6: MOVWF 4C
01E7: CALL 115
01E8: GOTO 1E9
.................... #endif
.................... }
.................... }
01EE: RETURN
01E9: RETURN
....................
.................... char lcd_getc(BYTE x, BYTE y)
.................... {
961,50 → 961,54
....................
.................... for(i=0;i<=lenght;i++)
*
060D: CLRF 3C
060E: MOVF 3C,W
060F: SUBWF 39,W
0610: BTFSS 03.0
0611: GOTO 655
0654: CLRF 3D
0655: MOVF 3D,W
0656: SUBWF 3A,W
0657: BTFSS 03.0
0658: GOTO 69C
.................... {
.................... output_toggle(BEEP);
0612: BSF 03.5
0613: BCF 08.2
0614: MOVLW 04
0615: BCF 03.5
0616: XORWF 08,F
0659: BSF 03.5
065A: BCF 08.2
065B: MOVLW 04
065C: BCF 03.5
065D: XORWF 08,F
.................... delay_us(1/frequency);
0617: CLRF 3E
0618: MOVLW 01
0619: MOVWF 3D
061A: MOVF 3B,W
061B: MOVWF 40
061C: MOVF 3A,W
061D: MOVWF 3F
065E: CLRF 3F
065F: MOVLW 01
0660: MOVWF 3E
0661: MOVF 3C,W
0662: MOVWF 41
0663: MOVF 3B,W
0664: MOVWF 40
*
0642: MOVF 79,W
0643: MOVWF 3E
0644: MOVF 78,W
0645: MOVWF 3D
0646: MOVF 3E,W
0647: MOVWF 3F
0648: INCF 3F,F
0649: DECF 3F,F
064A: BTFSC 03.2
064B: GOTO 650
064C: MOVLW FF
064D: MOVWF 40
064E: CALL 5FC
064F: GOTO 649
0650: MOVF 3D,W
0651: MOVWF 40
0652: CALL 5FC
0689: MOVF 79,W
068A: MOVWF 3F
068B: MOVF 78,W
068C: MOVWF 3E
068D: MOVF 3F,W
068E: MOVWF 40
068F: INCF 40,F
0690: DECF 40,F
0691: BTFSC 03.2
0692: GOTO 697
0693: MOVLW FF
0694: MOVWF 41
0695: CALL 643
0696: GOTO 690
0697: MOVF 3E,W
0698: MOVWF 41
0699: CALL 643
.................... }
0653: INCF 3C,F
0654: GOTO 60E
069A: INCF 3D,F
069B: GOTO 655
.................... }
0655: RETURN
069C: RETURN
....................
.................... #define TRESHOLD_setup 1
.................... #define INTERVAL_setup 0
....................
....................
.................... void main()
.................... {
*
1046,1073 → 1050,1216
0825: CLRF 31
0826: MOVLW 3C
0827: MOVWF 30
0828: CLRF 38
0829: CLRF 37
0828: BCF 36.1
0829: CLRF 38
082A: CLRF 37
082B: MOVLW 06
082C: MOVWF 39
.................... unsigned int16 integration_time=60;
.................... unsigned int16 time;
.................... unsigned int16 last_timer; // promena pro praskani
.................... unsigned int1 button_press,voltage_setup,time_setup; // semafor pro cteni tlacitek
.................... unsigned int1 button_press,setup_mode=INTERVAL_setup; // semafor pro cteni tlacitek
.................... unsigned int16 measurement_number=0;
.................... unsigned int8 treshold=6;
....................
.................... setup_adc_ports(sAN0|VSS_VDD);
082A: BSF 03.5
082B: BSF 03.6
082C: MOVF 09,W
082D: ANDLW C0
082E: MOVWF 09
082F: BCF 03.6
0830: BCF 1F.4
0831: BCF 1F.5
0832: MOVLW 01
0833: BSF 03.6
0834: MOVWF 08
082D: BSF 03.5
082E: BSF 03.6
082F: MOVF 09,W
0830: ANDLW C0
0831: MOVWF 09
0832: BCF 03.6
0833: BCF 1F.4
0834: BCF 1F.5
0835: MOVLW 01
0836: BSF 03.6
0837: MOVWF 08
.................... setup_adc(ADC_CLOCK_DIV_32);
0835: BCF 03.5
0836: BCF 03.6
0837: BCF 1F.6
0838: BSF 1F.7
0839: BSF 03.5
083A: BSF 1F.7
083B: BCF 03.5
083C: BSF 1F.0
0838: BCF 03.5
0839: BCF 03.6
083A: BCF 1F.6
083B: BSF 1F.7
083C: BSF 03.5
083D: BSF 1F.7
083E: BCF 03.5
083F: BSF 1F.0
.................... setup_spi(SPI_SS_DISABLED);
083D: BCF 14.5
083E: BCF 2F.5
083F: MOVF 2F,W
0840: BSF 03.5
0841: MOVWF 07
0842: BCF 03.5
0843: BSF 2F.4
0844: MOVF 2F,W
0845: BSF 03.5
0846: MOVWF 07
0847: BCF 03.5
0848: BCF 2F.3
0849: MOVF 2F,W
084A: BSF 03.5
084B: MOVWF 07
084C: MOVLW 01
084D: BCF 03.5
084E: MOVWF 14
084F: MOVLW 00
0850: BSF 03.5
0840: BCF 14.5
0841: BCF 2F.5
0842: MOVF 2F,W
0843: BSF 03.5
0844: MOVWF 07
0845: BCF 03.5
0846: BSF 2F.4
0847: MOVF 2F,W
0848: BSF 03.5
0849: MOVWF 07
084A: BCF 03.5
084B: BCF 2F.3
084C: MOVF 2F,W
084D: BSF 03.5
084E: MOVWF 07
084F: MOVLW 01
0850: BCF 03.5
0851: MOVWF 14
0852: MOVLW 00
0853: BSF 03.5
0854: MOVWF 14
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_256);
0852: MOVF 01,W
0853: ANDLW C0
0854: IORLW 07
0855: MOVWF 01
0855: MOVF 01,W
0856: ANDLW C0
0857: IORLW 07
0858: MOVWF 01
.................... setup_timer_1(T1_EXTERNAL|T1_DIV_BY_1);
0856: MOVLW 07
0857: BCF 03.5
0858: MOVWF 10
0859: MOVLW 07
085A: BCF 03.5
085B: MOVWF 10
.................... setup_timer_2(T2_DISABLED,0,1);
0859: MOVLW 00
085A: MOVWF 78
085B: MOVWF 12
085C: MOVLW 00
085D: BSF 03.5
085D: MOVWF 78
085E: MOVWF 12
085F: MOVLW 00
0860: BSF 03.5
0861: MOVWF 12
.................... setup_ccp1(CCP_PWM);
085F: BCF 03.5
0860: BCF 2F.2
0861: MOVF 2F,W
0862: BSF 03.5
0863: MOVWF 07
0864: BCF 03.5
0865: BCF 07.2
0866: BSF 03.5
0867: BCF 09.6
0868: MOVLW 0C
0869: BCF 03.5
086A: MOVWF 17
086B: BSF 03.5
086C: CLRF 1B
086D: CLRF 1C
086E: MOVLW 01
086F: MOVWF 1D
0862: BCF 03.5
0863: BCF 2F.2
0864: MOVF 2F,W
0865: BSF 03.5
0866: MOVWF 07
0867: BCF 03.5
0868: BCF 07.2
0869: BSF 03.5
086A: BCF 09.6
086B: MOVLW 0C
086C: BCF 03.5
086D: MOVWF 17
086E: BSF 03.5
086F: CLRF 1B
0870: CLRF 1C
0871: MOVLW 01
0872: MOVWF 1D
.................... setup_ccp2(CCP_PWM);
0870: BCF 03.5
0871: BCF 2F.1
0872: MOVF 2F,W
0873: BSF 03.5
0874: MOVWF 07
0875: BCF 03.5
0876: BCF 07.1
0877: MOVLW 0C
0878: MOVWF 1D
0879: MOVLW 01
087A: MOVWF 00
0873: BCF 03.5
0874: BCF 2F.1
0875: MOVF 2F,W
0876: BSF 03.5
0877: MOVWF 07
0878: BCF 03.5
0879: BCF 07.1
087A: MOVLW 0C
087B: MOVWF 1D
087C: MOVLW 01
087D: MOVWF 00
.................... setup_oscillator(OSC_8MHZ);
087B: MOVLW 71
087C: BSF 03.5
087D: MOVWF 0F
087E: MOVF 0F,W
087E: MOVLW 71
087F: BSF 03.5
0880: MOVWF 0F
0881: MOVF 0F,W
....................
.................... set_pwm1_duty(0);
087F: BCF 03.5
0880: CLRF 15
0882: BCF 03.5
0883: CLRF 15
.................... set_pwm2_duty(0);
0881: CLRF 1B
0884: CLRF 1B
....................
.................... output_high(LED1);
0882: BCF 2F.6
0883: MOVF 2F,W
0884: BSF 03.5
0885: MOVWF 07
0886: BCF 03.5
0887: BSF 07.6
0885: BCF 2F.6
0886: MOVF 2F,W
0887: BSF 03.5
0888: MOVWF 07
0889: BCF 03.5
088A: BSF 07.6
.................... output_high(LED2);
0888: BCF 2F.5
0889: MOVF 2F,W
088A: BSF 03.5
088B: MOVWF 07
088C: BCF 03.5
088D: BSF 07.5
088B: BCF 2F.5
088C: MOVF 2F,W
088D: BSF 03.5
088E: MOVWF 07
088F: BCF 03.5
0890: BSF 07.5
.................... output_high(LED3);
088E: BCF 2F.4
088F: MOVF 2F,W
0890: BSF 03.5
0891: MOVWF 07
0892: BCF 03.5
0893: BSF 07.4
0891: BCF 2F.4
0892: MOVF 2F,W
0893: BSF 03.5
0894: MOVWF 07
0895: BCF 03.5
0896: BSF 07.4
.................... output_high(LED4);
0894: BSF 03.5
0895: BCF 08.3
0896: BCF 03.5
0897: BSF 08.3
0897: BSF 03.5
0898: BCF 08.3
0899: BCF 03.5
089A: BSF 08.3
.................... output_low(BEEP);
0898: BSF 03.5
0899: BCF 08.2
089A: BCF 03.5
089B: BCF 08.2
089B: BSF 03.5
089C: BCF 08.2
089D: BCF 03.5
089E: BCF 08.2
....................
.................... setup_comparator(CP2_A0_VREF|CP2_OUT_ON_A5); // sets two comparators(A1 and VR and A2 as the output)
089C: BSF 03.6
089D: CLRF 07
089E: MOVLW A4
089F: MOVWF 08
08A0: MOVLW 10
08A1: MOVWF 09
08A2: BSF 03.5
08A3: BCF 03.6
08A4: BCF 05.5
08A5: BSF 05.0
.................... setup_vref(VREF_HIGH|6); //sets 3.6(vdd *value/32 +vdd/4) if vdd is 5.0V
08A6: MOVLW 86
08A7: MOVWF 17
089F: BSF 03.6
08A0: CLRF 07
08A1: MOVLW A4
08A2: MOVWF 08
08A3: MOVLW 10
08A4: MOVWF 09
08A5: BSF 03.5
08A6: BCF 03.6
08A7: BCF 05.5
08A8: BSF 05.0
.................... setup_vref(VREF_HIGH|treshold); //sets 3.6(vdd *value/32 +vdd/4) if vdd is 5.0V
08A9: BCF 03.5
08AA: MOVF 39,W
08AB: IORLW 80
08AC: MOVWF 3A
08AD: BSF 03.5
08AE: MOVWF 17
.................... enable_interrupts(INT_COMP); //enables the comparator interrupt
08A8: BSF 0D.5
08AF: BSF 0D.5
.................... enable_interrupts(INT_RTCC);
08A9: BCF 03.5
08AA: BSF 0B.5
08B0: BCF 03.5
08B1: BSF 0B.5
.................... enable_interrupts(INT_TIMER1);
08AB: BSF 03.5
08AC: BSF 0C.0
08B2: BSF 03.5
08B3: BSF 0C.0
.................... enable_interrupts(INT_TIMER2);
08AD: BSF 0C.1
08B4: BSF 0C.1
.................... enable_interrupts(GLOBAL);
08AE: MOVLW C0
08AF: BCF 03.5
08B0: IORWF 0B,F
08B5: MOVLW C0
08B6: BCF 03.5
08B7: IORWF 0B,F
.................... lcd_init();
08B1: BCF 0A.3
08B2: GOTO 176
08B3: BSF 0A.3
08B8: BCF 0A.3
08B9: GOTO 171
08BA: BSF 0A.3
....................
.................... lcd_putc("\fGM counter V1.0 \n 2013 MLAB");
08B4: MOVLW 5A
08B5: BSF 03.6
08B6: MOVWF 0D
08B7: MOVLW 00
08B8: MOVWF 0F
08B9: BCF 0A.3
08BA: BCF 03.6
08BB: CALL 1EF
08BC: BSF 0A.3
08BB: MOVLW 5A
08BC: BSF 03.6
08BD: MOVWF 0D
08BE: MOVLW 00
08BF: MOVWF 0F
08C0: BCF 0A.3
08C1: BCF 03.6
08C2: CALL 1EA
08C3: BSF 0A.3
.................... printf("Geiger-Muller Counter V1.0 \r\n");
08BD: MOVLW 6A
08BE: BSF 03.6
08BF: MOVWF 0D
08C0: MOVLW 00
08C1: MOVWF 0F
08C2: BCF 0A.3
08C3: BCF 03.6
08C4: CALL 257
08C5: BSF 0A.3
08C4: MOVLW 6A
08C5: BSF 03.6
08C6: MOVWF 0D
08C7: MOVLW 00
08C8: MOVWF 0F
08C9: BCF 0A.3
08CA: BCF 03.6
08CB: CALL 252
08CC: BSF 0A.3
.................... printf("(c) 2013 MLAB and UST.cz \r\n");
08C6: MOVLW 79
08C7: BSF 03.6
08C8: MOVWF 0D
08C9: MOVLW 00
08CA: MOVWF 0F
08CB: BCF 0A.3
08CC: BCF 03.6
08CD: CALL 257
08CE: BSF 0A.3
08CD: MOVLW 79
08CE: BSF 03.6
08CF: MOVWF 0D
08D0: MOVLW 00
08D1: MOVWF 0F
08D2: BCF 0A.3
08D3: BCF 03.6
08D4: CALL 252
08D5: BSF 0A.3
.................... Delay_ms(1000);
08CF: MOVLW 04
08D0: MOVWF 39
08D1: MOVLW FA
08D2: MOVWF 46
08D3: BCF 0A.3
08D4: CALL 0A9
08D5: BSF 0A.3
08D6: DECFSZ 39,F
08D7: GOTO 0D1
08D6: MOVLW 04
08D7: MOVWF 3A
08D8: MOVLW FA
08D9: MOVWF 47
08DA: BCF 0A.3
08DB: CALL 0A4
08DC: BSF 0A.3
08DD: DECFSZ 3A,F
08DE: GOTO 0D8
....................
.................... lcd_putc("\f");
08D8: MOVLW 87
08D9: BSF 03.6
08DA: MOVWF 0D
08DB: MOVLW 00
08DC: MOVWF 0F
08DD: BCF 0A.3
08DE: BCF 03.6
08DF: CALL 1EF
08E0: BSF 0A.3
08DF: MOVLW 87
08E0: BSF 03.6
08E1: MOVWF 0D
08E2: MOVLW 00
08E3: MOVWF 0F
08E4: BCF 0A.3
08E5: BCF 03.6
08E6: CALL 1EA
08E7: BSF 0A.3
.................... printf("\r\n");
08E1: MOVLW 0D
08E2: MOVWF 45
08E3: BCF 0A.3
08E4: CALL 235
08E5: BSF 0A.3
08E6: MOVLW 0A
08E7: MOVWF 45
08E8: BCF 0A.3
08E9: CALL 235
08EA: BSF 0A.3
08E8: MOVLW 0D
08E9: MOVWF 46
08EA: BCF 0A.3
08EB: CALL 230
08EC: BSF 0A.3
08ED: MOVLW 0A
08EE: MOVWF 46
08EF: BCF 0A.3
08F0: CALL 230
08F1: BSF 0A.3
....................
.................... set_timer1(0);
08EB: CLRF 0F
08EC: CLRF 0E
08F2: CLRF 0F
08F3: CLRF 0E
....................
.................... lcd_gotoxy(1,1); // vypsani hodnoty count, abz byla na LCD hned od zapnuti
08ED: MOVLW 01
08EE: MOVWF 46
08EF: MOVWF 47
08F0: BCF 0A.3
08F1: CALL 1B0
08F2: BSF 0A.3
08F4: MOVLW 01
08F5: MOVWF 47
08F6: MOVWF 48
08F7: BCF 0A.3
08F8: CALL 1AB
08F9: BSF 0A.3
.................... printf(lcd_putc,"Count:%lu ",pulse_count);
08F3: MOVLW 88
08F4: BSF 03.6
08F5: MOVWF 0D
08F6: MOVLW 00
08F7: MOVWF 0F
08F8: BCF 03.0
08F9: MOVLW 06
08FA: BCF 03.6
08FB: MOVWF 39
08FC: BCF 0A.3
08FD: CALL 29D
08FE: BSF 0A.3
08FF: MOVLW 41
0900: MOVWF 04
0901: MOVF 2A,W
0902: MOVWF 3C
0903: MOVF 29,W
0904: MOVWF 3B
0905: MOVF 28,W
0906: MOVWF 3A
0907: MOVF 27,W
0908: MOVWF 39
0909: BCF 0A.3
090A: CALL 32E
090B: BSF 0A.3
090C: MOVLW 8C
090D: BSF 03.6
090E: MOVWF 0D
090F: MOVLW 00
0910: MOVWF 0F
0911: BSF 03.0
0912: MOVLW 05
0913: BCF 03.6
0914: MOVWF 39
0915: BCF 0A.3
0916: CALL 29D
0917: BSF 0A.3
08FA: MOVLW 88
08FB: BSF 03.6
08FC: MOVWF 0D
08FD: MOVLW 00
08FE: MOVWF 0F
08FF: BCF 03.0
0900: MOVLW 06
0901: BCF 03.6
0902: MOVWF 3A
0903: BCF 0A.3
0904: CALL 298
0905: BSF 0A.3
0906: MOVLW 41
0907: MOVWF 04
0908: MOVF 2A,W
0909: MOVWF 3D
090A: MOVF 29,W
090B: MOVWF 3C
090C: MOVF 28,W
090D: MOVWF 3B
090E: MOVF 27,W
090F: MOVWF 3A
0910: BCF 0A.3
0911: CALL 329
0912: BSF 0A.3
0913: MOVLW 8C
0914: BSF 03.6
0915: MOVWF 0D
0916: MOVLW 00
0917: MOVWF 0F
0918: BSF 03.0
0919: MOVLW 05
091A: BCF 03.6
091B: MOVWF 3A
091C: BCF 0A.3
091D: CALL 298
091E: BSF 0A.3
....................
.................... while(true)
.................... {
.................... pulse_count = get_timer1() + (0xffff * overflow_count); // compute pulse count
0918: MOVF 0F,W
0919: MOVWF 7A
091A: MOVF 0E,W
091B: MOVWF 77
091C: MOVF 0F,W
091D: SUBWF 7A,W
091E: BTFSS 03.2
091F: GOTO 118
0920: MOVF 77,W
0921: MOVWF 39
0922: MOVF 7A,W
0923: MOVWF 3A
0924: MOVLW FF
0925: MOVWF 3C
0926: MOVWF 3B
0927: MOVF 2C,W
0928: MOVWF 3E
0929: MOVF 2B,W
092A: MOVWF 3D
092B: BCF 0A.3
092C: GOTO 38A
092D: BSF 0A.3
092E: MOVF 79,W
092F: MOVWF 7A
0930: MOVF 78,W
0931: ADDWF 39,W
0932: MOVWF 27
0933: MOVF 3A,W
0934: MOVWF 28
0935: MOVF 7A,W
0936: BTFSC 03.0
0937: INCFSZ 7A,W
0938: ADDWF 28,F
0939: CLRF 29
093A: CLRF 2A
091F: MOVF 0F,W
0920: MOVWF 7A
0921: MOVF 0E,W
0922: MOVWF 77
0923: MOVF 0F,W
0924: SUBWF 7A,W
0925: BTFSS 03.2
0926: GOTO 11F
0927: MOVF 77,W
0928: MOVWF 3A
0929: MOVF 7A,W
092A: MOVWF 3B
092B: MOVLW FF
092C: MOVWF 3D
092D: MOVWF 3C
092E: MOVF 2C,W
092F: MOVWF 3F
0930: MOVF 2B,W
0931: MOVWF 3E
0932: BCF 0A.3
0933: GOTO 385
0934: BSF 0A.3
0935: MOVF 79,W
0936: MOVWF 7A
0937: MOVF 78,W
0938: ADDWF 3A,W
0939: MOVWF 27
093A: MOVF 3B,W
093B: MOVWF 28
093C: MOVF 7A,W
093D: BTFSC 03.0
093E: INCFSZ 7A,W
093F: ADDWF 28,F
0940: CLRF 29
0941: CLRF 2A
.................... time = integration_time + 1 - (time_overflow_count * 0.0327); // compute time interval
093B: MOVLW 01
093C: ADDWF 30,W
093D: MOVWF 39
093E: MOVF 31,W
093F: MOVWF 3A
0940: BTFSC 03.0
0941: INCF 3A,F
0942: MOVF 2E,W
0943: MOVWF 40
0944: MOVF 2D,W
0945: MOVWF 3F
0946: BCF 0A.3
0947: CALL 3A1
0948: BSF 0A.3
0949: MOVF 7A,W
094A: MOVWF 3E
094B: MOVF 79,W
094C: MOVWF 3D
094D: MOVF 78,W
094E: MOVWF 3C
094F: MOVF 77,W
0950: MOVWF 3B
0951: MOVLW 6F
0952: MOVWF 42
0953: MOVLW F0
0954: MOVWF 41
0955: MOVLW 05
0956: MOVWF 40
0957: MOVLW 7A
0958: MOVWF 3F
0959: BCF 0A.3
095A: GOTO 3BE
095B: BSF 0A.3
095C: MOVF 77,W
095D: MOVWF 3B
095E: MOVF 78,W
095F: MOVWF 3C
0960: MOVF 79,W
0961: MOVWF 3D
0962: MOVF 7A,W
0963: MOVWF 3E
0964: MOVF 3A,W
0965: MOVWF 40
0966: MOVF 39,W
0967: MOVWF 3F
0968: BCF 0A.3
0969: CALL 3A1
096A: BSF 0A.3
096B: BSF 03.1
096C: MOVF 7A,W
096D: MOVWF 42
096E: MOVF 79,W
096F: MOVWF 41
0970: MOVF 78,W
0971: MOVWF 40
0972: MOVF 77,W
0973: MOVWF 3F
0974: MOVF 3E,W
0975: MOVWF 46
0976: MOVF 3D,W
0977: MOVWF 45
0978: MOVF 3C,W
0979: MOVWF 44
097A: MOVF 3B,W
097B: MOVWF 43
097C: BCF 0A.3
097D: GOTO 435
097E: BSF 0A.3
097F: MOVF 7A,W
0980: MOVWF 42
0981: MOVF 79,W
0982: MOVWF 41
0983: MOVF 78,W
0984: MOVWF 40
0985: MOVF 77,W
0986: MOVWF 3F
0987: BCF 0A.3
0988: GOTO 578
0989: BSF 0A.3
098A: MOVF 79,W
098B: MOVWF 33
098C: MOVF 78,W
098D: MOVWF 32
0942: MOVLW 01
0943: ADDWF 30,W
0944: MOVWF 3A
0945: MOVF 31,W
0946: MOVWF 3B
0947: BTFSC 03.0
0948: INCF 3B,F
0949: MOVF 2E,W
094A: MOVWF 41
094B: MOVF 2D,W
094C: MOVWF 40
094D: BCF 0A.3
094E: CALL 39C
094F: BSF 0A.3
0950: MOVF 7A,W
0951: MOVWF 3F
0952: MOVF 79,W
0953: MOVWF 3E
0954: MOVF 78,W
0955: MOVWF 3D
0956: MOVF 77,W
0957: MOVWF 3C
0958: MOVLW 6F
0959: MOVWF 43
095A: MOVLW F0
095B: MOVWF 42
095C: MOVLW 05
095D: MOVWF 41
095E: MOVLW 7A
095F: MOVWF 40
0960: BCF 0A.3
0961: GOTO 3B9
0962: BSF 0A.3
0963: MOVF 77,W
0964: MOVWF 3C
0965: MOVF 78,W
0966: MOVWF 3D
0967: MOVF 79,W
0968: MOVWF 3E
0969: MOVF 7A,W
096A: MOVWF 3F
096B: MOVF 3B,W
096C: MOVWF 41
096D: MOVF 3A,W
096E: MOVWF 40
096F: BCF 0A.3
0970: CALL 39C
0971: BSF 0A.3
0972: BSF 03.1
0973: MOVF 7A,W
0974: MOVWF 43
0975: MOVF 79,W
0976: MOVWF 42
0977: MOVF 78,W
0978: MOVWF 41
0979: MOVF 77,W
097A: MOVWF 40
097B: MOVF 3F,W
097C: MOVWF 47
097D: MOVF 3E,W
097E: MOVWF 46
097F: MOVF 3D,W
0980: MOVWF 45
0981: MOVF 3C,W
0982: MOVWF 44
0983: BCF 0A.3
0984: GOTO 430
0985: BSF 0A.3
0986: MOVF 7A,W
0987: MOVWF 43
0988: MOVF 79,W
0989: MOVWF 42
098A: MOVF 78,W
098B: MOVWF 41
098C: MOVF 77,W
098D: MOVWF 40
098E: BCF 0A.3
098F: GOTO 573
0990: BSF 0A.3
0991: MOVF 79,W
0992: MOVWF 33
0993: MOVF 78,W
0994: MOVWF 32
....................
.................... if(get_timer1() != last_timer) // timer count increment detection
098E: MOVF 0F,W
098F: MOVWF 7A
0990: MOVF 0E,W
0991: MOVWF 77
0992: MOVF 0F,W
0993: SUBWF 7A,W
0994: BTFSS 03.2
0995: GOTO 18E
0996: MOVF 77,W
0997: MOVWF 39
0998: MOVF 7A,W
0999: MOVWF 3A
099A: MOVF 34,W
099B: SUBWF 39,W
099C: BTFSS 03.2
099D: GOTO 1A2
099E: MOVF 35,W
099F: SUBWF 3A,W
09A0: BTFSC 03.2
09A1: GOTO 1EF
0995: MOVF 0F,W
0996: MOVWF 7A
0997: MOVF 0E,W
0998: MOVWF 77
0999: MOVF 0F,W
099A: SUBWF 7A,W
099B: BTFSS 03.2
099C: GOTO 195
099D: MOVF 77,W
099E: MOVWF 3A
099F: MOVF 7A,W
09A0: MOVWF 3B
09A1: MOVF 34,W
09A2: SUBWF 3A,W
09A3: BTFSS 03.2
09A4: GOTO 1A9
09A5: MOVF 35,W
09A6: SUBWF 3B,W
09A7: BTFSC 03.2
09A8: GOTO 1F6
.................... {
.................... output_toggle(BEEP);
09A2: BSF 03.5
09A3: BCF 08.2
09A4: MOVLW 04
09A5: BCF 03.5
09A6: XORWF 08,F
09A9: BSF 03.5
09AA: BCF 08.2
09AB: MOVLW 04
09AC: BCF 03.5
09AD: XORWF 08,F
.................... delay_ms(1);
09A7: MOVLW 01
09A8: MOVWF 46
09A9: BCF 0A.3
09AA: CALL 0A9
09AB: BSF 0A.3
09AE: MOVLW 01
09AF: MOVWF 47
09B0: BCF 0A.3
09B1: CALL 0A4
09B2: BSF 0A.3
.................... output_toggle(BEEP);
09AC: BSF 03.5
09AD: BCF 08.2
09AE: MOVLW 04
09AF: BCF 03.5
09B0: XORWF 08,F
.................... output_toggle(LED3);
09B1: BCF 2F.4
09B2: MOVF 2F,W
09B3: BSF 03.5
09B4: MOVWF 07
09B5: MOVLW 10
09B4: BCF 08.2
09B5: MOVLW 04
09B6: BCF 03.5
09B7: XORWF 07,F
09B7: XORWF 08,F
.................... output_toggle(LED3);
09B8: BCF 2F.4
09B9: MOVF 2F,W
09BA: BSF 03.5
09BB: MOVWF 07
09BC: MOVLW 10
09BD: BCF 03.5
09BE: XORWF 07,F
.................... last_timer=get_timer1();
09B8: MOVF 0F,W
09B9: MOVWF 7A
09BA: MOVF 0E,W
09BB: MOVWF 77
09BC: MOVF 0F,W
09BD: SUBWF 7A,W
09BE: BTFSS 03.2
09BF: GOTO 1B8
09C0: MOVF 77,W
09C1: MOVWF 34
09C2: MOVF 7A,W
09C3: MOVWF 35
09BF: MOVF 0F,W
09C0: MOVWF 7A
09C1: MOVF 0E,W
09C2: MOVWF 77
09C3: MOVF 0F,W
09C4: SUBWF 7A,W
09C5: BTFSS 03.2
09C6: GOTO 1BF
09C7: MOVF 77,W
09C8: MOVWF 34
09C9: MOVF 7A,W
09CA: MOVWF 35
.................... lcd_gotoxy(1,1); // prepsani dat na displeje
09C4: MOVLW 01
09C5: MOVWF 46
09C6: MOVWF 47
09C7: BCF 0A.3
09C8: CALL 1B0
09C9: BSF 0A.3
09CB: MOVLW 01
09CC: MOVWF 47
09CD: MOVWF 48
09CE: BCF 0A.3
09CF: CALL 1AB
09D0: BSF 0A.3
.................... printf(lcd_putc,"Count:%lu ",pulse_count);
09CA: MOVLW 90
09CB: BSF 03.6
09CC: MOVWF 0D
09CD: MOVLW 00
09CE: MOVWF 0F
09CF: BCF 03.0
09D0: MOVLW 06
09D1: BCF 03.6
09D2: MOVWF 39
09D3: BCF 0A.3
09D4: CALL 29D
09D5: BSF 0A.3
09D6: MOVLW 41
09D7: MOVWF 04
09D8: MOVF 2A,W
09D9: MOVWF 3C
09DA: MOVF 29,W
09DB: MOVWF 3B
09DC: MOVF 28,W
09DD: MOVWF 3A
09DE: MOVF 27,W
09DF: MOVWF 39
09E0: BCF 0A.3
09E1: CALL 32E
09E2: BSF 0A.3
09E3: MOVLW 94
09E4: BSF 03.6
09E5: MOVWF 0D
09E6: MOVLW 00
09E7: MOVWF 0F
09E8: BSF 03.0
09E9: MOVLW 05
09EA: BCF 03.6
09EB: MOVWF 39
09EC: BCF 0A.3
09ED: CALL 29D
09EE: BSF 0A.3
09D1: MOVLW 90
09D2: BSF 03.6
09D3: MOVWF 0D
09D4: MOVLW 00
09D5: MOVWF 0F
09D6: BCF 03.0
09D7: MOVLW 06
09D8: BCF 03.6
09D9: MOVWF 3A
09DA: BCF 0A.3
09DB: CALL 298
09DC: BSF 0A.3
09DD: MOVLW 41
09DE: MOVWF 04
09DF: MOVF 2A,W
09E0: MOVWF 3D
09E1: MOVF 29,W
09E2: MOVWF 3C
09E3: MOVF 28,W
09E4: MOVWF 3B
09E5: MOVF 27,W
09E6: MOVWF 3A
09E7: BCF 0A.3
09E8: CALL 329
09E9: BSF 0A.3
09EA: MOVLW 94
09EB: BSF 03.6
09EC: MOVWF 0D
09ED: MOVLW 00
09EE: MOVWF 0F
09EF: BSF 03.0
09F0: MOVLW 05
09F1: BCF 03.6
09F2: MOVWF 3A
09F3: BCF 0A.3
09F4: CALL 298
09F5: BSF 0A.3
.................... }
....................
.................... lcd_gotoxy(1,2);
09EF: MOVLW 01
09F0: MOVWF 46
09F1: MOVLW 02
09F2: MOVWF 47
09F3: BCF 0A.3
09F4: CALL 1B0
09F5: BSF 0A.3
.................... printf(lcd_putc,"T:%lu ",time);
09F6: MOVLW 54
09F7: MOVWF 45
09F8: BCF 0A.3
09F9: CALL 1C2
09FA: BSF 0A.3
09FB: MOVLW 3A
09FC: MOVWF 45
09FD: BCF 0A.3
09FE: CALL 1C2
09FF: BSF 0A.3
0A00: MOVLW 10
0A01: MOVWF 04
0A02: MOVF 33,W
0A03: MOVWF 3A
0A04: MOVF 32,W
0A05: MOVWF 39
0A06: BCF 0A.3
0A07: CALL 599
0A08: BSF 0A.3
0A09: MOVLW 20
0A0A: MOVWF 45
0A0B: BCF 0A.3
0A0C: CALL 1C2
0A0D: BSF 0A.3
0A0E: MOVLW 20
0A0F: MOVWF 45
0A10: BCF 0A.3
0A11: CALL 1C2
0A12: BSF 0A.3
0A13: MOVLW 20
0A14: MOVWF 45
0A15: BCF 0A.3
0A16: CALL 1C2
0A17: BSF 0A.3
.................... lcd_gotoxy(9,2);
0A18: MOVLW 09
0A19: MOVWF 46
0A1A: MOVLW 02
0A1B: MOVWF 47
09F6: MOVLW 01
09F7: MOVWF 47
09F8: MOVLW 02
09F9: MOVWF 48
09FA: BCF 0A.3
09FB: CALL 1AB
09FC: BSF 0A.3
.................... printf(lcd_putc,"T:%3lu I:%3lu U:%2u ",time,integration_time,treshold);
09FD: MOVLW 54
09FE: MOVWF 46
09FF: BCF 0A.3
0A00: CALL 1BD
0A01: BSF 0A.3
0A02: MOVLW 3A
0A03: MOVWF 46
0A04: BCF 0A.3
0A05: CALL 1BD
0A06: BSF 0A.3
0A07: MOVLW 02
0A08: MOVWF 04
0A09: MOVF 33,W
0A0A: MOVWF 3B
0A0B: MOVF 32,W
0A0C: MOVWF 3A
0A0D: BCF 0A.3
0A0E: CALL 594
0A0F: BSF 0A.3
0A10: MOVLW 20
0A11: MOVWF 46
0A12: BCF 0A.3
0A13: CALL 1BD
0A14: BSF 0A.3
0A15: MOVLW 49
0A16: MOVWF 46
0A17: BCF 0A.3
0A18: CALL 1BD
0A19: BSF 0A.3
0A1A: MOVLW 3A
0A1B: MOVWF 46
0A1C: BCF 0A.3
0A1D: CALL 1B0
0A1D: CALL 1BD
0A1E: BSF 0A.3
.................... printf(lcd_putc,"I:%lu ", integration_time);
0A1F: MOVLW 49
0A20: MOVWF 45
0A21: BCF 0A.3
0A22: CALL 1C2
0A23: BSF 0A.3
0A24: MOVLW 3A
0A25: MOVWF 45
0A26: BCF 0A.3
0A27: CALL 1C2
0A28: BSF 0A.3
0A29: MOVLW 10
0A2A: MOVWF 04
0A2B: MOVF 31,W
0A2C: MOVWF 3A
0A2D: MOVF 30,W
0A2E: MOVWF 39
0A1F: MOVLW 02
0A20: MOVWF 04
0A21: MOVF 31,W
0A22: MOVWF 3B
0A23: MOVF 30,W
0A24: MOVWF 3A
0A25: BCF 0A.3
0A26: CALL 594
0A27: BSF 0A.3
0A28: MOVLW 20
0A29: MOVWF 46
0A2A: BCF 0A.3
0A2B: CALL 1BD
0A2C: BSF 0A.3
0A2D: MOVLW 55
0A2E: MOVWF 46
0A2F: BCF 0A.3
0A30: CALL 599
0A30: CALL 1BD
0A31: BSF 0A.3
0A32: MOVLW 9A
0A33: BSF 03.6
0A34: MOVWF 0D
0A35: MOVLW 00
0A36: MOVWF 0F
0A37: BSF 03.0
0A38: MOVLW 04
0A39: BCF 03.6
0A3A: MOVWF 39
0A32: MOVLW 3A
0A33: MOVWF 46
0A34: BCF 0A.3
0A35: CALL 1BD
0A36: BSF 0A.3
0A37: MOVF 39,W
0A38: MOVWF 3A
0A39: MOVLW 11
0A3A: MOVWF 3B
0A3B: BCF 0A.3
0A3C: CALL 29D
0A3C: GOTO 60C
0A3D: BSF 0A.3
0A3E: MOVLW 20
0A3F: MOVWF 46
0A40: BCF 0A.3
0A41: CALL 1BD
0A42: BSF 0A.3
.................... // printf(lcd_putc,"I:%4lu ", integration_time);
....................
.................... if(time == 0) // po uplynuti mereneho intervalu vypis na seriovku
0A3E: MOVF 32,F
0A3F: BTFSS 03.2
0A40: GOTO 298
0A41: MOVF 33,F
0A42: BTFSS 03.2
0A43: GOTO 298
0A43: MOVF 32,F
0A44: BTFSS 03.2
0A45: GOTO 29D
0A46: MOVF 33,F
0A47: BTFSS 03.2
0A48: GOTO 29D
.................... {
.................... set_timer0(0);
0A44: CLRF 01
0A49: CLRF 01
.................... time_overflow_count=0;
0A45: CLRF 2E
0A46: CLRF 2D
0A4A: CLRF 2E
0A4B: CLRF 2D
.................... sound_beep(1000,700);
0A47: MOVLW E8
0A48: MOVWF 39
0A49: MOVLW 02
0A4A: MOVWF 3B
0A4B: MOVLW BC
0A4C: MOVWF 3A
0A4D: BCF 0A.3
0A4E: CALL 60D
0A4F: BSF 0A.3
0A4C: MOVLW E8
0A4D: MOVWF 3A
0A4E: MOVLW 02
0A4F: MOVWF 3C
0A50: MOVLW BC
0A51: MOVWF 3B
0A52: BCF 0A.3
0A53: CALL 654
0A54: BSF 0A.3
.................... printf("$GMC1.0 %lu %lu %lu \r\n", measurement_number, integration_time, pulse_count);
0A50: MOVLW 9D
0A51: BSF 03.6
0A52: MOVWF 0D
0A53: MOVLW 00
0A54: MOVWF 0F
0A55: BCF 03.0
0A56: MOVLW 08
0A57: BCF 03.6
0A58: MOVWF 39
0A59: BCF 0A.3
0A5A: CALL 656
0A5B: BSF 0A.3
0A5C: MOVLW 10
0A5D: MOVWF 04
0A5E: MOVF 38,W
0A5F: MOVWF 3A
0A60: MOVF 37,W
0A61: MOVWF 39
0A62: BCF 0A.3
0A63: CALL 6A5
0A64: BSF 0A.3
0A65: MOVLW 20
0A66: MOVWF 45
0A55: MOVLW 98
0A56: BSF 03.6
0A57: MOVWF 0D
0A58: MOVLW 00
0A59: MOVWF 0F
0A5A: BCF 03.0
0A5B: MOVLW 08
0A5C: BCF 03.6
0A5D: MOVWF 3A
0A5E: BCF 0A.3
0A5F: CALL 69D
0A60: BSF 0A.3
0A61: MOVLW 10
0A62: MOVWF 04
0A63: MOVF 38,W
0A64: MOVWF 3B
0A65: MOVF 37,W
0A66: MOVWF 3A
0A67: BCF 0A.3
0A68: CALL 235
0A68: CALL 6EC
0A69: BSF 0A.3
0A6A: MOVLW 10
0A6B: MOVWF 04
0A6C: MOVF 31,W
0A6D: MOVWF 3A
0A6E: MOVF 30,W
0A6F: MOVWF 39
0A70: BCF 0A.3
0A71: CALL 6A5
0A72: BSF 0A.3
0A73: MOVLW 20
0A74: MOVWF 45
0A6A: MOVLW 20
0A6B: MOVWF 46
0A6C: BCF 0A.3
0A6D: CALL 230
0A6E: BSF 0A.3
0A6F: MOVLW 10
0A70: MOVWF 04
0A71: MOVF 31,W
0A72: MOVWF 3B
0A73: MOVF 30,W
0A74: MOVWF 3A
0A75: BCF 0A.3
0A76: CALL 235
0A76: CALL 6EC
0A77: BSF 0A.3
0A78: MOVLW 41
0A79: MOVWF 04
0A7A: MOVF 2A,W
0A7B: MOVWF 3C
0A7C: MOVF 29,W
0A7D: MOVWF 3B
0A7E: MOVF 28,W
0A7F: MOVWF 3A
0A80: MOVF 27,W
0A81: MOVWF 39
0A82: BCF 0A.3
0A83: GOTO 708
0A84: BSF 0A.3
0A85: MOVLW A6
0A86: BSF 03.6
0A87: MOVWF 0D
0A88: MOVLW 00
0A89: MOVWF 0F
0A8A: BSF 03.0
0A8B: MOVLW 04
0A8C: BCF 03.6
0A8D: MOVWF 39
0A8E: BCF 0A.3
0A8F: CALL 656
0A90: BSF 0A.3
0A78: MOVLW 20
0A79: MOVWF 46
0A7A: BCF 0A.3
0A7B: CALL 230
0A7C: BSF 0A.3
0A7D: MOVLW 41
0A7E: MOVWF 04
0A7F: MOVF 2A,W
0A80: MOVWF 3D
0A81: MOVF 29,W
0A82: MOVWF 3C
0A83: MOVF 28,W
0A84: MOVWF 3B
0A85: MOVF 27,W
0A86: MOVWF 3A
0A87: BCF 0A.3
0A88: GOTO 74F
0A89: BSF 0A.3
0A8A: MOVLW A1
0A8B: BSF 03.6
0A8C: MOVWF 0D
0A8D: MOVLW 00
0A8E: MOVWF 0F
0A8F: BSF 03.0
0A90: MOVLW 04
0A91: BCF 03.6
0A92: MOVWF 3A
0A93: BCF 0A.3
0A94: CALL 69D
0A95: BSF 0A.3
.................... set_timer1(0);
0A91: CLRF 0F
0A92: CLRF 0E
0A96: CLRF 0F
0A97: CLRF 0E
.................... overflow_count=0;
0A93: CLRF 2C
0A94: CLRF 2B
0A98: CLRF 2C
0A99: CLRF 2B
.................... measurement_number++;
0A95: INCF 37,F
0A96: BTFSC 03.2
0A97: INCF 38,F
0A9A: INCF 37,F
0A9B: BTFSC 03.2
0A9C: INCF 38,F
.................... }
....................
.................... if(button_press==false ) // tlacitka se ctou znovu pouze pokud v redchozim cyklu nebyla zmacknuta.
0A98: BTFSC 36.0
0A99: GOTO 37E
0A9D: BTFSC 36.0
0A9E: GOTO 3EF
.................... {
.................... if(!input(S1))
0A9A: BSF 2F.2
0A9B: MOVF 2F,W
0A9C: BSF 03.5
0A9D: MOVWF 07
0A9E: BCF 03.5
0A9F: BTFSC 07.2
0AA0: GOTO 2C7
0A9F: BSF 2F.2
0AA0: MOVF 2F,W
0AA1: BSF 03.5
0AA2: MOVWF 07
0AA3: BCF 03.5
0AA4: BTFSC 07.2
0AA5: GOTO 2E2
.................... {
.................... delay_ms(20);
0AA1: MOVLW 14
0AA2: MOVWF 46
0AA3: BCF 0A.3
0AA4: CALL 0A9
0AA5: BSF 0A.3
0AA6: MOVLW 14
0AA7: MOVWF 47
0AA8: BCF 0A.3
0AA9: CALL 0A4
0AAA: BSF 0A.3
.................... if(!input(S1))
0AA6: BSF 2F.2
0AA7: MOVF 2F,W
0AA8: BSF 03.5
0AA9: MOVWF 07
0AAA: BCF 03.5
0AAB: BTFSC 07.2
0AAC: GOTO 2C7
0AAB: BSF 2F.2
0AAC: MOVF 2F,W
0AAD: BSF 03.5
0AAE: MOVWF 07
0AAF: BCF 03.5
0AB0: BTFSC 07.2
0AB1: GOTO 2E2
.................... {
.................... button_press=true;
0AAD: BSF 36.0
.................... if(time_setup==TRUE)
0AAE: BTFSS 36.2
0AAF: GOTO 2C7
0AB2: BSF 36.0
.................... sound_beep(100,700);
0AB3: MOVLW 64
0AB4: MOVWF 3A
0AB5: MOVLW 02
0AB6: MOVWF 3C
0AB7: MOVLW BC
0AB8: MOVWF 3B
0AB9: BCF 0A.3
0ABA: CALL 654
0ABB: BSF 0A.3
.................... switch (setup_mode)
.................... {
.................... sound_beep(100,700);
0AB0: MOVLW 64
0AB1: MOVWF 39
0AB2: MOVLW 02
0AB3: MOVWF 3B
0AB4: MOVLW BC
0AB5: MOVWF 3A
0AB6: BCF 0A.3
0AB7: CALL 60D
0AB8: BSF 0A.3
.................... if(integration_time < 0xfffa ) integration_time+=5;
0AB9: MOVF 31,W
0ABA: SUBLW FF
0ABB: BTFSS 03.0
0ABC: GOTO 2C7
0ABD: BTFSS 03.2
0ABE: GOTO 2C3
0ABF: MOVF 30,W
0AC0: SUBLW F9
0AC1: BTFSS 03.0
0AC2: GOTO 2C7
0AC3: MOVLW 05
0AC4: ADDWF 30,F
0AC5: BTFSC 03.0
0AC6: INCF 31,F
0ABC: MOVLW 00
0ABD: BTFSC 36.1
0ABE: MOVLW 01
0ABF: XORLW 00
0AC0: BTFSC 03.2
0AC1: GOTO 2C6
0AC2: XORLW 01
0AC3: BTFSC 03.2
0AC4: GOTO 2D5
0AC5: GOTO 2E2
.................... case INTERVAL_setup:
.................... if(integration_time < 0xfffa ) integration_time+=5;
0AC6: MOVF 31,W
0AC7: SUBLW FF
0AC8: BTFSS 03.0
0AC9: GOTO 2D4
0ACA: BTFSS 03.2
0ACB: GOTO 2D0
0ACC: MOVF 30,W
0ACD: SUBLW F9
0ACE: BTFSS 03.0
0ACF: GOTO 2D4
0AD0: MOVLW 05
0AD1: ADDWF 30,F
0AD2: BTFSC 03.0
0AD3: INCF 31,F
.................... break;
0AD4: GOTO 2E2
....................
.................... case TRESHOLD_setup:
.................... if(treshold < 0x0a ) treshold +=5;
0AD5: MOVF 39,W
0AD6: SUBLW 09
0AD7: BTFSS 03.0
0AD8: GOTO 2DB
0AD9: MOVLW 05
0ADA: ADDWF 39,F
.................... setup_vref(VREF_HIGH|treshold); //sets 3.6(vdd *value/32 +vdd/4) if vdd is 5.0V
0ADB: MOVF 39,W
0ADC: IORLW 80
0ADD: MOVWF 3A
0ADE: BSF 03.5
0ADF: MOVWF 17
.................... break;
0AE0: BCF 03.5
0AE1: GOTO 2E2
.................... }
.................... }
.................... }
....................
.................... if(!input(S2))
0AC7: BSF 2F.3
0AC8: MOVF 2F,W
0AC9: BSF 03.5
0ACA: MOVWF 07
0ACB: BCF 03.5
0ACC: BTFSC 07.3
0ACD: GOTO 2FA
0AE2: BSF 2F.3
0AE3: MOVF 2F,W
0AE4: BSF 03.5
0AE5: MOVWF 07
0AE6: BCF 03.5
0AE7: BTFSC 07.3
0AE8: GOTO 32B
.................... {
.................... delay_ms(20);
0ACE: MOVLW 14
0ACF: MOVWF 46
0AD0: BCF 0A.3
0AD1: CALL 0A9
0AD2: BSF 0A.3
0AE9: MOVLW 14
0AEA: MOVWF 47
0AEB: BCF 0A.3
0AEC: CALL 0A4
0AED: BSF 0A.3
.................... if(!input(S2))
0AD3: BSF 2F.3
0AD4: MOVF 2F,W
0AD5: BSF 03.5
0AD6: MOVWF 07
0AD7: BCF 03.5
0AD8: BTFSC 07.3
0AD9: GOTO 2FA
0AEE: BSF 2F.3
0AEF: MOVF 2F,W
0AF0: BSF 03.5
0AF1: MOVWF 07
0AF2: BCF 03.5
0AF3: BTFSC 07.3
0AF4: GOTO 32B
.................... {
.................... button_press=true;
0ADA: BSF 36.0
.................... if(time_setup==TRUE)
0ADB: BTFSS 36.2
0ADC: GOTO 2FA
0AF5: BSF 36.0
.................... sound_beep(100,600);
0AF6: MOVLW 64
0AF7: MOVWF 3A
0AF8: MOVLW 02
0AF9: MOVWF 3C
0AFA: MOVLW 58
0AFB: MOVWF 3B
0AFC: BCF 0A.3
0AFD: CALL 654
0AFE: BSF 0A.3
.................... switch (setup_mode)
.................... {
.................... sound_beep(100,600);
0ADD: MOVLW 64
0ADE: MOVWF 39
0ADF: MOVLW 02
0AE0: MOVWF 3B
0AE1: MOVLW 58
0AE2: MOVWF 3A
0AE3: BCF 0A.3
0AE4: CALL 60D
0AE5: BSF 0A.3
.................... if(integration_time > 0x0005 ) integration_time-=5;
0AE6: MOVF 31,F
0AE7: BTFSS 03.2
0AE8: GOTO 2ED
0AE9: MOVF 30,W
0AEA: SUBLW 05
0AEB: BTFSC 03.0
0AEC: GOTO 2F3
0AED: MOVLW 05
0AEE: SUBWF 30,F
0AEF: MOVLW 00
0AF0: BTFSS 03.0
0AF1: MOVLW 01
0AF2: SUBWF 31,F
....................
.................... set_timer0(0); // vynulovani pocitadel, kdyz uzivatel sahne na tlacitka
0AF3: CLRF 01
.................... time_overflow_count=0;
0AF4: CLRF 2E
0AF5: CLRF 2D
.................... set_timer1(0);
0AF6: CLRF 0F
0AF7: CLRF 0E
.................... overflow_count=0;
0AF8: CLRF 2C
0AF9: CLRF 2B
0AFF: MOVLW 00
0B00: BTFSC 36.1
0B01: MOVLW 01
0B02: XORLW 00
0B03: BTFSC 03.2
0B04: GOTO 309
0B05: XORLW 01
0B06: BTFSC 03.2
0B07: GOTO 31E
0B08: GOTO 32B
.................... case INTERVAL_setup:
.................... if(integration_time > 0x0005 ) integration_time-=5;
0B09: MOVF 31,F
0B0A: BTFSS 03.2
0B0B: GOTO 310
0B0C: MOVF 30,W
0B0D: SUBLW 05
0B0E: BTFSC 03.0
0B0F: GOTO 316
0B10: MOVLW 05
0B11: SUBWF 30,F
0B12: MOVLW 00
0B13: BTFSS 03.0
0B14: MOVLW 01
0B15: SUBWF 31,F
.................... set_timer0(0); // vynulovani pocitadel, kdyz uzivatel sahne na tlacitka
0B16: CLRF 01
.................... time_overflow_count=0;
0B17: CLRF 2E
0B18: CLRF 2D
.................... set_timer1(0);
0B19: CLRF 0F
0B1A: CLRF 0E
.................... overflow_count=0;
0B1B: CLRF 2C
0B1C: CLRF 2B
.................... break;
0B1D: GOTO 32B
.................... case TRESHOLD_setup:
.................... if(treshold > 0x05 ) treshold +=5;
0B1E: MOVF 39,W
0B1F: SUBLW 05
0B20: BTFSC 03.0
0B21: GOTO 324
0B22: MOVLW 05
0B23: ADDWF 39,F
.................... setup_vref(VREF_HIGH|treshold); //sets 3.6(vdd *value/32 +vdd/4) if vdd is 5.0V
0B24: MOVF 39,W
0B25: IORLW 80
0B26: MOVWF 3A
0B27: BSF 03.5
0B28: MOVWF 17
.................... break;
0B29: BCF 03.5
0B2A: GOTO 32B
.................... }
.................... }
.................... }
....................
.................... if(!input(S3))
0AFA: BSF 03.5
0AFB: BSF 08.0
0AFC: BCF 03.5
0AFD: BTFSC 08.0
0AFE: GOTO 31D
0B2B: BSF 03.5
0B2C: BSF 08.0
0B2D: BCF 03.5
0B2E: BTFSC 08.0
0B2F: GOTO 362
.................... {
.................... delay_ms(20);
0AFF: MOVLW 14
0B00: MOVWF 46
0B01: BCF 0A.3
0B02: CALL 0A9
0B03: BSF 0A.3
0B30: MOVLW 14
0B31: MOVWF 47
0B32: BCF 0A.3
0B33: CALL 0A4
0B34: BSF 0A.3
.................... if(!input(S3))
0B04: BSF 03.5
0B05: BSF 08.0
0B06: BCF 03.5
0B07: BTFSC 08.0
0B08: GOTO 31D
0B35: BSF 03.5
0B36: BSF 08.0
0B37: BCF 03.5
0B38: BTFSC 08.0
0B39: GOTO 362
.................... {
.................... button_press=true;
0B09: BSF 36.0
.................... if(time_setup==TRUE)
0B0A: BTFSS 36.2
0B0B: GOTO 31D
0B3A: BSF 36.0
.................... sound_beep(100,500);
0B3B: MOVLW 64
0B3C: MOVWF 3A
0B3D: MOVLW 01
0B3E: MOVWF 3C
0B3F: MOVLW F4
0B40: MOVWF 3B
0B41: BCF 0A.3
0B42: CALL 654
0B43: BSF 0A.3
.................... switch (setup_mode)
.................... {
.................... sound_beep(100,500);
0B0C: MOVLW 64
0B0D: MOVWF 39
0B0E: MOVLW 01
0B0F: MOVWF 3B
0B10: MOVLW F4
0B11: MOVWF 3A
0B12: BCF 0A.3
0B13: CALL 60D
0B14: BSF 0A.3
.................... if(integration_time < 0xffff ) integration_time++;
0B15: INCFSZ 30,W
0B16: GOTO 31A
0B17: INCFSZ 31,W
0B18: GOTO 31A
0B19: GOTO 31D
0B1A: INCF 30,F
0B1B: BTFSC 03.2
0B1C: INCF 31,F
0B44: MOVLW 00
0B45: BTFSC 36.1
0B46: MOVLW 01
0B47: XORLW 00
0B48: BTFSC 03.2
0B49: GOTO 34E
0B4A: XORLW 01
0B4B: BTFSC 03.2
0B4C: GOTO 357
0B4D: GOTO 362
.................... case INTERVAL_setup:
.................... if(integration_time < 0xffff ) integration_time++;
0B4E: INCFSZ 30,W
0B4F: GOTO 353
0B50: INCFSZ 31,W
0B51: GOTO 353
0B52: GOTO 356
0B53: INCF 30,F
0B54: BTFSC 03.2
0B55: INCF 31,F
.................... break;
0B56: GOTO 362
....................
.................... case TRESHOLD_setup:
.................... if(treshold < 0x0F ) treshold ++;
0B57: MOVF 39,W
0B58: SUBLW 0E
0B59: BTFSC 03.0
0B5A: INCF 39,F
.................... setup_vref(VREF_HIGH|treshold); //sets 3.6(vdd *value/32 +vdd/4) if vdd is 5.0V
0B5B: MOVF 39,W
0B5C: IORLW 80
0B5D: MOVWF 3A
0B5E: BSF 03.5
0B5F: MOVWF 17
.................... break;
0B60: BCF 03.5
0B61: GOTO 362
.................... }
.................... }
.................... }
....................
.................... if(!input(S4))
0B1D: BSF 03.5
0B1E: BSF 08.1
0B1F: BCF 03.5
0B20: BTFSC 08.1
0B21: GOTO 34A
0B62: BSF 03.5
0B63: BSF 08.1
0B64: BCF 03.5
0B65: BTFSC 08.1
0B66: GOTO 3A3
.................... {
.................... delay_ms(20);
0B22: MOVLW 14
0B23: MOVWF 46
0B24: BCF 0A.3
0B25: CALL 0A9
0B26: BSF 0A.3
0B67: MOVLW 14
0B68: MOVWF 47
0B69: BCF 0A.3
0B6A: CALL 0A4
0B6B: BSF 0A.3
.................... if(!input(S4))
0B27: BSF 03.5
0B28: BSF 08.1
0B29: BCF 03.5
0B2A: BTFSC 08.1
0B2B: GOTO 34A
0B6C: BSF 03.5
0B6D: BSF 08.1
0B6E: BCF 03.5
0B6F: BTFSC 08.1
0B70: GOTO 3A3
.................... {
.................... button_press=true;
0B2C: BSF 36.0
.................... if(time_setup==TRUE)
0B2D: BTFSS 36.2
0B2E: GOTO 34A
0B71: BSF 36.0
.................... sound_beep(100,400);
0B72: MOVLW 64
0B73: MOVWF 3A
0B74: MOVLW 01
0B75: MOVWF 3C
0B76: MOVLW 90
0B77: MOVWF 3B
0B78: BCF 0A.3
0B79: CALL 654
0B7A: BSF 0A.3
.................... switch (setup_mode)
.................... {
.................... sound_beep(100,400);
0B2F: MOVLW 64
0B30: MOVWF 39
0B31: MOVLW 01
0B32: MOVWF 3B
0B33: MOVLW 90
0B34: MOVWF 3A
0B35: BCF 0A.3
0B36: CALL 60D
0B37: BSF 0A.3
.................... if(integration_time > 0x0001 ) integration_time--;
0B38: MOVF 31,F
0B39: BTFSS 03.2
0B3A: GOTO 33F
0B3B: MOVF 30,W
0B3C: SUBLW 01
0B3D: BTFSC 03.0
0B3E: GOTO 343
0B3F: MOVF 30,W
0B40: BTFSC 03.2
0B41: DECF 31,F
0B42: DECF 30,F
0B7B: MOVLW 00
0B7C: BTFSC 36.1
0B7D: MOVLW 01
0B7E: XORLW 00
0B7F: BTFSC 03.2
0B80: GOTO 385
0B81: XORLW 01
0B82: BTFSC 03.2
0B83: GOTO 398
0B84: GOTO 3A3
.................... case INTERVAL_setup:
....................
.................... if(integration_time > 0x0001 ) integration_time--;
0B85: MOVF 31,F
0B86: BTFSS 03.2
0B87: GOTO 38C
0B88: MOVF 30,W
0B89: SUBLW 01
0B8A: BTFSC 03.0
0B8B: GOTO 390
0B8C: MOVF 30,W
0B8D: BTFSC 03.2
0B8E: DECF 31,F
0B8F: DECF 30,F
....................
.................... set_timer0(0); // vynulovani pocitadel, kdyz uzivatel sahne na tlacitka
0B43: CLRF 01
.................... time_overflow_count=0;
0B44: CLRF 2E
0B45: CLRF 2D
.................... set_timer1(0);
0B46: CLRF 0F
0B47: CLRF 0E
.................... overflow_count=0;
0B48: CLRF 2C
0B49: CLRF 2B
.................... set_timer0(0); // vynulovani pocitadel, kdyz uzivatel sahne na tlacitka
0B90: CLRF 01
.................... time_overflow_count=0;
0B91: CLRF 2E
0B92: CLRF 2D
.................... set_timer1(0);
0B93: CLRF 0F
0B94: CLRF 0E
.................... overflow_count=0;
0B95: CLRF 2C
0B96: CLRF 2B
.................... break;
0B97: GOTO 3A3
.................... case TRESHOLD_setup:
.................... if(treshold > 0x01 ) treshold--;
0B98: MOVF 39,W
0B99: SUBLW 01
0B9A: BTFSS 03.0
0B9B: DECF 39,F
.................... setup_vref(VREF_HIGH|treshold); //sets 3.6(vdd *value/32 +vdd/4) if vdd is 5.0V
0B9C: MOVF 39,W
0B9D: IORLW 80
0B9E: MOVWF 3A
0B9F: BSF 03.5
0BA0: MOVWF 17
.................... break;
0BA1: BCF 03.5
0BA2: GOTO 3A3
.................... }
.................... }
.................... }
....................
.................... if(!input(S5)) // prepnuti na nastavovani casu
0B4A: BSF 03.5
0B4B: BSF 06.1
0B4C: BCF 03.5
0B4D: BTFSC 06.1
0B4E: GOTO 364
0BA3: BSF 03.5
0BA4: BSF 06.1
0BA5: BCF 03.5
0BA6: BTFSC 06.1
0BA7: GOTO 3C9
.................... {
.................... delay_ms(20);
0B4F: MOVLW 14
0B50: MOVWF 46
0B51: BCF 0A.3
0B52: CALL 0A9
0B53: BSF 0A.3
0BA8: MOVLW 14
0BA9: MOVWF 47
0BAA: BCF 0A.3
0BAB: CALL 0A4
0BAC: BSF 0A.3
.................... if(!input(S5))
0B54: BSF 03.5
0B55: BSF 06.1
0B56: BCF 03.5
0B57: BTFSC 06.1
0B58: GOTO 364
0BAD: BSF 03.5
0BAE: BSF 06.1
0BAF: BCF 03.5
0BB0: BTFSC 06.1
0BB1: GOTO 3C9
.................... {
.................... button_press=true;
0BB2: BSF 36.0
.................... sound_beep(100,800);
0B59: MOVLW 64
0B5A: MOVWF 39
0B5B: MOVLW 03
0B5C: MOVWF 3B
0B5D: MOVLW 20
0B5E: MOVWF 3A
0B5F: BCF 0A.3
0B60: CALL 60D
0B61: BSF 0A.3
.................... voltage_setup=FALSE;
0B62: BCF 36.1
.................... time_setup=TRUE;
0B63: BSF 36.2
0BB3: MOVLW 64
0BB4: MOVWF 3A
0BB5: MOVLW 03
0BB6: MOVWF 3C
0BB7: MOVLW 20
0BB8: MOVWF 3B
0BB9: BCF 0A.3
0BBA: CALL 654
0BBB: BSF 0A.3
.................... setup_mode=INTERVAL_setup;
0BBC: BCF 36.1
.................... lcd_gotoxy(16,1); // prepsani dat na displeje
0BBD: MOVLW 10
0BBE: MOVWF 47
0BBF: MOVLW 01
0BC0: MOVWF 48
0BC1: BCF 0A.3
0BC2: CALL 1AB
0BC3: BSF 0A.3
.................... printf(lcd_putc,"I");
0BC4: MOVLW 49
0BC5: MOVWF 46
0BC6: BCF 0A.3
0BC7: CALL 1BD
0BC8: BSF 0A.3
.................... }
.................... }
....................
.................... if(!input(S6)) // prepnuti na nastavovani napeti
0B64: BSF 03.5
0B65: BSF 06.2
0B66: BCF 03.5
0B67: BTFSC 06.2
0B68: GOTO 37E
0BC9: BSF 03.5
0BCA: BSF 06.2
0BCB: BCF 03.5
0BCC: BTFSC 06.2
0BCD: GOTO 3EF
.................... {
.................... delay_ms(20);
0B69: MOVLW 14
0B6A: MOVWF 46
0B6B: BCF 0A.3
0B6C: CALL 0A9
0B6D: BSF 0A.3
0BCE: MOVLW 14
0BCF: MOVWF 47
0BD0: BCF 0A.3
0BD1: CALL 0A4
0BD2: BSF 0A.3
.................... if(!input(S6))
0B6E: BSF 03.5
0B6F: BSF 06.2
0B70: BCF 03.5
0B71: BTFSC 06.2
0B72: GOTO 37E
0BD3: BSF 03.5
0BD4: BSF 06.2
0BD5: BCF 03.5
0BD6: BTFSC 06.2
0BD7: GOTO 3EF
.................... {
.................... button_press=true;
0BD8: BSF 36.0
.................... sound_beep(100,800);
0B73: MOVLW 64
0B74: MOVWF 39
0B75: MOVLW 03
0B76: MOVWF 3B
0B77: MOVLW 20
0B78: MOVWF 3A
0B79: BCF 0A.3
0B7A: CALL 60D
0B7B: BSF 0A.3
.................... voltage_setup=TRUE;
0B7C: BSF 36.1
.................... time_setup=FALSE;
0B7D: BCF 36.2
0BD9: MOVLW 64
0BDA: MOVWF 3A
0BDB: MOVLW 03
0BDC: MOVWF 3C
0BDD: MOVLW 20
0BDE: MOVWF 3B
0BDF: BCF 0A.3
0BE0: CALL 654
0BE1: BSF 0A.3
.................... setup_mode=TRESHOLD_setup;
0BE2: BSF 36.1
.................... lcd_gotoxy(16,1); // prepsani dat na displeje
0BE3: MOVLW 10
0BE4: MOVWF 47
0BE5: MOVLW 01
0BE6: MOVWF 48
0BE7: BCF 0A.3
0BE8: CALL 1AB
0BE9: BSF 0A.3
.................... printf(lcd_putc,"U");
0BEA: MOVLW 55
0BEB: MOVWF 46
0BEC: BCF 0A.3
0BED: CALL 1BD
0BEE: BSF 0A.3
.................... }
.................... }
.................... }
....................
.................... if ( input(S1) && input(S2) && input(S3) && input(S4) && input(S5) && input(S6)) // detekce pustenych tlacitek
0B7E: BSF 2F.2
0B7F: MOVF 2F,W
0B80: BSF 03.5
0B81: MOVWF 07
0B82: BCF 03.5
0B83: BTFSS 07.2
0B84: GOTO 3A1
0B85: BSF 2F.3
0B86: MOVF 2F,W
0B87: BSF 03.5
0B88: MOVWF 07
0B89: BCF 03.5
0B8A: BTFSS 07.3
0B8B: GOTO 3A1
0B8C: BSF 03.5
0B8D: BSF 08.0
0B8E: BCF 03.5
0B8F: BTFSS 08.0
0B90: GOTO 3A1
0B91: BSF 03.5
0B92: BSF 08.1
0B93: BCF 03.5
0B94: BTFSS 08.1
0B95: GOTO 3A1
0B96: BSF 03.5
0B97: BSF 06.1
0B98: BCF 03.5
0B99: BTFSS 06.1
0B9A: GOTO 3A1
0B9B: BSF 03.5
0B9C: BSF 06.2
0B9D: BCF 03.5
0B9E: BTFSS 06.2
0B9F: GOTO 3A1
0BEF: BSF 2F.2
0BF0: MOVF 2F,W
0BF1: BSF 03.5
0BF2: MOVWF 07
0BF3: BCF 03.5
0BF4: BTFSS 07.2
0BF5: GOTO 412
0BF6: BSF 2F.3
0BF7: MOVF 2F,W
0BF8: BSF 03.5
0BF9: MOVWF 07
0BFA: BCF 03.5
0BFB: BTFSS 07.3
0BFC: GOTO 412
0BFD: BSF 03.5
0BFE: BSF 08.0
0BFF: BCF 03.5
0C00: BTFSS 08.0
0C01: GOTO 412
0C02: BSF 03.5
0C03: BSF 08.1
0C04: BCF 03.5
0C05: BTFSS 08.1
0C06: GOTO 412
0C07: BSF 03.5
0C08: BSF 06.1
0C09: BCF 03.5
0C0A: BTFSS 06.1
0C0B: GOTO 412
0C0C: BSF 03.5
0C0D: BSF 06.2
0C0E: BCF 03.5
0C0F: BTFSS 06.2
0C10: GOTO 412
.................... {
.................... button_press=false;
0BA0: BCF 36.0
0C11: BCF 36.0
.................... }
.................... }
0BA1: GOTO 118
0C12: GOTO 11F
.................... }
0BA2: SLEEP
0C13: SLEEP
 
Configuration Fuses:
Word 1: 2CF5 INTRC NOWDT NOPUT MCLR NOPROTECT NOCPD NOBROWNOUT IESO FCMEN NOLVP NODEBUG