Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

Rev Author Line No. Line
2 kaklik 1
CCS PCM C Compiler, Version 3.245, 27853               22-IV-06 23:50
2
 
3
               Filename: D:\KAKLIK\programy\PIC_C\roboti\istrobot\3Orbis\main.lst
4
 
5
               ROM used: 960 words (23%)
6
                         Largest free fragment is 2048
7
               RAM used: 30 (17%) at main() level
8
                         37 (21%) worst case
9
               Stack:    4 worst case (2 in main + 2 for interrupts)
10
 
11
*
12
0000:  MOVLW  00
13
0001:  MOVWF  0A
14
0002:  GOTO   212
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.0
43
001F:  GOTO   022
44
0020:  BTFSC  0C.0
45
0021:  GOTO   03B
46
0022:  MOVLW  8C
47
0023:  MOVWF  04
48
0024:  BTFSS  00.1
49
0025:  GOTO   028
50
0026:  BTFSC  0C.1
51
0027:  GOTO   03D
52
0028:  MOVF   22,W
53
0029:  MOVWF  04
54
002A:  MOVF   23,W
55
002B:  MOVWF  77
56
002C:  MOVF   24,W
57
002D:  MOVWF  78
58
002E:  MOVF   25,W
59
002F:  MOVWF  79
60
0030:  MOVF   26,W
61
0031:  MOVWF  7A
62
0032:  MOVF   27,W
63
0033:  MOVWF  7B
64
0034:  MOVF   28,W
65
0035:  MOVWF  0A
66
0036:  SWAPF  21,W
67
0037:  MOVWF  03
68
0038:  SWAPF  7F,F
69
0039:  SWAPF  7F,W
70
003A:  RETFIE
71
003B:  BCF    0A.3
72
003C:  GOTO   03F
73
003D:  BCF    0A.3
74
003E:  GOTO   053
75
.................... #include ".\main.h" 
76
.................... #include <16F88.h> 
77
.................... //////// Standard Header file for the PIC16F88 device //////////////// 
78
.................... #device PIC16F88 
79
.................... #list 
80
....................  
81
.................... #device adc=8 
82
....................  
83
.................... #FUSES NOWDT                 	//No Watch Dog Timer 
84
.................... #FUSES INTRC_IO 
85
.................... #FUSES NOPUT                 	//No Power Up Timer 
86
.................... #FUSES MCLR                  	//Master Clear pin enabled 
87
.................... #FUSES NOBROWNOUT             //Reset when brownout detected 
88
.................... #FUSES NOLVP                  //Low Voltage Programming on B3(PIC16) or B5(PIC18) 
89
.................... #FUSES NOCPD                 	//No EE protection 
90
.................... #FUSES NOWRT                 	//Program memory not write protected 
91
.................... #FUSES NODEBUG               	//No Debug mode for ICD 
92
.................... #FUSES NOPROTECT             	//Code not protected from reading 
93
.................... #FUSES NOFCMEN                //Fail-safe clock monitor enabled 
94
.................... #FUSES NOIESO                  	//Internal External Switch Over mode enabled 
95
....................  
96
.................... #use delay(clock=8000000,RESTART_WDT) 
97
*
98
0043:  MOVLW  08
99
0044:  SUBWF  3F,F
100
0045:  BTFSS  03.0
101
0046:  GOTO   052
102
0047:  MOVLW  3F
103
0048:  MOVWF  04
104
0049:  BCF    03.0
105
004A:  RRF    00,F
106
004B:  MOVF   00,W
107
004C:  BTFSC  03.2
108
004D:  GOTO   052
109
004E:  GOTO   050
110
004F:  CLRWDT
111
0050:  DECFSZ 00,F
112
0051:  GOTO   04F
113
0052:  RETLW  00
114
*
115
0071:  MOVLW  3C
116
0072:  MOVWF  04
117
0073:  MOVF   00,W
118
0074:  BTFSC  03.2
119
0075:  GOTO   088
120
0076:  MOVLW  02
121
0077:  MOVWF  78
122
0078:  MOVLW  BF
123
0079:  MOVWF  77
124
007A:  CLRWDT
125
007B:  DECFSZ 77,F
126
007C:  GOTO   07A
127
007D:  DECFSZ 78,F
128
007E:  GOTO   078
129
007F:  MOVLW  96
130
0080:  MOVWF  77
131
0081:  DECFSZ 77,F
132
0082:  GOTO   081
133
0083:  NOP
134
0084:  NOP
135
0085:  CLRWDT
136
0086:  DECFSZ 00,F
137
0087:  GOTO   076
138
0088:  RETLW  00
139
....................  
140
....................  
141
....................  
142
.................... #define  KOLMO1      225         // predni kolecko sroubem dopredu 
143
.................... #define  KOLMO2      30          // predni kolecko je hlavou sroubu dozadu 
144
.................... #define  STRED       128         // sredni poloha zataceciho kolecka 
145
.................... #define  BEAR1       10//10           // 3 stupne zataceni 
146
.................... #define  BEAR2       25//27 
147
.................... #define  BEAR3       45 
148
.................... #define  SPEEDMAX    140         // ANSMANN=140; GP=120; maximalni rozumna rychlost 
149
.................... #define  R17         255         // X nasobek rozumne rychlosti 
150
.................... #define  DOZNIVANI   10 
151
.................... #define  L1            1     // cara vlevo 
152
.................... #define  L2            2     // cara vlevo 
153
.................... #define  L3            3     // cara vlevo 
154
.................... #define  S             0     // casa mezi sensory 
155
.................... #define  R1           -1     // cara vpravo 
156
.................... #define  R2           -2     // cara vpravo 
157
.................... #define  R3           -3     // cara vpravo 
158
....................  
159
.................... // servo 
160
.................... #define  SERVO PIN_A2 
161
....................  
162
.................... // IR 
163
.................... #define IRTX      PIN_B2 
164
.................... #define  CIHLA    PIN_A3 
165
....................  
166
.................... //motory 
167
.................... #define  FR         output_low(PIN_A7); output_high(PIN_A6)  // Vpred 
168
.................... #define  FL         output_low(PIN_A1); output_high(PIN_A0) 
169
.................... #define  BR         output_low(PIN_A6); output_high(PIN_A7)  // Vzad 
170
.................... #define  BL         output_low(PIN_A0); output_high(PIN_A1) 
171
.................... #define  STOPR      output_low(PIN_A6);output_low(PIN_A7) 
172
.................... #define  STOPL      output_low(PIN_A0);output_low(PIN_A1) 
173
....................  
174
.................... //HID 
175
.................... #define  LED1     PIN_B1      //oranzova 
176
.................... #define  LED2     PIN_B2      //zluta 
177
....................  
178
.................... #define  STROBE   PIN_B0 
179
.................... //#define  SW1      PIN_A2      // Motory On/off 
180
....................  
181
.................... unsigned int8 sensors;        // pomocna promenna pro cteni cidel na caru 
182
.................... signed int8 line = S;           // na ktere strane byla detekovana cara 
183
*
184
021F:  BCF    03.5
185
0220:  CLRF   2B
186
.................... //unsigned int8 dira;         // pocita dobu po kterou je ztracena cara 
187
.................... unsigned int8 uhel;           // urcuje aktualni uhel zataceni 
188
.................... unsigned int8 speed;        // maximalni povolena rychlost 
189
.................... unsigned int8 rovinka;        // pocitadlo na zjisteni rovinky 
190
....................  
191
.................... short int preteceni;          // flag preteceni timeru1 
192
....................  
193
.................... signed int16  Lmotor;         // promene, ktere urcuji velikost vykonu na levem 
194
.................... signed int16  Rmotor;         // a pravem motoru 
195
....................  
196
.................... // makro pro PWM pro motory 
197
.................... #define GO(motor, direction, power) if(get_timer0()<=power) \ 
198
.................... {direction##motor;} else {stop##motor;} 
199
....................  
200
.................... //////////////////////////////////////////////////////////////////////////////// 
201
.................... /* 
202
.................... void diagnostika() 
203
.................... { 
204
....................    if(input(SW1))STOPR;STOPL;While(TRUE); 
205
.................... //   if(LSENSOR==true) output_high(LED2); else output_low(LED2); 
206
.................... //   if(RSENSOR==true) output_high(LED1); else output_low(LED1); 
207
.................... } 
208
.................... */ 
209
.................... //////////////////////////////////////////////////////////////////////////////// 
210
.................... #int_TIMER1 
211
.................... TIMER1_isr() 
212
.................... { 
213
....................    preteceni = true; 
214
*
215
003F:  BSF    2F.0
216
.................... } 
217
.................... //////////////////////////////////////////////////////////////////////////////// 
218
0040:  BCF    0C.0
219
0041:  BCF    0A.3
220
0042:  GOTO   028
221
.................... #int_TIMER2 
222
.................... TIMER2_isr()      // ovladani serva 
223
.................... { 
224
....................    unsigned int8 n; 
225
....................  
226
....................    output_high(SERVO); 
227
*
228
0053:  BSF    03.5
229
0054:  BCF    05.2
230
0055:  BCF    03.5
231
0056:  BSF    05.2
232
....................    delay_us(1000); 
233
0057:  CLRWDT
234
0058:  MOVLW  09
235
0059:  MOVWF  3E
236
005A:  MOVLW  6D
237
005B:  MOVWF  3F
238
005C:  CALL   043
239
005D:  DECFSZ 3E,F
240
005E:  GOTO   05A
241
....................    for(n=uhel; n>0; n--) Delay_us(2); 
242
005F:  MOVF   2C,W
243
0060:  MOVWF  3D
244
0061:  MOVF   3D,F
245
0062:  BTFSC  03.2
246
0063:  GOTO   06A
247
0064:  CLRWDT
248
0065:  NOP
249
0066:  NOP
250
0067:  NOP
251
0068:  DECF   3D,F
252
0069:  GOTO   061
253
....................    output_low(SERVO); 
254
006A:  BSF    03.5
255
006B:  BCF    05.2
256
006C:  BCF    03.5
257
006D:  BCF    05.2
258
.................... } 
259
....................  
260
.................... //////////////////////////////////////////////////////////////////////////////// 
261
006E:  BCF    0C.1
262
006F:  BCF    0A.3
263
0070:  GOTO   028
264
.................... short int IRcheck()                 // potvrdi detekci cihly 
265
.................... { 
266
....................    output_high(IRTX);               // vypne vysilac IR 
267
....................    delay_ms(100); 
268
....................  
269
....................    output_low(STROBE); 
270
....................    sensors = spi_read(0);         // cteni senzoru 
271
....................    sensors=~sensors; 
272
....................    output_high(STROBE); 
273
....................  
274
....................    if(true==bit_test(sensors,7))    // otestuje, jestli je stale detekovan IR signal 
275
....................    { 
276
....................       output_low(IRTX);             // zapne vysilac IR 
277
....................       delay_ms(100); 
278
....................  
279
....................       output_low(STROBE); 
280
....................       sensors = spi_read(0);         // cteni senzoru 
281
....................       sensors=~sensors; 
282
....................       output_high(STROBE); 
283
....................  
284
....................       if(false==bit_test(sensors,7))      // otestuje, jestli je detekovana cihla 
285
....................       { 
286
....................          output_high(IRTX);            // vypne vysilac IR 
287
....................          delay_ms(100); 
288
....................  
289
....................          output_low(STROBE); 
290
....................          sensors = spi_read(0);         // cteni senzoru 
291
....................          sensors=~sensors; 
292
....................          output_high(STROBE); 
293
....................  
294
....................          output_low(IRTX);             // zapne vysilac IR 
295
....................          if(bit_test(sensors,7)) return 1; // vrat 1, kdyz je stale cihla 
296
....................       } 
297
....................    }; 
298
....................    output_low(IRTX);             // zapne vysilac IR 
299
....................    return 0; // vrat 0, kdyz je detekovano ruseni 
300
.................... } 
301
.................... //////////////////////////////////////////////////////////////////////////////// 
302
.................... void objizdka() 
303
.................... { 
304
....................    int8 shure=0; 
305
*
306
0089:  CLRF   38
307
....................    unsigned int16 n; 
308
....................  
309
....................    BR;BL; 
310
008A:  BSF    03.5
311
008B:  BCF    05.6
312
008C:  BCF    03.5
313
008D:  BCF    05.6
314
008E:  BSF    03.5
315
008F:  BCF    05.7
316
0090:  BCF    03.5
317
0091:  BSF    05.7
318
0092:  BSF    03.5
319
0093:  BCF    05.0
320
0094:  BCF    03.5
321
0095:  BCF    05.0
322
0096:  BSF    03.5
323
0097:  BCF    05.1
324
0098:  BCF    03.5
325
0099:  BSF    05.1
326
....................    Delay_ms(400); 
327
009A:  MOVLW  02
328
009B:  MOVWF  3B
329
009C:  MOVLW  C8
330
009D:  MOVWF  3C
331
009E:  CALL   071
332
009F:  DECFSZ 3B,F
333
00A0:  GOTO   09C
334
....................    STOPR;STOPL; 
335
00A1:  BSF    03.5
336
00A2:  BCF    05.6
337
00A3:  BCF    03.5
338
00A4:  BCF    05.6
339
00A5:  BSF    03.5
340
00A6:  BCF    05.7
341
00A7:  BCF    03.5
342
00A8:  BCF    05.7
343
00A9:  BSF    03.5
344
00AA:  BCF    05.0
345
00AB:  BCF    03.5
346
00AC:  BCF    05.0
347
00AD:  BSF    03.5
348
00AE:  BCF    05.1
349
00AF:  BCF    03.5
350
00B0:  BCF    05.1
351
....................  
352
.................... // toceni na miste dokud nezmizi cihla 
353
.................... //------------------------------------ 
354
....................    uhel=KOLMO1;      // nastav zataceci kolecko kolmo na osu robota 
355
00B1:  MOVLW  E1
356
00B2:  MOVWF  2C
357
....................    Delay_ms(100); 
358
00B3:  MOVLW  64
359
00B4:  MOVWF  3C
360
00B5:  CALL   071
361
....................    BL;FR; 
362
00B6:  BSF    03.5
363
00B7:  BCF    05.0
364
00B8:  BCF    03.5
365
00B9:  BCF    05.0
366
00BA:  BSF    03.5
367
00BB:  BCF    05.1
368
00BC:  BCF    03.5
369
00BD:  BSF    05.1
370
00BE:  BSF    03.5
371
00BF:  BCF    05.7
372
00C0:  BCF    03.5
373
00C1:  BCF    05.7
374
00C2:  BSF    03.5
375
00C3:  BCF    05.6
376
00C4:  BCF    03.5
377
00C5:  BSF    05.6
378
....................    Delay_ms(200);    // minimalni toceni, kdyby se zastavilo sikmo k cihle 
379
00C6:  MOVLW  C8
380
00C7:  MOVWF  3C
381
00C8:  CALL   071
382
....................  
383
....................    While(bit_test(sensors,7)) // toc, dokud neni cihla z primeho senzoru 
384
....................    { 
385
00C9:  BTFSS  2A.7
386
00CA:  GOTO   0DA
387
....................        sensors = spi_read(0);         // cteni senzoru 
388
00CB:  MOVF   13,W
389
00CC:  CLRF   13
390
00CD:  BSF    03.5
391
00CE:  BTFSC  14.0
392
00CF:  GOTO   0D2
393
00D0:  BCF    03.5
394
00D1:  GOTO   0CD
395
00D2:  BCF    03.5
396
00D3:  MOVF   13,W
397
00D4:  MOVWF  2A
398
....................        sensors=~sensors; 
399
00D5:  COMF   2A,F
400
....................        Delay_ms(4);              // cekani na SLAVE nez pripravi data od cidel 
401
00D6:  MOVLW  04
402
00D7:  MOVWF  3C
403
00D8:  CALL   071
404
....................    } 
405
00D9:  GOTO   0C9
406
....................    STOPL; STOPR; 
407
00DA:  BSF    03.5
408
00DB:  BCF    05.0
409
00DC:  BCF    03.5
410
00DD:  BCF    05.0
411
00DE:  BSF    03.5
412
00DF:  BCF    05.1
413
00E0:  BCF    03.5
414
00E1:  BCF    05.1
415
00E2:  BSF    03.5
416
00E3:  BCF    05.6
417
00E4:  BCF    03.5
418
00E5:  BCF    05.6
419
00E6:  BSF    03.5
420
00E7:  BCF    05.7
421
00E8:  BCF    03.5
422
00E9:  BCF    05.7
423
....................  
424
....................    for (n=0;n<1000;n++)    // vystred se na hranu cihly 
425
00EA:  CLRF   3A
426
00EB:  CLRF   39
427
00EC:  MOVF   3A,W
428
00ED:  SUBLW  03
429
00EE:  BTFSS  03.0
430
00EF:  GOTO   157
431
00F0:  BTFSS  03.2
432
00F1:  GOTO   0F6
433
00F2:  MOVF   39,W
434
00F3:  SUBLW  E7
435
00F4:  BTFSS  03.0
436
00F5:  GOTO   157
437
....................    { 
438
....................       if(!input(CIHLA)) 
439
00F6:  BSF    03.5
440
00F7:  BSF    05.3
441
00F8:  BCF    03.5
442
00F9:  BTFSC  05.3
443
00FA:  GOTO   126
444
....................       { 
445
.................... //      BL; FR; 
446
....................          GO(L,B,180);GO(R,F,160);   // zapni motory PWM podle promenych Lmotor a Rmotor 
447
00FB:  MOVF   01,W
448
00FC:  SUBLW  B4
449
00FD:  BTFSS  03.0
450
00FE:  GOTO   108
451
00FF:  BSF    03.5
452
0100:  BCF    05.0
453
0101:  BCF    03.5
454
0102:  BCF    05.0
455
0103:  BSF    03.5
456
0104:  BCF    05.1
457
0105:  BCF    03.5
458
0106:  BSF    05.1
459
0107:  GOTO   110
460
0108:  BSF    03.5
461
0109:  BCF    05.0
462
010A:  BCF    03.5
463
010B:  BCF    05.0
464
010C:  BSF    03.5
465
010D:  BCF    05.1
466
010E:  BCF    03.5
467
010F:  BCF    05.1
468
0110:  MOVF   01,W
469
0111:  SUBLW  A0
470
0112:  BTFSS  03.0
471
0113:  GOTO   11D
472
0114:  BSF    03.5
473
0115:  BCF    05.7
474
0116:  BCF    03.5
475
0117:  BCF    05.7
476
0118:  BSF    03.5
477
0119:  BCF    05.6
478
011A:  BCF    03.5
479
011B:  BSF    05.6
480
011C:  GOTO   125
481
011D:  BSF    03.5
482
011E:  BCF    05.6
483
011F:  BCF    03.5
484
0120:  BCF    05.6
485
0121:  BSF    03.5
486
0122:  BCF    05.7
487
0123:  BCF    03.5
488
0124:  BCF    05.7
489
....................       } else 
490
0125:  GOTO   150
491
....................       { 
492
.................... //      FL; BR; 
493
....................          GO(L,F,180);GO(R,B,160);   // zapni motory PWM podle promenych Lmotor a Rmotor 
494
0126:  MOVF   01,W
495
0127:  SUBLW  B4
496
0128:  BTFSS  03.0
497
0129:  GOTO   133
498
012A:  BSF    03.5
499
012B:  BCF    05.1
500
012C:  BCF    03.5
501
012D:  BCF    05.1
502
012E:  BSF    03.5
503
012F:  BCF    05.0
504
0130:  BCF    03.5
505
0131:  BSF    05.0
506
0132:  GOTO   13B
507
0133:  BSF    03.5
508
0134:  BCF    05.0
509
0135:  BCF    03.5
510
0136:  BCF    05.0
511
0137:  BSF    03.5
512
0138:  BCF    05.1
513
0139:  BCF    03.5
514
013A:  BCF    05.1
515
013B:  MOVF   01,W
516
013C:  SUBLW  A0
517
013D:  BTFSS  03.0
518
013E:  GOTO   148
519
013F:  BSF    03.5
520
0140:  BCF    05.6
521
0141:  BCF    03.5
522
0142:  BCF    05.6
523
0143:  BSF    03.5
524
0144:  BCF    05.7
525
0145:  BCF    03.5
526
0146:  BSF    05.7
527
0147:  GOTO   150
528
0148:  BSF    03.5
529
0149:  BCF    05.6
530
014A:  BCF    03.5
531
014B:  BCF    05.6
532
014C:  BSF    03.5
533
014D:  BCF    05.7
534
014E:  BCF    03.5
535
014F:  BCF    05.7
536
....................       }; 
537
....................       delay_ms(1); 
538
0150:  MOVLW  01
539
0151:  MOVWF  3C
540
0152:  CALL   071
541
....................    } 
542
0153:  INCF   39,F
543
0154:  BTFSC  03.2
544
0155:  INCF   3A,F
545
0156:  GOTO   0EC
546
....................    STOPR;STOPL; 
547
0157:  BSF    03.5
548
0158:  BCF    05.6
549
0159:  BCF    03.5
550
015A:  BCF    05.6
551
015B:  BSF    03.5
552
015C:  BCF    05.7
553
015D:  BCF    03.5
554
015E:  BCF    05.7
555
015F:  BSF    03.5
556
0160:  BCF    05.0
557
0161:  BCF    03.5
558
0162:  BCF    05.0
559
0163:  BSF    03.5
560
0164:  BCF    05.1
561
0165:  BCF    03.5
562
0166:  BCF    05.1
563
....................  
564
....................    uhel=STRED;          // dopredu 
565
0167:  MOVLW  80
566
0168:  MOVWF  2C
567
....................    delay_ms(100); 
568
0169:  MOVLW  64
569
016A:  MOVWF  3C
570
016B:  CALL   071
571
....................    FR; FL; 
572
016C:  BSF    03.5
573
016D:  BCF    05.7
574
016E:  BCF    03.5
575
016F:  BCF    05.7
576
0170:  BSF    03.5
577
0171:  BCF    05.6
578
0172:  BCF    03.5
579
0173:  BSF    05.6
580
0174:  BSF    03.5
581
0175:  BCF    05.1
582
0176:  BCF    03.5
583
0177:  BCF    05.1
584
0178:  BSF    03.5
585
0179:  BCF    05.0
586
017A:  BCF    03.5
587
017B:  BSF    05.0
588
....................    delay_ms(500); 
589
017C:  MOVLW  02
590
017D:  MOVWF  3B
591
017E:  MOVLW  FA
592
017F:  MOVWF  3C
593
0180:  CALL   071
594
0181:  DECFSZ 3B,F
595
0182:  GOTO   17E
596
....................    BL;BR; 
597
0183:  BSF    03.5
598
0184:  BCF    05.0
599
0185:  BCF    03.5
600
0186:  BCF    05.0
601
0187:  BSF    03.5
602
0188:  BCF    05.1
603
0189:  BCF    03.5
604
018A:  BSF    05.1
605
018B:  BSF    03.5
606
018C:  BCF    05.6
607
018D:  BCF    03.5
608
018E:  BCF    05.6
609
018F:  BSF    03.5
610
0190:  BCF    05.7
611
0191:  BCF    03.5
612
0192:  BSF    05.7
613
....................    delay_ms(200); 
614
0193:  MOVLW  C8
615
0194:  MOVWF  3C
616
0195:  CALL   071
617
....................    STOPL;STOPR; 
618
0196:  BSF    03.5
619
0197:  BCF    05.0
620
0198:  BCF    03.5
621
0199:  BCF    05.0
622
019A:  BSF    03.5
623
019B:  BCF    05.1
624
019C:  BCF    03.5
625
019D:  BCF    05.1
626
019E:  BSF    03.5
627
019F:  BCF    05.6
628
01A0:  BCF    03.5
629
01A1:  BCF    05.6
630
01A2:  BSF    03.5
631
01A3:  BCF    05.7
632
01A4:  BCF    03.5
633
01A5:  BCF    05.7
634
....................  
635
....................    uhel=STRED+BEAR3;    // doprava 
636
01A6:  MOVLW  AD
637
01A7:  MOVWF  2C
638
....................    delay_ms(100); 
639
01A8:  MOVLW  64
640
01A9:  MOVWF  3C
641
01AA:  CALL   071
642
....................    FL; 
643
01AB:  BSF    03.5
644
01AC:  BCF    05.1
645
01AD:  BCF    03.5
646
01AE:  BCF    05.1
647
01AF:  BSF    03.5
648
01B0:  BCF    05.0
649
01B1:  BCF    03.5
650
01B2:  BSF    05.0
651
....................    delay_ms(400); 
652
01B3:  MOVLW  02
653
01B4:  MOVWF  3B
654
01B5:  MOVLW  C8
655
01B6:  MOVWF  3C
656
01B7:  CALL   071
657
01B8:  DECFSZ 3B,F
658
01B9:  GOTO   1B5
659
....................    uhel=STRED+BEAR2;    // min doprava 
660
01BA:  MOVLW  99
661
01BB:  MOVWF  2C
662
....................    FL;FR; 
663
01BC:  BSF    03.5
664
01BD:  BCF    05.1
665
01BE:  BCF    03.5
666
01BF:  BCF    05.1
667
01C0:  BSF    03.5
668
01C1:  BCF    05.0
669
01C2:  BCF    03.5
670
01C3:  BSF    05.0
671
01C4:  BSF    03.5
672
01C5:  BCF    05.7
673
01C6:  BCF    03.5
674
01C7:  BCF    05.7
675
01C8:  BSF    03.5
676
01C9:  BCF    05.6
677
01CA:  BCF    03.5
678
01CB:  BSF    05.6
679
....................    delay_ms(100); 
680
01CC:  MOVLW  64
681
01CD:  MOVWF  3C
682
01CE:  CALL   071
683
....................    uhel=STRED+BEAR1;    // jeste min doprava 
684
01CF:  MOVLW  8A
685
01D0:  MOVWF  2C
686
....................    FL;FR; 
687
01D1:  BSF    03.5
688
01D2:  BCF    05.1
689
01D3:  BCF    03.5
690
01D4:  BCF    05.1
691
01D5:  BSF    03.5
692
01D6:  BCF    05.0
693
01D7:  BCF    03.5
694
01D8:  BSF    05.0
695
01D9:  BSF    03.5
696
01DA:  BCF    05.7
697
01DB:  BCF    03.5
698
01DC:  BCF    05.7
699
01DD:  BSF    03.5
700
01DE:  BCF    05.6
701
01DF:  BCF    03.5
702
01E0:  BSF    05.6
703
....................    delay_ms(200); 
704
01E1:  MOVLW  C8
705
01E2:  MOVWF  3C
706
01E3:  CALL   071
707
.................... /* 
708
....................    uhel=STRED;          // rovne 
709
....................    delay_ms(100); 
710
....................    FL;FR; 
711
....................    delay_ms(100); 
712
.................... */ 
713
....................    While((sensors & 0b01111111)!=0) //dokud neni cara 
714
....................    { 
715
01E4:  MOVF   2A,W
716
01E5:  ANDLW  7F
717
01E6:  BTFSC  03.2
718
01E7:  GOTO   1F7
719
....................        sensors = spi_read(0);         // cteni senzoru 
720
01E8:  MOVF   13,W
721
01E9:  CLRF   13
722
01EA:  BSF    03.5
723
01EB:  BTFSC  14.0
724
01EC:  GOTO   1EF
725
01ED:  BCF    03.5
726
01EE:  GOTO   1EA
727
01EF:  BCF    03.5
728
01F0:  MOVF   13,W
729
01F1:  MOVWF  2A
730
....................        sensors=~sensors; 
731
01F2:  COMF   2A,F
732
....................        Delay_ms(4);              // cekani na SLAVE nez pripravi data od cidel 
733
01F3:  MOVLW  04
734
01F4:  MOVWF  3C
735
01F5:  CALL   071
736
....................    } 
737
01F6:  GOTO   1E4
738
....................    BL; BR; 
739
01F7:  BSF    03.5
740
01F8:  BCF    05.0
741
01F9:  BCF    03.5
742
01FA:  BCF    05.0
743
01FB:  BSF    03.5
744
01FC:  BCF    05.1
745
01FD:  BCF    03.5
746
01FE:  BSF    05.1
747
01FF:  BSF    03.5
748
0200:  BCF    05.6
749
0201:  BCF    03.5
750
0202:  BCF    05.6
751
0203:  BSF    03.5
752
0204:  BCF    05.7
753
0205:  BCF    03.5
754
0206:  BSF    05.7
755
....................    delay_ms(400); 
756
0207:  MOVLW  02
757
0208:  MOVWF  3B
758
0209:  MOVLW  C8
759
020A:  MOVWF  3C
760
020B:  CALL   071
761
020C:  DECFSZ 3B,F
762
020D:  GOTO   209
763
....................  
764
....................    uhel=STRED-BEAR3;    // doleva 
765
020E:  MOVLW  53
766
020F:  MOVWF  2C
767
.................... } 
768
0210:  BCF    0A.3
769
0211:  GOTO   317 (RETURN)
770
....................  
771
.................... //////////////////////////////////////////////////////////////////////////////// 
772
.................... void main() 
773
.................... { 
774
0212:  CLRF   04
775
0213:  MOVLW  1F
776
0214:  ANDWF  03,F
777
0215:  MOVLW  70
778
0216:  BSF    03.5
779
0217:  MOVWF  0F
780
0218:  BCF    1F.4
781
0219:  BCF    1F.5
782
021A:  MOVF   1B,W
783
021B:  ANDLW  80
784
021C:  MOVWF  1B
785
021D:  MOVLW  07
786
021E:  MOVWF  1C
787
....................  
788
....................    unsigned int8 n; 
789
....................    unsigned int8 i,v; 
790
....................    unsigned int8 last_sensors; 
791
....................  
792
....................    setup_adc_ports(NO_ANALOGS); 
793
*
794
0221:  BSF    03.5
795
0222:  BCF    1F.4
796
0223:  BCF    1F.5
797
0224:  MOVF   1B,W
798
0225:  ANDLW  80
799
0226:  MOVWF  1B
800
....................    setup_adc(ADC_CLOCK_INTERNAL); 
801
0227:  BCF    1F.6
802
0228:  BCF    03.5
803
0229:  BSF    1F.6
804
022A:  BSF    1F.7
805
022B:  BSF    03.5
806
022C:  BCF    1F.7
807
022D:  BCF    03.5
808
022E:  BSF    1F.0
809
....................    setup_spi(SPI_MASTER|SPI_H_TO_L|SPI_XMIT_L_TO_H|SPI_CLK_DIV_16); 
810
022F:  BCF    14.5
811
0230:  BSF    03.5
812
0231:  BCF    06.2
813
0232:  BSF    06.1
814
0233:  BCF    06.4
815
0234:  MOVLW  31
816
0235:  BCF    03.5
817
0236:  MOVWF  14
818
0237:  MOVLW  00
819
0238:  BSF    03.5
820
0239:  MOVWF  14
821
....................    setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); 
822
023A:  MOVF   01,W
823
023B:  ANDLW  C7
824
023C:  IORLW  08
825
023D:  MOVWF  01
826
.................... //   setup_timer_1(T1_INTERNAL|T1_DIV_BY_8); 
827
....................    setup_timer_1(T1_DISABLED|T1_DIV_BY_8); 
828
023E:  MOVLW  30
829
023F:  BCF    03.5
830
0240:  MOVWF  10
831
....................    setup_timer_2(T2_DIV_BY_16,140,16); 
832
0241:  MOVLW  78
833
0242:  MOVWF  78
834
0243:  IORLW  06
835
0244:  MOVWF  12
836
0245:  MOVLW  8C
837
0246:  BSF    03.5
838
0247:  MOVWF  12
839
....................    setup_oscillator(OSC_8MHZ|OSC_INTRC); 
840
0248:  MOVLW  72
841
0249:  MOVWF  0F
842
....................  
843
....................    STOPR; STOPL;  // zastav motory 
844
024A:  BCF    05.6
845
024B:  BCF    03.5
846
024C:  BCF    05.6
847
024D:  BSF    03.5
848
024E:  BCF    05.7
849
024F:  BCF    03.5
850
0250:  BCF    05.7
851
0251:  BSF    03.5
852
0252:  BCF    05.0
853
0253:  BCF    03.5
854
0254:  BCF    05.0
855
0255:  BSF    03.5
856
0256:  BCF    05.1
857
0257:  BCF    03.5
858
0258:  BCF    05.1
859
....................    Lmotor=0;Rmotor=0; 
860
0259:  CLRF   31
861
025A:  CLRF   30
862
025B:  CLRF   33
863
025C:  CLRF   32
864
....................  
865
....................    uhel = STRED;    // nastav zadni kolecko na stred 
866
025D:  MOVLW  80
867
025E:  MOVWF  2C
868
....................    rovinka = 0; 
869
025F:  CLRF   2E
870
....................  
871
....................    enable_interrupts(INT_TIMER2); 
872
0260:  BSF    03.5
873
0261:  BSF    0C.1
874
.................... //   enable_interrupts(INT_TIMER1); 
875
....................    enable_interrupts(GLOBAL); 
876
0262:  MOVLW  C0
877
0263:  BCF    03.5
878
0264:  IORWF  0B,F
879
....................  
880
....................    output_low(IRTX); // zapni IR vysilac 
881
0265:  BSF    03.5
882
0266:  BCF    06.2
883
0267:  BCF    03.5
884
0268:  BCF    06.2
885
....................  
886
....................    delay_ms(1000); 
887
0269:  MOVLW  04
888
026A:  MOVWF  38
889
026B:  MOVLW  FA
890
026C:  MOVWF  3C
891
026D:  CALL   071
892
026E:  DECFSZ 38,F
893
026F:  GOTO   26B
894
....................  
895
.................... //!!!! 
896
.................... speed=SPEEDMAX; 
897
0270:  MOVLW  8C
898
0271:  MOVWF  2D
899
....................  
900
....................    while(true) 
901
....................    { 
902
....................  
903
....................       GO(L,F,Lmotor);GO(R,F,Rmotor);   // zapni motory PWM podle promenych Lmotor a Rmotor 
904
0272:  MOVF   01,W
905
0273:  BTFSS  00.7
906
0274:  GOTO   278
907
0275:  BTFSS  31.7
908
0276:  GOTO   280
909
0277:  GOTO   27A
910
0278:  BTFSC  31.7
911
0279:  GOTO   289
912
027A:  MOVF   31,F
913
027B:  BTFSS  03.2
914
027C:  GOTO   280
915
027D:  SUBWF  30,W
916
027E:  BTFSS  03.0
917
027F:  GOTO   289
918
0280:  BSF    03.5
919
0281:  BCF    05.1
920
0282:  BCF    03.5
921
0283:  BCF    05.1
922
0284:  BSF    03.5
923
0285:  BCF    05.0
924
0286:  BCF    03.5
925
0287:  BSF    05.0
926
0288:  GOTO   291
927
0289:  BSF    03.5
928
028A:  BCF    05.0
929
028B:  BCF    03.5
930
028C:  BCF    05.0
931
028D:  BSF    03.5
932
028E:  BCF    05.1
933
028F:  BCF    03.5
934
0290:  BCF    05.1
935
0291:  MOVF   01,W
936
0292:  BTFSS  00.7
937
0293:  GOTO   297
938
0294:  BTFSS  33.7
939
0295:  GOTO   29F
940
0296:  GOTO   299
941
0297:  BTFSC  33.7
942
0298:  GOTO   2A8
943
0299:  MOVF   33,F
944
029A:  BTFSS  03.2
945
029B:  GOTO   29F
946
029C:  SUBWF  32,W
947
029D:  BTFSS  03.0
948
029E:  GOTO   2A8
949
029F:  BSF    03.5
950
02A0:  BCF    05.7
951
02A1:  BCF    03.5
952
02A2:  BCF    05.7
953
02A3:  BSF    03.5
954
02A4:  BCF    05.6
955
02A5:  BCF    03.5
956
02A6:  BSF    05.6
957
02A7:  GOTO   2B0
958
02A8:  BSF    03.5
959
02A9:  BCF    05.6
960
02AA:  BCF    03.5
961
02AB:  BCF    05.6
962
02AC:  BSF    03.5
963
02AD:  BCF    05.7
964
02AE:  BCF    03.5
965
02AF:  BCF    05.7
966
....................  
967
....................       delay_us(1500);                  // cekani na SLAVE, nez pripravi data od cidel 
968
02B0:  CLRWDT
969
02B1:  MOVLW  01
970
02B2:  MOVWF  3C
971
02B3:  CALL   071
972
02B4:  MOVLW  02
973
02B5:  MOVWF  38
974
02B6:  CLRF   29
975
02B7:  BTFSC  0B.7
976
02B8:  BSF    29.7
977
02B9:  BCF    0B.7
978
02BA:  MOVLW  F7
979
02BB:  MOVWF  3F
980
02BC:  CALL   043
981
02BD:  BTFSC  29.7
982
02BE:  BSF    0B.7
983
02BF:  DECFSZ 38,F
984
02C0:  GOTO   2B6
985
....................  
986
....................       output_low(STROBE);              // vypni zobrazovani na posuvnem registru 
987
02C1:  BSF    03.5
988
02C2:  BCF    06.0
989
02C3:  BCF    03.5
990
02C4:  BCF    06.0
991
....................       sensors = spi_read(0);           // cteni senzoru 
992
02C5:  MOVF   13,W
993
02C6:  CLRF   13
994
02C7:  BSF    03.5
995
02C8:  BTFSC  14.0
996
02C9:  GOTO   2CC
997
02CA:  BCF    03.5
998
02CB:  GOTO   2C7
999
02CC:  BCF    03.5
1000
02CD:  MOVF   13,W
1001
02CE:  MOVWF  2A
1002
....................       sensors=~sensors; 
1003
02CF:  COMF   2A,F
1004
....................       output_high(STROBE);       // zobraz data na posuvnem registru 
1005
02D0:  BSF    03.5
1006
02D1:  BCF    06.0
1007
02D2:  BCF    03.5
1008
02D3:  BSF    06.0
1009
....................  
1010
....................       i=0;                       // havarijni kod 
1011
02D4:  CLRF   35
1012
....................       for (n=0; n<=6; n++) 
1013
02D5:  CLRF   34
1014
02D6:  MOVF   34,W
1015
02D7:  SUBLW  06
1016
02D8:  BTFSS  03.0
1017
02D9:  GOTO   2E8
1018
....................       { 
1019
....................          if(bit_test(sensors,n)) i++; 
1020
02DA:  MOVF   2A,W
1021
02DB:  MOVWF  77
1022
02DC:  MOVF   34,W
1023
02DD:  MOVWF  78
1024
02DE:  BTFSC  03.2
1025
02DF:  GOTO   2E4
1026
02E0:  BCF    03.0
1027
02E1:  RRF    77,F
1028
02E2:  DECFSZ 78,F
1029
02E3:  GOTO   2E0
1030
02E4:  BTFSC  77.0
1031
02E5:  INCF   35,F
1032
....................       } 
1033
02E6:  INCF   34,F
1034
02E7:  GOTO   2D6
1035
....................       if (i>3) // zastavi, kdyz je cerno pod vice nez tremi cidly 
1036
02E8:  MOVF   35,W
1037
02E9:  SUBLW  03
1038
02EA:  BTFSC  03.0
1039
02EB:  GOTO   314
1040
....................       { 
1041
....................          BL; BR; 
1042
02EC:  BSF    03.5
1043
02ED:  BCF    05.0
1044
02EE:  BCF    03.5
1045
02EF:  BCF    05.0
1046
02F0:  BSF    03.5
1047
02F1:  BCF    05.1
1048
02F2:  BCF    03.5
1049
02F3:  BSF    05.1
1050
02F4:  BSF    03.5
1051
02F5:  BCF    05.6
1052
02F6:  BCF    03.5
1053
02F7:  BCF    05.6
1054
02F8:  BSF    03.5
1055
02F9:  BCF    05.7
1056
02FA:  BCF    03.5
1057
02FB:  BSF    05.7
1058
....................          delay_ms(300); 
1059
02FC:  MOVLW  02
1060
02FD:  MOVWF  38
1061
02FE:  MOVLW  96
1062
02FF:  MOVWF  3C
1063
0300:  CALL   071
1064
0301:  DECFSZ 38,F
1065
0302:  GOTO   2FE
1066
....................          STOPR; STOPL; 
1067
0303:  BSF    03.5
1068
0304:  BCF    05.6
1069
0305:  BCF    03.5
1070
0306:  BCF    05.6
1071
0307:  BSF    03.5
1072
0308:  BCF    05.7
1073
0309:  BCF    03.5
1074
030A:  BCF    05.7
1075
030B:  BSF    03.5
1076
030C:  BCF    05.0
1077
030D:  BCF    03.5
1078
030E:  BCF    05.0
1079
030F:  BSF    03.5
1080
0310:  BCF    05.1
1081
0311:  BCF    03.5
1082
0312:  BCF    05.1
1083
....................          While(true);  
1084
0313:  GOTO   313
1085
....................       }; 
1086
....................        
1087
....................       if(bit_test(sensors,7))    // detekce cihly 
1088
0314:  BTFSS  2A.7
1089
0315:  GOTO   317
1090
....................       { 
1091
....................          objizdka();       // objede cihlu 
1092
0316:  GOTO   089
1093
....................       } 
1094
....................  
1095
....................  
1096
....................       if(bit_test(sensors,3)) //...|...// 
1097
0317:  BTFSS  2A.3
1098
0318:  GOTO   32B
1099
....................       { 
1100
....................          uhel=STRED; 
1101
0319:  MOVLW  80
1102
031A:  MOVWF  2C
1103
....................          Lmotor=speed; 
1104
031B:  CLRF   7A
1105
031C:  MOVF   2D,W
1106
031D:  MOVWF  30
1107
031E:  MOVF   7A,W
1108
031F:  MOVWF  31
1109
....................          Rmotor=speed; 
1110
0320:  CLRF   7A
1111
0321:  MOVF   2D,W
1112
0322:  MOVWF  32
1113
0323:  MOVF   7A,W
1114
0324:  MOVWF  33
1115
....................          line=S; 
1116
0325:  CLRF   2B
1117
.................... //         set_timer1(0); 
1118
....................          if (rovinka < 255) rovinka++; 
1119
0326:  INCFSZ 2E,W
1120
0327:  GOTO   329
1121
0328:  GOTO   32A
1122
0329:  INCF   2E,F
1123
....................          continue; 
1124
032A:  GOTO   272
1125
....................       } 
1126
....................  
1127
....................       if(bit_test(sensors,0)) //|......//     // z duvodu zkraceni doby reakce se cidla nevyhodnocuji poporade ale od krajnich k prostrednimu 
1128
032B:  BTFSS  2A.0
1129
032C:  GOTO   339
1130
....................       { 
1131
....................          uhel=STRED - BEAR3; 
1132
032D:  MOVLW  53
1133
032E:  MOVWF  2C
1134
....................          Lmotor=0; 
1135
032F:  CLRF   31
1136
0330:  CLRF   30
1137
....................          Rmotor=speed; 
1138
0331:  CLRF   7A
1139
0332:  MOVF   2D,W
1140
0333:  MOVWF  32
1141
0334:  MOVF   7A,W
1142
0335:  MOVWF  33
1143
....................          line=L3; 
1144
0336:  MOVLW  03
1145
0337:  MOVWF  2B
1146
.................... //         set_timer1(0); 
1147
....................          continue; 
1148
0338:  GOTO   272
1149
....................       } 
1150
....................  
1151
....................       if(bit_test(sensors,6)) //......|// 
1152
0339:  BTFSS  2A.6
1153
033A:  GOTO   347
1154
....................       { 
1155
....................          uhel=STRED + BEAR3; 
1156
033B:  MOVLW  AD
1157
033C:  MOVWF  2C
1158
....................          Rmotor=0; 
1159
033D:  CLRF   33
1160
033E:  CLRF   32
1161
....................          Lmotor=speed; 
1162
033F:  CLRF   7A
1163
0340:  MOVF   2D,W
1164
0341:  MOVWF  30
1165
0342:  MOVF   7A,W
1166
0343:  MOVWF  31
1167
....................          line=R3; 
1168
0344:  MOVLW  FD
1169
0345:  MOVWF  2B
1170
.................... //         set_timer1(0); 
1171
....................          continue; 
1172
0346:  GOTO   272
1173
....................       } 
1174
....................  
1175
....................       if(bit_test(sensors,1)) //.|.....// 
1176
0347:  BTFSS  2A.1
1177
0348:  GOTO   359
1178
....................       { 
1179
....................          uhel=STRED - BEAR2; 
1180
0349:  MOVLW  67
1181
034A:  MOVWF  2C
1182
....................          Lmotor=speed-50; 
1183
034B:  MOVLW  32
1184
034C:  SUBWF  2D,W
1185
034D:  CLRF   7A
1186
034E:  MOVWF  30
1187
034F:  MOVF   7A,W
1188
0350:  MOVWF  31
1189
....................          Rmotor=speed; 
1190
0351:  CLRF   7A
1191
0352:  MOVF   2D,W
1192
0353:  MOVWF  32
1193
0354:  MOVF   7A,W
1194
0355:  MOVWF  33
1195
....................          line=L2; 
1196
0356:  MOVLW  02
1197
0357:  MOVWF  2B
1198
.................... //         set_timer1(0); 
1199
....................          continue; 
1200
0358:  GOTO   272
1201
....................       } 
1202
....................  
1203
....................       if(bit_test(sensors,5)) //.....|.// 
1204
0359:  BTFSS  2A.5
1205
035A:  GOTO   36B
1206
....................       { 
1207
....................          uhel=STRED + BEAR2; 
1208
035B:  MOVLW  99
1209
035C:  MOVWF  2C
1210
....................          Rmotor=speed-50; 
1211
035D:  MOVLW  32
1212
035E:  SUBWF  2D,W
1213
035F:  CLRF   7A
1214
0360:  MOVWF  32
1215
0361:  MOVF   7A,W
1216
0362:  MOVWF  33
1217
....................          Lmotor=speed; 
1218
0363:  CLRF   7A
1219
0364:  MOVF   2D,W
1220
0365:  MOVWF  30
1221
0366:  MOVF   7A,W
1222
0367:  MOVWF  31
1223
....................          line=R2; 
1224
0368:  MOVLW  FE
1225
0369:  MOVWF  2B
1226
.................... //         set_timer1(0); 
1227
....................          continue; 
1228
036A:  GOTO   272
1229
....................       } 
1230
....................  
1231
....................       if (bit_test(sensors,2)) //..|....// 
1232
036B:  BTFSS  2A.2
1233
036C:  GOTO   380
1234
....................       { 
1235
....................          uhel=STRED - BEAR1; 
1236
036D:  MOVLW  76
1237
036E:  MOVWF  2C
1238
....................          Lmotor=speed; 
1239
036F:  CLRF   7A
1240
0370:  MOVF   2D,W
1241
0371:  MOVWF  30
1242
0372:  MOVF   7A,W
1243
0373:  MOVWF  31
1244
....................          Rmotor=speed; 
1245
0374:  CLRF   7A
1246
0375:  MOVF   2D,W
1247
0376:  MOVWF  32
1248
0377:  MOVF   7A,W
1249
0378:  MOVWF  33
1250
....................          line=L1; 
1251
0379:  MOVLW  01
1252
037A:  MOVWF  2B
1253
.................... //         set_timer1(0); 
1254
....................          if (rovinka<255) rovinka++; 
1255
037B:  INCFSZ 2E,W
1256
037C:  GOTO   37E
1257
037D:  GOTO   37F
1258
037E:  INCF   2E,F
1259
....................          continue; 
1260
037F:  GOTO   272
1261
....................       } 
1262
....................  
1263
....................       if (bit_test(sensors,4)) //....|..// 
1264
0380:  BTFSS  2A.4
1265
0381:  GOTO   395
1266
....................       { 
1267
....................          uhel=STRED + BEAR1; 
1268
0382:  MOVLW  8A
1269
0383:  MOVWF  2C
1270
....................          Rmotor=speed; 
1271
0384:  CLRF   7A
1272
0385:  MOVF   2D,W
1273
0386:  MOVWF  32
1274
0387:  MOVF   7A,W
1275
0388:  MOVWF  33
1276
....................          Lmotor=speed; 
1277
0389:  CLRF   7A
1278
038A:  MOVF   2D,W
1279
038B:  MOVWF  30
1280
038C:  MOVF   7A,W
1281
038D:  MOVWF  31
1282
....................          line=R1; 
1283
038E:  MOVLW  FF
1284
038F:  MOVWF  2B
1285
.................... //         set_timer1(0); 
1286
....................          if (rovinka<255) rovinka++; 
1287
0390:  INCFSZ 2E,W
1288
0391:  GOTO   393
1289
0392:  GOTO   394
1290
0393:  INCF   2E,F
1291
....................          continue; 
1292
0394:  GOTO   272
1293
....................       } 
1294
....................  
1295
....................  
1296
....................       if ((L3==line) || (R3==line)) // Brzdeni pri vyjeti z trate 
1297
0395:  MOVF   2B,W
1298
0396:  SUBLW  03
1299
0397:  BTFSC  03.2
1300
0398:  GOTO   39D
1301
0399:  MOVF   2B,W
1302
039A:  SUBLW  FD
1303
039B:  BTFSS  03.2
1304
039C:  GOTO   3BE
1305
....................       { 
1306
....................          if (rovinka>50) 
1307
039D:  MOVF   2E,W
1308
039E:  SUBLW  32
1309
039F:  BTFSC  03.0
1310
03A0:  GOTO   3BB
1311
....................          { 
1312
....................             BL; BR; 
1313
03A1:  BSF    03.5
1314
03A2:  BCF    05.0
1315
03A3:  BCF    03.5
1316
03A4:  BCF    05.0
1317
03A5:  BSF    03.5
1318
03A6:  BCF    05.1
1319
03A7:  BCF    03.5
1320
03A8:  BSF    05.1
1321
03A9:  BSF    03.5
1322
03AA:  BCF    05.6
1323
03AB:  BCF    03.5
1324
03AC:  BCF    05.6
1325
03AD:  BSF    03.5
1326
03AE:  BCF    05.7
1327
03AF:  BCF    03.5
1328
03B0:  BSF    05.7
1329
....................             Delay_ms(100); 
1330
03B1:  MOVLW  64
1331
03B2:  MOVWF  3C
1332
03B3:  CALL   071
1333
....................             if (rovinka>250) delay_ms(50); 
1334
03B4:  MOVF   2E,W
1335
03B5:  SUBLW  FA
1336
03B6:  BTFSC  03.0
1337
03B7:  GOTO   3BB
1338
03B8:  MOVLW  32
1339
03B9:  MOVWF  3C
1340
03BA:  CALL   071
1341
....................          }; 
1342
....................          rovinka=0; 
1343
03BB:  CLRF   2E
1344
....................          speed=SPEEDMAX; 
1345
03BC:  MOVLW  8C
1346
03BD:  MOVWF  2D
1347
....................       }; 
1348
....................    } 
1349
03BE:  GOTO   272
1350
.................... } 
1351
03BF:  SLEEP
1352
 
1353
Configuration Fuses:
1354
   Word  1: 3F38   NOWDT NOPUT MCLR NOBROWNOUT NOLVP NOCPD NOWRT NODEBUG CCPB0 NOPROTECT INTRC_IO
1355
   Word  2: 3FFC   NOFCMEN NOIESO