1,17 → 1,17 |
CCS PCM C Compiler, Version 3.245, 27853 12-IX-06 23:20 |
CCS PCM C Compiler, Version 3.245, 27853 17-IX-06 22:12 |
|
Filename: D:\KAKL\roboti\solarni\2006\scamnum\menic.lst |
|
ROM used: 837 words (20%) |
ROM used: 836 words (20%) |
Largest free fragment is 2048 |
RAM used: 85 (49%) at main() level |
91 (52%) worst case |
RAM used: 87 (50%) at main() level |
94 (54%) worst case |
Stack: 4 worst case (3 in main + 1 for interrupts) |
|
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 1BA |
0002: GOTO 1C3 |
0003: NOP |
0004: MOVWF 7F |
0005: SWAPF 03,W |
63,7 → 63,7 |
0033: SWAPF 7F,W |
0034: RETFIE |
0035: BCF 0A.3 |
0036: GOTO 043 |
0036: GOTO 037 |
.................... // ************************************* |
.................... // * Scamnum Specularis ** 20. 9. 2006 * |
.................... // ************************************* |
77,33 → 77,53 |
.................... |
.................... #device adc=8 |
.................... |
.................... #fuses WDT,INTRC_IO, NOPUT, MCLR, NOBROWNOUT, NOLVP, NOCPD, \ |
.................... #fuses NOWDT,INTRC_IO, NOPUT, MCLR, NOBROWNOUT, NOLVP, NOCPD, \ |
.................... NOWRT, DEBUG, NOPROTECT, NOFCMEN, NOIESO, CCPB3 |
.................... |
.................... #use delay(clock=3900000,RESTART_WDT) |
* |
0048: MOVLW 6F |
0049: MOVWF 04 |
004A: MOVF 00,W |
004B: BTFSC 03.2 |
004C: GOTO 05D |
004D: MOVLW 01 |
004E: MOVWF 78 |
004F: MOVLW BF |
0050: MOVWF 77 |
0051: CLRWDT |
0052: DECFSZ 77,F |
0053: GOTO 051 |
0054: DECFSZ 78,F |
0055: GOTO 04F |
0056: MOVLW 42 |
0057: MOVWF 77 |
0058: DECFSZ 77,F |
0059: GOTO 058 |
005A: CLRWDT |
005B: DECFSZ 00,F |
005C: GOTO 04D |
005D: RETLW 00 |
003C: MOVLW 71 |
003D: MOVWF 04 |
003E: MOVF 00,W |
003F: BTFSC 03.2 |
0040: GOTO 051 |
0041: MOVLW 01 |
0042: MOVWF 78 |
0043: MOVLW BF |
0044: MOVWF 77 |
0045: CLRWDT |
0046: DECFSZ 77,F |
0047: GOTO 045 |
0048: DECFSZ 78,F |
0049: GOTO 043 |
004A: MOVLW 42 |
004B: MOVWF 77 |
004C: DECFSZ 77,F |
004D: GOTO 04C |
004E: CLRWDT |
004F: DECFSZ 00,F |
0050: GOTO 041 |
0051: RETLW 00 |
* |
01B0: MOVLW 12 |
01B1: SUBWF 72,F |
01B2: BTFSS 03.0 |
01B3: GOTO 1C2 |
01B4: MOVLW 72 |
01B5: MOVWF 04 |
01B6: MOVLW FC |
01B7: ANDWF 00,F |
01B8: BCF 03.0 |
01B9: RRF 00,F |
01BA: RRF 00,F |
01BB: MOVF 00,W |
01BC: BTFSC 03.2 |
01BD: GOTO 1C2 |
01BE: GOTO 1C0 |
01BF: CLRWDT |
01C0: DECFSZ 00,F |
01C1: GOTO 1BF |
01C2: RETLW 00 |
.................... |
.................... |
.................... |
125,34 → 145,34 |
.................... 'C'<<1, 'Z'<<1, '0'<<1, 'R'<<1, 'R'<<1, 'R'<<1, 0x61, |
.................... 0x03, 0xF0}; |
* |
01C5: MOVLW 82 |
01C6: BCF 03.5 |
01C7: MOVWF 29 |
01C8: MOVLW 98 |
01C9: MOVWF 2A |
01CA: MOVWF 2B |
01CB: MOVLW 40 |
01CC: MOVWF 2C |
01CD: MOVWF 2D |
01CE: MOVWF 2E |
01CF: MOVLW 60 |
01D0: MOVWF 2F |
01D1: MOVLW 86 |
01D2: MOVWF 30 |
01D3: MOVLW B4 |
01D4: MOVWF 31 |
01D5: MOVLW 60 |
01D6: MOVWF 32 |
01D7: MOVLW A4 |
01D8: MOVWF 33 |
01D9: MOVWF 34 |
01DA: MOVWF 35 |
01DB: MOVLW 61 |
01DC: MOVWF 36 |
01DD: MOVLW 03 |
01DE: MOVWF 37 |
01DF: MOVLW F0 |
01E0: MOVWF 38 |
01CE: MOVLW 82 |
01CF: BCF 03.5 |
01D0: MOVWF 29 |
01D1: MOVLW 98 |
01D2: MOVWF 2A |
01D3: MOVWF 2B |
01D4: MOVLW 40 |
01D5: MOVWF 2C |
01D6: MOVWF 2D |
01D7: MOVWF 2E |
01D8: MOVLW 60 |
01D9: MOVWF 2F |
01DA: MOVLW 86 |
01DB: MOVWF 30 |
01DC: MOVLW B4 |
01DD: MOVWF 31 |
01DE: MOVLW 60 |
01DF: MOVWF 32 |
01E0: MOVLW A4 |
01E1: MOVWF 33 |
01E2: MOVWF 34 |
01E3: MOVWF 35 |
01E4: MOVLW 61 |
01E5: MOVWF 36 |
01E6: MOVLW 03 |
01E7: MOVWF 37 |
01E8: MOVLW F0 |
01E9: MOVWF 38 |
.................... |
.................... boolean bit; |
.................... int fcslo, fcshi; // variabloes for calculating FCS (CRC) |
165,22 → 185,22 |
.................... { |
.................... stuff = 0; //since this is a 0, reset the stuff counter |
* |
00E7: CLRF 3C |
00DD: CLRF 3C |
.................... if (bit) |
00E8: BTFSS 39.0 |
00E9: GOTO 0EC |
00DE: BTFSS 39.0 |
00DF: GOTO 0E2 |
.................... { |
.................... bit=FALSE; //if the state of the pin was low, make it high. |
00EA: BCF 39.0 |
00E0: BCF 39.0 |
.................... } |
.................... else |
00EB: GOTO 0ED |
00E1: GOTO 0E3 |
.................... { |
.................... bit=TRUE; //if the state of the pin was high make it low |
00EC: BSF 39.0 |
00E2: BSF 39.0 |
.................... } |
.................... } |
00ED: RETLW 00 |
00E3: RETLW 00 |
.................... |
.................... void fcsbit(byte tbyte) |
.................... { |
187,26 → 207,26 |
.................... #asm |
.................... BCF STATUS,0 |
* |
0149: BCF 03.0 |
013F: BCF 03.0 |
.................... RRF fcshi,F // rotates the entire 16 bits |
014A: RRF 3B,F |
0140: RRF 3B,F |
.................... RRF fcslo,F // to the right |
014B: RRF 3A,F |
0141: RRF 3A,F |
.................... #endasm |
.................... if (((STATUS & 0x01)^(tbyte)) ==0x01) |
014C: MOVF 03,W |
014D: ANDLW 01 |
014E: XORWF 73,W |
014F: SUBLW 01 |
0150: BTFSS 03.2 |
0151: GOTO 156 |
0142: MOVF 03,W |
0143: ANDLW 01 |
0144: XORWF 75,W |
0145: SUBLW 01 |
0146: BTFSS 03.2 |
0147: GOTO 14C |
.................... { |
.................... fcshi = fcshi^0x84; |
0152: MOVLW 84 |
0153: XORWF 3B,F |
0148: MOVLW 84 |
0149: XORWF 3B,F |
.................... fcslo = fcslo^0x08; |
0154: MOVLW 08 |
0155: XORWF 3A,F |
014A: MOVLW 08 |
014B: XORWF 3A,F |
.................... } |
.................... } |
.................... |
214,14 → 234,26 |
.................... { |
.................... if (bit) |
* |
00EE: BTFSS 39.0 |
00EF: GOTO 11A |
00E4: BTFSS 39.0 |
00E5: GOTO 110 |
.................... { |
.................... output_low(TXo); |
00E6: BSF 03.5 |
00E7: BCF 06.5 |
00E8: BCF 03.5 |
00E9: BCF 06.5 |
.................... PERIODAH; |
00EA: CLRWDT |
00EB: MOVLW 47 |
00EC: MOVWF 77 |
00ED: DECFSZ 77,F |
00EE: GOTO 0ED |
00EF: NOP |
.................... output_high(TXo); |
00F0: BSF 03.5 |
00F1: BCF 06.5 |
00F2: BCF 03.5 |
00F3: BCF 06.5 |
00F3: BSF 06.5 |
.................... PERIODAH; |
00F4: CLRWDT |
00F5: MOVLW 47 |
229,11 → 261,11 |
00F7: DECFSZ 77,F |
00F8: GOTO 0F7 |
00F9: NOP |
.................... output_high(TXo); |
.................... output_low(TXo); |
00FA: BSF 03.5 |
00FB: BCF 06.5 |
00FC: BCF 03.5 |
00FD: BSF 06.5 |
00FD: BCF 06.5 |
.................... PERIODAH; |
00FE: CLRWDT |
00FF: MOVLW 47 |
241,61 → 273,49 |
0101: DECFSZ 77,F |
0102: GOTO 101 |
0103: NOP |
.................... output_low(TXo); |
.................... output_high(TXo); |
0104: BSF 03.5 |
0105: BCF 06.5 |
0106: BCF 03.5 |
0107: BCF 06.5 |
.................... PERIODAH; |
0107: BSF 06.5 |
.................... TAILH; |
0108: CLRWDT |
0109: MOVLW 47 |
0109: MOVLW 18 |
010A: MOVWF 77 |
010B: DECFSZ 77,F |
010C: GOTO 10B |
010D: NOP |
.................... output_high(TXo); |
010E: BSF 03.5 |
010F: BCF 06.5 |
0110: BCF 03.5 |
0111: BSF 06.5 |
.................... TAILH; |
0112: CLRWDT |
0113: MOVLW 18 |
0114: MOVWF 77 |
0115: DECFSZ 77,F |
0116: GOTO 115 |
0117: NOP |
0118: NOP |
010E: NOP |
.................... } |
.................... else |
0119: GOTO 12D |
010F: GOTO 123 |
.................... { |
.................... output_low(TXo); |
011A: BSF 03.5 |
011B: BCF 06.5 |
011C: BCF 03.5 |
011D: BCF 06.5 |
0110: BSF 03.5 |
0111: BCF 06.5 |
0112: BCF 03.5 |
0113: BCF 06.5 |
.................... PERIODAL; |
011E: CLRWDT |
011F: MOVLW 85 |
0120: MOVWF 77 |
0121: DECFSZ 77,F |
0122: GOTO 121 |
0114: CLRWDT |
0115: MOVLW 85 |
0116: MOVWF 77 |
0117: DECFSZ 77,F |
0118: GOTO 117 |
.................... output_high(TXo); |
0123: BSF 03.5 |
0124: BCF 06.5 |
0125: BCF 03.5 |
0126: BSF 06.5 |
0119: BSF 03.5 |
011A: BCF 06.5 |
011B: BCF 03.5 |
011C: BSF 06.5 |
.................... TAILL; |
0127: CLRWDT |
0128: MOVLW 6F |
0129: MOVWF 77 |
012A: DECFSZ 77,F |
012B: GOTO 12A |
012C: NOP |
011D: CLRWDT |
011E: MOVLW 6F |
011F: MOVWF 77 |
0120: DECFSZ 77,F |
0121: GOTO 120 |
0122: NOP |
.................... }; |
.................... } |
012D: RETLW 00 |
0123: RETLW 00 |
.................... |
.................... void SendByte (byte inbyte) |
.................... { |
302,101 → 322,101 |
.................... int k, bt; |
.................... |
.................... for (k=0;k<8;k++) //do the following for each of the 8 bits in the byte |
012E: CLRF 71 |
012F: MOVF 71,W |
0130: SUBLW 07 |
0131: BTFSS 03.0 |
0132: GOTO 176 |
0124: CLRF 73 |
0125: MOVF 73,W |
0126: SUBLW 07 |
0127: BTFSS 03.0 |
0128: GOTO 16C |
.................... { |
.................... bt = inbyte & 0x01; //strip off the rightmost bit of the byte to be sent (inbyte) |
0133: MOVF 70,W |
0134: ANDLW 01 |
0135: MOVWF 72 |
0129: MOVF 72,W |
012A: ANDLW 01 |
012B: MOVWF 74 |
.................... if ((fcs_flag == FALSE) & (flag_flag == FALSE)) fcsbit(bt); //do FCS calc, but only if this |
0136: MOVF 3E,F |
0137: BTFSC 03.2 |
0138: GOTO 13B |
0139: MOVLW 00 |
013A: GOTO 13C |
013B: MOVLW 01 |
013C: MOVWF 73 |
013D: MOVF 3D,F |
013E: BTFSC 03.2 |
013F: GOTO 142 |
0140: MOVLW 00 |
0141: GOTO 143 |
0142: MOVLW 01 |
0143: ANDWF 73,W |
0144: XORLW 00 |
0145: BTFSC 03.2 |
0146: GOTO 156 |
0147: MOVF 72,W |
0148: MOVWF 73 |
012C: MOVF 3E,F |
012D: BTFSC 03.2 |
012E: GOTO 131 |
012F: MOVLW 00 |
0130: GOTO 132 |
0131: MOVLW 01 |
0132: MOVWF 75 |
0133: MOVF 3D,F |
0134: BTFSC 03.2 |
0135: GOTO 138 |
0136: MOVLW 00 |
0137: GOTO 139 |
0138: MOVLW 01 |
0139: ANDWF 75,W |
013A: XORLW 00 |
013B: BTFSC 03.2 |
013C: GOTO 14C |
013D: MOVF 74,W |
013E: MOVWF 75 |
.................... //is not a flag or fcs byte |
.................... if (bt == 0) |
* |
0156: MOVF 72,F |
0157: BTFSS 03.2 |
0158: GOTO 15B |
014C: MOVF 74,F |
014D: BTFSS 03.2 |
014E: GOTO 151 |
.................... { |
.................... flipout(); |
0159: CALL 0E7 |
014F: CALL 0DD |
.................... } // if this bit is a zero, flip the output state |
.................... else |
015A: GOTO 171 |
0150: GOTO 167 |
.................... { //otherwise if it is a 1, do the following: |
.................... if (flag_flag == FALSE) stuff++; //increment the count of consequtive 1's |
015B: MOVF 3D,F |
015C: BTFSC 03.2 |
015D: INCF 3C,F |
0151: MOVF 3D,F |
0152: BTFSC 03.2 |
0153: INCF 3C,F |
.................... if ((flag_flag == FALSE) & (stuff == 5)) |
015E: MOVF 3D,F |
015F: BTFSC 03.2 |
0160: GOTO 163 |
0161: MOVLW 00 |
0162: GOTO 164 |
0163: MOVLW 01 |
0164: MOVWF 73 |
0165: MOVF 3C,W |
0166: SUBLW 05 |
0167: BTFSC 03.2 |
0168: GOTO 16B |
0169: MOVLW 00 |
016A: GOTO 16C |
016B: MOVLW 01 |
016C: ANDWF 73,W |
016D: BTFSC 03.2 |
016E: GOTO 171 |
0154: MOVF 3D,F |
0155: BTFSC 03.2 |
0156: GOTO 159 |
0157: MOVLW 00 |
0158: GOTO 15A |
0159: MOVLW 01 |
015A: MOVWF 75 |
015B: MOVF 3C,W |
015C: SUBLW 05 |
015D: BTFSC 03.2 |
015E: GOTO 161 |
015F: MOVLW 00 |
0160: GOTO 162 |
0161: MOVLW 01 |
0162: ANDWF 75,W |
0163: BTFSC 03.2 |
0164: GOTO 167 |
.................... { //stuff an extra 0, if 5 1's in a row |
.................... SendBit(); |
016F: CALL 0EE |
0165: CALL 0E4 |
.................... flipout(); //flip the output state to stuff a 0 |
0170: CALL 0E7 |
0166: CALL 0DD |
.................... }//end of if |
.................... }//end of else |
.................... // delay_us(850); //introduces a delay that creates 1200 baud |
.................... SendBit(); |
0171: CALL 0EE |
0167: CALL 0E4 |
.................... inbyte = inbyte>>1; //go to the next bit in the byte |
0172: BCF 03.0 |
0173: RRF 70,F |
0168: BCF 03.0 |
0169: RRF 72,F |
.................... }//end of for |
0174: INCF 71,F |
0175: GOTO 12F |
016A: INCF 73,F |
016B: GOTO 125 |
.................... }//end of SendByte |
0176: RETLW 00 |
016C: RETLW 00 |
.................... |
.................... void SendPacket(char *data) |
.................... { |
.................... bit=FALSE; |
0177: BCF 39.0 |
016D: BCF 39.0 |
.................... |
.................... fcslo=fcshi=0xFF; //The 2 FCS Bytes are initialized to FF |
0178: MOVLW FF |
0179: MOVWF 3B |
017A: MOVWF 3A |
016E: MOVLW FF |
016F: MOVWF 3B |
0170: MOVWF 3A |
.................... stuff = 0; //The variable stuff counts the number of 1's in a row. When it gets to 5 |
017B: CLRF 3C |
0171: CLRF 3C |
.................... // it is time to stuff a 0. |
.................... |
.................... // output_low(PTT); // Blinking LED |
404,91 → 424,91 |
.................... // output_high(PTT); |
.................... |
.................... flag_flag = TRUE; //The variable flag is true if you are transmitted flags (7E's) false otherwise. |
017C: MOVLW 01 |
017D: MOVWF 3D |
0172: MOVLW 01 |
0173: MOVWF 3D |
.................... fcs_flag = FALSE; //The variable fcsflag is true if you are transmitting FCS bytes, false otherwise. |
017E: CLRF 3E |
0174: CLRF 3E |
.................... |
.................... for(i=0; i<10; i++) SendByte(0x7E); //Sends flag bytes. Adjust length for txdelay |
017F: CLRF 3F |
0180: MOVF 3F,W |
0181: SUBLW 09 |
0182: BTFSS 03.0 |
0183: GOTO 189 |
0184: MOVLW 7E |
0185: MOVWF 70 |
0186: CALL 12E |
0187: INCF 3F,F |
0188: GOTO 180 |
0175: CLRF 3F |
0176: MOVF 3F,W |
0177: SUBLW 09 |
0178: BTFSS 03.0 |
0179: GOTO 17F |
017A: MOVLW 7E |
017B: MOVWF 72 |
017C: CALL 124 |
017D: INCF 3F,F |
017E: GOTO 176 |
.................... //each flag takes approx 6.7 ms |
.................... flag_flag = FALSE; //done sending flags |
0189: CLRF 3D |
017F: CLRF 3D |
.................... |
.................... for(i=0; i<16; i++) SendByte(SendData[i]); //send the packet bytes |
018A: CLRF 3F |
018B: MOVF 3F,W |
018C: SUBLW 0F |
018D: BTFSS 03.0 |
018E: GOTO 198 |
018F: MOVLW 29 |
0190: ADDWF 3F,W |
0191: MOVWF 04 |
0192: MOVF 00,W |
0193: MOVWF 6F |
0194: MOVWF 70 |
0195: CALL 12E |
0196: INCF 3F,F |
0197: GOTO 18B |
0180: CLRF 3F |
0181: MOVF 3F,W |
0182: SUBLW 0F |
0183: BTFSS 03.0 |
0184: GOTO 18E |
0185: MOVLW 29 |
0186: ADDWF 3F,W |
0187: MOVWF 04 |
0188: MOVF 00,W |
0189: MOVWF 71 |
018A: MOVWF 72 |
018B: CALL 124 |
018C: INCF 3F,F |
018D: GOTO 181 |
.................... |
.................... for(i=0; 0 != *data; i++) |
0198: CLRF 3F |
0199: MOVF 6E,W |
019A: MOVWF 04 |
019B: MOVF 00,W |
019C: BTFSC 03.2 |
019D: GOTO 1A7 |
018E: CLRF 3F |
018F: MOVF 70,W |
0190: MOVWF 04 |
0191: MOVF 00,W |
0192: BTFSC 03.2 |
0193: GOTO 19D |
.................... { |
.................... SendByte(*data); //send the packet bytes |
019E: MOVF 6E,W |
019F: MOVWF 04 |
01A0: MOVF 00,W |
01A1: MOVWF 6F |
01A2: MOVWF 70 |
01A3: CALL 12E |
0194: MOVF 70,W |
0195: MOVWF 04 |
0196: MOVF 00,W |
0197: MOVWF 71 |
0198: MOVWF 72 |
0199: CALL 124 |
.................... data++; |
01A4: INCF 6E,F |
019A: INCF 70,F |
.................... }; |
01A5: INCF 3F,F |
01A6: GOTO 199 |
019B: INCF 3F,F |
019C: GOTO 18F |
.................... |
.................... fcs_flag = TRUE; //about to send the FCS bytes |
01A7: MOVLW 01 |
01A8: MOVWF 3E |
019D: MOVLW 01 |
019E: MOVWF 3E |
.................... fcslo =fcslo^0xff; //must XOR them with FF before sending |
01A9: MOVLW FF |
01AA: XORWF 3A,F |
019F: MOVLW FF |
01A0: XORWF 3A,F |
.................... fcshi = fcshi^0xff; |
01AB: XORWF 3B,F |
01A1: XORWF 3B,F |
.................... SendByte(fcslo); //send the low byte of fcs |
01AC: MOVF 3A,W |
01AD: MOVWF 70 |
01AE: CALL 12E |
01A2: MOVF 3A,W |
01A3: MOVWF 72 |
01A4: CALL 124 |
.................... SendByte(fcshi); //send the high byte of fcs |
01AF: MOVF 3B,W |
01B0: MOVWF 70 |
01B1: CALL 12E |
01A5: MOVF 3B,W |
01A6: MOVWF 72 |
01A7: CALL 124 |
.................... fcs_flag = FALSE; //done sending FCS |
01B2: CLRF 3E |
01A8: CLRF 3E |
.................... flag_flag = TRUE; //about to send flags |
01B3: MOVLW 01 |
01B4: MOVWF 3D |
01A9: MOVLW 01 |
01AA: MOVWF 3D |
.................... SendByte(0x7e); // Send a flag to end packet |
01B5: MOVLW 7E |
01B6: MOVWF 70 |
01B7: CALL 12E |
01AB: MOVLW 7E |
01AC: MOVWF 72 |
01AD: CALL 124 |
.................... } |
01B8: BCF 0A.3 |
01B9: GOTO 30C (RETURN) |
01AE: BCF 0A.3 |
01AF: GOTO 2FD (RETURN) |
.................... |
.................... |
.................... |
532,13 → 552,13 |
.................... { |
.................... SSPBUF=MotorPattern; // znovu vysli stejnou hodnotu |
* |
0043: MOVF 68,W |
0044: MOVWF 13 |
0037: MOVF 68,W |
0038: MOVWF 13 |
.................... } |
.................... |
0045: BCF 0C.3 |
0046: BCF 0A.3 |
0047: GOTO 022 |
0039: BCF 0C.3 |
003A: BCF 0A.3 |
003B: GOTO 022 |
.................... void pip() // pipnuti a bliknuti |
.................... { |
.................... int1 beep; |
546,269 → 566,272 |
.................... |
.................... for(i=0; i<250; i++) |
* |
006B: CLRF 6F |
006C: MOVF 6F,W |
006D: SUBLW F9 |
006E: BTFSS 03.0 |
006F: GOTO 08B |
005F: CLRF 71 |
0060: MOVF 71,W |
0061: SUBLW F9 |
0062: BTFSS 03.0 |
0063: GOTO 081 |
.................... { |
.................... output_bit(PIEZO, beep); |
0070: BTFSC 6E.0 |
0071: GOTO 074 |
0072: BCF 05.6 |
0073: GOTO 075 |
0074: BSF 05.6 |
0075: BSF 03.5 |
0076: BCF 05.6 |
0064: BTFSC 70.0 |
0065: GOTO 068 |
0066: BCF 05.6 |
0067: GOTO 069 |
0068: BSF 05.6 |
0069: BSF 03.5 |
006A: BCF 05.6 |
.................... beep=~beep; |
0077: MOVLW 01 |
0078: BCF 03.5 |
0079: XORWF 6E,F |
006B: MOVLW 01 |
006C: XORWF 70,F |
.................... output_bit(LED, beep); |
007A: BTFSC 6E.0 |
007B: GOTO 07E |
007C: BCF 05.7 |
007D: GOTO 07F |
007E: BSF 05.7 |
007F: BSF 03.5 |
0080: BCF 05.7 |
006D: BTFSC 70.0 |
006E: GOTO 073 |
006F: BCF 03.5 |
0070: BCF 05.7 |
0071: GOTO 075 |
0072: BSF 03.5 |
0073: BCF 03.5 |
0074: BSF 05.7 |
0075: BSF 03.5 |
0076: BCF 05.7 |
.................... delay_us(100); |
0081: CLRWDT |
0082: MOVLW 1F |
0083: MOVWF 77 |
0084: DECFSZ 77,F |
0085: GOTO 084 |
0086: NOP |
0087: NOP |
0077: CLRWDT |
0078: MOVLW 1F |
0079: MOVWF 77 |
007A: DECFSZ 77,F |
007B: GOTO 07A |
007C: NOP |
007D: NOP |
.................... }; |
0088: BCF 03.5 |
0089: INCF 6F,F |
008A: GOTO 06C |
007E: INCF 71,F |
007F: BCF 03.5 |
0080: GOTO 060 |
.................... output_high(PIEZO); |
008B: BSF 03.5 |
008C: BCF 05.6 |
008D: BCF 03.5 |
008E: BSF 05.6 |
0081: BSF 03.5 |
0082: BCF 05.6 |
0083: BCF 03.5 |
0084: BSF 05.6 |
.................... output_high(LED); |
008F: BSF 03.5 |
0090: BCF 05.7 |
0091: BCF 03.5 |
0092: BSF 05.7 |
0085: BSF 03.5 |
0086: BCF 05.7 |
0087: BCF 03.5 |
0088: BSF 05.7 |
.................... } |
0093: BCF 0A.3 |
0094: GOTO 2A3 (RETURN) |
0089: BCF 0A.3 |
008A: GOTO 2B1 (RETURN) |
.................... |
.................... void cvak() // pouze cvaknuti piezoelementem bez bliknuti |
.................... { |
.................... output_bit(PIEZO,~input(PIEZO)); |
* |
005E: BSF 03.5 |
005F: BSF 05.6 |
0060: BCF 03.5 |
0061: BTFSS 05.6 |
0062: GOTO 065 |
0063: BCF 05.6 |
0064: GOTO 066 |
0065: BSF 05.6 |
0066: BSF 03.5 |
0067: BCF 05.6 |
0052: BSF 03.5 |
0053: BSF 05.6 |
0054: BCF 03.5 |
0055: BTFSS 05.6 |
0056: GOTO 059 |
0057: BCF 05.6 |
0058: GOTO 05A |
0059: BSF 05.6 |
005A: BSF 03.5 |
005B: BCF 05.6 |
.................... } |
0068: BCF 03.5 |
0069: BCF 0A.3 |
006A: GOTO 25A (RETURN) |
005C: BCF 03.5 |
005D: BCF 0A.3 |
005E: GOTO 263 (RETURN) |
.................... |
.................... void main() |
.................... { |
* |
01BA: CLRF 04 |
01BB: MOVLW 1F |
01BC: ANDWF 03,F |
01BD: BSF 03.5 |
01BE: BCF 1F.4 |
01BF: BCF 1F.5 |
01C0: MOVF 1B,W |
01C1: ANDLW 80 |
01C2: MOVWF 1B |
01C3: MOVLW 07 |
01C4: MOVWF 1C |
01C3: CLRF 04 |
01C4: MOVLW 1F |
01C5: ANDWF 03,F |
01C6: BSF 03.5 |
01C7: BCF 1F.4 |
01C8: BCF 1F.5 |
01C9: MOVF 1B,W |
01CA: ANDLW 80 |
01CB: MOVWF 1B |
01CC: MOVLW 07 |
01CD: MOVWF 1C |
.................... int8 n; |
.................... int8 perioda; |
.................... int8 razeni; |
.................... int8 uclanku; |
.................... int16 ble; |
.................... |
.................... setup_timer_0(RTCC_INTERNAL);setup_wdt(WDT_1152MS); |
* |
01E2: BSF 03.5 |
01E3: MOVF 01,W |
01E4: ANDLW C0 |
01E5: MOVWF 01 |
01E6: MOVLW 0E |
01E7: MOVWF 77 |
01E8: MOVLW 07 |
01E9: BCF 03.5 |
01EA: CLRF 01 |
01EB: MOVLW 81 |
01EC: MOVWF 04 |
01ED: MOVF 00,W |
01EE: ANDLW F0 |
01EF: IORLW 07 |
01F0: MOVWF 00 |
01F1: CLRWDT |
01F2: MOVF 00,W |
01F3: ANDLW F7 |
01F4: BTFSC 77.3 |
01F5: ANDLW F0 |
01F6: IORWF 77,W |
01F7: MOVWF 00 |
01EB: BSF 03.5 |
01EC: MOVF 01,W |
01ED: ANDLW C0 |
01EE: MOVWF 01 |
01EF: MOVLW 0E |
01F0: MOVWF 77 |
01F1: MOVLW 07 |
01F2: BCF 03.5 |
01F3: CLRF 01 |
01F4: MOVLW 81 |
01F5: MOVWF 04 |
01F6: MOVF 00,W |
01F7: ANDLW F0 |
01F8: IORLW 07 |
01F9: MOVWF 00 |
01FA: CLRWDT |
01FB: MOVF 00,W |
01FC: ANDLW F7 |
01FD: BTFSC 77.3 |
01FE: ANDLW F0 |
01FF: IORWF 77,W |
0200: MOVWF 00 |
.................... setup_timer_1(T1_DISABLED); |
01F8: CLRF 10 |
0201: CLRF 10 |
.................... setup_adc_ports(ADC_CLOCK_INTERNAL|sAN0|sAN1|sAN4|VSS_VDD); |
01F9: BSF 03.5 |
01FA: BCF 1F.4 |
01FB: BCF 1F.5 |
01FC: MOVF 1B,W |
01FD: ANDLW 80 |
01FE: IORLW D3 |
01FF: MOVWF 1B |
0202: BSF 03.5 |
0203: BCF 1F.4 |
0204: BCF 1F.5 |
0205: MOVF 1B,W |
0206: ANDLW 80 |
0207: IORLW D3 |
0208: MOVWF 1B |
.................... setup_adc(ADC_CLOCK_INTERNAL); |
0200: BCF 1F.6 |
0201: BCF 03.5 |
0202: BSF 1F.6 |
0203: BSF 1F.7 |
0204: BSF 03.5 |
0205: BCF 1F.7 |
0206: BCF 03.5 |
0207: BSF 1F.0 |
0209: BCF 1F.6 |
020A: BCF 03.5 |
020B: BSF 1F.6 |
020C: BSF 1F.7 |
020D: BSF 03.5 |
020E: BCF 1F.7 |
020F: BCF 03.5 |
0210: BSF 1F.0 |
.................... setup_spi(FALSE); |
0208: BCF 14.5 |
0209: BSF 03.5 |
020A: BCF 06.2 |
020B: BSF 06.1 |
020C: BCF 06.4 |
020D: MOVLW 00 |
020E: BCF 03.5 |
020F: MOVWF 14 |
0210: BSF 03.5 |
0211: MOVWF 14 |
0211: BCF 14.5 |
0212: BSF 03.5 |
0213: BCF 06.2 |
0214: BSF 06.1 |
0215: BCF 06.4 |
0216: MOVLW 00 |
0217: BCF 03.5 |
0218: MOVWF 14 |
0219: BSF 03.5 |
021A: MOVWF 14 |
.................... setup_comparator(NC_NC_NC_NC); |
0212: MOVLW 07 |
0213: MOVWF 1C |
0214: MOVF 05,W |
0215: CLRWDT |
0216: MOVLW 02 |
0217: MOVWF 77 |
0218: DECFSZ 77,F |
0219: GOTO 218 |
021A: NOP |
021B: MOVF 1C,W |
021C: BCF 03.5 |
021D: BCF 0D.6 |
021B: MOVLW 07 |
021C: MOVWF 1C |
021D: MOVF 05,W |
021E: CLRWDT |
021F: MOVLW 02 |
0220: MOVWF 77 |
0221: DECFSZ 77,F |
0222: GOTO 221 |
0223: NOP |
0224: MOVF 1C,W |
0225: BCF 03.5 |
0226: BCF 0D.6 |
.................... setup_vref(FALSE); |
021E: BSF 03.5 |
021F: CLRF 1D |
0227: BSF 03.5 |
0228: CLRF 1D |
.................... |
.................... output_low(MENIC); // Vsechno zastav |
0220: BCF 06.3 |
0221: BCF 03.5 |
0222: BCF 06.3 |
0229: BCF 06.3 |
022A: BCF 03.5 |
022B: BCF 06.3 |
.................... output_low(MOTOR); |
0223: BSF 03.5 |
0224: BCF 06.2 |
0225: BCF 03.5 |
0226: BCF 06.2 |
022C: BSF 03.5 |
022D: BCF 06.2 |
022E: BCF 03.5 |
022F: BCF 06.2 |
.................... output_low(REFPWR); |
0227: BSF 03.5 |
0228: BCF 06.1 |
0229: BCF 03.5 |
022A: BCF 06.1 |
0230: BSF 03.5 |
0231: BCF 06.1 |
0232: BCF 03.5 |
0233: BCF 06.1 |
.................... output_high(LED); |
022B: BSF 03.5 |
022C: BCF 05.7 |
022D: BCF 03.5 |
022E: BSF 05.7 |
0234: BSF 03.5 |
0235: BCF 05.7 |
0236: BCF 03.5 |
0237: BSF 05.7 |
.................... output_high(PIEZO); |
022F: BSF 03.5 |
0230: BCF 05.6 |
0231: BCF 03.5 |
0232: BSF 05.6 |
0238: BSF 03.5 |
0239: BCF 05.6 |
023A: BCF 03.5 |
023B: BSF 05.6 |
.................... |
.................... set_adc_channel(NAPETI); // Vyber AD kanal pro pomerne mereni napeti |
0233: MOVLW 20 |
0234: MOVWF 78 |
0235: MOVF 1F,W |
0236: ANDLW C7 |
0237: IORWF 78,W |
0238: MOVWF 1F |
023C: MOVLW 20 |
023D: MOVWF 78 |
023E: MOVF 1F,W |
023F: ANDLW C7 |
0240: IORWF 78,W |
0241: MOVWF 1F |
.................... set_pwm1_duty(0); // Spust PWM, ale zatim s trvalou 0 na vystupu |
0239: CLRF 15 |
0242: CLRF 15 |
.................... setup_ccp1(CCP_PWM); |
023A: BSF 03.5 |
023B: BCF 06.3 |
023C: BCF 03.5 |
023D: BCF 06.3 |
023E: MOVLW 0C |
023F: MOVWF 17 |
0243: BSF 03.5 |
0244: BCF 06.3 |
0245: BCF 03.5 |
0246: BCF 06.3 |
0247: MOVLW 0C |
0248: MOVWF 17 |
.................... setup_timer_2(T2_DIV_BY_1,100,1); // perioda |
0240: MOVLW 00 |
0241: MOVWF 78 |
0242: IORLW 04 |
0243: MOVWF 12 |
0244: MOVLW 64 |
0245: BSF 03.5 |
0246: MOVWF 12 |
0249: MOVLW 00 |
024A: MOVWF 78 |
024B: IORLW 04 |
024C: MOVWF 12 |
024D: MOVLW 64 |
024E: BSF 03.5 |
024F: MOVWF 12 |
.................... |
.................... setup_oscillator(OSC_4MHZ|OSC_INTRC); // rozjed PIC (zvysi se odber) |
0247: MOVLW 62 |
0248: MOVWF 0F |
0250: MOVLW 62 |
0251: MOVWF 0F |
.................... |
.................... // jsme v depu? |
.................... set_pwm1_duty(DUTY1); // PWM pro zatizeni clanku pri malem osvetleni |
0249: MOVLW 02 |
024A: BCF 03.5 |
024B: MOVWF 15 |
0252: MOVLW 02 |
0253: BCF 03.5 |
0254: MOVWF 15 |
.................... n=0; |
024C: CLRF 6A |
0255: CLRF 6A |
.................... do |
.................... { |
.................... output_low(REFPWR); // Vypni napajeni napetove reference, aby se setrilo |
024D: BSF 03.5 |
024E: BCF 06.1 |
024F: BCF 03.5 |
0250: BCF 06.1 |
0256: BSF 03.5 |
0257: BCF 06.1 |
0258: BCF 03.5 |
0259: BCF 06.1 |
.................... delay_ms(100); |
0251: MOVLW 64 |
0252: MOVWF 6F |
0253: CALL 048 |
025A: MOVLW 64 |
025B: MOVWF 71 |
025C: CALL 03C |
.................... if (4==n++) {cvak(); n=0;}; // Kazdy 4. pruchod cvakni |
0254: MOVF 6A,W |
0255: INCF 6A,F |
0256: SUBLW 04 |
0257: BTFSS 03.2 |
0258: GOTO 25B |
0259: GOTO 05E |
025A: CLRF 6A |
025D: MOVF 6A,W |
025E: INCF 6A,F |
025F: SUBLW 04 |
0260: BTFSS 03.2 |
0261: GOTO 264 |
0262: GOTO 052 |
0263: CLRF 6A |
.................... output_high(REFPWR); // Zapni napajeni napetove reference |
025B: BSF 03.5 |
025C: BCF 06.1 |
025D: BCF 03.5 |
025E: BSF 06.1 |
0264: BSF 03.5 |
0265: BCF 06.1 |
0266: BCF 03.5 |
0267: BSF 06.1 |
.................... delay_ms(1); // Pockej na ustaleni napeti |
025F: MOVLW 01 |
0260: MOVWF 6F |
0261: CALL 048 |
0268: MOVLW 01 |
0269: MOVWF 71 |
026A: CALL 03C |
.................... } while (read_adc()>REFSTART); // Odkryl starter clanky? |
0262: BSF 1F.2 |
0263: BTFSC 1F.2 |
0264: GOTO 263 |
0265: MOVF 1E,W |
0266: SUBLW 5F |
0267: BTFSS 03.0 |
0268: GOTO 24D |
026B: BSF 1F.2 |
026C: BTFSC 1F.2 |
026D: GOTO 26C |
026E: MOVF 1E,W |
026F: SUBLW 5F |
0270: BTFSS 03.0 |
0271: GOTO 256 |
.................... output_low(REFPWR); // Vypni napajeni napetove reference, aby se setrilo |
0269: BSF 03.5 |
026A: BCF 06.1 |
026B: BCF 03.5 |
026C: BCF 06.1 |
0272: BSF 03.5 |
0273: BCF 06.1 |
0274: BCF 03.5 |
0275: BCF 06.1 |
.................... |
.................... // port_b_pullups(TRUE); // Zapni pullupy, aby slo cist DIPswitch |
.................... // do |
815,311 → 838,270 |
.................... // { |
.................... // Precti trimry |
.................... set_adc_channel(PWM); // Zjisteni nastaveni PWM |
026D: MOVLW 00 |
026E: MOVWF 78 |
026F: MOVF 1F,W |
0270: ANDLW C7 |
0271: IORWF 78,W |
0272: MOVWF 1F |
0276: MOVLW 00 |
0277: MOVWF 78 |
0278: MOVF 1F,W |
0279: ANDLW C7 |
027A: IORWF 78,W |
027B: MOVWF 1F |
.................... delay_us(100); // Pockej na prepnuti kanalu A/D prevodniku |
0273: CLRWDT |
0274: MOVLW 1F |
0275: MOVWF 77 |
0276: DECFSZ 77,F |
0277: GOTO 276 |
0278: NOP |
0279: NOP |
.................... perioda=(read_adc()>>1)+40; // rozsah: 40 az 167 |
027A: BSF 1F.2 |
027B: BTFSC 1F.2 |
027C: GOTO 27B |
027D: MOVF 1E,W |
027C: CLRWDT |
027D: MOVLW 1F |
027E: MOVWF 77 |
027F: BCF 03.0 |
0280: RRF 77,F |
0281: MOVF 77,W |
0282: ADDLW 28 |
0283: MOVWF 6B |
027F: DECFSZ 77,F |
0280: GOTO 27F |
0281: NOP |
0282: NOP |
.................... perioda=(read_adc()>>2)+40; // rozsah: 40 az 103 |
0283: BSF 1F.2 |
0284: BTFSC 1F.2 |
0285: GOTO 284 |
0286: MOVF 1E,W |
0287: MOVWF 77 |
0288: RRF 77,F |
0289: RRF 77,F |
028A: MOVLW 3F |
028B: ANDWF 77,F |
028C: MOVF 77,W |
028D: ADDLW 28 |
028E: MOVWF 6B |
.................... |
.................... set_adc_channel(ROZJEZD); // Zjisteni nastaveni rozjezdu |
0284: MOVLW 08 |
0285: MOVWF 78 |
0286: MOVF 1F,W |
0287: ANDLW C7 |
0288: IORWF 78,W |
0289: MOVWF 1F |
028F: MOVLW 08 |
0290: MOVWF 78 |
0291: MOVF 1F,W |
0292: ANDLW C7 |
0293: IORWF 78,W |
0294: MOVWF 1F |
.................... delay_us(100); // Pockej na prepnuti kanalu A/D prevodniku |
028A: CLRWDT |
028B: MOVLW 1F |
028C: MOVWF 77 |
028D: DECFSZ 77,F |
028E: GOTO 28D |
028F: NOP |
0290: NOP |
.................... razeni=read_adc()>>1; // rozsah: 0 az 127 |
0291: BSF 1F.2 |
0292: BTFSC 1F.2 |
0293: GOTO 292 |
0294: BCF 03.0 |
0295: RRF 1E,W |
0296: MOVWF 6C |
0295: CLRWDT |
0296: MOVLW 1F |
0297: MOVWF 77 |
0298: DECFSZ 77,F |
0299: GOTO 298 |
029A: NOP |
029B: NOP |
.................... razeni=read_adc()>>3; // rozsah: 0 az 31 |
029C: BSF 1F.2 |
029D: BTFSC 1F.2 |
029E: GOTO 29D |
029F: RRF 1E,W |
02A0: MOVWF 6C |
02A1: RRF 6C,F |
02A2: RRF 6C,F |
02A3: MOVLW 1F |
02A4: ANDWF 6C,F |
.................... |
.................... // Rozjeti menice |
.................... set_pwm1_duty(0); // Zastav PWM, aby slo nastavit jinou frekvenci |
0297: CLRF 15 |
02A5: CLRF 15 |
.................... setup_timer_2(T2_DIV_BY_1,perioda,1); // perioda |
0298: MOVLW 00 |
0299: MOVWF 78 |
029A: IORLW 04 |
029B: MOVWF 12 |
029C: MOVF 6B,W |
029D: BSF 03.5 |
029E: MOVWF 12 |
02A6: MOVLW 00 |
02A7: MOVWF 78 |
02A8: IORLW 04 |
02A9: MOVWF 12 |
02AA: MOVF 6B,W |
02AB: BSF 03.5 |
02AC: MOVWF 12 |
.................... set_pwm1_duty(DUTY2); // PWM pro zatizeni clanku pri jedne 500W zarovce |
029F: MOVLW 13 |
02A0: BCF 03.5 |
02A1: MOVWF 15 |
02AD: MOVLW 13 |
02AE: BCF 03.5 |
02AF: MOVWF 15 |
.................... |
.................... pip(); // potvrzeni odstartovani / servisni mod |
02A2: GOTO 06B |
02B0: GOTO 05F |
.................... delay_ms(500); |
02A3: MOVLW 02 |
02A4: MOVWF 6E |
02A5: MOVLW FA |
02A6: MOVWF 6F |
02A7: CALL 048 |
02A8: DECFSZ 6E,F |
02A9: GOTO 2A5 |
02B1: MOVLW 02 |
02B2: MOVWF 70 |
02B3: MOVLW FA |
02B4: MOVWF 71 |
02B5: CALL 03C |
02B6: DECFSZ 70,F |
02B7: GOTO 2B3 |
.................... |
.................... // } while (input(SW1)); // Je zapnut servisni mod? SW1(OFF)=ANO |
.................... // port_b_pullups(FALSE); // Vypni pullupy, aby se setrilo energii |
.................... |
.................... // Regulace nabíjení |
.................... // zmereni napeti na clancich |
.................... output_high(REFPWR); // Prepni AD na mereni napeti clanku |
02AA: BSF 03.5 |
02AB: BCF 06.1 |
02AC: BCF 03.5 |
02AD: BSF 06.1 |
02B8: BSF 03.5 |
02B9: BCF 06.1 |
02BA: BCF 03.5 |
02BB: BSF 06.1 |
.................... set_adc_channel(NAPETI); // Prepni Zmer napeti clanku |
02AE: MOVLW 20 |
02AF: MOVWF 78 |
02B0: MOVF 1F,W |
02B1: ANDLW C7 |
02B2: IORWF 78,W |
02B3: MOVWF 1F |
02BC: MOVLW 20 |
02BD: MOVWF 78 |
02BE: MOVF 1F,W |
02BF: ANDLW C7 |
02C0: IORWF 78,W |
02C1: MOVWF 1F |
.................... delay_us(50); // Pockej na prepnuti kanalu A/D prevodniku |
02B4: CLRWDT |
02B5: MOVLW 0F |
02B6: MOVWF 77 |
02B7: DECFSZ 77,F |
02B8: GOTO 2B7 |
02B9: NOP |
.................... for(n=1;n<=10;n++) |
02BA: MOVLW 01 |
02BB: MOVWF 6A |
02BC: MOVF 6A,W |
02BD: SUBLW 0A |
02BE: BTFSS 03.0 |
02BF: GOTO 2DC |
.................... { |
.................... // Zmer napeti (aktualni zatizeni clanku) |
.................... uclanku=read_adc(); |
02C0: BSF 1F.2 |
02C1: BTFSC 1F.2 |
02C2: GOTO 2C1 |
02C3: MOVF 1E,W |
02C4: MOVWF 6D |
.................... // Uprav parametry menice |
.................... if (uclanku>105) |
02C5: MOVF 6D,W |
02C6: SUBLW 69 |
02C7: BTFSC 03.0 |
02C8: GOTO 2CB |
.................... { |
.................... perioda++; |
02C9: INCF 6B,F |
.................... } |
.................... else |
02CA: GOTO 2CC |
.................... { |
.................... perioda--; |
02CB: DECF 6B,F |
.................... } |
.................... set_pwm1_duty(0); // Zastav PWM, aby slo nastavit jinou frekvenci |
02CC: CLRF 15 |
.................... setup_timer_2(T2_DIV_BY_1,perioda,1); // perioda |
02CD: MOVLW 00 |
02CE: MOVWF 78 |
02CF: IORLW 04 |
02D0: MOVWF 12 |
02D1: MOVF 6B,W |
02D2: BSF 03.5 |
02D3: MOVWF 12 |
.................... set_pwm1_duty(DUTY2); // PWM pro zatizeni clanku pri jedne 500W zarovce |
02D4: MOVLW 13 |
02D5: BCF 03.5 |
02D6: MOVWF 15 |
.................... delay_ms(100); |
02D7: MOVLW 64 |
02D8: MOVWF 6F |
02D9: CALL 048 |
.................... } |
02DA: INCF 6A,F |
02DB: GOTO 2BC |
.................... output_low(REFPWR); |
02DC: BSF 03.5 |
02DD: BCF 06.1 |
02DE: BCF 03.5 |
02DF: BCF 06.1 |
02C2: CLRWDT |
02C3: MOVLW 0F |
02C4: MOVWF 77 |
02C5: DECFSZ 77,F |
02C6: GOTO 2C5 |
02C7: NOP |
.................... uclanku=read_adc(); |
02C8: BSF 1F.2 |
02C9: BTFSC 1F.2 |
02CA: GOTO 2C9 |
02CB: MOVF 1E,W |
02CC: MOVWF 6D |
.................... output_low(REFPWR); // odpoj odpor pro mereni napeti |
02CD: BSF 03.5 |
02CE: BCF 06.1 |
02CF: BCF 03.5 |
02D0: BCF 06.1 |
.................... |
.................... // posli telemetrii |
.................... sprintf(AXstring,"p=%u r=%u u=%u", perioda, razeni, uclanku); // Convert DATA to String. |
* |
01E1: CLRF 69 |
01EA: CLRF 69 |
* |
02E0: MOVLW 40 |
02E1: MOVWF 69 |
02E2: MOVLW 70 |
02E3: MOVWF 70 |
02E4: CALL 095 |
02E5: MOVLW 3D |
02E6: MOVWF 70 |
02E7: CALL 095 |
02E8: MOVF 6B,W |
02E9: MOVWF 6E |
02EA: MOVLW 1B |
02EB: MOVWF 6F |
02EC: CALL 0B2 |
02ED: MOVLW 20 |
02EE: MOVWF 70 |
02EF: CALL 095 |
02F0: MOVLW 72 |
02F1: MOVWF 70 |
02F2: CALL 095 |
02F3: MOVLW 3D |
02F4: MOVWF 70 |
02F5: CALL 095 |
02F6: MOVF 6C,W |
02F7: MOVWF 6E |
02F8: MOVLW 1B |
02F9: MOVWF 6F |
02FA: CALL 0B2 |
02FB: MOVLW 20 |
02FC: MOVWF 70 |
02FD: CALL 095 |
02FE: MOVLW 75 |
02FF: MOVWF 70 |
0300: CALL 095 |
0301: MOVLW 3D |
0302: MOVWF 70 |
0303: CALL 095 |
0304: MOVF 6D,W |
0305: MOVWF 6E |
0306: MOVLW 1B |
0307: MOVWF 6F |
0308: CALL 0B2 |
02D1: MOVLW 40 |
02D2: MOVWF 69 |
02D3: MOVLW 70 |
02D4: MOVWF 72 |
02D5: CALL 08B |
02D6: MOVLW 3D |
02D7: MOVWF 72 |
02D8: CALL 08B |
02D9: MOVF 6B,W |
02DA: MOVWF 70 |
02DB: MOVLW 1B |
02DC: MOVWF 71 |
02DD: CALL 0A8 |
02DE: MOVLW 20 |
02DF: MOVWF 72 |
02E0: CALL 08B |
02E1: MOVLW 72 |
02E2: MOVWF 72 |
02E3: CALL 08B |
02E4: MOVLW 3D |
02E5: MOVWF 72 |
02E6: CALL 08B |
02E7: MOVF 6C,W |
02E8: MOVWF 70 |
02E9: MOVLW 1B |
02EA: MOVWF 71 |
02EB: CALL 0A8 |
02EC: MOVLW 20 |
02ED: MOVWF 72 |
02EE: CALL 08B |
02EF: MOVLW 75 |
02F0: MOVWF 72 |
02F1: CALL 08B |
02F2: MOVLW 3D |
02F3: MOVWF 72 |
02F4: CALL 08B |
02F5: MOVF 6D,W |
02F6: MOVWF 70 |
02F7: MOVLW 1B |
02F8: MOVWF 71 |
02F9: CALL 0A8 |
.................... SendPacket(&AXstring[0]); |
0309: MOVLW 40 |
030A: MOVWF 6E |
030B: GOTO 177 |
02FA: MOVLW 40 |
02FB: MOVWF 70 |
02FC: GOTO 16D |
.................... |
.................... delay_ms(13000); // Pockame 14s |
030C: MOVLW 34 |
030D: MOVWF 6E |
030E: MOVLW FA |
030F: MOVWF 6F |
0310: CALL 048 |
0311: DECFSZ 6E,F |
0312: GOTO 30E |
.................... delay_ms(14000); // Pockame do 14.5s |
02FD: MOVLW 38 |
02FE: MOVWF 70 |
02FF: MOVLW FA |
0300: MOVWF 71 |
0301: CALL 03C |
0302: DECFSZ 70,F |
0303: GOTO 2FF |
.................... |
.................... // rozjezd |
.................... SSPSTAT = 0; // inicializace SPI jednotky |
0313: BSF 03.5 |
0314: CLRF 14 |
.................... SSPCON1 = 0x22; // SPI OSC/64 |
0315: MOVLW 22 |
0316: BCF 03.5 |
0317: MOVWF 14 |
.................... MotorPattern=0x02; // prvni data pro vyslani |
0318: MOVLW 02 |
0319: MOVWF 68 |
.................... SSPBUF=MotorPattern; |
031A: MOVF 68,W |
031B: MOVWF 13 |
.................... enable_interrupts(global); |
031C: MOVLW C0 |
031D: IORWF 0B,F |
.................... enable_interrupts(INT_SSP); // az budou vyslana, prijde interrupt od SSP |
031E: BSF 03.5 |
031F: BSF 0C.3 |
.................... |
.................... for(n=0; n<=7; n++) // razeni osmi rychlostnich stupnu |
0320: BCF 03.5 |
0321: CLRF 6A |
0322: MOVF 6A,W |
0323: SUBLW 07 |
0324: BTFSS 03.0 |
0325: GOTO 32F |
.................... { |
.................... MotorPattern=Pattern[n]; |
0326: MOVF 6A,W |
0327: CALL 037 |
0328: MOVWF 78 |
0329: MOVWF 68 |
.................... delay_ms(razeni); // Pockej na dalsi razeni |
032A: MOVF 6C,W |
032B: MOVWF 6F |
032C: CALL 048 |
.................... }; |
.................... // rozjezd |
.................... for(ble=1;ble<=1000;ble++) |
0304: CLRF 6F |
0305: MOVLW 01 |
0306: MOVWF 6E |
0307: MOVF 6F,W |
0308: SUBLW 03 |
0309: BTFSS 03.0 |
030A: GOTO 333 |
030B: BTFSS 03.2 |
030C: GOTO 311 |
030D: MOVF 6E,W |
030E: SUBLW E8 |
030F: BTFSS 03.0 |
0310: GOTO 333 |
.................... { |
.................... for(n=0;n<=razeni;n++) |
0311: CLRF 6A |
0312: MOVF 6A,W |
0313: SUBWF 6C,W |
0314: BTFSS 03.0 |
0315: GOTO 32F |
.................... { |
.................... output_high(MOTOR); |
0316: BSF 03.5 |
0317: BCF 06.2 |
0318: BCF 03.5 |
0319: BSF 06.2 |
.................... delay_us(ble); |
031A: MOVF 6E,W |
031B: MOVWF 72 |
031C: CALL 1B0 |
.................... output_low(MOTOR); |
031D: BSF 03.5 |
031E: BCF 06.2 |
031F: BCF 03.5 |
0320: BCF 06.2 |
.................... delay_us(1000-ble); |
0321: MOVF 6E,W |
0322: SUBLW E8 |
0323: MOVWF 70 |
0324: MOVLW 03 |
0325: MOVWF 71 |
0326: MOVF 6F,W |
0327: BTFSS 03.0 |
0328: INCFSZ 6F,W |
0329: SUBWF 71,F |
032A: MOVF 70,W |
032B: MOVWF 72 |
032C: CALL 1B0 |
.................... } |
032D: INCF 6A,F |
032E: GOTO 322 |
.................... SSPSTAT = 0; |
032F: BSF 03.5 |
0330: CLRF 14 |
.................... SSPCON1 = 0; // SPI stop |
0331: BCF 03.5 |
0332: CLRF 14 |
.................... disable_interrupts(INT_SSP); // zastav preruseni od SSP |
0333: BSF 03.5 |
0334: BCF 0C.3 |
032E: GOTO 312 |
.................... } |
032F: INCF 6E,F |
0330: BTFSC 03.2 |
0331: INCF 6F,F |
0332: GOTO 307 |
.................... |
.................... // jedem co to da |
.................... output_high(MOTOR); |
0335: BCF 06.2 |
0336: BCF 03.5 |
0337: BSF 06.2 |
0333: BSF 03.5 |
0334: BCF 06.2 |
0335: BCF 03.5 |
0336: BSF 06.2 |
.................... |
.................... /* |
.................... if (TRUE) // Venkovni jizda? |
.................... { |
.................... delay_ms(5000); // Venku muzeme jet 5s |
.................... set_pwm1_duty(0); // Zastav menic |
.................... // output_low(MOTOR); // Zastav motor |
.................... while(TRUE) restart_wdt(); // Cekej porad |
.................... }; |
.................... delay_ms(3000); |
.................... */ |
.................... delay_ms(1300); // Nemeli bysme jet dele nez 1,3s :-) |
0338: MOVLW 0A |
0339: MOVWF 6E |
033A: MOVLW 82 |
033B: MOVWF 6F |
033C: CALL 048 |
033D: DECFSZ 6E,F |
033E: GOTO 33A |
0337: MOVLW 0A |
0338: MOVWF 70 |
0339: MOVLW 82 |
033A: MOVWF 71 |
033B: CALL 03C |
033C: DECFSZ 70,F |
033D: GOTO 339 |
.................... output_low(MOTOR); // Zastav motor |
033F: BSF 03.5 |
0340: BCF 06.2 |
0341: BCF 03.5 |
0342: BCF 06.2 |
033E: BSF 03.5 |
033F: BCF 06.2 |
0340: BCF 03.5 |
0341: BCF 06.2 |
.................... // Menic je stale zapnut a zatezuje clanky |
.................... |
.................... while(TRUE); // Cekej, dokud se neztrati svetlo, |
0343: GOTO 343 |
0342: GOTO 342 |
.................... // nebo prijde WatchDog |
.................... |
.................... } |
0344: SLEEP |
0343: SLEEP |
|
Configuration Fuses: |
Word 1: 273C WDT NOPUT MCLR NOBROWNOUT NOLVP NOCPD NOWRT DEBUG CCPB3 NOPROTECT INTRC_IO |
Word 1: 2738 NOWDT NOPUT MCLR NOBROWNOUT NOLVP NOCPD NOWRT DEBUG CCPB3 NOPROTECT INTRC_IO |
Word 2: 3FFC NOFCMEN NOIESO |