0,0 → 1,340 |
CCS PCW C Compiler, Version 3.110, 15448 |
|
Filename: d:\@kaklik\programy\pic_c\mereni\serva\main.LST |
|
ROM used: 239 (23%) |
Largest free fragment is 785 |
RAM used: 4 (6%) at main() level |
5 (7%) worst case |
Stack: 1 locations |
|
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 027 |
0003: NOP |
.................... #include "D:\@Kaklik\programy\PIC_C\mereni\serva\main.h" |
.................... #include <16F84.h> |
.................... //////// Standard Header file for the PIC16F84 device //////////////// |
.................... #device PIC16F84 |
.................... #list |
.................... |
.................... #use delay(clock=4000000) |
0004: MOVLW 10 |
0005: MOVWF 04 |
0006: MOVF 00,W |
0007: BTFSC 03.2 |
0008: GOTO 018 |
0009: MOVLW 01 |
000A: MOVWF 0D |
000B: CLRF 0C |
000C: DECFSZ 0C,F |
000D: GOTO 00C |
000E: DECFSZ 0D,F |
000F: GOTO 00B |
0010: MOVLW 4A |
0011: MOVWF 0C |
0012: DECFSZ 0C,F |
0013: GOTO 012 |
0014: NOP |
0015: NOP |
0016: DECFSZ 00,F |
0017: GOTO 009 |
0018: RETLW 00 |
0019: MOVLW 11 |
001A: MOVWF 04 |
001B: MOVLW FC |
001C: ANDWF 00,F |
001D: RRF 00,F |
001E: RRF 00,F |
001F: MOVF 00,W |
0020: BTFSC 03.2 |
0021: GOTO 026 |
0022: GOTO 024 |
0023: NOP |
0024: DECFSZ 00,F |
0025: GOTO 023 |
0026: RETLW 00 |
.................... #fuses XT,NOWDT |
.................... |
.................... |
.................... #DEFINE servo1 PIN_A4 |
.................... #DEFINE servo2 PIN_A3 |
.................... #DEFINE servo3 PIN_A2 |
.................... #DEFINE servo4 PIN_A0 |
.................... #DEFINE SW PIN_A1 |
.................... |
.................... void main() |
.................... { |
.................... int i; |
0027: CLRF 04 |
0028: MOVLW 1F |
0029: ANDWF 03,F |
.................... |
.................... while(true) |
.................... { |
.................... While(input(SW)) |
002A: BSF 03.5 |
002B: BSF 05.1 |
002C: BCF 03.5 |
002D: BTFSS 05.1 |
002E: GOTO 07B |
.................... { |
.................... output_high(servo1); |
002F: BSF 03.5 |
0030: BCF 05.4 |
0031: BCF 03.5 |
0032: BSF 05.4 |
.................... Delay_us(1500); |
0033: MOVLW 01 |
0034: MOVWF 10 |
0035: CALL 004 |
0036: MOVLW 02 |
0037: MOVWF 10 |
0038: MOVLW EC |
0039: MOVWF 11 |
003A: CALL 019 |
003B: DECFSZ 10,F |
003C: GOTO 038 |
.................... output_low(servo1); |
003D: BSF 03.5 |
003E: BCF 05.4 |
003F: BCF 03.5 |
0040: BCF 05.4 |
.................... |
.................... output_high(servo2); |
0041: BSF 03.5 |
0042: BCF 05.3 |
0043: BCF 03.5 |
0044: BSF 05.3 |
.................... Delay_us(1500); |
0045: MOVLW 01 |
0046: MOVWF 10 |
0047: CALL 004 |
0048: MOVLW 02 |
0049: MOVWF 10 |
004A: MOVLW EC |
004B: MOVWF 11 |
004C: CALL 019 |
004D: DECFSZ 10,F |
004E: GOTO 04A |
.................... output_low(servo2); |
004F: BSF 03.5 |
0050: BCF 05.3 |
0051: BCF 03.5 |
0052: BCF 05.3 |
.................... |
.................... output_high(servo3); |
0053: BSF 03.5 |
0054: BCF 05.2 |
0055: BCF 03.5 |
0056: BSF 05.2 |
.................... Delay_us(1500); |
0057: MOVLW 01 |
0058: MOVWF 10 |
0059: CALL 004 |
005A: MOVLW 02 |
005B: MOVWF 10 |
005C: MOVLW EC |
005D: MOVWF 11 |
005E: CALL 019 |
005F: DECFSZ 10,F |
0060: GOTO 05C |
.................... output_low(servo3); |
0061: BSF 03.5 |
0062: BCF 05.2 |
0063: BCF 03.5 |
0064: BCF 05.2 |
.................... |
.................... output_high(servo4); |
0065: BSF 03.5 |
0066: BCF 05.0 |
0067: BCF 03.5 |
0068: BSF 05.0 |
.................... Delay_us(1500); |
0069: MOVLW 01 |
006A: MOVWF 10 |
006B: CALL 004 |
006C: MOVLW 02 |
006D: MOVWF 10 |
006E: MOVLW EC |
006F: MOVWF 11 |
0070: CALL 019 |
0071: DECFSZ 10,F |
0072: GOTO 06E |
.................... output_low(servo4); |
0073: BSF 03.5 |
0074: BCF 05.0 |
0075: BCF 03.5 |
0076: BCF 05.0 |
.................... |
.................... Delay_ms(10); |
0077: MOVLW 0A |
0078: MOVWF 10 |
0079: CALL 004 |
.................... } |
007A: GOTO 02A |
.................... |
.................... While(!input(SW)) |
007B: BSF 03.5 |
007C: BSF 05.1 |
007D: BCF 03.5 |
007E: BTFSC 05.1 |
007F: GOTO 0ED |
.................... { |
.................... for(i=0; i<100; ++i) |
0080: CLRF 0F |
0081: MOVF 0F,W |
0082: SUBLW 63 |
0083: BTFSS 03.0 |
0084: GOTO 0B6 |
.................... { |
.................... output_high(servo1); |
0085: BSF 03.5 |
0086: BCF 05.4 |
0087: BCF 03.5 |
0088: BSF 05.4 |
.................... Delay_us(1000); |
0089: MOVLW 01 |
008A: MOVWF 10 |
008B: CALL 004 |
.................... output_low(servo1); |
008C: BSF 03.5 |
008D: BCF 05.4 |
008E: BCF 03.5 |
008F: BCF 05.4 |
.................... |
.................... output_high(servo2); |
0090: BSF 03.5 |
0091: BCF 05.3 |
0092: BCF 03.5 |
0093: BSF 05.3 |
.................... Delay_us(1000); |
0094: MOVLW 01 |
0095: MOVWF 10 |
0096: CALL 004 |
.................... output_low(servo2); |
0097: BSF 03.5 |
0098: BCF 05.3 |
0099: BCF 03.5 |
009A: BCF 05.3 |
.................... |
.................... output_high(servo3); |
009B: BSF 03.5 |
009C: BCF 05.2 |
009D: BCF 03.5 |
009E: BSF 05.2 |
.................... Delay_us(1000); |
009F: MOVLW 01 |
00A0: MOVWF 10 |
00A1: CALL 004 |
.................... output_low(servo3); |
00A2: BSF 03.5 |
00A3: BCF 05.2 |
00A4: BCF 03.5 |
00A5: BCF 05.2 |
.................... |
.................... output_high(servo4); |
00A6: BSF 03.5 |
00A7: BCF 05.0 |
00A8: BCF 03.5 |
00A9: BSF 05.0 |
.................... Delay_us(1000); |
00AA: MOVLW 01 |
00AB: MOVWF 10 |
00AC: CALL 004 |
.................... output_low(servo4); |
00AD: BSF 03.5 |
00AE: BCF 05.0 |
00AF: BCF 03.5 |
00B0: BCF 05.0 |
.................... |
.................... Delay_ms(10); |
00B1: MOVLW 0A |
00B2: MOVWF 10 |
00B3: CALL 004 |
.................... } |
00B4: INCF 0F,F |
00B5: GOTO 081 |
.................... |
.................... for(i=0; i<100; ++i) |
00B6: CLRF 0F |
00B7: MOVF 0F,W |
00B8: SUBLW 63 |
00B9: BTFSS 03.0 |
00BA: GOTO 0EC |
.................... { |
.................... output_high(servo1); |
00BB: BSF 03.5 |
00BC: BCF 05.4 |
00BD: BCF 03.5 |
00BE: BSF 05.4 |
.................... Delay_us(2000); |
00BF: MOVLW 02 |
00C0: MOVWF 10 |
00C1: CALL 004 |
.................... output_low(servo1); |
00C2: BSF 03.5 |
00C3: BCF 05.4 |
00C4: BCF 03.5 |
00C5: BCF 05.4 |
.................... |
.................... output_high(servo2); |
00C6: BSF 03.5 |
00C7: BCF 05.3 |
00C8: BCF 03.5 |
00C9: BSF 05.3 |
.................... Delay_us(2000); |
00CA: MOVLW 02 |
00CB: MOVWF 10 |
00CC: CALL 004 |
.................... output_low(servo2); |
00CD: BSF 03.5 |
00CE: BCF 05.3 |
00CF: BCF 03.5 |
00D0: BCF 05.3 |
.................... |
.................... output_high(servo3); |
00D1: BSF 03.5 |
00D2: BCF 05.2 |
00D3: BCF 03.5 |
00D4: BSF 05.2 |
.................... Delay_us(2000); |
00D5: MOVLW 02 |
00D6: MOVWF 10 |
00D7: CALL 004 |
.................... output_low(servo3); |
00D8: BSF 03.5 |
00D9: BCF 05.2 |
00DA: BCF 03.5 |
00DB: BCF 05.2 |
.................... |
.................... output_high(servo4); |
00DC: BSF 03.5 |
00DD: BCF 05.0 |
00DE: BCF 03.5 |
00DF: BSF 05.0 |
.................... Delay_us(2000); |
00E0: MOVLW 02 |
00E1: MOVWF 10 |
00E2: CALL 004 |
.................... output_low(servo4); |
00E3: BSF 03.5 |
00E4: BCF 05.0 |
00E5: BCF 03.5 |
00E6: BCF 05.0 |
.................... |
.................... Delay_ms(10); |
00E7: MOVLW 0A |
00E8: MOVWF 10 |
00E9: CALL 004 |
.................... } |
00EA: INCF 0F,F |
00EB: GOTO 0B7 |
.................... } |
00EC: GOTO 07B |
.................... } |
00ED: GOTO 02A |
.................... } |
.................... |
00EE: SLEEP |