Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

Rev Author Line No. Line
2 kaklik 1
CCS PCW C Compiler, Version 3.110, 15448
2
 
3
               Filename: d:\@kaklik\programy\pic_c\robot\auto\main.LST
4
 
5
               ROM used: 188 (18%)
6
                         Largest free fragment is 836
7
               RAM used: 4 (11%) at main() level
8
                         5 (14%) worst case
9
               Stack:    2 locations
10
 
11
*
12
0000:  MOVLW  00
13
0001:  MOVWF  0A
14
0002:  GOTO   071
15
0003:  NOP
16
....................  #include "D:\@Kaklik\programy\PIC_C\robot\auto\main.h" 
17
....................  #include <16C84.h> 
18
....................  //////// Standard Header file for the PIC16C84 device ////////////////  
19
.................... #device PIC16C84  
20
.................... #list  
21
....................  
22
.................... #use delay(clock=4000000)  
23
0004:  MOVLW  10
24
0005:  MOVWF  04
25
0006:  MOVF   00,W
26
0007:  BTFSC  03.2
27
0008:  GOTO   018
28
0009:  MOVLW  01
29
000A:  MOVWF  0D
30
000B:  CLRF   0C
31
000C:  DECFSZ 0C,F
32
000D:  GOTO   00C
33
000E:  DECFSZ 0D,F
34
000F:  GOTO   00B
35
0010:  MOVLW  4A
36
0011:  MOVWF  0C
37
0012:  DECFSZ 0C,F
38
0013:  GOTO   012
39
0014:  NOP
40
0015:  NOP
41
0016:  DECFSZ 00,F
42
0017:  GOTO   009
43
0018:  RETLW  00
44
.................... #fuses XT,NOWDT  
45
....................   
46
....................  
47
....................   
48
.................... #DEFINE     CIDLO1L      PIN_B0  
49
.................... #DEFINE     CIDLO1R      PIN_B1  
50
.................... #DEFINE     CIDLO2L      PIN_B2  
51
.................... #DEFINE     CIDLO2R      PIN_B3  
52
....................   
53
.................... #DEFINE     RELE1       PIN_B5  
54
.................... #DEFINE     RELE2       PIN_B6  
55
.................... #DEFINE     MOTOR1      PIN_B4  
56
.................... #DEFINE     MOTOR2      PIN_A0  
57
.................... #DEFINE     MOTOR2a     PIN_A1  
58
....................   
59
.................... #DEFINE     LASER       PIN_A2  
60
....................   
61
.................... #DEFINE  L  0  
62
.................... #DEFINE  R  1  
63
....................   
64
.................... int cara;  
65
.................... int movement;  
66
....................   
67
.................... void left()  
68
.................... {  
69
....................    output_high(RELE1);     
70
*
71
0041:  BSF    03.5
72
0042:  BCF    06.5
73
0043:  BCF    03.5
74
0044:  BSF    06.5
75
....................    output_high(RELE2);  
76
0045:  BSF    03.5
77
0046:  BCF    06.6
78
0047:  BCF    03.5
79
0048:  BSF    06.6
80
....................    delay_ms(100);  
81
0049:  MOVLW  64
82
004A:  MOVWF  10
83
004B:  CALL   004
84
....................    output_high(MOTOR1);  
85
004C:  BSF    03.5
86
004D:  BCF    06.4
87
004E:  BCF    03.5
88
004F:  BSF    06.4
89
....................    output_high(MOTOR2);  
90
0050:  BSF    03.5
91
0051:  BCF    05.0
92
0052:  BCF    03.5
93
0053:  BSF    05.0
94
....................    output_high(MOTOR2a);  
95
0054:  BSF    03.5
96
0055:  BCF    05.1
97
0056:  BCF    03.5
98
0057:  BSF    05.1
99
0058:  GOTO   0A4 (RETURN)
100
.................... }  
101
....................   
102
.................... void right()  
103
.................... {  
104
....................    output_low(RELE1);        
105
0059:  BSF    03.5
106
005A:  BCF    06.5
107
005B:  BCF    03.5
108
005C:  BCF    06.5
109
....................    output_low(RELE2);  
110
005D:  BSF    03.5
111
005E:  BCF    06.6
112
005F:  BCF    03.5
113
0060:  BCF    06.6
114
....................    delay_ms(100);  
115
0061:  MOVLW  64
116
0062:  MOVWF  10
117
0063:  CALL   004
118
....................    output_high(MOTOR1);  
119
0064:  BSF    03.5
120
0065:  BCF    06.4
121
0066:  BCF    03.5
122
0067:  BSF    06.4
123
....................    output_high(MOTOR2);  
124
0068:  BSF    03.5
125
0069:  BCF    05.0
126
006A:  BCF    03.5
127
006B:  BSF    05.0
128
....................    output_high(MOTOR2a);  
129
006C:  BSF    03.5
130
006D:  BCF    05.1
131
006E:  BCF    03.5
132
006F:  BSF    05.1
133
0070:  GOTO   0B1 (RETURN)
134
.................... }  
135
....................   
136
.................... void rovne()  
137
.................... {  
138
....................    output_low(RELE1);      // oba motory vpred  
139
*
140
0029:  BSF    03.5
141
002A:  BCF    06.5
142
002B:  BCF    03.5
143
002C:  BCF    06.5
144
....................    output_high(RELE2);  
145
002D:  BSF    03.5
146
002E:  BCF    06.6
147
002F:  BCF    03.5
148
0030:  BSF    06.6
149
....................    delay_ms(100);  
150
0031:  MOVLW  64
151
0032:  MOVWF  10
152
0033:  CALL   004
153
....................    output_high(MOTOR1);  
154
0034:  BSF    03.5
155
0035:  BCF    06.4
156
0036:  BCF    03.5
157
0037:  BSF    06.4
158
....................    output_high(MOTOR2);  
159
0038:  BSF    03.5
160
0039:  BCF    05.0
161
003A:  BCF    03.5
162
003B:  BSF    05.0
163
....................    output_high(MOTOR2a);  
164
003C:  BSF    03.5
165
003D:  BCF    05.1
166
003E:  BCF    03.5
167
003F:  BSF    05.1
168
0040:  RETLW  00
169
.................... }  
170
....................   
171
.................... void stop()  
172
.................... {  
173
....................    output_low(MOTOR1);  
174
*
175
0019:  BSF    03.5
176
001A:  BCF    06.4
177
001B:  BCF    03.5
178
001C:  BCF    06.4
179
....................    output_low(MOTOR2);  
180
001D:  BSF    03.5
181
001E:  BCF    05.0
182
001F:  BCF    03.5
183
0020:  BCF    05.0
184
....................    output_low(MOTOR2a);  
185
0021:  BSF    03.5
186
0022:  BCF    05.1
187
0023:  BCF    03.5
188
0024:  BCF    05.1
189
....................    delay_ms(100);  
190
0025:  MOVLW  64
191
0026:  MOVWF  10
192
0027:  CALL   004
193
0028:  RETLW  00
194
.................... }  
195
....................   
196
....................   
197
.................... void main()  
198
.................... {  
199
*
200
0071:  CLRF   04
201
0072:  MOVLW  1F
202
0073:  ANDWF  03,F
203
....................    cara=L;  
204
0074:  CLRF   0E
205
....................    movement=R;  
206
0075:  MOVLW  01
207
0076:  MOVWF  0F
208
....................    output_low(RELE1);      // oba motory vpred  
209
0077:  BSF    03.5
210
0078:  BCF    06.5
211
0079:  BCF    03.5
212
007A:  BCF    06.5
213
....................    output_high(RELE2);  
214
007B:  BSF    03.5
215
007C:  BCF    06.6
216
007D:  BCF    03.5
217
007E:  BSF    06.6
218
....................    delay_ms(100);  
219
007F:  MOVLW  64
220
0080:  MOVWF  10
221
0081:  CALL   004
222
....................    while (true)  
223
....................    {  
224
....................          if (!input(CIDLO1R)) cara=R; // cara vpravo  
225
0082:  BSF    03.5
226
0083:  BSF    06.1
227
0084:  BCF    03.5
228
0085:  BTFSC  06.1
229
0086:  GOTO   089
230
0087:  MOVLW  01
231
0088:  MOVWF  0E
232
....................          if (!input(CIDLO1L)) cara=L; // cara vlevo  
233
0089:  BSF    03.5
234
008A:  BSF    06.0
235
008B:  BCF    03.5
236
008C:  BTFSC  06.0
237
008D:  GOTO   08F
238
008E:  CLRF   0E
239
....................            
240
....................   
241
....................          if (cara != movement)  
242
008F:  MOVF   0F,W
243
0090:  SUBWF  0E,W
244
0091:  BTFSC  03.2
245
0092:  GOTO   0B4
246
....................          {  
247
....................             switch(cara)  
248
0093:  MOVF   0E,W
249
0094:  ADDLW  FE
250
0095:  BTFSC  03.0
251
0096:  GOTO   0B4
252
0097:  ADDLW  02
253
0098:  GOTO   0B6
254
....................             {  
255
....................               case L:  
256
....................                  output_high(LASER);  
257
0099:  BSF    03.5
258
009A:  BCF    05.2
259
009B:  BCF    03.5
260
009C:  BSF    05.2
261
....................             stop();  
262
009D:  CALL   019
263
....................             rovne();  
264
009E:  CALL   029
265
....................             delay_ms(100);         
266
009F:  MOVLW  64
267
00A0:  MOVWF  10
268
00A1:  CALL   004
269
....................                  stop();  
270
00A2:  CALL   019
271
....................                  left();  
272
00A3:  GOTO   041
273
....................                  movement=L;  
274
00A4:  CLRF   0F
275
....................                 break;  
276
00A5:  GOTO   0B4
277
....................                   
278
....................               case R:  
279
....................             stop();  
280
00A6:  CALL   019
281
....................             rovne();  
282
00A7:  CALL   029
283
....................             delay_ms(100);         
284
00A8:  MOVLW  64
285
00A9:  MOVWF  10
286
00AA:  CALL   004
287
....................                  output_low(LASER);  
288
00AB:  BSF    03.5
289
00AC:  BCF    05.2
290
00AD:  BCF    03.5
291
00AE:  BCF    05.2
292
....................                  stop();  
293
00AF:  CALL   019
294
....................                  right();  
295
00B0:  GOTO   059
296
....................                  movement=R;  
297
00B1:  MOVLW  01
298
00B2:  MOVWF  0F
299
....................                 break;             
300
00B3:  GOTO   0B4
301
....................             }  
302
*
303
00B6:  BCF    0A.0
304
00B7:  BCF    0A.1
305
00B8:  BCF    0A.2
306
00B9:  ADDWF  02,F
307
00BA:  GOTO   099
308
00BB:  GOTO   0A6
309
....................          }  
310
....................    }  
311
*
312
00B4:  GOTO   082
313
.................... }  
314
....................  
315
00B5:  SLEEP