Rev Author Line No. Line
237 kaklik 1 CCS PCM C Compiler, Version 4.058s, 42064 06-V-08 13:28
221 svejda 2  
237 kaklik 3 Filename: C:\Documents and Settings\Administrator\Plocha\rotacni_display\SW\infra\infra.lst
221 svejda 4  
237 kaklik 5 ROM used: 553 words (7%)
221 svejda 6 Largest free fragment is 2048
237 kaklik 7 RAM used: 48 (13%) at main() level
8 51 (14%) 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
237 kaklik 14 0002: GOTO 136
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
237 kaklik 64 0034: GOTO 0DE
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 *
85 00F7: MOVLW 42
86 00F8: MOVWF 04
87 00F9: BCF 03.7
88 00FA: MOVF 00,W
89 00FB: BTFSC 03.2
90 00FC: GOTO 10E
91 00FD: MOVLW 01
92 00FE: MOVWF 78
93 00FF: MOVLW BF
94 0100: MOVWF 77
95 0101: CLRWDT
96 0102: DECFSZ 77,F
97 0103: GOTO 101
98 0104: DECFSZ 78,F
99 0105: GOTO 0FF
100 0106: MOVLW 4A
101 0107: MOVWF 77
102 0108: DECFSZ 77,F
103 0109: GOTO 108
104 010A: NOP
105 010B: CLRWDT
106 010C: DECFSZ 00,F
107 010D: GOTO 0FD
108 010E: BCF 0A.3
109 010F: BCF 0A.4
110 0110: GOTO 1E5 (RETURN)
221 svejda 111 .................... #use rs232(baud=600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
112 ....................
113 ....................
114 ....................
115 .................... #define MAX_SLOVO 10 // Maximalni pocet znaku ve slovu
116 ....................
237 kaklik 117 .................... int8 napis[2*MAX_SLOVO] ={'[','[',92,'[','E',']','A','[',92,'[','[','^','_','_',']',96,'^','_','_','a'};
221 svejda 118 *
237 kaklik 119 0149: MOVLW 5B
120 014A: BCF 03.5
121 014B: MOVWF 28
122 014C: MOVWF 29
123 014D: MOVLW 5C
124 014E: MOVWF 2A
125 014F: MOVLW 5B
126 0150: MOVWF 2B
127 0151: MOVLW 45
128 0152: MOVWF 2C
129 0153: MOVLW 5D
130 0154: MOVWF 2D
131 0155: MOVLW 41
132 0156: MOVWF 2E
133 0157: MOVLW 5B
134 0158: MOVWF 2F
135 0159: MOVLW 5C
136 015A: MOVWF 30
137 015B: MOVLW 5B
138 015C: MOVWF 31
139 015D: MOVWF 32
140 015E: MOVLW 5E
141 015F: MOVWF 33
142 0160: MOVLW 5F
143 0161: MOVWF 34
144 0162: MOVWF 35
145 0163: MOVLW 5D
146 0164: MOVWF 36
147 0165: MOVLW 60
148 0166: MOVWF 37
149 0167: MOVLW 5E
150 0168: MOVWF 38
151 0169: MOVLW 5F
152 016A: MOVWF 39
153 016B: MOVWF 3A
154 016C: MOVLW 61
155 016D: MOVWF 3B
156 .................... int8 otacky;
221 svejda 157 ....................
158 .................... #int_RDA
159 .................... void RDA_isr(void)
160 .................... {
161 .................... int n;
162 .................... output_B(0x55);
163 *
237 kaklik 164 00DE: BSF 03.5
165 00DF: CLRF 06
166 00E0: MOVLW 55
167 00E1: BCF 03.5
168 00E2: MOVWF 06
221 svejda 169 .................... for(n=0;n<(MAX_SLOVO*2);n++)
237 kaklik 170 00E3: CLRF 4A
171 00E4: MOVF 4A,W
172 00E5: SUBLW 13
173 00E6: BTFSS 03.0
174 00E7: GOTO 0F3
221 svejda 175 .................... {
176 .................... napis[n]=getc();
237 kaklik 177 00E8: MOVLW 28
178 00E9: ADDWF 4A,W
179 00EA: MOVWF 04
180 00EB: BCF 03.7
181 00EC: BTFSS 0C.5
182 00ED: GOTO 0EC
183 00EE: MOVF 1A,W
184 00EF: MOVWF 00
221 svejda 185 .................... restart_WDT();
237 kaklik 186 00F0: CLRWDT
221 svejda 187 .................... }
237 kaklik 188 00F1: INCF 4A,F
189 00F2: GOTO 0E4
221 svejda 190 .................... }
191 ....................
237 kaklik 192 00F3: BCF 0C.5
193 00F4: BCF 0A.3
194 00F5: BCF 0A.4
195 00F6: GOTO 01F
221 svejda 196 .................... void main()
197 .................... {
198 *
237 kaklik 199 0136: CLRF 04
200 0137: BCF 03.7
201 0138: MOVLW 1F
202 0139: ANDWF 03,F
203 013A: MOVLW 67
204 013B: BSF 03.5
205 013C: MOVWF 19
206 013D: MOVLW A2
207 013E: MOVWF 18
208 013F: MOVLW 90
209 0140: BCF 03.5
210 0141: MOVWF 18
211 0142: BSF 03.5
212 0143: BSF 1F.0
213 0144: BSF 1F.1
214 0145: BSF 1F.2
215 0146: BCF 1F.3
216 0147: MOVLW 07
217 0148: MOVWF 1C
221 svejda 218 ....................
219 .................... int slovo,pismeno,sloupec,j;
220 ....................
221 ....................
237 kaklik 222 .................... const int8 pis[33*5]={0b00000001,0b11110110,0b11110110,0b11110110,0b00000001, //A
223 .................... 0b00000000,0b01110110,0b01110110,0b01110110,0b10001001, //B
224 .................... 0b10000001,0b01111110,0b01111110,0b01111110,0b10111101, //C
225 .................... 0b00000000,0b01111110,0b01111110,0b01111110,0b10000001, //D
226 .................... 0b00000000,0b01110110,0b01110110,0b01111110,0b01111110, //E
227 .................... 0b00000000,0b11110110,0b11110110,0b11111110,0b11111110, //F
228 .................... 0b10000001,0b01111110,0b01110110,0b01110110,0b10000101, //G
229 .................... 0b00000000,0b11110111,0b11110111,0b11110111,0b00000000, //H
230 .................... 0b01111110,0b01111110,0b00000000,0b01111110,0b01111110, //I
231 .................... 0b10111110,0b01111110,0b01111110,0b01111110,0b10000000, //J
232 .................... 0b00000000,0b11110111,0b11110111,0b11101011,0b00011100, //K
233 .................... 0b00000000,0b01111111,0b01111111,0b01111111,0b01111111, //L
234 .................... 0b00000000,0b11111110,0b11110000,0b11111110,0b00000000, //M
235 .................... 0b00000000,0b11101111,0b11011111,0b10111111,0b00000000, //N
236 .................... 0b10000001,0b01111110,0b01111110,0b01111110,0b10000001, //O
237 .................... 0b00000000,0b11110110,0b11110110,0b11110110,0b11111001, //P
238 .................... 0b10000001,0b01111110,0b01111110,0b01111110,0b00000001, //Q
239 .................... 0b00000000,0b11110110,0b11110110,0b11110110,0b00001001, //R
240 .................... 0b10111001,0b01110110,0b01110110,0b01110110,0b10001101, //S
241 .................... 0b11111110,0b11111110,0b00000000,0b11111110,0b11111110, //T
242 .................... 0b10000000,0b01111111,0b01111111,0b01111111,0b10000000, //U
243 .................... 0b11000000,0b10111111,0b01111111,0b10111111,0b11000000, //V
244 .................... 0b10000000,0b01111111,0b10000000,0b01111111,0b10000000, //W
245 .................... 0b00011100,0b11101011,0b11110111,0b11101011,0b00011100, //X
246 .................... 0b11111000,0b11110111,0b00000111,0b11110111,0b11111000, //Y
247 .................... 0b00011110,0b01101110,0b01110110,0b01111010,0b01111100, //Z
248 .................... 0b11111111,0b11111111,0b11111111,0b11111111,0b11111111, //mezera
249 .................... 0b00010111,0b00110011,0b01010101,0b11100110,0b11110111, //blesk
250 .................... 0b11110000,0b11110111,0b11110111,0b00000001,0b11110111, //4
251 .................... 0b00111101,0b01011110,0b01101110,0b01110110,0b01111001, //2
252 .................... 0b00000000,0b01111110,0b01111110,0b01111110,0b00000000, //0
253 .................... 0b11110111,0b11110111,0b11110111,0b11110111,0b11110111, //pomlka
254 .................... 0b10001001,0b01110110,0b01110110,0b01110110,0b10001001, //8
255 .................... };
221 svejda 256 ....................
237 kaklik 257 .................... setup_adc_ports(AN0);
221 svejda 258 *
237 kaklik 259 0170: BSF 03.5
260 0171: BCF 1F.0
261 0172: BSF 1F.1
262 0173: BSF 1F.2
263 0174: BSF 1F.3
264 .................... setup_adc(ADC_CLOCK_INTERNAL);
265 0175: BCF 1F.6
266 0176: BCF 03.5
267 0177: BSF 1F.6
268 0178: BSF 1F.7
269 0179: BSF 03.5
270 017A: BCF 1F.7
271 017B: BCF 03.5
272 017C: BSF 1F.0
221 svejda 273 .................... setup_psp(PSP_DISABLED);
237 kaklik 274 017D: BSF 03.5
275 017E: BCF 09.4
221 svejda 276 .................... setup_spi(SPI_SS_DISABLED);
277 *
237 kaklik 278 016E: MOVLW FF
279 016F: MOVWF 3D
221 svejda 280 *
237 kaklik 281 017F: BCF 03.5
282 0180: BCF 14.5
283 0181: BCF 3D.5
284 0182: MOVF 3D,W
285 0183: BSF 03.5
286 0184: MOVWF 07
287 0185: BCF 03.5
288 0186: BSF 3D.4
289 0187: MOVF 3D,W
290 0188: BSF 03.5
291 0189: MOVWF 07
292 018A: BCF 03.5
293 018B: BCF 3D.3
294 018C: MOVF 3D,W
295 018D: BSF 03.5
296 018E: MOVWF 07
297 018F: MOVLW 01
298 0190: BCF 03.5
299 0191: MOVWF 14
300 0192: MOVLW 00
301 0193: BSF 03.5
302 0194: MOVWF 14
221 svejda 303 .................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
237 kaklik 304 0195: MOVF 01,W
305 0196: ANDLW C7
306 0197: IORLW 08
307 0198: MOVWF 01
221 svejda 308 .................... setup_wdt(WDT_2304MS);
237 kaklik 309 0199: MOVLW 0F
310 019A: MOVWF 77
311 019B: MOVLW 07
312 019C: BCF 03.5
313 019D: CLRF 01
314 019E: MOVLW 81
315 019F: MOVWF 04
316 01A0: BCF 03.7
317 01A1: MOVF 00,W
318 01A2: ANDLW F0
319 01A3: IORLW 07
320 01A4: MOVWF 00
321 01A5: CLRWDT
322 01A6: MOVF 00,W
323 01A7: ANDLW F7
324 01A8: BTFSC 77.3
325 01A9: ANDLW F0
326 01AA: IORWF 77,W
327 01AB: MOVWF 00
221 svejda 328 .................... setup_timer_1(T1_DISABLED);
237 kaklik 329 01AC: CLRF 10
221 svejda 330 .................... setup_timer_2(T2_DISABLED,0,1);
237 kaklik 331 01AD: MOVLW 00
332 01AE: MOVWF 78
333 01AF: MOVWF 12
334 01B0: MOVLW 00
335 01B1: BSF 03.5
336 01B2: MOVWF 12
221 svejda 337 .................... setup_comparator(NC_NC_NC_NC);
237 kaklik 338 01B3: MOVLW 07
339 01B4: MOVWF 1C
340 01B5: MOVF 05,W
341 01B6: CLRWDT
342 01B7: MOVLW 02
343 01B8: MOVWF 77
344 01B9: DECFSZ 77,F
345 01BA: GOTO 1B9
346 01BB: GOTO 1BC
347 01BC: MOVF 1C,W
348 01BD: BCF 03.5
349 01BE: BCF 0D.6
221 svejda 350 .................... setup_vref(FALSE);
237 kaklik 351 01BF: BSF 03.5
352 01C0: CLRF 1D
221 svejda 353 ....................
354 .................... enable_interrupts(INT_RDA);
237 kaklik 355 01C1: BSF 0C.5
221 svejda 356 .................... enable_interrupts(GLOBAL);
237 kaklik 357 01C2: MOVLW C0
358 01C3: BCF 03.5
359 01C4: IORWF 0B,F
221 svejda 360 ....................
237 kaklik 361 .................... set_adc_channel(0); // Prevodnik pro Hall
362 01C5: MOVLW 00
363 01C6: MOVWF 78
364 01C7: MOVF 1F,W
365 01C8: ANDLW C7
366 01C9: IORWF 78,W
367 01CA: MOVWF 1F
368 .................... output_B(0xFF); // Zhasneme
369 01CB: BSF 03.5
370 01CC: CLRF 06
371 01CD: MOVLW FF
372 01CE: BCF 03.5
373 01CF: MOVWF 06
221 svejda 374 ....................
237 kaklik 375 .................... otacky=0;
376 01D0: CLRF 3C
377 ....................
221 svejda 378 .................... while(TRUE)
379 .................... {
380 .................... for(slovo=0;slovo<2;slovo++)
237 kaklik 381 01D1: CLRF 3E
382 01D2: MOVF 3E,W
383 01D3: SUBLW 01
384 01D4: BTFSS 03.0
385 01D5: GOTO 227
386 .................... for(j=0;j<=20;j++) // Jedno slovo se zobrazi stokrat
387 01D6: CLRF 41
388 01D7: MOVF 41,W
389 01D8: SUBLW 14
390 01D9: BTFSS 03.0
391 01DA: GOTO 225
221 svejda 392 .................... {
237 kaklik 393 .................... while(read_adc()<9); // Cekani na magnet
394 01DB: BSF 1F.2
395 01DC: BTFSC 1F.2
396 01DD: GOTO 1DC
397 01DE: MOVF 1E,W
398 01DF: SUBLW 08
399 01E0: BTFSC 03.0
400 01E1: GOTO 1DB
401 .................... delay_ms(10);
402 01E2: MOVLW 0A
403 01E3: MOVWF 42
404 01E4: GOTO 0F7
221 svejda 405 ....................
406 .................... for(pismeno=0;pismeno<MAX_SLOVO;pismeno++)
237 kaklik 407 01E5: CLRF 3F
408 01E6: MOVF 3F,W
409 01E7: SUBLW 09
410 01E8: BTFSS 03.0
411 01E9: GOTO 21C
221 svejda 412 .................... {
413 .................... for(sloupec=0;sloupec<5;sloupec++)
237 kaklik 414 01EA: CLRF 40
415 01EB: MOVF 40,W
416 01EC: SUBLW 04
417 01ED: BTFSS 03.0
418 01EE: GOTO 210
221 svejda 419 .................... {
237 kaklik 420 .................... output_B(pis[(napis[slovo*MAX_SLOVO+pismeno]-0x41)*5+sloupec]);
421 01EF: MOVF 3E,W
422 01F0: MOVWF 47
423 01F1: MOVLW 0A
424 01F2: MOVWF 48
425 01F3: CALL 111
426 01F4: MOVF 3F,W
427 01F5: ADDWF 78,W
428 01F6: ADDLW 28
429 01F7: MOVWF 04
430 01F8: BCF 03.7
431 01F9: MOVLW 41
432 01FA: SUBWF 00,W
433 01FB: MOVWF 46
434 01FC: MOVWF 47
435 01FD: MOVLW 05
436 01FE: MOVWF 48
437 01FF: CALL 111
438 0200: MOVF 40,W
439 0201: ADDWF 78,W
440 0202: CALL 035
441 0203: MOVWF 49
442 0204: BSF 03.5
443 0205: CLRF 06
444 0206: BCF 03.5
445 0207: MOVF 49,W
446 0208: MOVWF 06
447 .................... delay_us(500);
448 0209: CLRWDT
449 020A: MOVLW A6
450 020B: MOVWF 77
451 020C: DECFSZ 77,F
452 020D: GOTO 20C
221 svejda 453 .................... }
237 kaklik 454 020E: INCF 40,F
455 020F: GOTO 1EB
456 .................... output_B(0xFF);
457 0210: BSF 03.5
458 0211: CLRF 06
459 0212: MOVLW FF
460 0213: BCF 03.5
461 0214: MOVWF 06
462 .................... delay_us(500);
463 0215: CLRWDT
464 0216: MOVLW A6
465 0217: MOVWF 77
466 0218: DECFSZ 77,F
467 0219: GOTO 218
221 svejda 468 .................... }
237 kaklik 469 021A: INCF 3F,F
470 021B: GOTO 1E6
471 .................... if (otacky++>120) reset_cpu();
472 021C: MOVF 3C,W
473 021D: INCF 3C,F
474 021E: SUBLW 78
475 021F: BTFSC 03.0
476 0220: GOTO 223
477 0221: CLRF 0A
478 0222: GOTO 000
221 svejda 479 .................... }
237 kaklik 480 0223: INCF 41,F
481 0224: GOTO 1D7
482 0225: INCF 3E,F
483 0226: GOTO 1D2
221 svejda 484 .................... }
237 kaklik 485 0227: GOTO 1D1
221 svejda 486 .................... }
237 kaklik 487 0228: SLEEP
221 svejda 488  
489 Configuration Fuses:
237 kaklik 490 Word 1: 3F3D XT WDT NOPUT NODEBUG NOPROTECT NOBROWNOUT NOLVP NOCPD NOWRT