503 |
kaklik |
1 |
CCS PCM C Compiler, Version 3.221, 27853 18-VI-05 13:30 |
|
|
2 |
|
|
|
3 |
Filename: D:\KAKLIK\programy\PIC_C\roboti\merkur\PIC16F88\MerkurU\tank.LST |
|
|
4 |
|
|
|
5 |
ROM used: 1441 words (35%) |
|
|
6 |
Largest free fragment is 2048 |
|
|
7 |
RAM used: 27 (15%) at main() level |
|
|
8 |
34 (19%) worst case |
|
|
9 |
Stack: 4 worst case (3 in main + 1 for interrupts) |
|
|
10 |
|
|
|
11 |
* |
|
|
12 |
0000: MOVLW 00 |
|
|
13 |
0001: MOVWF 0A |
|
|
14 |
0002: GOTO 2D1 |
|
|
15 |
0003: NOP |
|
|
16 |
0004: MOVWF 7F |
|
|
17 |
0005: SWAPF 03,W |
|
|
18 |
0006: CLRF 03 |
|
|
19 |
0007: MOVWF 21 |
|
|
20 |
0008: MOVF 7F,W |
|
|
21 |
0009: MOVWF 20 |
|
|
22 |
000A: MOVF 0A,W |
|
|
23 |
000B: MOVWF 28 |
|
|
24 |
000C: CLRF 0A |
|
|
25 |
000D: SWAPF 20,F |
|
|
26 |
000E: MOVF 04,W |
|
|
27 |
000F: MOVWF 22 |
|
|
28 |
0010: MOVF 77,W |
|
|
29 |
0011: MOVWF 23 |
|
|
30 |
0012: MOVF 78,W |
|
|
31 |
0013: MOVWF 24 |
|
|
32 |
0014: MOVF 79,W |
|
|
33 |
0015: MOVWF 25 |
|
|
34 |
0016: MOVF 7A,W |
|
|
35 |
0017: MOVWF 26 |
|
|
36 |
0018: MOVF 7B,W |
|
|
37 |
0019: MOVWF 27 |
|
|
38 |
001A: BCF 03.7 |
|
|
39 |
001B: BCF 03.5 |
|
|
40 |
001C: MOVLW 8C |
|
|
41 |
001D: MOVWF 04 |
|
|
42 |
001E: BTFSS 00.1 |
|
|
43 |
001F: GOTO 022 |
|
|
44 |
0020: BTFSC 0C.1 |
|
|
45 |
0021: GOTO 035 |
|
|
46 |
0022: MOVF 22,W |
|
|
47 |
0023: MOVWF 04 |
|
|
48 |
0024: MOVF 23,W |
|
|
49 |
0025: MOVWF 77 |
|
|
50 |
0026: MOVF 24,W |
|
|
51 |
0027: MOVWF 78 |
|
|
52 |
0028: MOVF 25,W |
|
|
53 |
0029: MOVWF 79 |
|
|
54 |
002A: MOVF 26,W |
|
|
55 |
002B: MOVWF 7A |
|
|
56 |
002C: MOVF 27,W |
|
|
57 |
002D: MOVWF 7B |
|
|
58 |
002E: MOVF 28,W |
|
|
59 |
002F: MOVWF 0A |
|
|
60 |
0030: SWAPF 21,W |
|
|
61 |
0031: MOVWF 03 |
|
|
62 |
0032: SWAPF 7F,F |
|
|
63 |
0033: SWAPF 7F,W |
|
|
64 |
0034: RETFIE |
|
|
65 |
0035: BCF 0A.3 |
|
|
66 |
0036: GOTO 037 |
|
|
67 |
.................... // Program pro predvadeni schopnosti robota Merkur |
|
|
68 |
.................... //------------------------------------------------ |
|
|
69 |
.................... |
|
|
70 |
.................... #include "tank.h" |
|
|
71 |
.................... #include <16F88.h> |
|
|
72 |
.................... //////// Standard Header file for the PIC16F88 device //////////////// |
|
|
73 |
.................... #device PIC16F88 |
|
|
74 |
.................... #list |
|
|
75 |
.................... |
|
|
76 |
.................... #device adc=8 |
|
|
77 |
.................... #fuses NOWDT,INTRC_IO, NOPUT, MCLR, NOBROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG, NOPROTECT, NOFCMEN, NOIESO |
|
|
78 |
.................... #use delay(clock=4000000) |
|
|
79 |
* |
|
|
80 |
0042: MOVLW 12 |
|
|
81 |
0043: SUBWF 3C,F |
|
|
82 |
0044: BTFSS 03.0 |
|
|
83 |
0045: GOTO 054 |
|
|
84 |
0046: MOVLW 3C |
|
|
85 |
0047: MOVWF 04 |
|
|
86 |
0048: MOVLW FC |
|
|
87 |
0049: ANDWF 00,F |
|
|
88 |
004A: BCF 03.0 |
|
|
89 |
004B: RRF 00,F |
|
|
90 |
004C: RRF 00,F |
|
|
91 |
004D: MOVF 00,W |
|
|
92 |
004E: BTFSC 03.2 |
|
|
93 |
004F: GOTO 054 |
|
|
94 |
0050: GOTO 052 |
|
|
95 |
0051: NOP |
|
|
96 |
0052: DECFSZ 00,F |
|
|
97 |
0053: GOTO 051 |
|
|
98 |
0054: RETLW 00 |
|
|
99 |
* |
|
|
100 |
0073: MOVLW 37 |
|
|
101 |
0074: MOVWF 04 |
|
|
102 |
0075: MOVF 00,W |
|
|
103 |
0076: BTFSC 03.2 |
|
|
104 |
0077: GOTO 087 |
|
|
105 |
0078: MOVLW 01 |
|
|
106 |
0079: MOVWF 78 |
|
|
107 |
007A: CLRF 77 |
|
|
108 |
007B: DECFSZ 77,F |
|
|
109 |
007C: GOTO 07B |
|
|
110 |
007D: DECFSZ 78,F |
|
|
111 |
007E: GOTO 07A |
|
|
112 |
007F: MOVLW 4A |
|
|
113 |
0080: MOVWF 77 |
|
|
114 |
0081: DECFSZ 77,F |
|
|
115 |
0082: GOTO 081 |
|
|
116 |
0083: NOP |
|
|
117 |
0084: NOP |
|
|
118 |
0085: DECFSZ 00,F |
|
|
119 |
0086: GOTO 078 |
|
|
120 |
0087: RETLW 00 |
|
|
121 |
.................... |
|
|
122 |
.................... |
|
|
123 |
.................... |
|
|
124 |
.................... unsigned int8 sensors; // pomocna promenna pro cteni cidel na caru |
|
|
125 |
.................... unsigned int8 line; // na ktere strane byla detekovana cara |
|
|
126 |
.................... unsigned int8 speed; // rychlost zataceni |
|
|
127 |
.................... unsigned int8 last; // kde byla cara, kdyz byly minule cidla mimo |
|
|
128 |
.................... unsigned int8 rovinka; // pocitadlo pro zjisteni rovneho useku |
|
|
129 |
.................... int cirkus; // pocitadlo, po kolika akcich se ma delat cirkus |
|
|
130 |
.................... int1 BW; // urcuje, jestli je cara cerno/bila nebo |
|
|
131 |
.................... // bilo/cerna (true = bila cara, cerny podklad) |
|
|
132 |
.................... |
|
|
133 |
.................... // Konstanty pro dynamiku pohybu |
|
|
134 |
.................... #define T_DIRA 120 // po jakem case zataceni se detekuje dira |
|
|
135 |
.................... #define FW_POMALU 170 // trochu mimo caru vnitrni pas |
|
|
136 |
.................... #define FW_ZATACKA 200 // rychlost vnejsiho kola pri zataceni |
|
|
137 |
.................... #define FW_STREDNE 190 // trochu mimo caru vnejsi pas |
|
|
138 |
.................... #define COUVANI 750 // couvnuti zpet na caru, po detekci diry |
|
|
139 |
.................... #define MAX_ROVINKA (255-FW_STREDNE) |
|
|
140 |
.................... #define TRESHOLD 15 // rozhodovaci uroven komparatoru, 0xF = 0.75*Vdd |
|
|
141 |
.................... #define BUMPER_TRESHOLD 128 // rozhodovaci uroven cidla na prekazku |
|
|
142 |
.................... |
|
|
143 |
.................... //motory //Napred vypnout potom zapnout! |
|
|
144 |
.................... #define FR output_low(PIN_B5); output_high(PIN_B4) // Vpred |
|
|
145 |
.................... #define FL output_low(PIN_B7); output_high(PIN_B6) |
|
|
146 |
.................... #define BR output_low(PIN_B4); output_high(PIN_B5) // Vzad |
|
|
147 |
.................... #define BL output_low(PIN_B6); output_high(PIN_B7) |
|
|
148 |
.................... #define STOPR output_low(PIN_B4);output_low(PIN_B5) // Zastav |
|
|
149 |
.................... #define STOPL output_low(PIN_B6);output_low(PIN_B7) |
|
|
150 |
.................... |
|
|
151 |
.................... #define L 0b10 // left |
|
|
152 |
.................... #define R 0b01 // right |
|
|
153 |
.................... #define S 0b11 // straight |
|
|
154 |
.................... |
|
|
155 |
.................... //cidla |
|
|
156 |
.................... #define RSENSOR (BW != C2OUT) // Senzory na caru |
|
|
157 |
.................... #define LSENSOR (BW != C1OUT) |
|
|
158 |
.................... #define BUMPER sAN2 // Senzor na cihlu |
|
|
159 |
.................... |
|
|
160 |
.................... #define DIAG_SERVO PIN_B3 // Propojka pro diagnosticky mod |
|
|
161 |
.................... #define DIAG_SENSORS PIN_B2 // Propojka pro diagnosticky mod |
|
|
162 |
.................... #define BARVY PIN_B1 // Propojka pro nastaveni barvy cary |
|
|
163 |
.................... |
|
|
164 |
.................... #define SPEAKER PIN_B0 // vystup pro pipak |
|
|
165 |
.................... |
|
|
166 |
.................... #define LED1 PIN_A4 // LEDky |
|
|
167 |
.................... #define LED2 PIN_A3 |
|
|
168 |
.................... #define LED3 PIN_A7 |
|
|
169 |
.................... #define LED4 PIN_A6 |
|
|
170 |
.................... |
|
|
171 |
.................... // makro pro PWM |
|
|
172 |
.................... #define GO(motor, direction, power) if(get_timer0()<=power) \ |
|
|
173 |
.................... {direction##motor;} else {stop##motor;} |
|
|
174 |
.................... |
|
|
175 |
.................... #int_TIMER2 |
|
|
176 |
.................... void TIMER2_isr() // obsluha zrychlovani |
|
|
177 |
.................... { |
|
|
178 |
.................... if (speed<255) speed++; |
|
|
179 |
* |
|
|
180 |
0037: INCFSZ 2B,W |
|
|
181 |
0038: GOTO 03A |
|
|
182 |
0039: GOTO 03B |
|
|
183 |
003A: INCF 2B,F |
|
|
184 |
.................... if (rovinka<MAX_ROVINKA) rovinka++; |
|
|
185 |
003B: MOVF 2D,W |
|
|
186 |
003C: SUBLW 40 |
|
|
187 |
003D: BTFSC 03.0 |
|
|
188 |
003E: INCF 2D,F |
|
|
189 |
.................... } |
|
|
190 |
.................... |
|
|
191 |
.................... // Primitivni Pipani |
|
|
192 |
003F: BCF 0C.1 |
|
|
193 |
0040: BCF 0A.3 |
|
|
194 |
0041: GOTO 022 |
|
|
195 |
.................... void beep(unsigned int16 period, unsigned int16 length) |
|
|
196 |
.................... { |
|
|
197 |
.................... unsigned int16 nn; |
|
|
198 |
.................... |
|
|
199 |
.................... for(nn=length; nn>0; nn--) |
|
|
200 |
* |
|
|
201 |
0055: MOVF 39,W |
|
|
202 |
0056: MOVWF 3B |
|
|
203 |
0057: MOVF 38,W |
|
|
204 |
0058: MOVWF 3A |
|
|
205 |
0059: MOVF 3A,F |
|
|
206 |
005A: BTFSS 03.2 |
|
|
207 |
005B: GOTO 05F |
|
|
208 |
005C: MOVF 3B,F |
|
|
209 |
005D: BTFSC 03.2 |
|
|
210 |
005E: GOTO 072 |
|
|
211 |
.................... { |
|
|
212 |
.................... output_high(SPEAKER); |
|
|
213 |
005F: BSF 03.5 |
|
|
214 |
0060: BCF 06.0 |
|
|
215 |
0061: BCF 03.5 |
|
|
216 |
0062: BSF 06.0 |
|
|
217 |
.................... delay_us(period); |
|
|
218 |
0063: MOVF 36,W |
|
|
219 |
0064: MOVWF 3C |
|
|
220 |
0065: CALL 042 |
|
|
221 |
.................... output_low(SPEAKER); |
|
|
222 |
0066: BSF 03.5 |
|
|
223 |
0067: BCF 06.0 |
|
|
224 |
0068: BCF 03.5 |
|
|
225 |
0069: BCF 06.0 |
|
|
226 |
.................... delay_us(period); |
|
|
227 |
006A: MOVF 36,W |
|
|
228 |
006B: MOVWF 3C |
|
|
229 |
006C: CALL 042 |
|
|
230 |
.................... } |
|
|
231 |
006D: MOVF 3A,W |
|
|
232 |
006E: BTFSC 03.2 |
|
|
233 |
006F: DECF 3B,F |
|
|
234 |
0070: DECF 3A,F |
|
|
235 |
0071: GOTO 059 |
|
|
236 |
.................... } |
|
|
237 |
0072: RETLW 00 |
|
|
238 |
.................... /******************************************************************************/ |
|
|
239 |
.................... void diagnostika() |
|
|
240 |
.................... { |
|
|
241 |
.................... unsigned int16 n; |
|
|
242 |
.................... |
|
|
243 |
.................... while (input(DIAG_SERVO)) // Propojka, ktera spousti diagnostiku |
|
|
244 |
.................... { |
|
|
245 |
* |
|
|
246 |
0088: BSF 03.5 |
|
|
247 |
0089: BSF 06.3 |
|
|
248 |
008A: BCF 03.5 |
|
|
249 |
008B: BTFSS 06.3 |
|
|
250 |
008C: GOTO 1B3 |
|
|
251 |
.................... for (n=500; n<800; n+=100) |
|
|
252 |
008D: MOVLW 01 |
|
|
253 |
008E: MOVWF 35 |
|
|
254 |
008F: MOVLW F4 |
|
|
255 |
0090: MOVWF 34 |
|
|
256 |
0091: MOVF 35,W |
|
|
257 |
0092: SUBLW 03 |
|
|
258 |
0093: BTFSS 03.0 |
|
|
259 |
0094: GOTO 0A9 |
|
|
260 |
0095: BTFSS 03.2 |
|
|
261 |
0096: GOTO 09B |
|
|
262 |
0097: MOVF 34,W |
|
|
263 |
0098: SUBLW 1F |
|
|
264 |
0099: BTFSS 03.0 |
|
|
265 |
009A: GOTO 0A9 |
|
|
266 |
.................... { |
|
|
267 |
.................... beep(n,n); //beep UP |
|
|
268 |
009B: MOVF 35,W |
|
|
269 |
009C: MOVWF 37 |
|
|
270 |
009D: MOVF 34,W |
|
|
271 |
009E: MOVWF 36 |
|
|
272 |
009F: MOVF 35,W |
|
|
273 |
00A0: MOVWF 39 |
|
|
274 |
00A1: MOVF 34,W |
|
|
275 |
00A2: MOVWF 38 |
|
|
276 |
00A3: CALL 055 |
|
|
277 |
.................... }; |
|
|
278 |
00A4: MOVLW 64 |
|
|
279 |
00A5: ADDWF 34,F |
|
|
280 |
00A6: BTFSC 03.0 |
|
|
281 |
00A7: INCF 35,F |
|
|
282 |
00A8: GOTO 091 |
|
|
283 |
.................... Delay_ms(1000); |
|
|
284 |
00A9: MOVLW 04 |
|
|
285 |
00AA: MOVWF 36 |
|
|
286 |
00AB: MOVLW FA |
|
|
287 |
00AC: MOVWF 37 |
|
|
288 |
00AD: CALL 073 |
|
|
289 |
00AE: DECFSZ 36,F |
|
|
290 |
00AF: GOTO 0AB |
|
|
291 |
.................... //zastav vse |
|
|
292 |
.................... STOPL; STOPR; |
|
|
293 |
00B0: BSF 03.5 |
|
|
294 |
00B1: BCF 06.6 |
|
|
295 |
00B2: BCF 03.5 |
|
|
296 |
00B3: BCF 06.6 |
|
|
297 |
00B4: BSF 03.5 |
|
|
298 |
00B5: BCF 06.7 |
|
|
299 |
00B6: BCF 03.5 |
|
|
300 |
00B7: BCF 06.7 |
|
|
301 |
00B8: BSF 03.5 |
|
|
302 |
00B9: BCF 06.4 |
|
|
303 |
00BA: BCF 03.5 |
|
|
304 |
00BB: BCF 06.4 |
|
|
305 |
00BC: BSF 03.5 |
|
|
306 |
00BD: BCF 06.5 |
|
|
307 |
00BE: BCF 03.5 |
|
|
308 |
00BF: BCF 06.5 |
|
|
309 |
.................... //pravy pas |
|
|
310 |
.................... FR; Delay_ms(1000); STOPR; Delay_ms(1000); |
|
|
311 |
00C0: BSF 03.5 |
|
|
312 |
00C1: BCF 06.5 |
|
|
313 |
00C2: BCF 03.5 |
|
|
314 |
00C3: BCF 06.5 |
|
|
315 |
00C4: BSF 03.5 |
|
|
316 |
00C5: BCF 06.4 |
|
|
317 |
00C6: BCF 03.5 |
|
|
318 |
00C7: BSF 06.4 |
|
|
319 |
00C8: MOVLW 04 |
|
|
320 |
00C9: MOVWF 36 |
|
|
321 |
00CA: MOVLW FA |
|
|
322 |
00CB: MOVWF 37 |
|
|
323 |
00CC: CALL 073 |
|
|
324 |
00CD: DECFSZ 36,F |
|
|
325 |
00CE: GOTO 0CA |
|
|
326 |
00CF: BSF 03.5 |
|
|
327 |
00D0: BCF 06.4 |
|
|
328 |
00D1: BCF 03.5 |
|
|
329 |
00D2: BCF 06.4 |
|
|
330 |
00D3: BSF 03.5 |
|
|
331 |
00D4: BCF 06.5 |
|
|
332 |
00D5: BCF 03.5 |
|
|
333 |
00D6: BCF 06.5 |
|
|
334 |
00D7: MOVLW 04 |
|
|
335 |
00D8: MOVWF 36 |
|
|
336 |
00D9: MOVLW FA |
|
|
337 |
00DA: MOVWF 37 |
|
|
338 |
00DB: CALL 073 |
|
|
339 |
00DC: DECFSZ 36,F |
|
|
340 |
00DD: GOTO 0D9 |
|
|
341 |
.................... BR; Delay_ms(1000); STOPR; Delay_ms(1000); |
|
|
342 |
00DE: BSF 03.5 |
|
|
343 |
00DF: BCF 06.4 |
|
|
344 |
00E0: BCF 03.5 |
|
|
345 |
00E1: BCF 06.4 |
|
|
346 |
00E2: BSF 03.5 |
|
|
347 |
00E3: BCF 06.5 |
|
|
348 |
00E4: BCF 03.5 |
|
|
349 |
00E5: BSF 06.5 |
|
|
350 |
00E6: MOVLW 04 |
|
|
351 |
00E7: MOVWF 36 |
|
|
352 |
00E8: MOVLW FA |
|
|
353 |
00E9: MOVWF 37 |
|
|
354 |
00EA: CALL 073 |
|
|
355 |
00EB: DECFSZ 36,F |
|
|
356 |
00EC: GOTO 0E8 |
|
|
357 |
00ED: BSF 03.5 |
|
|
358 |
00EE: BCF 06.4 |
|
|
359 |
00EF: BCF 03.5 |
|
|
360 |
00F0: BCF 06.4 |
|
|
361 |
00F1: BSF 03.5 |
|
|
362 |
00F2: BCF 06.5 |
|
|
363 |
00F3: BCF 03.5 |
|
|
364 |
00F4: BCF 06.5 |
|
|
365 |
00F5: MOVLW 04 |
|
|
366 |
00F6: MOVWF 36 |
|
|
367 |
00F7: MOVLW FA |
|
|
368 |
00F8: MOVWF 37 |
|
|
369 |
00F9: CALL 073 |
|
|
370 |
00FA: DECFSZ 36,F |
|
|
371 |
00FB: GOTO 0F7 |
|
|
372 |
.................... Beep(880,100); Delay_ms(1000); |
|
|
373 |
00FC: MOVLW 03 |
|
|
374 |
00FD: MOVWF 37 |
|
|
375 |
00FE: MOVLW 70 |
|
|
376 |
00FF: MOVWF 36 |
|
|
377 |
0100: CLRF 39 |
|
|
378 |
0101: MOVLW 64 |
|
|
379 |
0102: MOVWF 38 |
|
|
380 |
0103: CALL 055 |
|
|
381 |
0104: MOVLW 04 |
|
|
382 |
0105: MOVWF 36 |
|
|
383 |
0106: MOVLW FA |
|
|
384 |
0107: MOVWF 37 |
|
|
385 |
0108: CALL 073 |
|
|
386 |
0109: DECFSZ 36,F |
|
|
387 |
010A: GOTO 106 |
|
|
388 |
.................... //levy pas |
|
|
389 |
.................... FL; Delay_ms(1000); STOPL; Delay_ms(1000); |
|
|
390 |
010B: BSF 03.5 |
|
|
391 |
010C: BCF 06.7 |
|
|
392 |
010D: BCF 03.5 |
|
|
393 |
010E: BCF 06.7 |
|
|
394 |
010F: BSF 03.5 |
|
|
395 |
0110: BCF 06.6 |
|
|
396 |
0111: BCF 03.5 |
|
|
397 |
0112: BSF 06.6 |
|
|
398 |
0113: MOVLW 04 |
|
|
399 |
0114: MOVWF 36 |
|
|
400 |
0115: MOVLW FA |
|
|
401 |
0116: MOVWF 37 |
|
|
402 |
0117: CALL 073 |
|
|
403 |
0118: DECFSZ 36,F |
|
|
404 |
0119: GOTO 115 |
|
|
405 |
011A: BSF 03.5 |
|
|
406 |
011B: BCF 06.6 |
|
|
407 |
011C: BCF 03.5 |
|
|
408 |
011D: BCF 06.6 |
|
|
409 |
011E: BSF 03.5 |
|
|
410 |
011F: BCF 06.7 |
|
|
411 |
0120: BCF 03.5 |
|
|
412 |
0121: BCF 06.7 |
|
|
413 |
0122: MOVLW 04 |
|
|
414 |
0123: MOVWF 36 |
|
|
415 |
0124: MOVLW FA |
|
|
416 |
0125: MOVWF 37 |
|
|
417 |
0126: CALL 073 |
|
|
418 |
0127: DECFSZ 36,F |
|
|
419 |
0128: GOTO 124 |
|
|
420 |
.................... BL; Delay_ms(1000); STOPL; Delay_ms(1000); |
|
|
421 |
0129: BSF 03.5 |
|
|
422 |
012A: BCF 06.6 |
|
|
423 |
012B: BCF 03.5 |
|
|
424 |
012C: BCF 06.6 |
|
|
425 |
012D: BSF 03.5 |
|
|
426 |
012E: BCF 06.7 |
|
|
427 |
012F: BCF 03.5 |
|
|
428 |
0130: BSF 06.7 |
|
|
429 |
0131: MOVLW 04 |
|
|
430 |
0132: MOVWF 36 |
|
|
431 |
0133: MOVLW FA |
|
|
432 |
0134: MOVWF 37 |
|
|
433 |
0135: CALL 073 |
|
|
434 |
0136: DECFSZ 36,F |
|
|
435 |
0137: GOTO 133 |
|
|
436 |
0138: BSF 03.5 |
|
|
437 |
0139: BCF 06.6 |
|
|
438 |
013A: BCF 03.5 |
|
|
439 |
013B: BCF 06.6 |
|
|
440 |
013C: BSF 03.5 |
|
|
441 |
013D: BCF 06.7 |
|
|
442 |
013E: BCF 03.5 |
|
|
443 |
013F: BCF 06.7 |
|
|
444 |
0140: MOVLW 04 |
|
|
445 |
0141: MOVWF 36 |
|
|
446 |
0142: MOVLW FA |
|
|
447 |
0143: MOVWF 37 |
|
|
448 |
0144: CALL 073 |
|
|
449 |
0145: DECFSZ 36,F |
|
|
450 |
0146: GOTO 142 |
|
|
451 |
.................... Beep(880,100); Delay_ms(1000); |
|
|
452 |
0147: MOVLW 03 |
|
|
453 |
0148: MOVWF 37 |
|
|
454 |
0149: MOVLW 70 |
|
|
455 |
014A: MOVWF 36 |
|
|
456 |
014B: CLRF 39 |
|
|
457 |
014C: MOVLW 64 |
|
|
458 |
014D: MOVWF 38 |
|
|
459 |
014E: CALL 055 |
|
|
460 |
014F: MOVLW 04 |
|
|
461 |
0150: MOVWF 36 |
|
|
462 |
0151: MOVLW FA |
|
|
463 |
0152: MOVWF 37 |
|
|
464 |
0153: CALL 073 |
|
|
465 |
0154: DECFSZ 36,F |
|
|
466 |
0155: GOTO 151 |
|
|
467 |
.................... //oba pasy |
|
|
468 |
.................... FL; FR; Delay_ms(1000); STOPL; STOPR; Delay_ms(1000); |
|
|
469 |
0156: BSF 03.5 |
|
|
470 |
0157: BCF 06.7 |
|
|
471 |
0158: BCF 03.5 |
|
|
472 |
0159: BCF 06.7 |
|
|
473 |
015A: BSF 03.5 |
|
|
474 |
015B: BCF 06.6 |
|
|
475 |
015C: BCF 03.5 |
|
|
476 |
015D: BSF 06.6 |
|
|
477 |
015E: BSF 03.5 |
|
|
478 |
015F: BCF 06.5 |
|
|
479 |
0160: BCF 03.5 |
|
|
480 |
0161: BCF 06.5 |
|
|
481 |
0162: BSF 03.5 |
|
|
482 |
0163: BCF 06.4 |
|
|
483 |
0164: BCF 03.5 |
|
|
484 |
0165: BSF 06.4 |
|
|
485 |
0166: MOVLW 04 |
|
|
486 |
0167: MOVWF 36 |
|
|
487 |
0168: MOVLW FA |
|
|
488 |
0169: MOVWF 37 |
|
|
489 |
016A: CALL 073 |
|
|
490 |
016B: DECFSZ 36,F |
|
|
491 |
016C: GOTO 168 |
|
|
492 |
016D: BSF 03.5 |
|
|
493 |
016E: BCF 06.6 |
|
|
494 |
016F: BCF 03.5 |
|
|
495 |
0170: BCF 06.6 |
|
|
496 |
0171: BSF 03.5 |
|
|
497 |
0172: BCF 06.7 |
|
|
498 |
0173: BCF 03.5 |
|
|
499 |
0174: BCF 06.7 |
|
|
500 |
0175: BSF 03.5 |
|
|
501 |
0176: BCF 06.4 |
|
|
502 |
0177: BCF 03.5 |
|
|
503 |
0178: BCF 06.4 |
|
|
504 |
0179: BSF 03.5 |
|
|
505 |
017A: BCF 06.5 |
|
|
506 |
017B: BCF 03.5 |
|
|
507 |
017C: BCF 06.5 |
|
|
508 |
017D: MOVLW 04 |
|
|
509 |
017E: MOVWF 36 |
|
|
510 |
017F: MOVLW FA |
|
|
511 |
0180: MOVWF 37 |
|
|
512 |
0181: CALL 073 |
|
|
513 |
0182: DECFSZ 36,F |
|
|
514 |
0183: GOTO 17F |
|
|
515 |
.................... BL; BR; Delay_ms(1000); STOPL; STOPR; Delay_ms(1000); |
|
|
516 |
0184: BSF 03.5 |
|
|
517 |
0185: BCF 06.6 |
|
|
518 |
0186: BCF 03.5 |
|
|
519 |
0187: BCF 06.6 |
|
|
520 |
0188: BSF 03.5 |
|
|
521 |
0189: BCF 06.7 |
|
|
522 |
018A: BCF 03.5 |
|
|
523 |
018B: BSF 06.7 |
|
|
524 |
018C: BSF 03.5 |
|
|
525 |
018D: BCF 06.4 |
|
|
526 |
018E: BCF 03.5 |
|
|
527 |
018F: BCF 06.4 |
|
|
528 |
0190: BSF 03.5 |
|
|
529 |
0191: BCF 06.5 |
|
|
530 |
0192: BCF 03.5 |
|
|
531 |
0193: BSF 06.5 |
|
|
532 |
0194: MOVLW 04 |
|
|
533 |
0195: MOVWF 36 |
|
|
534 |
0196: MOVLW FA |
|
|
535 |
0197: MOVWF 37 |
|
|
536 |
0198: CALL 073 |
|
|
537 |
0199: DECFSZ 36,F |
|
|
538 |
019A: GOTO 196 |
|
|
539 |
019B: BSF 03.5 |
|
|
540 |
019C: BCF 06.6 |
|
|
541 |
019D: BCF 03.5 |
|
|
542 |
019E: BCF 06.6 |
|
|
543 |
019F: BSF 03.5 |
|
|
544 |
01A0: BCF 06.7 |
|
|
545 |
01A1: BCF 03.5 |
|
|
546 |
01A2: BCF 06.7 |
|
|
547 |
01A3: BSF 03.5 |
|
|
548 |
01A4: BCF 06.4 |
|
|
549 |
01A5: BCF 03.5 |
|
|
550 |
01A6: BCF 06.4 |
|
|
551 |
01A7: BSF 03.5 |
|
|
552 |
01A8: BCF 06.5 |
|
|
553 |
01A9: BCF 03.5 |
|
|
554 |
01AA: BCF 06.5 |
|
|
555 |
01AB: MOVLW 04 |
|
|
556 |
01AC: MOVWF 36 |
|
|
557 |
01AD: MOVLW FA |
|
|
558 |
01AE: MOVWF 37 |
|
|
559 |
01AF: CALL 073 |
|
|
560 |
01B0: DECFSZ 36,F |
|
|
561 |
01B1: GOTO 1AD |
|
|
562 |
.................... }; |
|
|
563 |
01B2: GOTO 088 |
|
|
564 |
.................... while (input(DIAG_SENSORS)) // spusteni diagnostiky cidel |
|
|
565 |
.................... { |
|
|
566 |
01B3: BSF 03.5 |
|
|
567 |
01B4: BSF 06.2 |
|
|
568 |
01B5: BCF 03.5 |
|
|
569 |
01B6: BTFSS 06.2 |
|
|
570 |
01B7: GOTO 1F6 |
|
|
571 |
.................... if (RSENSOR) beep(1000,200); |
|
|
572 |
01B8: CLRF 77 |
|
|
573 |
01B9: BSF 03.5 |
|
|
574 |
01BA: BTFSC 1C.7 |
|
|
575 |
01BB: BSF 77.0 |
|
|
576 |
01BC: BCF 03.5 |
|
|
577 |
01BD: MOVF 2F,W |
|
|
578 |
01BE: XORWF 77,W |
|
|
579 |
01BF: ANDLW 01 |
|
|
580 |
01C0: BTFSC 03.2 |
|
|
581 |
01C1: GOTO 1CA |
|
|
582 |
01C2: MOVLW 03 |
|
|
583 |
01C3: MOVWF 37 |
|
|
584 |
01C4: MOVLW E8 |
|
|
585 |
01C5: MOVWF 36 |
|
|
586 |
01C6: CLRF 39 |
|
|
587 |
01C7: MOVLW C8 |
|
|
588 |
01C8: MOVWF 38 |
|
|
589 |
01C9: CALL 055 |
|
|
590 |
.................... Delay_ms(200); |
|
|
591 |
01CA: MOVLW C8 |
|
|
592 |
01CB: MOVWF 37 |
|
|
593 |
01CC: CALL 073 |
|
|
594 |
.................... if (LSENSOR) beep(2000,300); |
|
|
595 |
01CD: CLRF 77 |
|
|
596 |
01CE: BSF 03.5 |
|
|
597 |
01CF: BTFSC 1C.6 |
|
|
598 |
01D0: BSF 77.0 |
|
|
599 |
01D1: BCF 03.5 |
|
|
600 |
01D2: MOVF 2F,W |
|
|
601 |
01D3: XORWF 77,W |
|
|
602 |
01D4: ANDLW 01 |
|
|
603 |
01D5: BTFSC 03.2 |
|
|
604 |
01D6: GOTO 1E0 |
|
|
605 |
01D7: MOVLW 07 |
|
|
606 |
01D8: MOVWF 37 |
|
|
607 |
01D9: MOVLW D0 |
|
|
608 |
01DA: MOVWF 36 |
|
|
609 |
01DB: MOVLW 01 |
|
|
610 |
01DC: MOVWF 39 |
|
|
611 |
01DD: MOVLW 2C |
|
|
612 |
01DE: MOVWF 38 |
|
|
613 |
01DF: CALL 055 |
|
|
614 |
.................... Delay_ms(200); |
|
|
615 |
01E0: MOVLW C8 |
|
|
616 |
01E1: MOVWF 37 |
|
|
617 |
01E2: CALL 073 |
|
|
618 |
.................... if ((read_adc(ADC_READ_ONLY)<BUMPER_TRESHOLD)) beep(3000,400); |
|
|
619 |
01E3: BTFSC 1F.2 |
|
|
620 |
01E4: GOTO 1E3 |
|
|
621 |
01E5: MOVF 1E,W |
|
|
622 |
01E6: SUBLW 7F |
|
|
623 |
01E7: BTFSS 03.0 |
|
|
624 |
01E8: GOTO 1F2 |
|
|
625 |
01E9: MOVLW 0B |
|
|
626 |
01EA: MOVWF 37 |
|
|
627 |
01EB: MOVLW B8 |
|
|
628 |
01EC: MOVWF 36 |
|
|
629 |
01ED: MOVLW 01 |
|
|
630 |
01EE: MOVWF 39 |
|
|
631 |
01EF: MOVLW 90 |
|
|
632 |
01F0: MOVWF 38 |
|
|
633 |
01F1: CALL 055 |
|
|
634 |
.................... Delay_ms(200); |
|
|
635 |
01F2: MOVLW C8 |
|
|
636 |
01F3: MOVWF 37 |
|
|
637 |
01F4: CALL 073 |
|
|
638 |
.................... }; |
|
|
639 |
01F5: GOTO 1B3 |
|
|
640 |
.................... } |
|
|
641 |
01F6: BCF 0A.3 |
|
|
642 |
01F7: GOTO 378 (RETURN) |
|
|
643 |
.................... /////////////////////////////////////////////////////////////////////////////// |
|
|
644 |
.................... void OtocSe() // otoci se zpet, kdyz je prekazka |
|
|
645 |
.................... { |
|
|
646 |
.................... unsigned int16 n; |
|
|
647 |
.................... |
|
|
648 |
.................... BL; BR; // cukni zpatky |
|
|
649 |
01F8: BSF 03.5 |
|
|
650 |
01F9: BCF 06.6 |
|
|
651 |
01FA: BCF 03.5 |
|
|
652 |
01FB: BCF 06.6 |
|
|
653 |
01FC: BSF 03.5 |
|
|
654 |
01FD: BCF 06.7 |
|
|
655 |
01FE: BCF 03.5 |
|
|
656 |
01FF: BSF 06.7 |
|
|
657 |
0200: BSF 03.5 |
|
|
658 |
0201: BCF 06.4 |
|
|
659 |
0202: BCF 03.5 |
|
|
660 |
0203: BCF 06.4 |
|
|
661 |
0204: BSF 03.5 |
|
|
662 |
0205: BCF 06.5 |
|
|
663 |
0206: BCF 03.5 |
|
|
664 |
0207: BSF 06.5 |
|
|
665 |
.................... Delay_ms(200); |
|
|
666 |
0208: MOVLW C8 |
|
|
667 |
0209: MOVWF 37 |
|
|
668 |
020A: CALL 073 |
|
|
669 |
.................... STOPR;STOPL; |
|
|
670 |
020B: BSF 03.5 |
|
|
671 |
020C: BCF 06.4 |
|
|
672 |
020D: BCF 03.5 |
|
|
673 |
020E: BCF 06.4 |
|
|
674 |
020F: BSF 03.5 |
|
|
675 |
0210: BCF 06.5 |
|
|
676 |
0211: BCF 03.5 |
|
|
677 |
0212: BCF 06.5 |
|
|
678 |
0213: BSF 03.5 |
|
|
679 |
0214: BCF 06.6 |
|
|
680 |
0215: BCF 03.5 |
|
|
681 |
0216: BCF 06.6 |
|
|
682 |
0217: BSF 03.5 |
|
|
683 |
0218: BCF 06.7 |
|
|
684 |
0219: BCF 03.5 |
|
|
685 |
021A: BCF 06.7 |
|
|
686 |
.................... beep(800,400); |
|
|
687 |
021B: MOVLW 03 |
|
|
688 |
021C: MOVWF 37 |
|
|
689 |
021D: MOVLW 20 |
|
|
690 |
021E: MOVWF 36 |
|
|
691 |
021F: MOVLW 01 |
|
|
692 |
0220: MOVWF 39 |
|
|
693 |
0221: MOVLW 90 |
|
|
694 |
0222: MOVWF 38 |
|
|
695 |
0223: CALL 055 |
|
|
696 |
.................... beep(2000,1000); |
|
|
697 |
0224: MOVLW 07 |
|
|
698 |
0225: MOVWF 37 |
|
|
699 |
0226: MOVLW D0 |
|
|
700 |
0227: MOVWF 36 |
|
|
701 |
0228: MOVLW 03 |
|
|
702 |
0229: MOVWF 39 |
|
|
703 |
022A: MOVLW E8 |
|
|
704 |
022B: MOVWF 38 |
|
|
705 |
022C: CALL 055 |
|
|
706 |
.................... output_low(LED4); |
|
|
707 |
022D: BSF 03.5 |
|
|
708 |
022E: BCF 05.6 |
|
|
709 |
022F: BCF 03.5 |
|
|
710 |
0230: BCF 05.6 |
|
|
711 |
.................... beep(900,400); |
|
|
712 |
0231: MOVLW 03 |
|
|
713 |
0232: MOVWF 37 |
|
|
714 |
0233: MOVLW 84 |
|
|
715 |
0234: MOVWF 36 |
|
|
716 |
0235: MOVLW 01 |
|
|
717 |
0236: MOVWF 39 |
|
|
718 |
0237: MOVLW 90 |
|
|
719 |
0238: MOVWF 38 |
|
|
720 |
0239: CALL 055 |
|
|
721 |
.................... output_low(LED1); |
|
|
722 |
023A: BSF 03.5 |
|
|
723 |
023B: BCF 05.4 |
|
|
724 |
023C: BCF 03.5 |
|
|
725 |
023D: BCF 05.4 |
|
|
726 |
.................... |
|
|
727 |
.................... BR; FL; Delay_ms(100); // otoc se 30° do prava |
|
|
728 |
023E: BSF 03.5 |
|
|
729 |
023F: BCF 06.4 |
|
|
730 |
0240: BCF 03.5 |
|
|
731 |
0241: BCF 06.4 |
|
|
732 |
0242: BSF 03.5 |
|
|
733 |
0243: BCF 06.5 |
|
|
734 |
0244: BCF 03.5 |
|
|
735 |
0245: BSF 06.5 |
|
|
736 |
0246: BSF 03.5 |
|
|
737 |
0247: BCF 06.7 |
|
|
738 |
0248: BCF 03.5 |
|
|
739 |
0249: BCF 06.7 |
|
|
740 |
024A: BSF 03.5 |
|
|
741 |
024B: BCF 06.6 |
|
|
742 |
024C: BCF 03.5 |
|
|
743 |
024D: BSF 06.6 |
|
|
744 |
024E: MOVLW 64 |
|
|
745 |
024F: MOVWF 37 |
|
|
746 |
0250: CALL 073 |
|
|
747 |
.................... STOPL; STOPR; |
|
|
748 |
0251: BSF 03.5 |
|
|
749 |
0252: BCF 06.6 |
|
|
750 |
0253: BCF 03.5 |
|
|
751 |
0254: BCF 06.6 |
|
|
752 |
0255: BSF 03.5 |
|
|
753 |
0256: BCF 06.7 |
|
|
754 |
0257: BCF 03.5 |
|
|
755 |
0258: BCF 06.7 |
|
|
756 |
0259: BSF 03.5 |
|
|
757 |
025A: BCF 06.4 |
|
|
758 |
025B: BCF 03.5 |
|
|
759 |
025C: BCF 06.4 |
|
|
760 |
025D: BSF 03.5 |
|
|
761 |
025E: BCF 06.5 |
|
|
762 |
025F: BCF 03.5 |
|
|
763 |
0260: BCF 06.5 |
|
|
764 |
.................... beep(1000,1000); |
|
|
765 |
0261: MOVLW 03 |
|
|
766 |
0262: MOVWF 37 |
|
|
767 |
0263: MOVLW E8 |
|
|
768 |
0264: MOVWF 36 |
|
|
769 |
0265: MOVLW 03 |
|
|
770 |
0266: MOVWF 39 |
|
|
771 |
0267: MOVLW E8 |
|
|
772 |
0268: MOVWF 38 |
|
|
773 |
0269: CALL 055 |
|
|
774 |
.................... output_low(LED3); |
|
|
775 |
026A: BSF 03.5 |
|
|
776 |
026B: BCF 05.7 |
|
|
777 |
026C: BCF 03.5 |
|
|
778 |
026D: BCF 05.7 |
|
|
779 |
.................... |
|
|
780 |
.................... BR; FL; |
|
|
781 |
026E: BSF 03.5 |
|
|
782 |
026F: BCF 06.4 |
|
|
783 |
0270: BCF 03.5 |
|
|
784 |
0271: BCF 06.4 |
|
|
785 |
0272: BSF 03.5 |
|
|
786 |
0273: BCF 06.5 |
|
|
787 |
0274: BCF 03.5 |
|
|
788 |
0275: BSF 06.5 |
|
|
789 |
0276: BSF 03.5 |
|
|
790 |
0277: BCF 06.7 |
|
|
791 |
0278: BCF 03.5 |
|
|
792 |
0279: BCF 06.7 |
|
|
793 |
027A: BSF 03.5 |
|
|
794 |
027B: BCF 06.6 |
|
|
795 |
027C: BCF 03.5 |
|
|
796 |
027D: BSF 06.6 |
|
|
797 |
.................... for(n=40000;n>0;n--) // toc se, dokud nenarazis na caru |
|
|
798 |
027E: MOVLW 9C |
|
|
799 |
027F: MOVWF 35 |
|
|
800 |
0280: MOVLW 40 |
|
|
801 |
0281: MOVWF 34 |
|
|
802 |
0282: MOVF 34,F |
|
|
803 |
0283: BTFSS 03.2 |
|
|
804 |
0284: GOTO 288 |
|
|
805 |
0285: MOVF 35,F |
|
|
806 |
0286: BTFSC 03.2 |
|
|
807 |
0287: GOTO 2B0 |
|
|
808 |
.................... { |
|
|
809 |
.................... line = RSENSOR; // cteni senzoru na caru |
|
|
810 |
0288: CLRF 77 |
|
|
811 |
0289: BSF 03.5 |
|
|
812 |
028A: BTFSC 1C.7 |
|
|
813 |
028B: BSF 77.0 |
|
|
814 |
028C: BCF 03.5 |
|
|
815 |
028D: MOVF 2F,W |
|
|
816 |
028E: XORWF 77,W |
|
|
817 |
028F: ANDLW 01 |
|
|
818 |
0290: BTFSS 03.2 |
|
|
819 |
0291: GOTO 294 |
|
|
820 |
0292: MOVLW 00 |
|
|
821 |
0293: GOTO 295 |
|
|
822 |
0294: MOVLW 01 |
|
|
823 |
0295: MOVWF 2A |
|
|
824 |
.................... line |= LSENSOR << 1; |
|
|
825 |
0296: CLRF 77 |
|
|
826 |
0297: BSF 03.5 |
|
|
827 |
0298: BTFSC 1C.6 |
|
|
828 |
0299: BSF 77.0 |
|
|
829 |
029A: BCF 03.5 |
|
|
830 |
029B: MOVF 2F,W |
|
|
831 |
029C: XORWF 77,W |
|
|
832 |
029D: ANDLW 01 |
|
|
833 |
029E: BTFSS 03.2 |
|
|
834 |
029F: GOTO 2A2 |
|
|
835 |
02A0: MOVLW 00 |
|
|
836 |
02A1: GOTO 2A3 |
|
|
837 |
02A2: MOVLW 01 |
|
|
838 |
02A3: MOVWF 77 |
|
|
839 |
02A4: BCF 03.0 |
|
|
840 |
02A5: RLF 77,F |
|
|
841 |
02A6: MOVF 77,W |
|
|
842 |
02A7: IORWF 2A,F |
|
|
843 |
.................... if (line!=0) break; |
|
|
844 |
02A8: MOVF 2A,F |
|
|
845 |
02A9: BTFSS 03.2 |
|
|
846 |
02AA: GOTO 2B0 |
|
|
847 |
.................... } |
|
|
848 |
02AB: MOVF 34,W |
|
|
849 |
02AC: BTFSC 03.2 |
|
|
850 |
02AD: DECF 35,F |
|
|
851 |
02AE: DECF 34,F |
|
|
852 |
02AF: GOTO 282 |
|
|
853 |
.................... STOPR; STOPL; |
|
|
854 |
02B0: BSF 03.5 |
|
|
855 |
02B1: BCF 06.4 |
|
|
856 |
02B2: BCF 03.5 |
|
|
857 |
02B3: BCF 06.4 |
|
|
858 |
02B4: BSF 03.5 |
|
|
859 |
02B5: BCF 06.5 |
|
|
860 |
02B6: BCF 03.5 |
|
|
861 |
02B7: BCF 06.5 |
|
|
862 |
02B8: BSF 03.5 |
|
|
863 |
02B9: BCF 06.6 |
|
|
864 |
02BA: BCF 03.5 |
|
|
865 |
02BB: BCF 06.6 |
|
|
866 |
02BC: BSF 03.5 |
|
|
867 |
02BD: BCF 06.7 |
|
|
868 |
02BE: BCF 03.5 |
|
|
869 |
02BF: BCF 06.7 |
|
|
870 |
.................... output_high(LED1); output_high(LED3); output_high(LED4); |
|
|
871 |
02C0: BSF 03.5 |
|
|
872 |
02C1: BCF 05.4 |
|
|
873 |
02C2: BCF 03.5 |
|
|
874 |
02C3: BSF 05.4 |
|
|
875 |
02C4: BSF 03.5 |
|
|
876 |
02C5: BCF 05.7 |
|
|
877 |
02C6: BCF 03.5 |
|
|
878 |
02C7: BSF 05.7 |
|
|
879 |
02C8: BSF 03.5 |
|
|
880 |
02C9: BCF 05.6 |
|
|
881 |
02CA: BCF 03.5 |
|
|
882 |
02CB: BSF 05.6 |
|
|
883 |
.................... |
|
|
884 |
.................... line=L; // caru jsme prejeli, tak je vlevo |
|
|
885 |
02CC: MOVLW 02 |
|
|
886 |
02CD: MOVWF 2A |
|
|
887 |
.................... cirkus=0; |
|
|
888 |
02CE: CLRF 2E |
|
|
889 |
.................... } |
|
|
890 |
02CF: BCF 0A.3 |
|
|
891 |
02D0: GOTO 3F1 (RETURN) |
|
|
892 |
.................... |
|
|
893 |
.................... |
|
|
894 |
.................... void main() |
|
|
895 |
.................... { |
|
|
896 |
02D1: CLRF 04 |
|
|
897 |
02D2: MOVLW 1F |
|
|
898 |
02D3: ANDWF 03,F |
|
|
899 |
02D4: BSF 03.5 |
|
|
900 |
02D5: BCF 1F.4 |
|
|
901 |
02D6: BCF 1F.5 |
|
|
902 |
02D7: MOVF 1B,W |
|
|
903 |
02D8: ANDLW 80 |
|
|
904 |
02D9: MOVWF 1B |
|
|
905 |
02DA: MOVLW 07 |
|
|
906 |
02DB: MOVWF 1C |
|
|
907 |
02DC: MOVF 1C,W |
|
|
908 |
02DD: BCF 03.5 |
|
|
909 |
02DE: BCF 0D.6 |
|
|
910 |
02DF: MOVLW 60 |
|
|
911 |
02E0: BSF 03.5 |
|
|
912 |
02E1: MOVWF 0F |
|
|
913 |
.................... unsigned int16 n; // pro FOR |
|
|
914 |
.................... unsigned int16 i; |
|
|
915 |
.................... |
|
|
916 |
.................... STOPL; STOPR; // prepne vystupy na ovladani motoru na output a zastavi |
|
|
917 |
02E2: BCF 06.6 |
|
|
918 |
02E3: BCF 03.5 |
|
|
919 |
02E4: BCF 06.6 |
|
|
920 |
02E5: BSF 03.5 |
|
|
921 |
02E6: BCF 06.7 |
|
|
922 |
02E7: BCF 03.5 |
|
|
923 |
02E8: BCF 06.7 |
|
|
924 |
02E9: BSF 03.5 |
|
|
925 |
02EA: BCF 06.4 |
|
|
926 |
02EB: BCF 03.5 |
|
|
927 |
02EC: BCF 06.4 |
|
|
928 |
02ED: BSF 03.5 |
|
|
929 |
02EE: BCF 06.5 |
|
|
930 |
02EF: BCF 03.5 |
|
|
931 |
02F0: BCF 06.5 |
|
|
932 |
.................... |
|
|
933 |
.................... setup_oscillator(OSC_4MHZ|OSC_INTRC); // 4 MHz interni RC oscilator |
|
|
934 |
02F1: MOVLW 62 |
|
|
935 |
02F2: BSF 03.5 |
|
|
936 |
02F3: MOVWF 0F |
|
|
937 |
.................... |
|
|
938 |
.................... port_b_pullups(TRUE); // pullups pro piano na diagnostiku |
|
|
939 |
02F4: BCF 01.7 |
|
|
940 |
.................... setup_spi(FALSE); |
|
|
941 |
02F5: BCF 03.5 |
|
|
942 |
02F6: BCF 14.5 |
|
|
943 |
02F7: BSF 03.5 |
|
|
944 |
02F8: BCF 06.2 |
|
|
945 |
02F9: BSF 06.1 |
|
|
946 |
02FA: BCF 06.4 |
|
|
947 |
02FB: MOVLW 00 |
|
|
948 |
02FC: BCF 03.5 |
|
|
949 |
02FD: MOVWF 14 |
|
|
950 |
02FE: BSF 03.5 |
|
|
951 |
02FF: MOVWF 14 |
|
|
952 |
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); // Casovac pro PWM |
|
|
953 |
0300: MOVF 01,W |
|
|
954 |
0301: ANDLW C7 |
|
|
955 |
0302: IORLW 08 |
|
|
956 |
0303: MOVWF 01 |
|
|
957 |
.................... |
|
|
958 |
.................... setup_timer_2(T2_DIV_BY_4,255,10); // Casovac pro regulaci |
|
|
959 |
0304: MOVLW 48 |
|
|
960 |
0305: MOVWF 78 |
|
|
961 |
0306: IORLW 05 |
|
|
962 |
0307: BCF 03.5 |
|
|
963 |
0308: MOVWF 12 |
|
|
964 |
0309: MOVLW FF |
|
|
965 |
030A: BSF 03.5 |
|
|
966 |
030B: MOVWF 12 |
|
|
967 |
.................... // preruseni kazdych 10ms |
|
|
968 |
.................... setup_adc_ports(BUMPER|VSS_VDD); // nastaveni A/D prevodniku pro naraznik |
|
|
969 |
030C: BCF 1F.4 |
|
|
970 |
030D: BCF 1F.5 |
|
|
971 |
030E: MOVF 1B,W |
|
|
972 |
030F: ANDLW 80 |
|
|
973 |
0310: IORLW 04 |
|
|
974 |
0311: MOVWF 1B |
|
|
975 |
.................... setup_adc(ADC_CLOCK_INTERNAL); |
|
|
976 |
0312: BCF 1F.6 |
|
|
977 |
0313: BCF 03.5 |
|
|
978 |
0314: BSF 1F.6 |
|
|
979 |
0315: BSF 1F.7 |
|
|
980 |
0316: BSF 03.5 |
|
|
981 |
0317: BCF 1F.7 |
|
|
982 |
0318: BCF 03.5 |
|
|
983 |
0319: BSF 1F.0 |
|
|
984 |
.................... set_adc_channel(2); |
|
|
985 |
031A: MOVLW 10 |
|
|
986 |
031B: MOVWF 78 |
|
|
987 |
031C: MOVF 1F,W |
|
|
988 |
031D: ANDLW C7 |
|
|
989 |
031E: IORWF 78,W |
|
|
990 |
031F: MOVWF 1F |
|
|
991 |
.................... setup_timer_1(T1_INTERNAL|T1_DIV_BY_1); // Casovac pro naraznik |
|
|
992 |
0320: MOVLW 85 |
|
|
993 |
0321: MOVWF 10 |
|
|
994 |
.................... setup_ccp1(CCP_COMPARE_RESET_TIMER); |
|
|
995 |
0322: BSF 03.5 |
|
|
996 |
0323: BSF 06.3 |
|
|
997 |
0324: MOVLW 0B |
|
|
998 |
0325: BCF 03.5 |
|
|
999 |
0326: MOVWF 17 |
|
|
1000 |
.................... CCP_1=(2^10)-1; // prevod kazdou 1ms |
|
|
1001 |
0327: CLRF 16 |
|
|
1002 |
0328: MOVLW 07 |
|
|
1003 |
0329: MOVWF 15 |
|
|
1004 |
.................... |
|
|
1005 |
.................... output_low(LED1); output_low(LED2); output_low(LED3); output_low(LED4); |
|
|
1006 |
032A: BSF 03.5 |
|
|
1007 |
032B: BCF 05.4 |
|
|
1008 |
032C: BCF 03.5 |
|
|
1009 |
032D: BCF 05.4 |
|
|
1010 |
032E: BSF 03.5 |
|
|
1011 |
032F: BCF 05.3 |
|
|
1012 |
0330: BCF 03.5 |
|
|
1013 |
0331: BCF 05.3 |
|
|
1014 |
0332: BSF 03.5 |
|
|
1015 |
0333: BCF 05.7 |
|
|
1016 |
0334: BCF 03.5 |
|
|
1017 |
0335: BCF 05.7 |
|
|
1018 |
0336: BSF 03.5 |
|
|
1019 |
0337: BCF 05.6 |
|
|
1020 |
0338: BCF 03.5 |
|
|
1021 |
0339: BCF 05.6 |
|
|
1022 |
.................... |
|
|
1023 |
.................... setup_comparator(A0_VR_A1_VR); // inicializace komparatoru pro cidla cary |
|
|
1024 |
033A: MOVLW 02 |
|
|
1025 |
033B: BSF 03.5 |
|
|
1026 |
033C: MOVWF 1C |
|
|
1027 |
033D: MOVF 05,W |
|
|
1028 |
033E: IORLW 03 |
|
|
1029 |
033F: MOVWF 05 |
|
|
1030 |
0340: MOVLW 03 |
|
|
1031 |
0341: MOVWF 77 |
|
|
1032 |
0342: DECFSZ 77,F |
|
|
1033 |
0343: GOTO 342 |
|
|
1034 |
0344: MOVF 1C,W |
|
|
1035 |
0345: BCF 03.5 |
|
|
1036 |
0346: BCF 0D.6 |
|
|
1037 |
.................... setup_vref(VREF_HIGH|TRESHOLD); // 32 kroku od 0.25 do 0.75 Vdd |
|
|
1038 |
0347: MOVLW 8F |
|
|
1039 |
0348: BSF 03.5 |
|
|
1040 |
0349: MOVWF 1D |
|
|
1041 |
.................... |
|
|
1042 |
.................... Beep(1000,200); //double beep |
|
|
1043 |
034A: MOVLW 03 |
|
|
1044 |
034B: BCF 03.5 |
|
|
1045 |
034C: MOVWF 37 |
|
|
1046 |
034D: MOVLW E8 |
|
|
1047 |
034E: MOVWF 36 |
|
|
1048 |
034F: CLRF 39 |
|
|
1049 |
0350: MOVLW C8 |
|
|
1050 |
0351: MOVWF 38 |
|
|
1051 |
0352: CALL 055 |
|
|
1052 |
.................... Delay_ms(50); |
|
|
1053 |
0353: MOVLW 32 |
|
|
1054 |
0354: MOVWF 37 |
|
|
1055 |
0355: CALL 073 |
|
|
1056 |
.................... Beep(1000,200); |
|
|
1057 |
0356: MOVLW 03 |
|
|
1058 |
0357: MOVWF 37 |
|
|
1059 |
0358: MOVLW E8 |
|
|
1060 |
0359: MOVWF 36 |
|
|
1061 |
035A: CLRF 39 |
|
|
1062 |
035B: MOVLW C8 |
|
|
1063 |
035C: MOVWF 38 |
|
|
1064 |
035D: CALL 055 |
|
|
1065 |
.................... Delay_ms(1000); // 1s |
|
|
1066 |
035E: MOVLW 04 |
|
|
1067 |
035F: MOVWF 34 |
|
|
1068 |
0360: MOVLW FA |
|
|
1069 |
0361: MOVWF 37 |
|
|
1070 |
0362: CALL 073 |
|
|
1071 |
0363: DECFSZ 34,F |
|
|
1072 |
0364: GOTO 360 |
|
|
1073 |
.................... |
|
|
1074 |
.................... // povoleni rizeni rychlosti zataceni pres preruseni |
|
|
1075 |
.................... enable_interrupts(INT_TIMER2); |
|
|
1076 |
0365: BSF 03.5 |
|
|
1077 |
0366: BSF 0C.1 |
|
|
1078 |
.................... enable_interrupts(GLOBAL); |
|
|
1079 |
0367: MOVLW C0 |
|
|
1080 |
0368: BCF 03.5 |
|
|
1081 |
0369: IORWF 0B,F |
|
|
1082 |
.................... |
|
|
1083 |
.................... /*---------------------------------------------------------------------------*/ |
|
|
1084 |
.................... sensors=S; |
|
|
1085 |
036A: MOVLW 03 |
|
|
1086 |
036B: MOVWF 29 |
|
|
1087 |
.................... line=S; |
|
|
1088 |
036C: MOVWF 2A |
|
|
1089 |
.................... last=S; |
|
|
1090 |
036D: MOVWF 2C |
|
|
1091 |
.................... cirkus=0; |
|
|
1092 |
036E: CLRF 2E |
|
|
1093 |
.................... // movement=S; |
|
|
1094 |
.................... speed=FW_POMALU; |
|
|
1095 |
036F: MOVLW AA |
|
|
1096 |
0370: MOVWF 2B |
|
|
1097 |
.................... |
|
|
1098 |
.................... BW=input(BARVY); // Jaka ma byt barva cary? |
|
|
1099 |
0371: BSF 03.5 |
|
|
1100 |
0372: BSF 06.1 |
|
|
1101 |
0373: BCF 03.5 |
|
|
1102 |
0374: BCF 2F.0 |
|
|
1103 |
0375: BTFSC 06.1 |
|
|
1104 |
0376: BSF 2F.0 |
|
|
1105 |
.................... diagnostika(); // Zkus, jestli nekdo nechce, diagnostiku |
|
|
1106 |
0377: GOTO 088 |
|
|
1107 |
.................... Delay_ms(500); |
|
|
1108 |
0378: MOVLW 02 |
|
|
1109 |
0379: MOVWF 34 |
|
|
1110 |
037A: MOVLW FA |
|
|
1111 |
037B: MOVWF 37 |
|
|
1112 |
037C: CALL 073 |
|
|
1113 |
037D: DECFSZ 34,F |
|
|
1114 |
037E: GOTO 37A |
|
|
1115 |
.................... |
|
|
1116 |
.................... output_high(LED1); Beep(1000,200); Delay_ms(500); |
|
|
1117 |
037F: BSF 03.5 |
|
|
1118 |
0380: BCF 05.4 |
|
|
1119 |
0381: BCF 03.5 |
|
|
1120 |
0382: BSF 05.4 |
|
|
1121 |
0383: MOVLW 03 |
|
|
1122 |
0384: MOVWF 37 |
|
|
1123 |
0385: MOVLW E8 |
|
|
1124 |
0386: MOVWF 36 |
|
|
1125 |
0387: CLRF 39 |
|
|
1126 |
0388: MOVLW C8 |
|
|
1127 |
0389: MOVWF 38 |
|
|
1128 |
038A: CALL 055 |
|
|
1129 |
038B: MOVLW 02 |
|
|
1130 |
038C: MOVWF 34 |
|
|
1131 |
038D: MOVLW FA |
|
|
1132 |
038E: MOVWF 37 |
|
|
1133 |
038F: CALL 073 |
|
|
1134 |
0390: DECFSZ 34,F |
|
|
1135 |
0391: GOTO 38D |
|
|
1136 |
.................... output_high(LED2); Beep(1000,200); Delay_ms(500); |
|
|
1137 |
0392: BSF 03.5 |
|
|
1138 |
0393: BCF 05.3 |
|
|
1139 |
0394: BCF 03.5 |
|
|
1140 |
0395: BSF 05.3 |
|
|
1141 |
0396: MOVLW 03 |
|
|
1142 |
0397: MOVWF 37 |
|
|
1143 |
0398: MOVLW E8 |
|
|
1144 |
0399: MOVWF 36 |
|
|
1145 |
039A: CLRF 39 |
|
|
1146 |
039B: MOVLW C8 |
|
|
1147 |
039C: MOVWF 38 |
|
|
1148 |
039D: CALL 055 |
|
|
1149 |
039E: MOVLW 02 |
|
|
1150 |
039F: MOVWF 34 |
|
|
1151 |
03A0: MOVLW FA |
|
|
1152 |
03A1: MOVWF 37 |
|
|
1153 |
03A2: CALL 073 |
|
|
1154 |
03A3: DECFSZ 34,F |
|
|
1155 |
03A4: GOTO 3A0 |
|
|
1156 |
.................... output_high(LED3); Beep(1000,200); Delay_ms(500); |
|
|
1157 |
03A5: BSF 03.5 |
|
|
1158 |
03A6: BCF 05.7 |
|
|
1159 |
03A7: BCF 03.5 |
|
|
1160 |
03A8: BSF 05.7 |
|
|
1161 |
03A9: MOVLW 03 |
|
|
1162 |
03AA: MOVWF 37 |
|
|
1163 |
03AB: MOVLW E8 |
|
|
1164 |
03AC: MOVWF 36 |
|
|
1165 |
03AD: CLRF 39 |
|
|
1166 |
03AE: MOVLW C8 |
|
|
1167 |
03AF: MOVWF 38 |
|
|
1168 |
03B0: CALL 055 |
|
|
1169 |
03B1: MOVLW 02 |
|
|
1170 |
03B2: MOVWF 34 |
|
|
1171 |
03B3: MOVLW FA |
|
|
1172 |
03B4: MOVWF 37 |
|
|
1173 |
03B5: CALL 073 |
|
|
1174 |
03B6: DECFSZ 34,F |
|
|
1175 |
03B7: GOTO 3B3 |
|
|
1176 |
.................... output_high(LED4); Beep(1000,200); Delay_ms(500); |
|
|
1177 |
03B8: BSF 03.5 |
|
|
1178 |
03B9: BCF 05.6 |
|
|
1179 |
03BA: BCF 03.5 |
|
|
1180 |
03BB: BSF 05.6 |
|
|
1181 |
03BC: MOVLW 03 |
|
|
1182 |
03BD: MOVWF 37 |
|
|
1183 |
03BE: MOVLW E8 |
|
|
1184 |
03BF: MOVWF 36 |
|
|
1185 |
03C0: CLRF 39 |
|
|
1186 |
03C1: MOVLW C8 |
|
|
1187 |
03C2: MOVWF 38 |
|
|
1188 |
03C3: CALL 055 |
|
|
1189 |
03C4: MOVLW 02 |
|
|
1190 |
03C5: MOVWF 34 |
|
|
1191 |
03C6: MOVLW FA |
|
|
1192 |
03C7: MOVWF 37 |
|
|
1193 |
03C8: CALL 073 |
|
|
1194 |
03C9: DECFSZ 34,F |
|
|
1195 |
03CA: GOTO 3C6 |
|
|
1196 |
.................... |
|
|
1197 |
.................... while(true) // hlavni smycka (jizda podle cary) |
|
|
1198 |
.................... { |
|
|
1199 |
.................... sensors = RSENSOR; // cteni senzoru na caru |
|
|
1200 |
03CB: CLRF 77 |
|
|
1201 |
03CC: BSF 03.5 |
|
|
1202 |
03CD: BTFSC 1C.7 |
|
|
1203 |
03CE: BSF 77.0 |
|
|
1204 |
03CF: BCF 03.5 |
|
|
1205 |
03D0: MOVF 2F,W |
|
|
1206 |
03D1: XORWF 77,W |
|
|
1207 |
03D2: ANDLW 01 |
|
|
1208 |
03D3: BTFSS 03.2 |
|
|
1209 |
03D4: GOTO 3D7 |
|
|
1210 |
03D5: MOVLW 00 |
|
|
1211 |
03D6: GOTO 3D8 |
|
|
1212 |
03D7: MOVLW 01 |
|
|
1213 |
03D8: MOVWF 29 |
|
|
1214 |
.................... sensors |= LSENSOR << 1; |
|
|
1215 |
03D9: CLRF 77 |
|
|
1216 |
03DA: BSF 03.5 |
|
|
1217 |
03DB: BTFSC 1C.6 |
|
|
1218 |
03DC: BSF 77.0 |
|
|
1219 |
03DD: BCF 03.5 |
|
|
1220 |
03DE: MOVF 2F,W |
|
|
1221 |
03DF: XORWF 77,W |
|
|
1222 |
03E0: ANDLW 01 |
|
|
1223 |
03E1: BTFSS 03.2 |
|
|
1224 |
03E2: GOTO 3E5 |
|
|
1225 |
03E3: MOVLW 00 |
|
|
1226 |
03E4: GOTO 3E6 |
|
|
1227 |
03E5: MOVLW 01 |
|
|
1228 |
03E6: MOVWF 77 |
|
|
1229 |
03E7: BCF 03.0 |
|
|
1230 |
03E8: RLF 77,F |
|
|
1231 |
03E9: MOVF 77,W |
|
|
1232 |
03EA: IORWF 29,F |
|
|
1233 |
.................... |
|
|
1234 |
.................... if (read_adc(ADC_READ_ONLY)<BUMPER_TRESHOLD) OtocSe(); |
|
|
1235 |
03EB: BTFSC 1F.2 |
|
|
1236 |
03EC: GOTO 3EB |
|
|
1237 |
03ED: MOVF 1E,W |
|
|
1238 |
03EE: SUBLW 7F |
|
|
1239 |
03EF: BTFSC 03.0 |
|
|
1240 |
03F0: GOTO 1F8 |
|
|
1241 |
.................... |
|
|
1242 |
.................... switch (sensors) // zatacej podle toho, kde vidis caru |
|
|
1243 |
.................... { |
|
|
1244 |
03F1: MOVF 29,W |
|
|
1245 |
03F2: XORLW 03 |
|
|
1246 |
03F3: BTFSC 03.2 |
|
|
1247 |
03F4: GOTO 3FC |
|
|
1248 |
03F5: XORLW 01 |
|
|
1249 |
03F6: BTFSC 03.2 |
|
|
1250 |
03F7: GOTO 431 |
|
|
1251 |
03F8: XORLW 03 |
|
|
1252 |
03F9: BTFSC 03.2 |
|
|
1253 |
03FA: GOTO 468 |
|
|
1254 |
03FB: GOTO 49F |
|
|
1255 |
.................... case S: // rovne |
|
|
1256 |
.................... GO(L, F, FW_STREDNE+rovinka); GO(R, F, FW_STREDNE+rovinka); |
|
|
1257 |
03FC: MOVF 01,W |
|
|
1258 |
03FD: MOVWF 34 |
|
|
1259 |
03FE: MOVLW BE |
|
|
1260 |
03FF: ADDWF 2D,W |
|
|
1261 |
0400: SUBWF 34,W |
|
|
1262 |
0401: BTFSC 03.2 |
|
|
1263 |
0402: GOTO 405 |
|
|
1264 |
0403: BTFSC 03.0 |
|
|
1265 |
0404: GOTO 40E |
|
|
1266 |
0405: BSF 03.5 |
|
|
1267 |
0406: BCF 06.7 |
|
|
1268 |
0407: BCF 03.5 |
|
|
1269 |
0408: BCF 06.7 |
|
|
1270 |
0409: BSF 03.5 |
|
|
1271 |
040A: BCF 06.6 |
|
|
1272 |
040B: BCF 03.5 |
|
|
1273 |
040C: BSF 06.6 |
|
|
1274 |
040D: GOTO 416 |
|
|
1275 |
040E: BSF 03.5 |
|
|
1276 |
040F: BCF 06.6 |
|
|
1277 |
0410: BCF 03.5 |
|
|
1278 |
0411: BCF 06.6 |
|
|
1279 |
0412: BSF 03.5 |
|
|
1280 |
0413: BCF 06.7 |
|
|
1281 |
0414: BCF 03.5 |
|
|
1282 |
0415: BCF 06.7 |
|
|
1283 |
0416: MOVF 01,W |
|
|
1284 |
0417: MOVWF 34 |
|
|
1285 |
0418: MOVLW BE |
|
|
1286 |
0419: ADDWF 2D,W |
|
|
1287 |
041A: SUBWF 34,W |
|
|
1288 |
041B: BTFSC 03.2 |
|
|
1289 |
041C: GOTO 41F |
|
|
1290 |
041D: BTFSC 03.0 |
|
|
1291 |
041E: GOTO 428 |
|
|
1292 |
041F: BSF 03.5 |
|
|
1293 |
0420: BCF 06.5 |
|
|
1294 |
0421: BCF 03.5 |
|
|
1295 |
0422: BCF 06.5 |
|
|
1296 |
0423: BSF 03.5 |
|
|
1297 |
0424: BCF 06.4 |
|
|
1298 |
0425: BCF 03.5 |
|
|
1299 |
0426: BSF 06.4 |
|
|
1300 |
0427: GOTO 430 |
|
|
1301 |
0428: BSF 03.5 |
|
|
1302 |
0429: BCF 06.4 |
|
|
1303 |
042A: BCF 03.5 |
|
|
1304 |
042B: BCF 06.4 |
|
|
1305 |
042C: BSF 03.5 |
|
|
1306 |
042D: BCF 06.5 |
|
|
1307 |
042E: BCF 03.5 |
|
|
1308 |
042F: BCF 06.5 |
|
|
1309 |
.................... continue; |
|
|
1310 |
0430: GOTO 3CB |
|
|
1311 |
.................... case L: // trochu vlevo |
|
|
1312 |
.................... GO(L, F, FW_POMALU+rovinka); GO(R, F, FW_STREDNE+rovinka); |
|
|
1313 |
0431: MOVF 01,W |
|
|
1314 |
0432: MOVWF 34 |
|
|
1315 |
0433: MOVLW AA |
|
|
1316 |
0434: ADDWF 2D,W |
|
|
1317 |
0435: SUBWF 34,W |
|
|
1318 |
0436: BTFSC 03.2 |
|
|
1319 |
0437: GOTO 43A |
|
|
1320 |
0438: BTFSC 03.0 |
|
|
1321 |
0439: GOTO 443 |
|
|
1322 |
043A: BSF 03.5 |
|
|
1323 |
043B: BCF 06.7 |
|
|
1324 |
043C: BCF 03.5 |
|
|
1325 |
043D: BCF 06.7 |
|
|
1326 |
043E: BSF 03.5 |
|
|
1327 |
043F: BCF 06.6 |
|
|
1328 |
0440: BCF 03.5 |
|
|
1329 |
0441: BSF 06.6 |
|
|
1330 |
0442: GOTO 44B |
|
|
1331 |
0443: BSF 03.5 |
|
|
1332 |
0444: BCF 06.6 |
|
|
1333 |
0445: BCF 03.5 |
|
|
1334 |
0446: BCF 06.6 |
|
|
1335 |
0447: BSF 03.5 |
|
|
1336 |
0448: BCF 06.7 |
|
|
1337 |
0449: BCF 03.5 |
|
|
1338 |
044A: BCF 06.7 |
|
|
1339 |
044B: MOVF 01,W |
|
|
1340 |
044C: MOVWF 34 |
|
|
1341 |
044D: MOVLW BE |
|
|
1342 |
044E: ADDWF 2D,W |
|
|
1343 |
044F: SUBWF 34,W |
|
|
1344 |
0450: BTFSC 03.2 |
|
|
1345 |
0451: GOTO 454 |
|
|
1346 |
0452: BTFSC 03.0 |
|
|
1347 |
0453: GOTO 45D |
|
|
1348 |
0454: BSF 03.5 |
|
|
1349 |
0455: BCF 06.5 |
|
|
1350 |
0456: BCF 03.5 |
|
|
1351 |
0457: BCF 06.5 |
|
|
1352 |
0458: BSF 03.5 |
|
|
1353 |
0459: BCF 06.4 |
|
|
1354 |
045A: BCF 03.5 |
|
|
1355 |
045B: BSF 06.4 |
|
|
1356 |
045C: GOTO 465 |
|
|
1357 |
045D: BSF 03.5 |
|
|
1358 |
045E: BCF 06.4 |
|
|
1359 |
045F: BCF 03.5 |
|
|
1360 |
0460: BCF 06.4 |
|
|
1361 |
0461: BSF 03.5 |
|
|
1362 |
0462: BCF 06.5 |
|
|
1363 |
0463: BCF 03.5 |
|
|
1364 |
0464: BCF 06.5 |
|
|
1365 |
.................... line=L; |
|
|
1366 |
0465: MOVLW 02 |
|
|
1367 |
0466: MOVWF 2A |
|
|
1368 |
.................... continue; |
|
|
1369 |
0467: GOTO 3CB |
|
|
1370 |
.................... case R: // trochu vpravo |
|
|
1371 |
.................... GO(R, F, FW_POMALU+rovinka); GO(L, F, FW_STREDNE+rovinka); |
|
|
1372 |
0468: MOVF 01,W |
|
|
1373 |
0469: MOVWF 34 |
|
|
1374 |
046A: MOVLW AA |
|
|
1375 |
046B: ADDWF 2D,W |
|
|
1376 |
046C: SUBWF 34,W |
|
|
1377 |
046D: BTFSC 03.2 |
|
|
1378 |
046E: GOTO 471 |
|
|
1379 |
046F: BTFSC 03.0 |
|
|
1380 |
0470: GOTO 47A |
|
|
1381 |
0471: BSF 03.5 |
|
|
1382 |
0472: BCF 06.5 |
|
|
1383 |
0473: BCF 03.5 |
|
|
1384 |
0474: BCF 06.5 |
|
|
1385 |
0475: BSF 03.5 |
|
|
1386 |
0476: BCF 06.4 |
|
|
1387 |
0477: BCF 03.5 |
|
|
1388 |
0478: BSF 06.4 |
|
|
1389 |
0479: GOTO 482 |
|
|
1390 |
047A: BSF 03.5 |
|
|
1391 |
047B: BCF 06.4 |
|
|
1392 |
047C: BCF 03.5 |
|
|
1393 |
047D: BCF 06.4 |
|
|
1394 |
047E: BSF 03.5 |
|
|
1395 |
047F: BCF 06.5 |
|
|
1396 |
0480: BCF 03.5 |
|
|
1397 |
0481: BCF 06.5 |
|
|
1398 |
0482: MOVF 01,W |
|
|
1399 |
0483: MOVWF 34 |
|
|
1400 |
0484: MOVLW BE |
|
|
1401 |
0485: ADDWF 2D,W |
|
|
1402 |
0486: SUBWF 34,W |
|
|
1403 |
0487: BTFSC 03.2 |
|
|
1404 |
0488: GOTO 48B |
|
|
1405 |
0489: BTFSC 03.0 |
|
|
1406 |
048A: GOTO 494 |
|
|
1407 |
048B: BSF 03.5 |
|
|
1408 |
048C: BCF 06.7 |
|
|
1409 |
048D: BCF 03.5 |
|
|
1410 |
048E: BCF 06.7 |
|
|
1411 |
048F: BSF 03.5 |
|
|
1412 |
0490: BCF 06.6 |
|
|
1413 |
0491: BCF 03.5 |
|
|
1414 |
0492: BSF 06.6 |
|
|
1415 |
0493: GOTO 49C |
|
|
1416 |
0494: BSF 03.5 |
|
|
1417 |
0495: BCF 06.6 |
|
|
1418 |
0496: BCF 03.5 |
|
|
1419 |
0497: BCF 06.6 |
|
|
1420 |
0498: BSF 03.5 |
|
|
1421 |
0499: BCF 06.7 |
|
|
1422 |
049A: BCF 03.5 |
|
|
1423 |
049B: BCF 06.7 |
|
|
1424 |
.................... line=R; |
|
|
1425 |
049C: MOVLW 01 |
|
|
1426 |
049D: MOVWF 2A |
|
|
1427 |
.................... continue; |
|
|
1428 |
049E: GOTO 3CB |
|
|
1429 |
.................... default: // kdyz jsou obe cidla mimo caru, tak pokracuj dal |
|
|
1430 |
.................... }; |
|
|
1431 |
.................... rovinka=0; |
|
|
1432 |
049F: CLRF 2D |
|
|
1433 |
.................... |
|
|
1434 |
.................... if (last!=line) // pokud si prejel caru z jedne strany na druhou stranu, |
|
|
1435 |
04A0: MOVF 2A,W |
|
|
1436 |
04A1: SUBWF 2C,W |
|
|
1437 |
04A2: BTFSC 03.2 |
|
|
1438 |
04A3: GOTO 560 |
|
|
1439 |
.................... // tak zabrzdi |
|
|
1440 |
.................... { |
|
|
1441 |
.................... output_bit(LED1, !input(LED1)); |
|
|
1442 |
04A4: BSF 03.5 |
|
|
1443 |
04A5: BSF 05.4 |
|
|
1444 |
04A6: BCF 03.5 |
|
|
1445 |
04A7: BTFSS 05.4 |
|
|
1446 |
04A8: GOTO 4AB |
|
|
1447 |
04A9: BCF 05.4 |
|
|
1448 |
04AA: GOTO 4AC |
|
|
1449 |
04AB: BSF 05.4 |
|
|
1450 |
04AC: BSF 03.5 |
|
|
1451 |
04AD: BCF 05.4 |
|
|
1452 |
.................... last=line; |
|
|
1453 |
04AE: BCF 03.5 |
|
|
1454 |
04AF: MOVF 2A,W |
|
|
1455 |
04B0: MOVWF 2C |
|
|
1456 |
.................... speed=FW_ZATACKA; |
|
|
1457 |
04B1: MOVLW C8 |
|
|
1458 |
04B2: MOVWF 2B |
|
|
1459 |
.................... cirkus++; |
|
|
1460 |
04B3: INCF 2E,F |
|
|
1461 |
.................... if (cirkus>8) |
|
|
1462 |
04B4: MOVF 2E,W |
|
|
1463 |
04B5: SUBLW 08 |
|
|
1464 |
04B6: BTFSC 03.0 |
|
|
1465 |
04B7: GOTO 560 |
|
|
1466 |
.................... { |
|
|
1467 |
.................... STOPL; STOPR; |
|
|
1468 |
04B8: BSF 03.5 |
|
|
1469 |
04B9: BCF 06.6 |
|
|
1470 |
04BA: BCF 03.5 |
|
|
1471 |
04BB: BCF 06.6 |
|
|
1472 |
04BC: BSF 03.5 |
|
|
1473 |
04BD: BCF 06.7 |
|
|
1474 |
04BE: BCF 03.5 |
|
|
1475 |
04BF: BCF 06.7 |
|
|
1476 |
04C0: BSF 03.5 |
|
|
1477 |
04C1: BCF 06.4 |
|
|
1478 |
04C2: BCF 03.5 |
|
|
1479 |
04C3: BCF 06.4 |
|
|
1480 |
04C4: BSF 03.5 |
|
|
1481 |
04C5: BCF 06.5 |
|
|
1482 |
04C6: BCF 03.5 |
|
|
1483 |
04C7: BCF 06.5 |
|
|
1484 |
.................... cirkus=0; |
|
|
1485 |
04C8: CLRF 2E |
|
|
1486 |
.................... disable_interrupts(GLOBAL); |
|
|
1487 |
04C9: BCF 0B.6 |
|
|
1488 |
04CA: BCF 0B.7 |
|
|
1489 |
04CB: BTFSC 0B.7 |
|
|
1490 |
04CC: GOTO 4CA |
|
|
1491 |
.................... beep(1000,400); |
|
|
1492 |
04CD: MOVLW 03 |
|
|
1493 |
04CE: MOVWF 37 |
|
|
1494 |
04CF: MOVLW E8 |
|
|
1495 |
04D0: MOVWF 36 |
|
|
1496 |
04D1: MOVLW 01 |
|
|
1497 |
04D2: MOVWF 39 |
|
|
1498 |
04D3: MOVLW 90 |
|
|
1499 |
04D4: MOVWF 38 |
|
|
1500 |
04D5: CALL 055 |
|
|
1501 |
.................... for(n=3000; n>3950; n--) beep(n,10); |
|
|
1502 |
04D6: MOVLW 0B |
|
|
1503 |
04D7: MOVWF 31 |
|
|
1504 |
04D8: MOVLW B8 |
|
|
1505 |
04D9: MOVWF 30 |
|
|
1506 |
04DA: MOVF 31,W |
|
|
1507 |
04DB: SUBLW 0E |
|
|
1508 |
04DC: BTFSC 03.0 |
|
|
1509 |
04DD: GOTO 4F2 |
|
|
1510 |
04DE: XORLW FF |
|
|
1511 |
04DF: BTFSS 03.2 |
|
|
1512 |
04E0: GOTO 4E5 |
|
|
1513 |
04E1: MOVF 30,W |
|
|
1514 |
04E2: SUBLW 6E |
|
|
1515 |
04E3: BTFSC 03.0 |
|
|
1516 |
04E4: GOTO 4F2 |
|
|
1517 |
04E5: MOVF 31,W |
|
|
1518 |
04E6: MOVWF 37 |
|
|
1519 |
04E7: MOVF 30,W |
|
|
1520 |
04E8: MOVWF 36 |
|
|
1521 |
04E9: CLRF 39 |
|
|
1522 |
04EA: MOVLW 0A |
|
|
1523 |
04EB: MOVWF 38 |
|
|
1524 |
04EC: CALL 055 |
|
|
1525 |
04ED: MOVF 30,W |
|
|
1526 |
04EE: BTFSC 03.2 |
|
|
1527 |
04EF: DECF 31,F |
|
|
1528 |
04F0: DECF 30,F |
|
|
1529 |
04F1: GOTO 4DA |
|
|
1530 |
.................... output_low(LED1); |
|
|
1531 |
04F2: BSF 03.5 |
|
|
1532 |
04F3: BCF 05.4 |
|
|
1533 |
04F4: BCF 03.5 |
|
|
1534 |
04F5: BCF 05.4 |
|
|
1535 |
.................... beep(2000,200); |
|
|
1536 |
04F6: MOVLW 07 |
|
|
1537 |
04F7: MOVWF 37 |
|
|
1538 |
04F8: MOVLW D0 |
|
|
1539 |
04F9: MOVWF 36 |
|
|
1540 |
04FA: CLRF 39 |
|
|
1541 |
04FB: MOVLW C8 |
|
|
1542 |
04FC: MOVWF 38 |
|
|
1543 |
04FD: CALL 055 |
|
|
1544 |
.................... beep(900,400); |
|
|
1545 |
04FE: MOVLW 03 |
|
|
1546 |
04FF: MOVWF 37 |
|
|
1547 |
0500: MOVLW 84 |
|
|
1548 |
0501: MOVWF 36 |
|
|
1549 |
0502: MOVLW 01 |
|
|
1550 |
0503: MOVWF 39 |
|
|
1551 |
0504: MOVLW 90 |
|
|
1552 |
0505: MOVWF 38 |
|
|
1553 |
0506: CALL 055 |
|
|
1554 |
.................... for(n=2950; n<3000; n++) beep(n,10); |
|
|
1555 |
0507: MOVLW 0B |
|
|
1556 |
0508: MOVWF 31 |
|
|
1557 |
0509: MOVLW 86 |
|
|
1558 |
050A: MOVWF 30 |
|
|
1559 |
050B: MOVF 31,W |
|
|
1560 |
050C: SUBLW 0B |
|
|
1561 |
050D: BTFSS 03.0 |
|
|
1562 |
050E: GOTO 521 |
|
|
1563 |
050F: BTFSS 03.2 |
|
|
1564 |
0510: GOTO 515 |
|
|
1565 |
0511: MOVF 30,W |
|
|
1566 |
0512: SUBLW B7 |
|
|
1567 |
0513: BTFSS 03.0 |
|
|
1568 |
0514: GOTO 521 |
|
|
1569 |
0515: MOVF 31,W |
|
|
1570 |
0516: MOVWF 37 |
|
|
1571 |
0517: MOVF 30,W |
|
|
1572 |
0518: MOVWF 36 |
|
|
1573 |
0519: CLRF 39 |
|
|
1574 |
051A: MOVLW 0A |
|
|
1575 |
051B: MOVWF 38 |
|
|
1576 |
051C: CALL 055 |
|
|
1577 |
051D: INCF 30,F |
|
|
1578 |
051E: BTFSC 03.2 |
|
|
1579 |
051F: INCF 31,F |
|
|
1580 |
0520: GOTO 50B |
|
|
1581 |
.................... output_low(LED2); |
|
|
1582 |
0521: BSF 03.5 |
|
|
1583 |
0522: BCF 05.3 |
|
|
1584 |
0523: BCF 03.5 |
|
|
1585 |
0524: BCF 05.3 |
|
|
1586 |
.................... output_high(LED1); |
|
|
1587 |
0525: BSF 03.5 |
|
|
1588 |
0526: BCF 05.4 |
|
|
1589 |
0527: BCF 03.5 |
|
|
1590 |
0528: BSF 05.4 |
|
|
1591 |
.................... beep(4000,400); |
|
|
1592 |
0529: MOVLW 0F |
|
|
1593 |
052A: MOVWF 37 |
|
|
1594 |
052B: MOVLW A0 |
|
|
1595 |
052C: MOVWF 36 |
|
|
1596 |
052D: MOVLW 01 |
|
|
1597 |
052E: MOVWF 39 |
|
|
1598 |
052F: MOVLW 90 |
|
|
1599 |
0530: MOVWF 38 |
|
|
1600 |
0531: CALL 055 |
|
|
1601 |
.................... beep(1000,100); |
|
|
1602 |
0532: MOVLW 03 |
|
|
1603 |
0533: MOVWF 37 |
|
|
1604 |
0534: MOVLW E8 |
|
|
1605 |
0535: MOVWF 36 |
|
|
1606 |
0536: CLRF 39 |
|
|
1607 |
0537: MOVLW 64 |
|
|
1608 |
0538: MOVWF 38 |
|
|
1609 |
0539: CALL 055 |
|
|
1610 |
.................... output_low(LED3); |
|
|
1611 |
053A: BSF 03.5 |
|
|
1612 |
053B: BCF 05.7 |
|
|
1613 |
053C: BCF 03.5 |
|
|
1614 |
053D: BCF 05.7 |
|
|
1615 |
.................... beep(3000,400); |
|
|
1616 |
053E: MOVLW 0B |
|
|
1617 |
053F: MOVWF 37 |
|
|
1618 |
0540: MOVLW B8 |
|
|
1619 |
0541: MOVWF 36 |
|
|
1620 |
0542: MOVLW 01 |
|
|
1621 |
0543: MOVWF 39 |
|
|
1622 |
0544: MOVLW 90 |
|
|
1623 |
0545: MOVWF 38 |
|
|
1624 |
0546: CALL 055 |
|
|
1625 |
.................... Delay_ms(1000); |
|
|
1626 |
0547: MOVLW 04 |
|
|
1627 |
0548: MOVWF 34 |
|
|
1628 |
0549: MOVLW FA |
|
|
1629 |
054A: MOVWF 37 |
|
|
1630 |
054B: CALL 073 |
|
|
1631 |
054C: DECFSZ 34,F |
|
|
1632 |
054D: GOTO 549 |
|
|
1633 |
.................... output_high(LED1); output_high(LED2); |
|
|
1634 |
054E: BSF 03.5 |
|
|
1635 |
054F: BCF 05.4 |
|
|
1636 |
0550: BCF 03.5 |
|
|
1637 |
0551: BSF 05.4 |
|
|
1638 |
0552: BSF 03.5 |
|
|
1639 |
0553: BCF 05.3 |
|
|
1640 |
0554: BCF 03.5 |
|
|
1641 |
0555: BSF 05.3 |
|
|
1642 |
.................... output_high(LED3); output_high(LED4); |
|
|
1643 |
0556: BSF 03.5 |
|
|
1644 |
0557: BCF 05.7 |
|
|
1645 |
0558: BCF 03.5 |
|
|
1646 |
0559: BSF 05.7 |
|
|
1647 |
055A: BSF 03.5 |
|
|
1648 |
055B: BCF 05.6 |
|
|
1649 |
055C: BCF 03.5 |
|
|
1650 |
055D: BSF 05.6 |
|
|
1651 |
.................... enable_interrupts(GLOBAL); |
|
|
1652 |
055E: MOVLW C0 |
|
|
1653 |
055F: IORWF 0B,F |
|
|
1654 |
.................... } |
|
|
1655 |
.................... }; |
|
|
1656 |
.................... |
|
|
1657 |
.................... if (L==line) // kdyz jsou obe cidla mimo caru, zatoc na caru |
|
|
1658 |
0560: MOVF 2A,W |
|
|
1659 |
0561: SUBLW 02 |
|
|
1660 |
0562: BTFSS 03.2 |
|
|
1661 |
0563: GOTO 582 |
|
|
1662 |
.................... { |
|
|
1663 |
.................... STOPL; |
|
|
1664 |
0564: BSF 03.5 |
|
|
1665 |
0565: BCF 06.6 |
|
|
1666 |
0566: BCF 03.5 |
|
|
1667 |
0567: BCF 06.6 |
|
|
1668 |
0568: BSF 03.5 |
|
|
1669 |
0569: BCF 06.7 |
|
|
1670 |
056A: BCF 03.5 |
|
|
1671 |
056B: BCF 06.7 |
|
|
1672 |
.................... GO(R, F, speed); |
|
|
1673 |
056C: MOVF 01,W |
|
|
1674 |
056D: SUBWF 2B,W |
|
|
1675 |
056E: BTFSS 03.0 |
|
|
1676 |
056F: GOTO 579 |
|
|
1677 |
0570: BSF 03.5 |
|
|
1678 |
0571: BCF 06.5 |
|
|
1679 |
0572: BCF 03.5 |
|
|
1680 |
0573: BCF 06.5 |
|
|
1681 |
0574: BSF 03.5 |
|
|
1682 |
0575: BCF 06.4 |
|
|
1683 |
0576: BCF 03.5 |
|
|
1684 |
0577: BSF 06.4 |
|
|
1685 |
0578: GOTO 581 |
|
|
1686 |
0579: BSF 03.5 |
|
|
1687 |
057A: BCF 06.4 |
|
|
1688 |
057B: BCF 03.5 |
|
|
1689 |
057C: BCF 06.4 |
|
|
1690 |
057D: BSF 03.5 |
|
|
1691 |
057E: BCF 06.5 |
|
|
1692 |
057F: BCF 03.5 |
|
|
1693 |
0580: BCF 06.5 |
|
|
1694 |
.................... } |
|
|
1695 |
.................... else |
|
|
1696 |
0581: GOTO 59F |
|
|
1697 |
.................... { |
|
|
1698 |
.................... STOPR; |
|
|
1699 |
0582: BSF 03.5 |
|
|
1700 |
0583: BCF 06.4 |
|
|
1701 |
0584: BCF 03.5 |
|
|
1702 |
0585: BCF 06.4 |
|
|
1703 |
0586: BSF 03.5 |
|
|
1704 |
0587: BCF 06.5 |
|
|
1705 |
0588: BCF 03.5 |
|
|
1706 |
0589: BCF 06.5 |
|
|
1707 |
.................... GO(L, F, speed); |
|
|
1708 |
058A: MOVF 01,W |
|
|
1709 |
058B: SUBWF 2B,W |
|
|
1710 |
058C: BTFSS 03.0 |
|
|
1711 |
058D: GOTO 597 |
|
|
1712 |
058E: BSF 03.5 |
|
|
1713 |
058F: BCF 06.7 |
|
|
1714 |
0590: BCF 03.5 |
|
|
1715 |
0591: BCF 06.7 |
|
|
1716 |
0592: BSF 03.5 |
|
|
1717 |
0593: BCF 06.6 |
|
|
1718 |
0594: BCF 03.5 |
|
|
1719 |
0595: BSF 06.6 |
|
|
1720 |
0596: GOTO 59F |
|
|
1721 |
0597: BSF 03.5 |
|
|
1722 |
0598: BCF 06.6 |
|
|
1723 |
0599: BCF 03.5 |
|
|
1724 |
059A: BCF 06.6 |
|
|
1725 |
059B: BSF 03.5 |
|
|
1726 |
059C: BCF 06.7 |
|
|
1727 |
059D: BCF 03.5 |
|
|
1728 |
059E: BCF 06.7 |
|
|
1729 |
.................... } |
|
|
1730 |
.................... |
|
|
1731 |
.................... } // while(true) |
|
|
1732 |
059F: GOTO 3CB |
|
|
1733 |
.................... } |
|
|
1734 |
.................... |
|
|
1735 |
.................... |
|
|
1736 |
05A0: SLEEP |
|
|
1737 |
|
|
|
1738 |
Configuration Fuses: |
|
|
1739 |
Word 1: 3F38 NOWDT NOPUT MCLR NOBROWNOUT NOLVP NOCPD NOWRT NODEBUG CCPB0 NOPROTECT INTRC_IO |
|
|
1740 |
Word 2: 3FFC NOFCMEN NOIESO |