221 |
svejda |
1 |
CCS PCM C Compiler, Version 4.058s, 42064 03-V-08 12:38 |
|
|
2 |
|
|
|
3 |
Filename: C:\RS\Prog\infra\infra.lst |
|
|
4 |
|
|
|
5 |
ROM used: 470 words (6%) |
|
|
6 |
Largest free fragment is 2048 |
|
|
7 |
RAM used: 47 (13%) at main() level |
|
|
8 |
50 (14%) worst case |
|
|
9 |
Stack: 2 worst case (1 in main + 1 for interrupts) |
|
|
10 |
|
|
|
11 |
* |
|
|
12 |
0000: MOVLW 00 |
|
|
13 |
0001: MOVWF 0A |
|
|
14 |
0002: GOTO 111 |
|
|
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 |
|
|
64 |
0034: GOTO 0BB |
|
|
65 |
.................... #include "C:\RS\Prog\infra\infra.h" |
|
|
66 |
.................... #include <16F877A.h> |
|
|
67 |
.................... //////// Standard Header file for the PIC16F877A device //////////////// |
|
|
68 |
.................... #device PIC16F877A |
|
|
69 |
.................... #list |
|
|
70 |
.................... |
|
|
71 |
.................... #device adc=8 |
|
|
72 |
.................... |
|
|
73 |
.................... #FUSES NOWDT //No Watch Dog Timer |
|
|
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) |
|
|
84 |
00F9: MOVLW 41 |
|
|
85 |
00FA: MOVWF 04 |
|
|
86 |
00FB: BCF 03.7 |
|
|
87 |
00FC: MOVF 00,W |
|
|
88 |
00FD: BTFSC 03.2 |
|
|
89 |
00FE: GOTO 110 |
|
|
90 |
00FF: MOVLW 01 |
|
|
91 |
0100: MOVWF 78 |
|
|
92 |
0101: MOVLW BF |
|
|
93 |
0102: MOVWF 77 |
|
|
94 |
0103: CLRWDT |
|
|
95 |
0104: DECFSZ 77,F |
|
|
96 |
0105: GOTO 103 |
|
|
97 |
0106: DECFSZ 78,F |
|
|
98 |
0107: GOTO 101 |
|
|
99 |
0108: MOVLW 4A |
|
|
100 |
0109: MOVWF 77 |
|
|
101 |
010A: DECFSZ 77,F |
|
|
102 |
010B: GOTO 10A |
|
|
103 |
010C: NOP |
|
|
104 |
010D: CLRWDT |
|
|
105 |
010E: DECFSZ 00,F |
|
|
106 |
010F: GOTO 0FF |
|
|
107 |
0110: RETLW 00 |
|
|
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 |
.................... |
|
|
114 |
.................... int8 napis[2*MAX_SLOVO] ={'A','A','A','A','A','A','A','A','A','A','A','A','A','A','A','A','A','A','A','A'}; |
|
|
115 |
* |
|
|
116 |
0124: MOVLW 41 |
|
|
117 |
0125: BCF 03.5 |
|
|
118 |
0126: MOVWF 28 |
|
|
119 |
0127: MOVWF 29 |
|
|
120 |
0128: MOVWF 2A |
|
|
121 |
0129: MOVWF 2B |
|
|
122 |
012A: MOVWF 2C |
|
|
123 |
012B: MOVWF 2D |
|
|
124 |
012C: MOVWF 2E |
|
|
125 |
012D: MOVWF 2F |
|
|
126 |
012E: MOVWF 30 |
|
|
127 |
012F: MOVWF 31 |
|
|
128 |
0130: MOVWF 32 |
|
|
129 |
0131: MOVWF 33 |
|
|
130 |
0132: MOVWF 34 |
|
|
131 |
0133: MOVWF 35 |
|
|
132 |
0134: MOVWF 36 |
|
|
133 |
0135: MOVWF 37 |
|
|
134 |
0136: MOVWF 38 |
|
|
135 |
0137: MOVWF 39 |
|
|
136 |
0138: MOVWF 3A |
|
|
137 |
0139: MOVWF 3B |
|
|
138 |
.................... |
|
|
139 |
.................... #int_RDA |
|
|
140 |
.................... void RDA_isr(void) |
|
|
141 |
.................... { |
|
|
142 |
.................... int n; |
|
|
143 |
.................... output_B(0x55); |
|
|
144 |
* |
|
|
145 |
00BB: BSF 03.5 |
|
|
146 |
00BC: CLRF 06 |
|
|
147 |
00BD: MOVLW 55 |
|
|
148 |
00BE: BCF 03.5 |
|
|
149 |
00BF: MOVWF 06 |
|
|
150 |
.................... for(n=0;n<(MAX_SLOVO*2);n++) |
|
|
151 |
00C0: CLRF 49 |
|
|
152 |
00C1: MOVF 49,W |
|
|
153 |
00C2: SUBLW 13 |
|
|
154 |
00C3: BTFSS 03.0 |
|
|
155 |
00C4: GOTO 0D0 |
|
|
156 |
.................... { |
|
|
157 |
.................... napis[n]=getc(); |
|
|
158 |
00C5: MOVLW 28 |
|
|
159 |
00C6: ADDWF 49,W |
|
|
160 |
00C7: MOVWF 04 |
|
|
161 |
00C8: BCF 03.7 |
|
|
162 |
00C9: BTFSS 0C.5 |
|
|
163 |
00CA: GOTO 0C9 |
|
|
164 |
00CB: MOVF 1A,W |
|
|
165 |
00CC: MOVWF 00 |
|
|
166 |
.................... restart_WDT(); |
|
|
167 |
00CD: CLRWDT |
|
|
168 |
.................... } |
|
|
169 |
00CE: INCF 49,F |
|
|
170 |
00CF: GOTO 0C1 |
|
|
171 |
.................... } |
|
|
172 |
.................... |
|
|
173 |
00D0: BCF 0C.5 |
|
|
174 |
00D1: BCF 0A.3 |
|
|
175 |
00D2: BCF 0A.4 |
|
|
176 |
00D3: GOTO 01F |
|
|
177 |
.................... void main() |
|
|
178 |
.................... { |
|
|
179 |
* |
|
|
180 |
0111: CLRF 04 |
|
|
181 |
0112: BCF 03.7 |
|
|
182 |
0113: MOVLW 1F |
|
|
183 |
0114: ANDWF 03,F |
|
|
184 |
0115: MOVLW 67 |
|
|
185 |
0116: BSF 03.5 |
|
|
186 |
0117: MOVWF 19 |
|
|
187 |
0118: MOVLW A2 |
|
|
188 |
0119: MOVWF 18 |
|
|
189 |
011A: MOVLW 90 |
|
|
190 |
011B: BCF 03.5 |
|
|
191 |
011C: MOVWF 18 |
|
|
192 |
011D: BSF 03.5 |
|
|
193 |
011E: BSF 1F.0 |
|
|
194 |
011F: BSF 1F.1 |
|
|
195 |
0120: BSF 1F.2 |
|
|
196 |
0121: BCF 1F.3 |
|
|
197 |
0122: MOVLW 07 |
|
|
198 |
0123: MOVWF 1C |
|
|
199 |
.................... |
|
|
200 |
.................... int slovo,pismeno,sloupec,j; |
|
|
201 |
.................... |
|
|
202 |
.................... |
|
|
203 |
.................... const int8 pis[26*5]={0b00000001,0b11110110,0b11110110,0b11110110,0b00000001, |
|
|
204 |
.................... 0b00000001,0b11110110,0b11110110,0b11110110,0b00000001, |
|
|
205 |
.................... 0b10000001,0b01111110,0b01111110,0b01111110,0b10111101, |
|
|
206 |
.................... 0b00000000,0b01111110,0b01111110,0b01111110,0b10000001, |
|
|
207 |
.................... 0b00000000,0b01110110,0b01110110,0b01111110,0b01111110, |
|
|
208 |
.................... 0b00000000,0b11110110,0b11110110,0b11111110,0b11111110, |
|
|
209 |
.................... 0b10000001,0b01111110,0b01110110,0b01110110,0b10000101, |
|
|
210 |
.................... 0b00000000,0b11110111,0b11110111,0b11110111,0b00000000, |
|
|
211 |
.................... 0b01111110,0b01111110,0b00000000,0b01111110,0b01111110, |
|
|
212 |
.................... 0b10111110,0b01111110,0b01111110,0b01111110,0b10000000, |
|
|
213 |
.................... 0b00000000,0b11110111,0b11110111,0b11101011,0b00011100, |
|
|
214 |
.................... 0b00000000,0b01111111,0b01111111,0b01111111,0b01111111, |
|
|
215 |
.................... 0b00000000,0b11111110,0b11110000,0b11111110,0b00000000, |
|
|
216 |
.................... 0b00000000,0b11101111,0b11011111,0b10111111,0b00000000, |
|
|
217 |
.................... 0b10000001,0b01111110,0b01111110,0b01111110,0b10000001, |
|
|
218 |
.................... 0b00000000,0b11110110,0b11110110,0b11110110,0b11111001, |
|
|
219 |
.................... 0b10000001,0b01111110,0b01111110,0b01111110,0b00000001, |
|
|
220 |
.................... 0b00000000,0b11110110,0b11110110,0b11110110,0b00001001, |
|
|
221 |
.................... 0b10111001,0b01110110,0b01110110,0b01110110,0b10001101, |
|
|
222 |
.................... 0b11111110,0b11111110,0b00000000,0b11111110,0b11111110, |
|
|
223 |
.................... 0b10000000,0b01111111,0b01111111,0b01111111,0b10000000, |
|
|
224 |
.................... 0b11000000,0b10111111,0b01111111,0b10111111,0b11000000, |
|
|
225 |
.................... 0b10000000,0b01111111,0b10000000,0b01111111,0b10000000, |
|
|
226 |
.................... 0b00011100,0b11101011,0b11110111,0b11101011,0b00011100, |
|
|
227 |
.................... 0b11111000,0b11110111,0b00000111,0b11110111,0b11111000, |
|
|
228 |
.................... 0b00011110,0b01101110,0b01110110,0b01111010,0b01111100}; |
|
|
229 |
.................... |
|
|
230 |
.................... setup_adc_ports(NO_ANALOGS); |
|
|
231 |
* |
|
|
232 |
013C: BSF 03.5 |
|
|
233 |
013D: BSF 1F.0 |
|
|
234 |
013E: BSF 1F.1 |
|
|
235 |
013F: BSF 1F.2 |
|
|
236 |
0140: BCF 1F.3 |
|
|
237 |
.................... setup_adc(ADC_OFF); |
|
|
238 |
0141: BCF 03.5 |
|
|
239 |
0142: BCF 1F.0 |
|
|
240 |
.................... setup_psp(PSP_DISABLED); |
|
|
241 |
0143: BSF 03.5 |
|
|
242 |
0144: BCF 09.4 |
|
|
243 |
.................... setup_spi(SPI_SS_DISABLED); |
|
|
244 |
* |
|
|
245 |
013A: MOVLW FF |
|
|
246 |
013B: MOVWF 3C |
|
|
247 |
* |
|
|
248 |
0145: BCF 03.5 |
|
|
249 |
0146: BCF 14.5 |
|
|
250 |
0147: BCF 3C.5 |
|
|
251 |
0148: MOVF 3C,W |
|
|
252 |
0149: BSF 03.5 |
|
|
253 |
014A: MOVWF 07 |
|
|
254 |
014B: BCF 03.5 |
|
|
255 |
014C: BSF 3C.4 |
|
|
256 |
014D: MOVF 3C,W |
|
|
257 |
014E: BSF 03.5 |
|
|
258 |
014F: MOVWF 07 |
|
|
259 |
0150: BCF 03.5 |
|
|
260 |
0151: BCF 3C.3 |
|
|
261 |
0152: MOVF 3C,W |
|
|
262 |
0153: BSF 03.5 |
|
|
263 |
0154: MOVWF 07 |
|
|
264 |
0155: MOVLW 01 |
|
|
265 |
0156: BCF 03.5 |
|
|
266 |
0157: MOVWF 14 |
|
|
267 |
0158: MOVLW 00 |
|
|
268 |
0159: BSF 03.5 |
|
|
269 |
015A: MOVWF 14 |
|
|
270 |
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
|
|
271 |
015B: MOVF 01,W |
|
|
272 |
015C: ANDLW C7 |
|
|
273 |
015D: IORLW 08 |
|
|
274 |
015E: MOVWF 01 |
|
|
275 |
.................... setup_wdt(WDT_2304MS); |
|
|
276 |
015F: MOVLW 0F |
|
|
277 |
0160: MOVWF 77 |
|
|
278 |
0161: MOVLW 07 |
|
|
279 |
0162: BCF 03.5 |
|
|
280 |
0163: CLRF 01 |
|
|
281 |
0164: MOVLW 81 |
|
|
282 |
0165: MOVWF 04 |
|
|
283 |
0166: BCF 03.7 |
|
|
284 |
0167: MOVF 00,W |
|
|
285 |
0168: ANDLW F0 |
|
|
286 |
0169: IORLW 07 |
|
|
287 |
016A: MOVWF 00 |
|
|
288 |
016B: CLRWDT |
|
|
289 |
016C: MOVF 00,W |
|
|
290 |
016D: ANDLW F7 |
|
|
291 |
016E: BTFSC 77.3 |
|
|
292 |
016F: ANDLW F0 |
|
|
293 |
0170: IORWF 77,W |
|
|
294 |
0171: MOVWF 00 |
|
|
295 |
.................... setup_timer_1(T1_DISABLED); |
|
|
296 |
0172: CLRF 10 |
|
|
297 |
.................... setup_timer_2(T2_DISABLED,0,1); |
|
|
298 |
0173: MOVLW 00 |
|
|
299 |
0174: MOVWF 78 |
|
|
300 |
0175: MOVWF 12 |
|
|
301 |
0176: MOVLW 00 |
|
|
302 |
0177: BSF 03.5 |
|
|
303 |
0178: MOVWF 12 |
|
|
304 |
.................... setup_comparator(NC_NC_NC_NC); |
|
|
305 |
0179: MOVLW 07 |
|
|
306 |
017A: MOVWF 1C |
|
|
307 |
017B: MOVF 05,W |
|
|
308 |
017C: CLRWDT |
|
|
309 |
017D: MOVLW 02 |
|
|
310 |
017E: MOVWF 77 |
|
|
311 |
017F: DECFSZ 77,F |
|
|
312 |
0180: GOTO 17F |
|
|
313 |
0181: GOTO 182 |
|
|
314 |
0182: MOVF 1C,W |
|
|
315 |
0183: BCF 03.5 |
|
|
316 |
0184: BCF 0D.6 |
|
|
317 |
.................... setup_vref(FALSE); |
|
|
318 |
0185: BSF 03.5 |
|
|
319 |
0186: CLRF 1D |
|
|
320 |
.................... |
|
|
321 |
.................... enable_interrupts(INT_RDA); |
|
|
322 |
0187: BSF 0C.5 |
|
|
323 |
.................... enable_interrupts(GLOBAL); |
|
|
324 |
0188: MOVLW C0 |
|
|
325 |
0189: BCF 03.5 |
|
|
326 |
018A: IORWF 0B,F |
|
|
327 |
.................... |
|
|
328 |
.................... set_adc_channel(0); |
|
|
329 |
018B: MOVLW 00 |
|
|
330 |
018C: MOVWF 78 |
|
|
331 |
018D: MOVF 1F,W |
|
|
332 |
018E: ANDLW C7 |
|
|
333 |
018F: IORWF 78,W |
|
|
334 |
0190: MOVWF 1F |
|
|
335 |
.................... |
|
|
336 |
.................... while(TRUE) |
|
|
337 |
.................... { |
|
|
338 |
.................... for(slovo=0;slovo<2;slovo++) |
|
|
339 |
0191: CLRF 3D |
|
|
340 |
0192: MOVF 3D,W |
|
|
341 |
0193: SUBLW 01 |
|
|
342 |
0194: BTFSS 03.0 |
|
|
343 |
0195: GOTO 1D4 |
|
|
344 |
.................... for(j=0;j<=100;j++) // Jedno slovo se zobrazi stokrat |
|
|
345 |
0196: CLRF 40 |
|
|
346 |
0197: MOVF 40,W |
|
|
347 |
0198: SUBLW 64 |
|
|
348 |
0199: BTFSS 03.0 |
|
|
349 |
019A: GOTO 1D2 |
|
|
350 |
.................... { |
|
|
351 |
.................... while(read_adc()<10); // Cekani na magnet |
|
|
352 |
019B: BSF 1F.2 |
|
|
353 |
019C: BTFSC 1F.2 |
|
|
354 |
019D: GOTO 19C |
|
|
355 |
019E: MOVF 1E,W |
|
|
356 |
019F: SUBLW 09 |
|
|
357 |
01A0: BTFSC 03.0 |
|
|
358 |
01A1: GOTO 19B |
|
|
359 |
.................... |
|
|
360 |
.................... for(pismeno=0;pismeno<MAX_SLOVO;pismeno++) |
|
|
361 |
01A2: CLRF 3E |
|
|
362 |
01A3: MOVF 3E,W |
|
|
363 |
01A4: SUBLW 09 |
|
|
364 |
01A5: BTFSS 03.0 |
|
|
365 |
01A6: GOTO 1D0 |
|
|
366 |
.................... { |
|
|
367 |
.................... for(sloupec=0;sloupec<5;sloupec++) |
|
|
368 |
01A7: CLRF 3F |
|
|
369 |
01A8: MOVF 3F,W |
|
|
370 |
01A9: SUBLW 04 |
|
|
371 |
01AA: BTFSS 03.0 |
|
|
372 |
01AB: GOTO 1CB |
|
|
373 |
.................... { |
|
|
374 |
.................... output_B(pis[(napis[slovo*MAX_SLOVO+pismeno]-0x40)*5+sloupec]); |
|
|
375 |
01AC: MOVF 3D,W |
|
|
376 |
01AD: MOVWF 46 |
|
|
377 |
01AE: MOVLW 0A |
|
|
378 |
01AF: MOVWF 47 |
|
|
379 |
01B0: CALL 0D4 |
|
|
380 |
01B1: MOVF 3E,W |
|
|
381 |
01B2: ADDWF 78,W |
|
|
382 |
01B3: ADDLW 28 |
|
|
383 |
01B4: MOVWF 04 |
|
|
384 |
01B5: BCF 03.7 |
|
|
385 |
01B6: MOVLW 40 |
|
|
386 |
01B7: SUBWF 00,W |
|
|
387 |
01B8: MOVWF 45 |
|
|
388 |
01B9: MOVWF 46 |
|
|
389 |
01BA: MOVLW 05 |
|
|
390 |
01BB: MOVWF 47 |
|
|
391 |
01BC: CALL 0D4 |
|
|
392 |
01BD: MOVF 3F,W |
|
|
393 |
01BE: ADDWF 78,W |
|
|
394 |
01BF: CALL 035 |
|
|
395 |
01C0: MOVWF 48 |
|
|
396 |
01C1: BSF 03.5 |
|
|
397 |
01C2: CLRF 06 |
|
|
398 |
01C3: BCF 03.5 |
|
|
399 |
01C4: MOVF 48,W |
|
|
400 |
01C5: MOVWF 06 |
|
|
401 |
.................... delay_ms(1); |
|
|
402 |
01C6: MOVLW 01 |
|
|
403 |
01C7: MOVWF 41 |
|
|
404 |
01C8: CALL 0F9 |
|
|
405 |
.................... } |
|
|
406 |
01C9: INCF 3F,F |
|
|
407 |
01CA: GOTO 1A8 |
|
|
408 |
.................... delay_ms(2); |
|
|
409 |
01CB: MOVLW 02 |
|
|
410 |
01CC: MOVWF 41 |
|
|
411 |
01CD: CALL 0F9 |
|
|
412 |
.................... } |
|
|
413 |
01CE: INCF 3E,F |
|
|
414 |
01CF: GOTO 1A3 |
|
|
415 |
.................... } |
|
|
416 |
01D0: INCF 40,F |
|
|
417 |
01D1: GOTO 197 |
|
|
418 |
01D2: INCF 3D,F |
|
|
419 |
01D3: GOTO 192 |
|
|
420 |
.................... } |
|
|
421 |
01D4: GOTO 191 |
|
|
422 |
.................... } |
|
|
423 |
01D5: SLEEP |
|
|
424 |
|
|
|
425 |
Configuration Fuses: |
|
|
426 |
Word 1: 3F39 XT NOWDT NOPUT NODEBUG NOPROTECT NOBROWNOUT NOLVP NOCPD NOWRT |