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               12-V-06 23:56
2
 
3
               Filename: D:\KAKLIK\roboti\istrobot\3Orbis\vystava\main.lst
4
 
5
               ROM used: 646 words (16%)
6
                         Largest free fragment is 2048
7
               RAM used: 32 (18%) at main() level
8
                         35 (20%) worst case
9
               Stack:    3 worst case (1 in main + 2 for interrupts)
10
 
11
*
12
0000:  MOVLW  00
13
0001:  MOVWF  0A
14
0002:  GOTO   07D
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   047
67
.................... #include ".\main.h" 
68
.................... #include <16F88.h> 
69
.................... //////// Standard Header file for the PIC16F88 device //////////////// 
70
.................... #device PIC16F88 
71
.................... #list 
72
....................  
73
.................... #device adc=8 
74
....................  
75
.................... #FUSES NOWDT                 	//No Watch Dog Timer 
76
.................... #FUSES INTRC_IO 
77
.................... #FUSES NOPUT                 	//No Power Up Timer 
78
.................... #FUSES MCLR                  	//Master Clear pin enabled 
79
.................... #FUSES NOBROWNOUT             //Reset when brownout detected 
80
.................... #FUSES NOLVP                  //Low Voltage Programming on B3(PIC16) or B5(PIC18) 
81
.................... #FUSES NOCPD                 	//No EE protection 
82
.................... #FUSES NOWRT                 	//Program memory not write protected 
83
.................... #FUSES NODEBUG               	//No Debug mode for ICD 
84
.................... #FUSES NOPROTECT             	//Code not protected from reading 
85
.................... #FUSES NOFCMEN                //Fail-safe clock monitor enabled 
86
.................... #FUSES NOIESO                  	//Internal External Switch Over mode enabled 
87
....................  
88
.................... #use delay(clock=8000000,RESTART_WDT) 
89
0037:  MOVLW  08
90
0038:  SUBWF  3D,F
91
0039:  BTFSS  03.0
92
003A:  GOTO   046
93
003B:  MOVLW  3D
94
003C:  MOVWF  04
95
003D:  BCF    03.0
96
003E:  RRF    00,F
97
003F:  MOVF   00,W
98
0040:  BTFSC  03.2
99
0041:  GOTO   046
100
0042:  GOTO   044
101
0043:  CLRWDT
102
0044:  DECFSZ 00,F
103
0045:  GOTO   043
104
0046:  RETLW  00
105
*
106
0065:  MOVLW  3A
107
0066:  MOVWF  04
108
0067:  MOVF   00,W
109
0068:  BTFSC  03.2
110
0069:  GOTO   07C
111
006A:  MOVLW  02
112
006B:  MOVWF  78
113
006C:  MOVLW  BF
114
006D:  MOVWF  77
115
006E:  CLRWDT
116
006F:  DECFSZ 77,F
117
0070:  GOTO   06E
118
0071:  DECFSZ 78,F
119
0072:  GOTO   06C
120
0073:  MOVLW  96
121
0074:  MOVWF  77
122
0075:  DECFSZ 77,F
123
0076:  GOTO   075
124
0077:  NOP
125
0078:  NOP
126
0079:  CLRWDT
127
007A:  DECFSZ 00,F
128
007B:  GOTO   06A
129
007C:  RETLW  00
130
....................  
131
....................  
132
....................  
133
.................... #define  KOLMO1      225         // predni kolecko sroubem dopredu 
134
.................... #define  KOLMO2      30          // predni kolecko je hlavou sroubu dozadu 
135
.................... #define  STRED       128         // sredni poloha zataceciho kolecka 
136
.................... #define  BEAR1       10          // 3 stupne zataceni 
137
.................... #define  BEAR2       25 
138
.................... #define  BEAR3       45 
139
.................... #define  R           100         // Rozumna rychlost 
140
.................... #define  R17         200         // X nasobek rozumne rychlosti 
141
.................... #define  PRED_CIHLOU 100         // rychlost pri dalkove detekci cihly 
142
.................... #define  L2            2     // cara vlevo 
143
.................... #define  L3            3     // cara vlevo 
144
.................... #define  S             0     // cara mezi sensory 
145
.................... #define  R2           -2     // cara vpravo 
146
.................... #define  R3           -3     // cara vpravo 
147
....................  
148
.................... // servo 
149
.................... #define  SERVO PIN_B5 
150
....................  
151
.................... // kroutitka 
152
.................... #define  CERVENA  4  // AN4 
153
.................... #define  MODRA    2  // AN2 
154
....................  
155
.................... // IR 
156
.................... #define IRTX      PIN_B2 
157
.................... #define  CIHLA    PIN_A3 
158
....................  
159
.................... //motory 
160
.................... #define  FR         output_low(PIN_A7); output_high(PIN_A6)  // Vpred 
161
.................... #define  FL         output_low(PIN_A1); output_high(PIN_A0) 
162
.................... #define  BR         output_low(PIN_A6); output_high(PIN_A7)  // Vzad 
163
.................... #define  BL         output_low(PIN_A0); output_high(PIN_A1) 
164
.................... #define  STOPR      output_low(PIN_A6);output_low(PIN_A7) 
165
.................... #define  STOPL      output_low(PIN_A0);output_low(PIN_A1) 
166
....................  
167
.................... //HID 
168
.................... #define  LED1     PIN_B1      //oranzova 
169
.................... #define  LED2     PIN_B2      //zluta 
170
....................  
171
.................... #define  STROBE   PIN_B0 
172
....................  
173
.................... unsigned int8 sensors;        // pomocna promenna pro cteni cidel na caru 
174
.................... signed int8 line = S;         // na ktere strane byla detekovana cara 
175
*
176
008A:  BCF    03.5
177
008B:  CLRF   2B
178
.................... unsigned int8 uhel;           // urcuje aktualni uhel zataceni 
179
.................... unsigned int8 speed;          // maximalni povolena rychlost 
180
.................... unsigned int8 turn;           // rychlost toceni 
181
.................... unsigned int8 rovinka;        // pocitadlo na zjisteni rovinky 
182
....................  
183
.................... signed int16  Lmotor;         // promene, ktere urcuji velikost vykonu na levem 
184
.................... signed int16  Rmotor;         // a pravem motoru 
185
....................  
186
.................... // makro pro PWM pro motory 
187
.................... #define GO(motor, direction, power) if(get_timer0()<=power) \ 
188
.................... {direction##motor;} else {stop##motor;} 
189
.................... //////////////////////////////////////////////////////////////////////////////// 
190
.................... #int_TIMER2 
191
.................... TIMER2_isr()      // ovladani serva 
192
.................... { 
193
....................    unsigned int8 n; 
194
....................  
195
....................    output_high(SERVO); 
196
*
197
0047:  BSF    03.5
198
0048:  BCF    06.5
199
0049:  BCF    03.5
200
004A:  BSF    06.5
201
....................    delay_us(1000); 
202
004B:  CLRWDT
203
004C:  MOVLW  09
204
004D:  MOVWF  3C
205
004E:  MOVLW  6D
206
004F:  MOVWF  3D
207
0050:  CALL   037
208
0051:  DECFSZ 3C,F
209
0052:  GOTO   04E
210
....................    for(n=uhel; n>0; n--) Delay_us(2); 
211
0053:  MOVF   2C,W
212
0054:  MOVWF  3B
213
0055:  MOVF   3B,F
214
0056:  BTFSC  03.2
215
0057:  GOTO   05E
216
0058:  CLRWDT
217
0059:  NOP
218
005A:  NOP
219
005B:  NOP
220
005C:  DECF   3B,F
221
005D:  GOTO   055
222
....................    output_low(SERVO); 
223
005E:  BSF    03.5
224
005F:  BCF    06.5
225
0060:  BCF    03.5
226
0061:  BCF    06.5
227
.................... } 
228
....................  
229
.................... //////////////////////////////////////////////////////////////////////////////// 
230
0062:  BCF    0C.1
231
0063:  BCF    0A.3
232
0064:  GOTO   022
233
.................... void main() 
234
.................... { 
235
*
236
007D:  CLRF   04
237
007E:  MOVLW  1F
238
007F:  ANDWF  03,F
239
0080:  MOVLW  70
240
0081:  BSF    03.5
241
0082:  MOVWF  0F
242
0083:  BCF    1F.4
243
0084:  BCF    1F.5
244
0085:  MOVF   1B,W
245
0086:  ANDLW  80
246
0087:  MOVWF  1B
247
0088:  MOVLW  07
248
0089:  MOVWF  1C
249
....................  
250
....................    unsigned int8 n; 
251
....................    unsigned int8 i,j; 
252
....................    unsigned int8 last_sensors; 
253
....................    unsigned int8 RozumnaRychlost; 
254
....................  
255
....................    setup_adc_ports(sAN5|sAN2|sAN4|sAN6|VSS_VDD); // AD pro kroutitka 
256
*
257
008C:  BSF    03.5
258
008D:  BCF    1F.4
259
008E:  BCF    1F.5
260
008F:  MOVF   1B,W
261
0090:  ANDLW  80
262
0091:  IORLW  74
263
0092:  MOVWF  1B
264
....................    setup_adc(ADC_CLOCK_INTERNAL); 
265
0093:  BCF    1F.6
266
0094:  BCF    03.5
267
0095:  BSF    1F.6
268
0096:  BSF    1F.7
269
0097:  BSF    03.5
270
0098:  BCF    1F.7
271
0099:  BCF    03.5
272
009A:  BSF    1F.0
273
....................    setup_spi(SPI_MASTER|SPI_H_TO_L|SPI_XMIT_L_TO_H|SPI_CLK_DIV_16); 
274
009B:  BCF    14.5
275
009C:  BSF    03.5
276
009D:  BCF    06.2
277
009E:  BSF    06.1
278
009F:  BCF    06.4
279
00A0:  MOVLW  31
280
00A1:  BCF    03.5
281
00A2:  MOVWF  14
282
00A3:  MOVLW  00
283
00A4:  BSF    03.5
284
00A5:  MOVWF  14
285
....................    setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); 
286
00A6:  MOVF   01,W
287
00A7:  ANDLW  C7
288
00A8:  IORLW  08
289
00A9:  MOVWF  01
290
....................    setup_timer_1(T1_DISABLED|T1_DIV_BY_8); 
291
00AA:  MOVLW  30
292
00AB:  BCF    03.5
293
00AC:  MOVWF  10
294
....................    setup_timer_2(T2_DIV_BY_16,140,16); 
295
00AD:  MOVLW  78
296
00AE:  MOVWF  78
297
00AF:  IORLW  06
298
00B0:  MOVWF  12
299
00B1:  MOVLW  8C
300
00B2:  BSF    03.5
301
00B3:  MOVWF  12
302
....................    setup_oscillator(OSC_8MHZ|OSC_INTRC); 
303
00B4:  MOVLW  72
304
00B5:  MOVWF  0F
305
....................  
306
....................    STOPR; STOPL;  // zastav motory 
307
00B6:  BCF    05.6
308
00B7:  BCF    03.5
309
00B8:  BCF    05.6
310
00B9:  BSF    03.5
311
00BA:  BCF    05.7
312
00BB:  BCF    03.5
313
00BC:  BCF    05.7
314
00BD:  BSF    03.5
315
00BE:  BCF    05.0
316
00BF:  BCF    03.5
317
00C0:  BCF    05.0
318
00C1:  BSF    03.5
319
00C2:  BCF    05.1
320
00C3:  BCF    03.5
321
00C4:  BCF    05.1
322
....................    Lmotor=0;Rmotor=0; 
323
00C5:  CLRF   31
324
00C6:  CLRF   30
325
00C7:  CLRF   33
326
00C8:  CLRF   32
327
....................  
328
....................    uhel = STRED;    // nastav zadni kolecko na stred 
329
00C9:  MOVLW  80
330
00CA:  MOVWF  2C
331
....................    rovinka = 0; 
332
00CB:  CLRF   2F
333
....................  
334
....................    enable_interrupts(INT_TIMER2); 
335
00CC:  BSF    03.5
336
00CD:  BSF    0C.1
337
....................    enable_interrupts(GLOBAL); 
338
00CE:  MOVLW  C0
339
00CF:  BCF    03.5
340
00D0:  IORWF  0B,F
341
....................  
342
....................    output_low(IRTX); // zapni IR vysilac 
343
00D1:  BSF    03.5
344
00D2:  BCF    06.2
345
00D3:  BCF    03.5
346
00D4:  BCF    06.2
347
....................  
348
....................    delay_ms(2000); // musime pockat na diagnostiku slave CPU 
349
00D5:  MOVLW  08
350
00D6:  MOVWF  39
351
00D7:  MOVLW  FA
352
00D8:  MOVWF  3A
353
00D9:  CALL   065
354
00DA:  DECFSZ 39,F
355
00DB:  GOTO   0D7
356
....................  
357
....................    //nastaveni rychlosti 
358
....................    set_adc_channel(CERVENA); 
359
00DC:  MOVLW  20
360
00DD:  MOVWF  78
361
00DE:  MOVF   1F,W
362
00DF:  ANDLW  C7
363
00E0:  IORWF  78,W
364
00E1:  MOVWF  1F
365
....................  
366
....................    Delay_ms(1); 
367
00E2:  MOVLW  01
368
00E3:  MOVWF  3A
369
00E4:  CALL   065
370
....................    speed=R+(read_adc()>>2); // rychlost rovne +63; kroutitko dava 0-63 
371
00E5:  BSF    1F.2
372
00E6:  BTFSC  1F.2
373
00E7:  GOTO   0E6
374
00E8:  MOVF   1E,W
375
00E9:  MOVWF  77
376
00EA:  RRF    77,F
377
00EB:  RRF    77,F
378
00EC:  MOVLW  3F
379
00ED:  ANDWF  77,F
380
00EE:  MOVF   77,W
381
00EF:  ADDLW  64
382
00F0:  MOVWF  2D
383
....................    set_adc_channel(MODRA); 
384
00F1:  MOVLW  10
385
00F2:  MOVWF  78
386
00F3:  MOVF   1F,W
387
00F4:  ANDLW  C7
388
00F5:  IORWF  78,W
389
00F6:  MOVWF  1F
390
....................    Delay_ms(1); 
391
00F7:  MOVLW  01
392
00F8:  MOVWF  3A
393
00F9:  CALL   065
394
....................    turn=speed-32+(read_adc()>>2);  // rychlost toceni +-32; kroutitko dava 0-63 
395
00FA:  MOVLW  20
396
00FB:  SUBWF  2D,W
397
00FC:  MOVWF  39
398
00FD:  BSF    1F.2
399
00FE:  BTFSC  1F.2
400
00FF:  GOTO   0FE
401
0100:  MOVF   1E,W
402
0101:  MOVWF  77
403
0102:  RRF    77,F
404
0103:  RRF    77,F
405
0104:  MOVLW  3F
406
0105:  ANDWF  77,F
407
0106:  MOVF   77,W
408
0107:  ADDWF  39,W
409
0108:  MOVWF  2E
410
....................  
411
....................  
412
....................    while(true) 
413
....................    { 
414
....................  
415
....................       GO(L,F,Lmotor);GO(R,F,Rmotor);   // zapni motory PWM podle promenych Lmotor a Rmotor 
416
0109:  MOVF   01,W
417
010A:  BTFSS  00.7
418
010B:  GOTO   10F
419
010C:  BTFSS  31.7
420
010D:  GOTO   117
421
010E:  GOTO   111
422
010F:  BTFSC  31.7
423
0110:  GOTO   120
424
0111:  MOVF   31,F
425
0112:  BTFSS  03.2
426
0113:  GOTO   117
427
0114:  SUBWF  30,W
428
0115:  BTFSS  03.0
429
0116:  GOTO   120
430
0117:  BSF    03.5
431
0118:  BCF    05.1
432
0119:  BCF    03.5
433
011A:  BCF    05.1
434
011B:  BSF    03.5
435
011C:  BCF    05.0
436
011D:  BCF    03.5
437
011E:  BSF    05.0
438
011F:  GOTO   128
439
0120:  BSF    03.5
440
0121:  BCF    05.0
441
0122:  BCF    03.5
442
0123:  BCF    05.0
443
0124:  BSF    03.5
444
0125:  BCF    05.1
445
0126:  BCF    03.5
446
0127:  BCF    05.1
447
0128:  MOVF   01,W
448
0129:  BTFSS  00.7
449
012A:  GOTO   12E
450
012B:  BTFSS  33.7
451
012C:  GOTO   136
452
012D:  GOTO   130
453
012E:  BTFSC  33.7
454
012F:  GOTO   13F
455
0130:  MOVF   33,F
456
0131:  BTFSS  03.2
457
0132:  GOTO   136
458
0133:  SUBWF  32,W
459
0134:  BTFSS  03.0
460
0135:  GOTO   13F
461
0136:  BSF    03.5
462
0137:  BCF    05.7
463
0138:  BCF    03.5
464
0139:  BCF    05.7
465
013A:  BSF    03.5
466
013B:  BCF    05.6
467
013C:  BCF    03.5
468
013D:  BSF    05.6
469
013E:  GOTO   147
470
013F:  BSF    03.5
471
0140:  BCF    05.6
472
0141:  BCF    03.5
473
0142:  BCF    05.6
474
0143:  BSF    03.5
475
0144:  BCF    05.7
476
0145:  BCF    03.5
477
0146:  BCF    05.7
478
....................  
479
....................       delay_us(2000);                  // cekani na SLAVE, nez pripravi data od cidel 
480
0147:  CLRWDT
481
0148:  MOVLW  01
482
0149:  MOVWF  3A
483
014A:  CALL   065
484
014B:  MOVLW  09
485
014C:  MOVWF  39
486
014D:  CLRF   29
487
014E:  BTFSC  0B.7
488
014F:  BSF    29.7
489
0150:  BCF    0B.7
490
0151:  MOVLW  6D
491
0152:  MOVWF  3D
492
0153:  CALL   037
493
0154:  BTFSC  29.7
494
0155:  BSF    0B.7
495
0156:  DECFSZ 39,F
496
0157:  GOTO   14D
497
....................  
498
....................       last_sensors=sensors; 
499
0158:  MOVF   2A,W
500
0159:  MOVWF  37
501
....................  
502
....................       output_low(STROBE);              // vypni zobrazovani na posuvnem registru 
503
015A:  BSF    03.5
504
015B:  BCF    06.0
505
015C:  BCF    03.5
506
015D:  BCF    06.0
507
....................       sensors = spi_read(0);           // cteni senzoru 
508
015E:  MOVF   13,W
509
015F:  CLRF   13
510
0160:  BSF    03.5
511
0161:  BTFSC  14.0
512
0162:  GOTO   165
513
0163:  BCF    03.5
514
0164:  GOTO   160
515
0165:  BCF    03.5
516
0166:  MOVF   13,W
517
0167:  MOVWF  2A
518
....................       sensors=~sensors;                // neguj prijata data 
519
0168:  COMF   2A,F
520
....................       output_high(STROBE);       // zobraz data na posuvnem registru 
521
0169:  BSF    03.5
522
016A:  BCF    06.0
523
016B:  BCF    03.5
524
016C:  BSF    06.0
525
....................  
526
....................       i=0;                       // havarijni kod 
527
016D:  CLRF   35
528
....................       for (n=0; n<=6; n++) 
529
016E:  CLRF   34
530
016F:  MOVF   34,W
531
0170:  SUBLW  06
532
0171:  BTFSS  03.0
533
0172:  GOTO   181
534
....................       { 
535
....................          if(bit_test(sensors,n)) i++; 
536
0173:  MOVF   2A,W
537
0174:  MOVWF  77
538
0175:  MOVF   34,W
539
0176:  MOVWF  78
540
0177:  BTFSC  03.2
541
0178:  GOTO   17D
542
0179:  BCF    03.0
543
017A:  RRF    77,F
544
017B:  DECFSZ 78,F
545
017C:  GOTO   179
546
017D:  BTFSC  77.0
547
017E:  INCF   35,F
548
....................       } 
549
017F:  INCF   34,F
550
0180:  GOTO   16F
551
....................       if (i>4) // zastavi, kdyz je cerno pod vice nez tremi cidly 
552
0181:  MOVF   35,W
553
0182:  SUBLW  04
554
0183:  BTFSC  03.0
555
0184:  GOTO   1AD
556
....................       { 
557
....................          BL; BR; 
558
0185:  BSF    03.5
559
0186:  BCF    05.0
560
0187:  BCF    03.5
561
0188:  BCF    05.0
562
0189:  BSF    03.5
563
018A:  BCF    05.1
564
018B:  BCF    03.5
565
018C:  BSF    05.1
566
018D:  BSF    03.5
567
018E:  BCF    05.6
568
018F:  BCF    03.5
569
0190:  BCF    05.6
570
0191:  BSF    03.5
571
0192:  BCF    05.7
572
0193:  BCF    03.5
573
0194:  BSF    05.7
574
....................          delay_ms(300); 
575
0195:  MOVLW  02
576
0196:  MOVWF  39
577
0197:  MOVLW  96
578
0198:  MOVWF  3A
579
0199:  CALL   065
580
019A:  DECFSZ 39,F
581
019B:  GOTO   197
582
....................          STOPR; STOPL; 
583
019C:  BSF    03.5
584
019D:  BCF    05.6
585
019E:  BCF    03.5
586
019F:  BCF    05.6
587
01A0:  BSF    03.5
588
01A1:  BCF    05.7
589
01A2:  BCF    03.5
590
01A3:  BCF    05.7
591
01A4:  BSF    03.5
592
01A5:  BCF    05.0
593
01A6:  BCF    03.5
594
01A7:  BCF    05.0
595
01A8:  BSF    03.5
596
01A9:  BCF    05.1
597
01AA:  BCF    03.5
598
01AB:  BCF    05.1
599
....................          While(true); 
600
01AC:  GOTO   1AC
601
....................       }; 
602
....................  
603
....................       if (bit_test(sensors,7))    // detekce cihly 
604
01AD:  BTFSS  2A.7
605
01AE:  GOTO   1D9
606
....................       { 
607
....................          BR;BL; 
608
01AF:  BSF    03.5
609
01B0:  BCF    05.6
610
01B1:  BCF    03.5
611
01B2:  BCF    05.6
612
01B3:  BSF    03.5
613
01B4:  BCF    05.7
614
01B5:  BCF    03.5
615
01B6:  BSF    05.7
616
01B7:  BSF    03.5
617
01B8:  BCF    05.0
618
01B9:  BCF    03.5
619
01BA:  BCF    05.0
620
01BB:  BSF    03.5
621
01BC:  BCF    05.1
622
01BD:  BCF    03.5
623
01BE:  BSF    05.1
624
....................          Delay_ms(100); 
625
01BF:  MOVLW  64
626
01C0:  MOVWF  3A
627
01C1:  CALL   065
628
....................          STOPR;STOPL; 
629
01C2:  BSF    03.5
630
01C3:  BCF    05.6
631
01C4:  BCF    03.5
632
01C5:  BCF    05.6
633
01C6:  BSF    03.5
634
01C7:  BCF    05.7
635
01C8:  BCF    03.5
636
01C9:  BCF    05.7
637
01CA:  BSF    03.5
638
01CB:  BCF    05.0
639
01CC:  BCF    03.5
640
01CD:  BCF    05.0
641
01CE:  BSF    03.5
642
01CF:  BCF    05.1
643
01D0:  BCF    03.5
644
01D1:  BCF    05.1
645
....................          Delay_ms(1000); 
646
01D2:  MOVLW  04
647
01D3:  MOVWF  39
648
01D4:  MOVLW  FA
649
01D5:  MOVWF  3A
650
01D6:  CALL   065
651
01D7:  DECFSZ 39,F
652
01D8:  GOTO   1D4
653
....................       } 
654
....................  
655
....................       if(bit_test(sensors,0)) //|......//     // z duvodu zkraceni doby reakce se cidla nevyhodnocuji poporade ale od krajnich k prostrednimu 
656
01D9:  BTFSS  2A.0
657
01DA:  GOTO   1E7
658
....................       { 
659
....................          uhel=STRED - BEAR3; 
660
01DB:  MOVLW  53
661
01DC:  MOVWF  2C
662
....................          Lmotor=0; 
663
01DD:  CLRF   31
664
01DE:  CLRF   30
665
....................          Rmotor=turn; 
666
01DF:  CLRF   7A
667
01E0:  MOVF   2E,W
668
01E1:  MOVWF  32
669
01E2:  MOVF   7A,W
670
01E3:  MOVWF  33
671
....................          line=L3; 
672
01E4:  MOVLW  03
673
01E5:  MOVWF  2B
674
....................          continue; 
675
01E6:  GOTO   109
676
....................       } 
677
....................  
678
....................       if(bit_test(sensors,6)) //......|// 
679
01E7:  BTFSS  2A.6
680
01E8:  GOTO   1F5
681
....................       { 
682
....................          uhel=STRED + BEAR3; 
683
01E9:  MOVLW  AD
684
01EA:  MOVWF  2C
685
....................          Rmotor=0; 
686
01EB:  CLRF   33
687
01EC:  CLRF   32
688
....................          Lmotor=turn; 
689
01ED:  CLRF   7A
690
01EE:  MOVF   2E,W
691
01EF:  MOVWF  30
692
01F0:  MOVF   7A,W
693
01F1:  MOVWF  31
694
....................          line=R3; 
695
01F2:  MOVLW  FD
696
01F3:  MOVWF  2B
697
....................          continue; 
698
01F4:  GOTO   109
699
....................       } 
700
....................  
701
....................       if(bit_test(sensors,1)) //.|.....// 
702
01F5:  BTFSS  2A.1
703
01F6:  GOTO   207
704
....................       { 
705
....................          uhel=STRED - BEAR2; 
706
01F7:  MOVLW  67
707
01F8:  MOVWF  2C
708
....................          Lmotor=speed-70; 
709
01F9:  MOVLW  46
710
01FA:  SUBWF  2D,W
711
01FB:  CLRF   7A
712
01FC:  MOVWF  30
713
01FD:  MOVF   7A,W
714
01FE:  MOVWF  31
715
....................          Rmotor=speed; 
716
01FF:  CLRF   7A
717
0200:  MOVF   2D,W
718
0201:  MOVWF  32
719
0202:  MOVF   7A,W
720
0203:  MOVWF  33
721
....................          line=L2; 
722
0204:  MOVLW  02
723
0205:  MOVWF  2B
724
....................          continue; 
725
0206:  GOTO   109
726
....................       } 
727
....................  
728
....................       if(bit_test(sensors,5)) //.....|.// 
729
0207:  BTFSS  2A.5
730
0208:  GOTO   219
731
....................       { 
732
....................          uhel=STRED + BEAR2; 
733
0209:  MOVLW  99
734
020A:  MOVWF  2C
735
....................          Rmotor=speed-70; 
736
020B:  MOVLW  46
737
020C:  SUBWF  2D,W
738
020D:  CLRF   7A
739
020E:  MOVWF  32
740
020F:  MOVF   7A,W
741
0210:  MOVWF  33
742
....................          Lmotor=speed; 
743
0211:  CLRF   7A
744
0212:  MOVF   2D,W
745
0213:  MOVWF  30
746
0214:  MOVF   7A,W
747
0215:  MOVWF  31
748
....................          line=R2; 
749
0216:  MOVLW  FE
750
0217:  MOVWF  2B
751
....................          continue; 
752
0218:  GOTO   109
753
....................       } 
754
....................  
755
....................       if (bit_test(sensors,2)) //..|....// 
756
0219:  BTFSS  2A.2
757
021A:  GOTO   22F
758
....................       { 
759
....................          uhel=STRED - BEAR1; 
760
021B:  MOVLW  76
761
021C:  MOVWF  2C
762
....................          Lmotor=speed-20; 
763
021D:  MOVLW  14
764
021E:  SUBWF  2D,W
765
021F:  CLRF   7A
766
0220:  MOVWF  30
767
0221:  MOVF   7A,W
768
0222:  MOVWF  31
769
....................          Rmotor=speed; 
770
0223:  CLRF   7A
771
0224:  MOVF   2D,W
772
0225:  MOVWF  32
773
0226:  MOVF   7A,W
774
0227:  MOVWF  33
775
....................          line=L2; 
776
0228:  MOVLW  02
777
0229:  MOVWF  2B
778
....................          if (rovinka<255) rovinka++; 
779
022A:  INCFSZ 2F,W
780
022B:  GOTO   22D
781
022C:  GOTO   22E
782
022D:  INCF   2F,F
783
....................          continue; 
784
022E:  GOTO   109
785
....................       } 
786
....................  
787
....................       if (bit_test(sensors,4)) //....|..// 
788
022F:  BTFSS  2A.4
789
0230:  GOTO   245
790
....................       { 
791
....................          uhel=STRED + BEAR1; 
792
0231:  MOVLW  8A
793
0232:  MOVWF  2C
794
....................          Rmotor=speed-20; 
795
0233:  MOVLW  14
796
0234:  SUBWF  2D,W
797
0235:  CLRF   7A
798
0236:  MOVWF  32
799
0237:  MOVF   7A,W
800
0238:  MOVWF  33
801
....................          Lmotor=speed; 
802
0239:  CLRF   7A
803
023A:  MOVF   2D,W
804
023B:  MOVWF  30
805
023C:  MOVF   7A,W
806
023D:  MOVWF  31
807
....................          line=L2; 
808
023E:  MOVLW  02
809
023F:  MOVWF  2B
810
....................          if (rovinka<255) rovinka++; 
811
0240:  INCFSZ 2F,W
812
0241:  GOTO   243
813
0242:  GOTO   244
814
0243:  INCF   2F,F
815
....................          continue; 
816
0244:  GOTO   109
817
....................       } 
818
....................  
819
....................       if(bit_test(sensors,3)) //...|...// 
820
0245:  BTFSS  2A.3
821
0246:  GOTO   259
822
....................       { 
823
....................          uhel=STRED; 
824
0247:  MOVLW  80
825
0248:  MOVWF  2C
826
....................          Lmotor=speed; 
827
0249:  CLRF   7A
828
024A:  MOVF   2D,W
829
024B:  MOVWF  30
830
024C:  MOVF   7A,W
831
024D:  MOVWF  31
832
....................          Rmotor=speed; 
833
024E:  CLRF   7A
834
024F:  MOVF   2D,W
835
0250:  MOVWF  32
836
0251:  MOVF   7A,W
837
0252:  MOVWF  33
838
....................          line=S; 
839
0253:  CLRF   2B
840
....................          if (rovinka < 255) rovinka++; 
841
0254:  INCFSZ 2F,W
842
0255:  GOTO   257
843
0256:  GOTO   258
844
0257:  INCF   2F,F
845
....................          continue; 
846
0258:  GOTO   109
847
....................       } 
848
....................  
849
....................  
850
....................  
851
....................       if ((L3==line) || (R3==line)) // Brzdeni pri vyjeti z trate 
852
0259:  MOVF   2B,W
853
025A:  SUBLW  03
854
025B:  BTFSC  03.2
855
025C:  GOTO   261
856
025D:  MOVF   2B,W
857
025E:  SUBLW  FD
858
025F:  BTFSS  03.2
859
0260:  GOTO   284
860
....................       { 
861
....................          if (rovinka>50) 
862
0261:  MOVF   2F,W
863
0262:  SUBLW  32
864
0263:  BTFSC  03.0
865
0264:  GOTO   283
866
....................          { 
867
....................             BL; BR; 
868
0265:  BSF    03.5
869
0266:  BCF    05.0
870
0267:  BCF    03.5
871
0268:  BCF    05.0
872
0269:  BSF    03.5
873
026A:  BCF    05.1
874
026B:  BCF    03.5
875
026C:  BSF    05.1
876
026D:  BSF    03.5
877
026E:  BCF    05.6
878
026F:  BCF    03.5
879
0270:  BCF    05.6
880
0271:  BSF    03.5
881
0272:  BCF    05.7
882
0273:  BCF    03.5
883
0274:  BSF    05.7
884
....................             Delay_ms(70); 
885
0275:  MOVLW  46
886
0276:  MOVWF  3A
887
0277:  CALL   065
888
....................             if (rovinka > 250 || speed > 170) delay_ms(50); 
889
0278:  MOVF   2F,W
890
0279:  SUBLW  FA
891
027A:  BTFSS  03.0
892
027B:  GOTO   280
893
027C:  MOVF   2D,W
894
027D:  SUBLW  AA
895
027E:  BTFSC  03.0
896
027F:  GOTO   283
897
0280:  MOVLW  32
898
0281:  MOVWF  3A
899
0282:  CALL   065
900
....................          }; 
901
....................          rovinka=0; 
902
0283:  CLRF   2F
903
....................       }; 
904
....................    } 
905
0284:  GOTO   109
906
.................... } 
907
0285:  SLEEP
908
 
909
Configuration Fuses:
910
   Word  1: 3F38   NOWDT NOPUT MCLR NOBROWNOUT NOLVP NOCPD NOWRT NODEBUG CCPB0 NOPROTECT INTRC_IO
911
   Word  2: 3FFC   NOFCMEN NOIESO