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