Rev Author Line No. Line
240 kaklik 1 CCS PCM C Compiler, Version 3.245, 27853 11-V-08 11:01
221 svejda 2  
240 kaklik 3 Filename: D:\MLAB_E\projekty\rotacni_display\SW\infra\infra.lst
221 svejda 4  
240 kaklik 5 ROM used: 595 words (7%)
221 svejda 6 Largest free fragment is 2048
240 kaklik 7 RAM used: 36 (21%) at main() level
8 38 (22%) worst case
221 svejda 9 Stack: 2 worst case (1 in main + 1 for interrupts)
10  
11 *
12 0000: MOVLW 00
13 0001: MOVWF 0A
240 kaklik 14 0002: GOTO 149
221 svejda 15 0003: NOP
16 0004: MOVWF 7F
17 0005: SWAPF 03,W
18 0006: CLRF 03
19 0007: MOVWF 21
20 0008: MOVF 0A,W
21 0009: MOVWF 20
22 000A: CLRF 0A
23 000B: MOVF 04,W
24 000C: MOVWF 22
25 000D: MOVF 77,W
26 000E: MOVWF 23
27 000F: MOVF 78,W
28 0010: MOVWF 24
29 0011: MOVF 79,W
30 0012: MOVWF 25
31 0013: MOVF 7A,W
32 0014: MOVWF 26
33 0015: MOVF 7B,W
34 0016: MOVWF 27
35 0017: BCF 03.7
36 0018: BCF 03.5
37 0019: MOVLW 8C
38 001A: MOVWF 04
39 001B: BTFSS 00.5
40 001C: GOTO 01F
41 001D: BTFSC 0C.5
42 001E: GOTO 032
43 001F: MOVF 22,W
44 0020: MOVWF 04
45 0021: MOVF 23,W
46 0022: MOVWF 77
47 0023: MOVF 24,W
48 0024: MOVWF 78
49 0025: MOVF 25,W
50 0026: MOVWF 79
51 0027: MOVF 26,W
52 0028: MOVWF 7A
53 0029: MOVF 27,W
54 002A: MOVWF 7B
55 002B: MOVF 20,W
56 002C: MOVWF 0A
57 002D: SWAPF 21,W
58 002E: MOVWF 03
59 002F: SWAPF 7F,F
60 0030: SWAPF 7F,W
61 0031: RETFIE
62 0032: BCF 0A.3
63 0033: BCF 0A.4
240 kaklik 64 0034: GOTO 0F6
237 kaklik 65 .................... #include ".\infra.h"
221 svejda 66 .................... #include <16F877A.h>
67 .................... //////// Standard Header file for the PIC16F877A device ////////////////
68 .................... #device PIC16F877A
69 .................... #list
70 ....................
71 .................... #device adc=8
72 ....................
237 kaklik 73 .................... #FUSES WDT //Watch Dog Timer
221 svejda 74 .................... #FUSES XT //Crystal osc <= 4mhz
75 .................... #FUSES NOPUT //No Power Up Timer
76 .................... #FUSES NOPROTECT //Code not protected from reading
77 .................... #FUSES NODEBUG //No Debug mode for ICD
78 .................... #FUSES NOBROWNOUT //No brownout reset
79 .................... #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
80 .................... #FUSES NOCPD //No EE protection
81 .................... #FUSES NOWRT //Program memory not write protected
82 ....................
83 .................... #use delay(clock=4000000,RESTART_WDT)
237 kaklik 84 *
240 kaklik 85 010D: MOVLW 39
86 010E: MOVWF 04
87 010F: MOVF 00,W
88 0110: BTFSC 03.2
89 0111: GOTO 123
90 0112: MOVLW 01
91 0113: MOVWF 78
92 0114: MOVLW BF
93 0115: MOVWF 77
94 0116: CLRWDT
95 0117: DECFSZ 77,F
96 0118: GOTO 116
97 0119: DECFSZ 78,F
98 011A: GOTO 114
99 011B: MOVLW 4A
100 011C: MOVWF 77
101 011D: DECFSZ 77,F
102 011E: GOTO 11D
103 011F: NOP
104 0120: CLRWDT
105 0121: DECFSZ 00,F
106 0122: GOTO 112
107 0123: RETLW 00
221 svejda 108 .................... #use rs232(baud=600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
109 ....................
110 ....................
111 ....................
112 .................... #define MAX_SLOVO 10 // Maximalni pocet znaku ve slovu
113 ....................
240 kaklik 114 .................... int8 napis[MAX_SLOVO+1];
237 kaklik 115 .................... int8 otacky;
221 svejda 116 ....................
240 kaklik 117 .................... const int8 logo[2*MAX_SLOVO] ={'[','[',92,'[','E',']','A','[',92,'[','[','^','_','_',']',96,'^','_','_','a'}; // [blesk] E4A [blesk] , 2004-2008
118 ....................
221 svejda 119 .................... #int_RDA
240 kaklik 120 .................... void RDA_isr(void)
221 svejda 121 .................... {
122 .................... int n;
123 .................... output_B(0x55);
124 *
240 kaklik 125 00F6: BSF 03.5
126 00F7: CLRF 06
127 00F8: MOVLW 55
128 00F9: BCF 03.5
129 00FA: MOVWF 06
130 .................... for(n=0;n<MAX_SLOVO;n++)
131 00FB: CLRF 3F
132 00FC: MOVF 3F,W
133 00FD: SUBLW 09
134 00FE: BTFSS 03.0
135 00FF: GOTO 109
221 svejda 136 .................... {
240 kaklik 137 .................... napis[n]=getc();
138 0100: MOVLW 28
139 0101: ADDWF 3F,W
140 0102: MOVWF 04
141 0103: BTFSS 0C.5
142 0104: GOTO 103
143 0105: MOVF 1A,W
144 0106: MOVWF 00
221 svejda 145 .................... }
240 kaklik 146 0107: INCF 3F,F
147 0108: GOTO 0FC
221 svejda 148 .................... }
149 ....................
240 kaklik 150 0109: BCF 0C.5
151 010A: BCF 0A.3
152 010B: BCF 0A.4
153 010C: GOTO 01F
221 svejda 154 .................... void main()
155 .................... {
156 *
240 kaklik 157 0149: CLRF 04
158 014A: MOVLW 1F
159 014B: ANDWF 03,F
160 014C: MOVLW 67
161 014D: BSF 03.5
162 014E: MOVWF 19
163 014F: MOVLW 22
164 0150: MOVWF 18
165 0151: MOVLW 90
166 0152: BCF 03.5
167 0153: MOVWF 18
168 0154: BSF 03.5
169 0155: BSF 1F.0
170 0156: BSF 1F.1
171 0157: BSF 1F.2
172 0158: BCF 1F.3
173 0159: MOVLW 07
174 015A: MOVWF 1C
221 svejda 175 ....................
176 .................... int slovo,pismeno,sloupec,j;
177 ....................
178 ....................
237 kaklik 179 .................... const int8 pis[33*5]={0b00000001,0b11110110,0b11110110,0b11110110,0b00000001, //A
180 .................... 0b00000000,0b01110110,0b01110110,0b01110110,0b10001001, //B
181 .................... 0b10000001,0b01111110,0b01111110,0b01111110,0b10111101, //C
182 .................... 0b00000000,0b01111110,0b01111110,0b01111110,0b10000001, //D
183 .................... 0b00000000,0b01110110,0b01110110,0b01111110,0b01111110, //E
184 .................... 0b00000000,0b11110110,0b11110110,0b11111110,0b11111110, //F
185 .................... 0b10000001,0b01111110,0b01110110,0b01110110,0b10000101, //G
186 .................... 0b00000000,0b11110111,0b11110111,0b11110111,0b00000000, //H
187 .................... 0b01111110,0b01111110,0b00000000,0b01111110,0b01111110, //I
188 .................... 0b10111110,0b01111110,0b01111110,0b01111110,0b10000000, //J
189 .................... 0b00000000,0b11110111,0b11110111,0b11101011,0b00011100, //K
190 .................... 0b00000000,0b01111111,0b01111111,0b01111111,0b01111111, //L
191 .................... 0b00000000,0b11111110,0b11110000,0b11111110,0b00000000, //M
192 .................... 0b00000000,0b11101111,0b11011111,0b10111111,0b00000000, //N
193 .................... 0b10000001,0b01111110,0b01111110,0b01111110,0b10000001, //O
194 .................... 0b00000000,0b11110110,0b11110110,0b11110110,0b11111001, //P
195 .................... 0b10000001,0b01111110,0b01111110,0b01111110,0b00000001, //Q
196 .................... 0b00000000,0b11110110,0b11110110,0b11110110,0b00001001, //R
197 .................... 0b10111001,0b01110110,0b01110110,0b01110110,0b10001101, //S
198 .................... 0b11111110,0b11111110,0b00000000,0b11111110,0b11111110, //T
199 .................... 0b10000000,0b01111111,0b01111111,0b01111111,0b10000000, //U
200 .................... 0b11000000,0b10111111,0b01111111,0b10111111,0b11000000, //V
201 .................... 0b10000000,0b01111111,0b10000000,0b01111111,0b10000000, //W
202 .................... 0b00011100,0b11101011,0b11110111,0b11101011,0b00011100, //X
203 .................... 0b11111000,0b11110111,0b00000111,0b11110111,0b11111000, //Y
204 .................... 0b00011110,0b01101110,0b01110110,0b01111010,0b01111100, //Z
205 .................... 0b11111111,0b11111111,0b11111111,0b11111111,0b11111111, //mezera
206 .................... 0b00010111,0b00110011,0b01010101,0b11100110,0b11110111, //blesk
207 .................... 0b11110000,0b11110111,0b11110111,0b00000001,0b11110111, //4
208 .................... 0b00111101,0b01011110,0b01101110,0b01110110,0b01111001, //2
209 .................... 0b00000000,0b01111110,0b01111110,0b01111110,0b00000000, //0
210 .................... 0b11110111,0b11110111,0b11110111,0b11110111,0b11110111, //pomlka
211 .................... 0b10001001,0b01110110,0b01110110,0b01110110,0b10001001, //8
212 .................... };
240 kaklik 213 ....................
237 kaklik 214 .................... setup_adc_ports(AN0);
221 svejda 215 *
240 kaklik 216 015E: BSF 03.5
217 015F: BCF 1F.0
218 0160: BSF 1F.1
219 0161: BSF 1F.2
220 0162: BSF 1F.3
237 kaklik 221 .................... setup_adc(ADC_CLOCK_INTERNAL);
240 kaklik 222 0163: BCF 1F.6
223 0164: BCF 03.5
224 0165: BSF 1F.6
225 0166: BSF 1F.7
226 0167: BSF 03.5
227 0168: BCF 1F.7
228 0169: BCF 03.5
229 016A: BSF 1F.0
221 svejda 230 .................... setup_psp(PSP_DISABLED);
240 kaklik 231 016B: BSF 03.5
232 016C: BCF 09.4
221 svejda 233 .................... setup_spi(SPI_SS_DISABLED);
234 *
240 kaklik 235 015B: MOVLW FF
236 015C: BCF 03.5
237 015D: MOVWF 34
221 svejda 238 *
240 kaklik 239 016D: BCF 03.5
240 016E: BCF 14.5
241 016F: BCF 34.5
242 0170: MOVF 34,W
243 0171: BSF 03.5
244 0172: MOVWF 07
245 0173: BCF 03.5
246 0174: BSF 34.4
247 0175: MOVF 34,W
248 0176: BSF 03.5
249 0177: MOVWF 07
250 0178: BCF 03.5
251 0179: BCF 34.3
252 017A: MOVF 34,W
253 017B: BSF 03.5
254 017C: MOVWF 07
255 017D: MOVLW 01
256 017E: BCF 03.5
257 017F: MOVWF 14
258 0180: MOVLW 00
259 0181: BSF 03.5
260 0182: MOVWF 14
221 svejda 261 .................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
240 kaklik 262 0183: MOVF 01,W
263 0184: ANDLW C7
264 0185: IORLW 08
265 0186: MOVWF 01
221 svejda 266 .................... setup_wdt(WDT_2304MS);
240 kaklik 267 0187: MOVLW 0F
268 0188: MOVWF 77
269 0189: MOVLW 07
270 018A: BCF 03.5
271 018B: CLRF 01
272 018C: MOVLW 81
273 018D: MOVWF 04
274 018E: MOVF 00,W
275 018F: ANDLW F0
276 0190: IORLW 07
277 0191: MOVWF 00
278 0192: CLRWDT
279 0193: MOVF 00,W
280 0194: ANDLW F7
281 0195: BTFSC 77.3
282 0196: ANDLW F0
283 0197: IORWF 77,W
284 0198: MOVWF 00
221 svejda 285 .................... setup_timer_1(T1_DISABLED);
240 kaklik 286 0199: CLRF 10
221 svejda 287 .................... setup_timer_2(T2_DISABLED,0,1);
240 kaklik 288 019A: MOVLW 00
289 019B: MOVWF 78
290 019C: MOVWF 12
291 019D: MOVLW 00
292 019E: BSF 03.5
293 019F: MOVWF 12
221 svejda 294 .................... setup_comparator(NC_NC_NC_NC);
240 kaklik 295 01A0: MOVLW 07
296 01A1: MOVWF 1C
297 01A2: MOVF 05,W
298 01A3: CLRWDT
299 01A4: MOVLW 02
300 01A5: MOVWF 77
301 01A6: DECFSZ 77,F
302 01A7: GOTO 1A6
303 01A8: NOP
304 01A9: NOP
305 01AA: MOVF 1C,W
306 01AB: BCF 03.5
307 01AC: BCF 0D.6
221 svejda 308 .................... setup_vref(FALSE);
240 kaklik 309 01AD: BSF 03.5
310 01AE: CLRF 1D
221 svejda 311 ....................
312 .................... enable_interrupts(INT_RDA);
240 kaklik 313 01AF: BSF 0C.5
221 svejda 314 .................... enable_interrupts(GLOBAL);
240 kaklik 315 01B0: MOVLW C0
316 01B1: BCF 03.5
317 01B2: IORWF 0B,F
221 svejda 318 ....................
237 kaklik 319 .................... set_adc_channel(0); // Prevodnik pro Hall
240 kaklik 320 01B3: MOVLW 00
321 01B4: MOVWF 78
322 01B5: MOVF 1F,W
323 01B6: ANDLW C7
324 01B7: IORWF 78,W
325 01B8: MOVWF 1F
237 kaklik 326 .................... output_B(0xFF); // Zhasneme
240 kaklik 327 01B9: BSF 03.5
328 01BA: CLRF 06
329 01BB: MOVLW FF
330 01BC: BCF 03.5
331 01BD: MOVWF 06
221 svejda 332 ....................
237 kaklik 333 .................... otacky=0;
240 kaklik 334 01BE: CLRF 33
335 .................... napis[0]=0;
336 01BF: CLRF 28
337 ....................
221 svejda 338 .................... while(TRUE)
339 .................... {
240 kaklik 340 .................... while(napis[0]!=0)
341 .................... {
342 01C0: MOVF 28,F
343 01C1: BTFSC 03.2
344 01C2: GOTO 1FE
345 .................... while(read_adc()<9); // Cekani na magnet
346 01C3: BSF 1F.2
347 01C4: BTFSC 1F.2
348 01C5: GOTO 1C4
349 01C6: MOVF 1E,W
350 01C7: SUBLW 08
351 01C8: BTFSC 03.0
352 01C9: GOTO 1C3
353 .................... delay_ms(10);
354 01CA: MOVLW 0A
355 01CB: MOVWF 39
356 01CC: CALL 10D
357 ....................
358 .................... for(pismeno=0;pismeno<MAX_SLOVO;pismeno++)
359 01CD: CLRF 36
360 01CE: MOVF 36,W
361 01CF: SUBLW 09
362 01D0: BTFSS 03.0
363 01D1: GOTO 1FD
364 .................... {
365 .................... for(sloupec=0;sloupec<5;sloupec++)
366 01D2: CLRF 37
367 01D3: MOVF 37,W
368 01D4: SUBLW 04
369 01D5: BTFSS 03.0
370 01D6: GOTO 1F1
371 .................... {
372 .................... output_B(pis[(napis[pismeno]-0x41)*5+sloupec]);
373 01D7: MOVLW 28
374 01D8: ADDWF 36,W
375 01D9: MOVWF 04
376 01DA: MOVLW 41
377 01DB: SUBWF 00,W
378 01DC: MOVWF 3B
379 01DD: MOVWF 3D
380 01DE: MOVLW 05
381 01DF: MOVWF 3E
382 01E0: CALL 124
383 01E1: MOVF 37,W
384 01E2: ADDWF 78,W
385 01E3: CALL 04D
386 01E4: MOVWF 39
387 01E5: BSF 03.5
388 01E6: CLRF 06
389 01E7: BCF 03.5
390 01E8: MOVF 39,W
391 01E9: MOVWF 06
392 .................... delay_us(500);
393 01EA: CLRWDT
394 01EB: MOVLW A6
395 01EC: MOVWF 77
396 01ED: DECFSZ 77,F
397 01EE: GOTO 1ED
398 .................... }
399 01EF: INCF 37,F
400 01F0: GOTO 1D3
401 .................... output_B(0xFF);
402 01F1: BSF 03.5
403 01F2: CLRF 06
404 01F3: MOVLW FF
405 01F4: BCF 03.5
406 01F5: MOVWF 06
407 .................... delay_us(500);
408 01F6: CLRWDT
409 01F7: MOVLW A6
410 01F8: MOVWF 77
411 01F9: DECFSZ 77,F
412 01FA: GOTO 1F9
413 .................... }
414 01FB: INCF 36,F
415 01FC: GOTO 1CE
416 .................... }
417 01FD: GOTO 1C0
418 ....................
221 svejda 419 .................... for(slovo=0;slovo<2;slovo++)
240 kaklik 420 01FE: CLRF 35
421 01FF: MOVF 35,W
422 0200: SUBLW 01
423 0201: BTFSS 03.0
424 0202: GOTO 251
237 kaklik 425 .................... for(j=0;j<=20;j++) // Jedno slovo se zobrazi stokrat
240 kaklik 426 0203: CLRF 38
427 0204: MOVF 38,W
428 0205: SUBLW 14
429 0206: BTFSS 03.0
430 0207: GOTO 24F
221 svejda 431 .................... {
240 kaklik 432 .................... while(read_adc()<9); // Cekani na magnet
433 0208: BSF 1F.2
434 0209: BTFSC 1F.2
435 020A: GOTO 209
436 020B: MOVF 1E,W
437 020C: SUBLW 08
438 020D: BTFSC 03.0
439 020E: GOTO 208
237 kaklik 440 .................... delay_ms(10);
240 kaklik 441 020F: MOVLW 0A
442 0210: MOVWF 39
443 0211: CALL 10D
444 ....................
221 svejda 445 .................... for(pismeno=0;pismeno<MAX_SLOVO;pismeno++)
240 kaklik 446 0212: CLRF 36
447 0213: MOVF 36,W
448 0214: SUBLW 09
449 0215: BTFSS 03.0
450 0216: GOTO 246
221 svejda 451 .................... {
452 .................... for(sloupec=0;sloupec<5;sloupec++)
240 kaklik 453 0217: CLRF 37
454 0218: MOVF 37,W
455 0219: SUBLW 04
456 021A: BTFSS 03.0
457 021B: GOTO 23A
221 svejda 458 .................... {
240 kaklik 459 .................... output_B(pis[(logo[slovo*MAX_SLOVO+pismeno]-0x41)*5+sloupec]);
460 021C: MOVF 35,W
461 021D: MOVWF 3D
462 021E: MOVLW 0A
463 021F: MOVWF 3E
464 0220: CALL 124
465 0221: MOVF 36,W
466 0222: ADDWF 78,W
467 0223: CALL 035
468 0224: ADDLW BF
469 0225: MOVWF 3C
470 0226: MOVWF 3D
471 0227: MOVLW 05
472 0228: MOVWF 3E
473 0229: CALL 124
474 022A: MOVF 37,W
475 022B: ADDWF 78,W
476 022C: CALL 04D
477 022D: MOVWF 39
478 022E: BSF 03.5
479 022F: CLRF 06
480 0230: BCF 03.5
481 0231: MOVF 39,W
482 0232: MOVWF 06
237 kaklik 483 .................... delay_us(500);
240 kaklik 484 0233: CLRWDT
485 0234: MOVLW A6
486 0235: MOVWF 77
487 0236: DECFSZ 77,F
488 0237: GOTO 236
221 svejda 489 .................... }
240 kaklik 490 0238: INCF 37,F
491 0239: GOTO 218
237 kaklik 492 .................... output_B(0xFF);
240 kaklik 493 023A: BSF 03.5
494 023B: CLRF 06
495 023C: MOVLW FF
496 023D: BCF 03.5
497 023E: MOVWF 06
237 kaklik 498 .................... delay_us(500);
240 kaklik 499 023F: CLRWDT
500 0240: MOVLW A6
501 0241: MOVWF 77
502 0242: DECFSZ 77,F
503 0243: GOTO 242
221 svejda 504 .................... }
240 kaklik 505 0244: INCF 36,F
506 0245: GOTO 213
237 kaklik 507 .................... if (otacky++>120) reset_cpu();
240 kaklik 508 0246: MOVF 33,W
509 0247: INCF 33,F
510 0248: SUBLW 78
511 0249: BTFSC 03.0
512 024A: GOTO 24D
513 024B: CLRF 0A
514 024C: GOTO 000
221 svejda 515 .................... }
240 kaklik 516 024D: INCF 38,F
517 024E: GOTO 204
518 024F: INCF 35,F
519 0250: GOTO 1FF
520 .................... }
521 0251: GOTO 1C0
221 svejda 522 .................... }
240 kaklik 523 0252: SLEEP
221 svejda 524  
525 Configuration Fuses:
237 kaklik 526 Word 1: 3F3D XT WDT NOPUT NODEBUG NOPROTECT NOBROWNOUT NOLVP NOCPD NOWRT