223 |
kapl |
1 |
CCS PCM C Compiler, Version 4.059d, 15399 04-V-07 12:10 |
|
|
2 |
|
|
|
3 |
Filename: main.lst |
|
|
4 |
|
|
|
5 |
ROM used: 1664 words (81%) |
|
|
6 |
Largest free fragment is 384 |
|
|
7 |
RAM used: 114 (31%) at main() level |
|
|
8 |
291 (79%) worst case |
|
|
9 |
Stack: 4 locations |
|
|
10 |
|
|
|
11 |
* |
|
|
12 |
0000: MOVLW 00 |
|
|
13 |
0001: MOVWF 0A |
|
|
14 |
0002: GOTO 25B |
|
|
15 |
0003: NOP |
|
|
16 |
.................... #include ".\main.h" |
|
|
17 |
.................... #include <16F877A.h> |
|
|
18 |
.................... //////// Standard Header file for the PIC16F877A device //////////////// |
|
|
19 |
.................... #device PIC16F877A |
|
|
20 |
.................... #list |
|
|
21 |
.................... |
|
|
22 |
.................... #device adc=8 |
|
|
23 |
.................... |
|
|
24 |
.................... #FUSES WDT //Watch Dog Timer |
|
|
25 |
.................... #FUSES XT //Crystal osc <= 4mhz |
|
|
26 |
.................... #FUSES NOPUT //No Power Up Timer |
|
|
27 |
.................... #FUSES NOPROTECT //Code not protected from reading |
|
|
28 |
.................... #FUSES NODEBUG //No Debug mode for ICD |
|
|
29 |
.................... #FUSES NOBROWNOUT //No brownout reset |
|
|
30 |
.................... #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O |
|
|
31 |
.................... #FUSES NOCPD //No EE protection |
|
|
32 |
.................... #FUSES NOWRT //Program memory not write protected |
|
|
33 |
.................... |
|
|
34 |
.................... #use delay(clock=4000000,RESTART_WDT) |
|
|
35 |
* |
|
|
36 |
0125: MOVLW 9A |
|
|
37 |
0126: MOVWF 04 |
|
|
38 |
0127: BSF 03.7 |
|
|
39 |
0128: MOVF 00,W |
|
|
40 |
0129: BTFSC 03.2 |
|
|
41 |
012A: GOTO 13C |
|
|
42 |
012B: MOVLW 01 |
|
|
43 |
012C: MOVWF 78 |
|
|
44 |
012D: MOVLW BF |
|
|
45 |
012E: MOVWF 77 |
|
|
46 |
012F: CLRWDT |
|
|
47 |
0130: DECFSZ 77,F |
|
|
48 |
0131: GOTO 12F |
|
|
49 |
0132: DECFSZ 78,F |
|
|
50 |
0133: GOTO 12D |
|
|
51 |
0134: MOVLW 4A |
|
|
52 |
0135: MOVWF 77 |
|
|
53 |
0136: DECFSZ 77,F |
|
|
54 |
0137: GOTO 136 |
|
|
55 |
0138: NOP |
|
|
56 |
0139: CLRWDT |
|
|
57 |
013A: DECFSZ 00,F |
|
|
58 |
013B: GOTO 12B |
|
|
59 |
013C: RETLW 00 |
|
|
60 |
.................... #use rs232(baud=19200,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8) |
|
|
61 |
.................... |
|
|
62 |
.................... |
|
|
63 |
.................... |
|
|
64 |
.................... #define LCD_RS PIN_B1 // rizeni registru LCD displeje |
|
|
65 |
.................... #define LCD_E PIN_B0 // enable LCD displeje |
|
|
66 |
.................... #define LCD_DATA_LSB PIN_C0 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou) |
|
|
67 |
.................... #define zar1 PIN_A3 |
|
|
68 |
.................... |
|
|
69 |
.................... #include "mylcd.c" |
|
|
70 |
.................... // LCD modul pro ovladani dvouradkoveho LCD modulu se standardnim Hitachi radicem |
|
|
71 |
.................... // (c)miho 2002 |
|
|
72 |
.................... // |
|
|
73 |
.................... // Historie: |
|
|
74 |
.................... // |
|
|
75 |
.................... // 0.0 Uvodni verze se snadnou definici portu LCD displeje |
|
|
76 |
.................... // |
|
|
77 |
.................... // |
|
|
78 |
.................... // Funkce: |
|
|
79 |
.................... // |
|
|
80 |
.................... // lcd_init() inicializuje LCD displej a porty, nutno volat jako prvni |
|
|
81 |
.................... // |
|
|
82 |
.................... // lcd_putc(c) zapis snaku do lcd displeje, zpracovava nasledujici ridici znaky |
|
|
83 |
.................... // \f = \x0C - nova stranka - smazani displeje |
|
|
84 |
.................... // \n = \x0A - odradkovani (prechod na druhou radku) |
|
|
85 |
.................... // \b = \x08 - backspace - posunuti kurzoru o 1 pozici zpet |
|
|
86 |
.................... // \r = \x0D - goto home to position 1,1 |
|
|
87 |
.................... // \0 .. \7 - definovatelne znaky v pozicich 0 az 7 v CGRAM |
|
|
88 |
.................... // \20 .. \27 - alternativne zapsane znaky (oktalove) v pozicich 0 az 7 CGRAM |
|
|
89 |
.................... // Pozor na to, ze funkce printf konci tisk pokud narazi na \0 (konec retezce) |
|
|
90 |
.................... // |
|
|
91 |
.................... // lcd_gotoxy(x,y) presune kurzor na uvedenou adresu |
|
|
92 |
.................... // nekontroluje parametry |
|
|
93 |
.................... // |
|
|
94 |
.................... // lcd_cursor_on zapne kurzor |
|
|
95 |
.................... // lcd_cursor_off vypne kurzor |
|
|
96 |
.................... // |
|
|
97 |
.................... // lcd_define_char(Index, Def) Makro, ktere definuje znaky od pozice Index obsahem definicniho |
|
|
98 |
.................... // retezce Def. Kazdych 8 znaku retezce Def definuje dalsi znak v CGRAM. |
|
|
99 |
.................... // Kapacita CGRAM je celkem 8 znaku s indexem 0 az 7. |
|
|
100 |
.................... // Na konci se provede lcd_gotoxy(1,1). |
|
|
101 |
.................... // Na konci teto knihovny je priklad pouziti definovanych znaku |
|
|
102 |
.................... // |
|
|
103 |
.................... // Definice portu: |
|
|
104 |
.................... // |
|
|
105 |
.................... // #DEFINE LCD_RS PIN_B2 // rizeni registru LCD displeje |
|
|
106 |
.................... // #DEFINE LCD_E PIN_B1 // enable LCD displeje |
|
|
107 |
.................... // #DEFINE LCD_DATA_LSB PIN_C2 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou) |
|
|
108 |
.................... |
|
|
109 |
.................... |
|
|
110 |
.................... |
|
|
111 |
.................... |
|
|
112 |
.................... // Privatni sekce, cist jen v pripade, ze neco nefunguje |
|
|
113 |
.................... |
|
|
114 |
.................... |
|
|
115 |
.................... |
|
|
116 |
.................... |
|
|
117 |
.................... // Generovane defince portu pro ucely teto knihovny aby kod generoval spravne IO operace a soucasne |
|
|
118 |
.................... // bylo mozne jednoduse deklarovat pripojene piny LCD displeje pri pouziti teto knihovny. Problem spociva |
|
|
119 |
.................... // v tom, ze se musi spravne ridit smery portu a soucasne datovy port zabira jen 4 bity ze zadaneho portu |
|
|
120 |
.................... // |
|
|
121 |
.................... #DEFINE LCD_SHIFT (LCD_DATA_LSB&7) // pocet bitu posuvu dataoveho kanalu v datovem portu |
|
|
122 |
.................... #DEFINE LCD_PORT (LCD_DATA_LSB>>3) // adresa LCD datoveho portu |
|
|
123 |
.................... #DEFINE LCD_TRIS (LCD_PORT+0x80) // adresa prislusneho TRIS registru |
|
|
124 |
.................... #DEFINE LCD_MASK (0xF<<LCD_SHIFT) // maska platnych bitu |
|
|
125 |
.................... // |
|
|
126 |
.................... #IF LCD_SHIFT>4 // kontrola mezi |
|
|
127 |
.................... #ERROR LCD data port LSB bit not in range 0..4 |
|
|
128 |
.................... #ENDIF |
|
|
129 |
.................... |
|
|
130 |
.................... |
|
|
131 |
.................... // Definice konstant pro LCD display |
|
|
132 |
.................... // |
|
|
133 |
.................... #define LCD_CURSOR_ON_ 0x0E // kurzor jako blikajici radka pod znakem |
|
|
134 |
.................... #define LCD_CURSOR_OFF_ 0x0C // zadny kurzor |
|
|
135 |
.................... #define LCD_LINE_2 0x40 // adresa 1. znaku 2. radky |
|
|
136 |
.................... |
|
|
137 |
.................... |
|
|
138 |
.................... // Definice rezimu LCD displeje |
|
|
139 |
.................... // |
|
|
140 |
.................... BYTE const LCD_INIT_STRING[4] = |
|
|
141 |
.................... { |
|
|
142 |
.................... 0x28, // intrfejs 4 bity, 2 radky, font 5x7 |
|
|
143 |
.................... LCD_CURSOR_OFF_, // display on, kurzor off, |
|
|
144 |
.................... 0x01, // clear displeje |
|
|
145 |
.................... 0x06 // inkrement pozice kurzoru (posun kurzoru doprava) |
|
|
146 |
.................... }; |
|
|
147 |
.................... |
|
|
148 |
.................... |
|
|
149 |
.................... // Odesle nibble do displeje (posle data a klikne signalem e) |
|
|
150 |
.................... // |
|
|
151 |
.................... void lcd_send_nibble( BYTE n ) |
|
|
152 |
.................... { |
|
|
153 |
.................... *LCD_PORT = (*LCD_PORT & ~LCD_MASK) | ((n << LCD_SHIFT) & LCD_MASK); // nastav datove bity portu a ostatni zachovej |
|
|
154 |
013D: MOVF 07,W |
|
|
155 |
013E: ANDLW F0 |
|
|
156 |
013F: BSF 03.5 |
|
|
157 |
0140: BSF 03.6 |
|
|
158 |
0141: MOVWF 21 |
|
|
159 |
0142: MOVF 20,W |
|
|
160 |
0143: ANDLW 0F |
|
|
161 |
0144: IORWF 21,W |
|
|
162 |
0145: BCF 03.5 |
|
|
163 |
0146: BCF 03.6 |
|
|
164 |
0147: MOVWF 07 |
|
|
165 |
.................... output_bit(LCD_E,1); // vzestupna hrana |
|
|
166 |
0148: BSF 06.0 |
|
|
167 |
0149: BSF 03.5 |
|
|
168 |
014A: BCF 06.0 |
|
|
169 |
.................... delay_us(100); // pockej alespon 450ns od e nebo alespon 195ns od dat |
|
|
170 |
014B: CLRWDT |
|
|
171 |
014C: MOVLW 20 |
|
|
172 |
014D: MOVWF 77 |
|
|
173 |
014E: DECFSZ 77,F |
|
|
174 |
014F: GOTO 14E |
|
|
175 |
0150: GOTO 151 |
|
|
176 |
.................... output_bit(LCD_E,0); // sestupna hrana (minimalni perioda e je 1us) |
|
|
177 |
0151: BCF 03.5 |
|
|
178 |
0152: BCF 06.0 |
|
|
179 |
0153: BSF 03.5 |
|
|
180 |
0154: BCF 06.0 |
|
|
181 |
.................... } |
|
|
182 |
0155: BCF 03.5 |
|
|
183 |
0156: RETLW 00 |
|
|
184 |
.................... |
|
|
185 |
.................... |
|
|
186 |
.................... // Odesle bajt do registru LCD |
|
|
187 |
.................... // |
|
|
188 |
.................... // Pokud je Adr=0 .. instrukcni registr |
|
|
189 |
.................... // Pokud je Adr=1 .. datovy registr |
|
|
190 |
.................... // |
|
|
191 |
.................... void lcd_send_byte( BOOLEAN Adr, BYTE n ) |
|
|
192 |
.................... { |
|
|
193 |
.................... output_bit(LCD_RS,Adr); // vyber registr |
|
|
194 |
0157: BSF 03.5 |
|
|
195 |
0158: BSF 03.6 |
|
|
196 |
0159: MOVF 1E,F |
|
|
197 |
015A: BTFSS 03.2 |
|
|
198 |
015B: GOTO 162 |
|
|
199 |
015C: BCF 03.5 |
|
|
200 |
015D: BCF 03.6 |
|
|
201 |
015E: BCF 06.1 |
|
|
202 |
015F: GOTO 165 |
|
|
203 |
0160: BSF 03.5 |
|
|
204 |
0161: BSF 03.6 |
|
|
205 |
0162: BCF 03.5 |
|
|
206 |
0163: BCF 03.6 |
|
|
207 |
0164: BSF 06.1 |
|
|
208 |
0165: BSF 03.5 |
|
|
209 |
0166: BCF 06.1 |
|
|
210 |
.................... swap(n); |
|
|
211 |
0167: BSF 03.6 |
|
|
212 |
0168: SWAPF 1F,F |
|
|
213 |
.................... lcd_send_nibble(n); // posli horni pulku bajtu |
|
|
214 |
0169: MOVF 1F,W |
|
|
215 |
016A: MOVWF 20 |
|
|
216 |
016B: BCF 03.5 |
|
|
217 |
016C: BCF 03.6 |
|
|
218 |
016D: CALL 13D |
|
|
219 |
.................... swap(n); |
|
|
220 |
016E: BSF 03.5 |
|
|
221 |
016F: BSF 03.6 |
|
|
222 |
0170: SWAPF 1F,F |
|
|
223 |
.................... lcd_send_nibble(n); // posli spodni pulku bajtu |
|
|
224 |
0171: MOVF 1F,W |
|
|
225 |
0172: MOVWF 20 |
|
|
226 |
0173: BCF 03.5 |
|
|
227 |
0174: BCF 03.6 |
|
|
228 |
0175: CALL 13D |
|
|
229 |
.................... delay_us(200); // minimalni doba na provedeni prikazu |
|
|
230 |
0176: CLRWDT |
|
|
231 |
0177: MOVLW 42 |
|
|
232 |
0178: MOVWF 77 |
|
|
233 |
0179: DECFSZ 77,F |
|
|
234 |
017A: GOTO 179 |
|
|
235 |
.................... } |
|
|
236 |
017B: RETLW 00 |
|
|
237 |
.................... |
|
|
238 |
.................... |
|
|
239 |
.................... // Provede inicializaci LCD displeje, smaze obsah a nastavi mod displeje |
|
|
240 |
.................... // |
|
|
241 |
.................... // Tato procedura se musi volat pred pouzitim ostatnich lcd_ procedur |
|
|
242 |
.................... // |
|
|
243 |
.................... void lcd_init() |
|
|
244 |
.................... { |
|
|
245 |
.................... |
|
|
246 |
.................... int i; // pocitadlo cyklu |
|
|
247 |
.................... |
|
|
248 |
.................... delay_ms(20); // spozdeni pro provedeni startu displeje po zapnuti napajeni |
|
|
249 |
017C: MOVLW 14 |
|
|
250 |
017D: BSF 03.5 |
|
|
251 |
017E: BSF 03.6 |
|
|
252 |
017F: MOVWF 1A |
|
|
253 |
0180: BCF 03.5 |
|
|
254 |
0181: BCF 03.6 |
|
|
255 |
0182: CALL 125 |
|
|
256 |
.................... |
|
|
257 |
.................... *LCD_TRIS = *LCD_TRIS & ~LCD_MASK; // nuluj odpovidajici bity tris registru datoveho portu LCD |
|
|
258 |
0183: MOVLW F0 |
|
|
259 |
0184: BSF 03.5 |
|
|
260 |
0185: ANDWF 07,F |
|
|
261 |
.................... |
|
|
262 |
.................... output_bit(LCD_RS,0); // nastav jako vystup a nastav klidovy stav |
|
|
263 |
0186: BCF 03.5 |
|
|
264 |
0187: BCF 06.1 |
|
|
265 |
0188: BSF 03.5 |
|
|
266 |
0189: BCF 06.1 |
|
|
267 |
.................... output_bit(LCD_E,0); // nastav jako vystup a nastav klidovy stav |
|
|
268 |
018A: BCF 03.5 |
|
|
269 |
018B: BCF 06.0 |
|
|
270 |
018C: BSF 03.5 |
|
|
271 |
018D: BCF 06.0 |
|
|
272 |
.................... |
|
|
273 |
.................... for (i=0; i<3; i++) // nastav lcd do rezimu 8 bitu sbernice |
|
|
274 |
018E: BSF 03.6 |
|
|
275 |
018F: CLRF 17 |
|
|
276 |
0190: MOVF 17,W |
|
|
277 |
0191: SUBLW 02 |
|
|
278 |
0192: BTFSS 03.0 |
|
|
279 |
0193: GOTO 1A4 |
|
|
280 |
.................... { |
|
|
281 |
.................... delay_ms(2); // muze byt rozdelany prenos dat (2x 4 bity) nebo pomaly povel |
|
|
282 |
0194: MOVLW 02 |
|
|
283 |
0195: MOVWF 1A |
|
|
284 |
0196: BCF 03.5 |
|
|
285 |
0197: BCF 03.6 |
|
|
286 |
0198: CALL 125 |
|
|
287 |
.................... lcd_send_nibble(3); // rezim 8 bitu |
|
|
288 |
0199: MOVLW 03 |
|
|
289 |
019A: BSF 03.5 |
|
|
290 |
019B: BSF 03.6 |
|
|
291 |
019C: MOVWF 20 |
|
|
292 |
019D: BCF 03.5 |
|
|
293 |
019E: BCF 03.6 |
|
|
294 |
019F: CALL 13D |
|
|
295 |
.................... } |
|
|
296 |
01A0: BSF 03.5 |
|
|
297 |
01A1: BSF 03.6 |
|
|
298 |
01A2: INCF 17,F |
|
|
299 |
01A3: GOTO 190 |
|
|
300 |
.................... |
|
|
301 |
.................... delay_us(40); // cas na zpracovani |
|
|
302 |
01A4: CLRWDT |
|
|
303 |
01A5: MOVLW 0C |
|
|
304 |
01A6: MOVWF 77 |
|
|
305 |
01A7: DECFSZ 77,F |
|
|
306 |
01A8: GOTO 1A7 |
|
|
307 |
01A9: GOTO 1AA |
|
|
308 |
.................... lcd_send_nibble(2); // nastav rezim 4 bitu (plati od nasledujiciho prenosu) |
|
|
309 |
01AA: MOVLW 02 |
|
|
310 |
01AB: MOVWF 20 |
|
|
311 |
01AC: BCF 03.5 |
|
|
312 |
01AD: BCF 03.6 |
|
|
313 |
01AE: CALL 13D |
|
|
314 |
.................... delay_us(40); // cas na zpracovani |
|
|
315 |
01AF: CLRWDT |
|
|
316 |
01B0: MOVLW 0C |
|
|
317 |
01B1: MOVWF 77 |
|
|
318 |
01B2: DECFSZ 77,F |
|
|
319 |
01B3: GOTO 1B2 |
|
|
320 |
01B4: GOTO 1B5 |
|
|
321 |
.................... |
|
|
322 |
.................... for (i=0;i<3;i++) // proved inicializaci (nastaveni modu, smazani apod) |
|
|
323 |
01B5: BSF 03.5 |
|
|
324 |
01B6: BSF 03.6 |
|
|
325 |
01B7: CLRF 17 |
|
|
326 |
01B8: MOVF 17,W |
|
|
327 |
01B9: SUBLW 02 |
|
|
328 |
01BA: BTFSS 03.0 |
|
|
329 |
01BB: GOTO 1D4 |
|
|
330 |
.................... { |
|
|
331 |
.................... lcd_send_byte(0,LCD_INIT_STRING[i]); |
|
|
332 |
01BC: MOVF 17,W |
|
|
333 |
01BD: BCF 03.5 |
|
|
334 |
01BE: BCF 03.6 |
|
|
335 |
01BF: CALL 004 |
|
|
336 |
01C0: BSF 03.5 |
|
|
337 |
01C1: BSF 03.6 |
|
|
338 |
01C2: MOVWF 18 |
|
|
339 |
01C3: CLRF 1E |
|
|
340 |
01C4: MOVF 18,W |
|
|
341 |
01C5: MOVWF 1F |
|
|
342 |
01C6: BCF 03.5 |
|
|
343 |
01C7: BCF 03.6 |
|
|
344 |
01C8: CALL 157 |
|
|
345 |
.................... delay_ms(2); |
|
|
346 |
01C9: MOVLW 02 |
|
|
347 |
01CA: BSF 03.5 |
|
|
348 |
01CB: BSF 03.6 |
|
|
349 |
01CC: MOVWF 1A |
|
|
350 |
01CD: BCF 03.5 |
|
|
351 |
01CE: BCF 03.6 |
|
|
352 |
01CF: CALL 125 |
|
|
353 |
.................... } |
|
|
354 |
01D0: BSF 03.5 |
|
|
355 |
01D1: BSF 03.6 |
|
|
356 |
01D2: INCF 17,F |
|
|
357 |
01D3: GOTO 1B8 |
|
|
358 |
.................... } |
|
|
359 |
01D4: BCF 03.5 |
|
|
360 |
01D5: BCF 03.6 |
|
|
361 |
01D6: GOTO 2BE (RETURN) |
|
|
362 |
.................... |
|
|
363 |
.................... |
|
|
364 |
.................... // Proved presun kurzoru |
|
|
365 |
.................... // |
|
|
366 |
.................... // Pozice 1.1 je domu |
|
|
367 |
.................... // |
|
|
368 |
.................... #separate |
|
|
369 |
.................... void lcd_gotoxy( BYTE x, BYTE y) |
|
|
370 |
.................... { |
|
|
371 |
.................... |
|
|
372 |
.................... BYTE Adr; |
|
|
373 |
.................... |
|
|
374 |
.................... switch(y) |
|
|
375 |
.................... { |
|
|
376 |
01D7: MOVLW 01 |
|
|
377 |
01D8: BSF 03.5 |
|
|
378 |
01D9: BSF 03.6 |
|
|
379 |
01DA: SUBWF 1B,W |
|
|
380 |
01DB: ADDLW FC |
|
|
381 |
01DC: BTFSC 03.0 |
|
|
382 |
01DD: GOTO 1F7 |
|
|
383 |
01DE: ADDLW 04 |
|
|
384 |
01DF: BCF 03.5 |
|
|
385 |
01E0: BCF 03.6 |
|
|
386 |
01E1: GOTO 204 |
|
|
387 |
.................... case 1: Adr=0; break; |
|
|
388 |
01E2: BSF 03.5 |
|
|
389 |
01E3: BSF 03.6 |
|
|
390 |
01E4: CLRF 1C |
|
|
391 |
01E5: GOTO 1F7 |
|
|
392 |
.................... case 2: Adr=0x40; break; |
|
|
393 |
01E6: MOVLW 40 |
|
|
394 |
01E7: BSF 03.5 |
|
|
395 |
01E8: BSF 03.6 |
|
|
396 |
01E9: MOVWF 1C |
|
|
397 |
01EA: GOTO 1F7 |
|
|
398 |
.................... case 3: Adr=0x14; break; |
|
|
399 |
01EB: MOVLW 14 |
|
|
400 |
01EC: BSF 03.5 |
|
|
401 |
01ED: BSF 03.6 |
|
|
402 |
01EE: MOVWF 1C |
|
|
403 |
01EF: GOTO 1F7 |
|
|
404 |
.................... case 4: Adr=0x54; break; |
|
|
405 |
01F0: MOVLW 54 |
|
|
406 |
01F1: BSF 03.5 |
|
|
407 |
01F2: BSF 03.6 |
|
|
408 |
01F3: MOVWF 1C |
|
|
409 |
01F4: GOTO 1F7 |
|
|
410 |
01F5: BSF 03.5 |
|
|
411 |
01F6: BSF 03.6 |
|
|
412 |
.................... } |
|
|
413 |
.................... Adr+=x-1; |
|
|
414 |
01F7: MOVLW 01 |
|
|
415 |
01F8: SUBWF 1A,W |
|
|
416 |
01F9: ADDWF 1C,F |
|
|
417 |
.................... |
|
|
418 |
.................... lcd_send_byte(0,0x80|Adr); |
|
|
419 |
01FA: MOVF 1C,W |
|
|
420 |
01FB: IORLW 80 |
|
|
421 |
01FC: MOVWF 1D |
|
|
422 |
01FD: CLRF 1E |
|
|
423 |
01FE: MOVF 1D,W |
|
|
424 |
01FF: MOVWF 1F |
|
|
425 |
0200: BCF 03.5 |
|
|
426 |
0201: BCF 03.6 |
|
|
427 |
0202: CALL 157 |
|
|
428 |
.................... } |
|
|
429 |
0203: RETLW 00 |
|
|
430 |
.................... |
|
|
431 |
.................... |
|
|
432 |
.................... // Zapis znaku na displej, zpracovani ridicich znaku |
|
|
433 |
.................... // |
|
|
434 |
.................... #separate |
|
|
435 |
.................... void lcd_putc( char c) |
|
|
436 |
.................... { |
|
|
437 |
.................... |
|
|
438 |
.................... switch (c) |
|
|
439 |
.................... { |
|
|
440 |
* |
|
|
441 |
020C: BSF 03.5 |
|
|
442 |
020D: BSF 03.6 |
|
|
443 |
020E: MOVF 19,W |
|
|
444 |
020F: XORLW 0C |
|
|
445 |
0210: BCF 03.5 |
|
|
446 |
0211: BCF 03.6 |
|
|
447 |
0212: BTFSC 03.2 |
|
|
448 |
0213: GOTO 21E |
|
|
449 |
0214: XORLW 06 |
|
|
450 |
0215: BTFSC 03.2 |
|
|
451 |
0216: GOTO 22E |
|
|
452 |
0217: XORLW 07 |
|
|
453 |
0218: BTFSC 03.2 |
|
|
454 |
0219: GOTO 238 |
|
|
455 |
021A: XORLW 05 |
|
|
456 |
021B: BTFSC 03.2 |
|
|
457 |
021C: GOTO 241 |
|
|
458 |
021D: GOTO 24A |
|
|
459 |
.................... case '\f' : lcd_send_byte(0,1); // smaz displej |
|
|
460 |
021E: BSF 03.5 |
|
|
461 |
021F: BSF 03.6 |
|
|
462 |
0220: CLRF 1E |
|
|
463 |
0221: MOVLW 01 |
|
|
464 |
0222: MOVWF 1F |
|
|
465 |
0223: BCF 03.5 |
|
|
466 |
0224: BCF 03.6 |
|
|
467 |
0225: CALL 157 |
|
|
468 |
.................... delay_ms(2); |
|
|
469 |
0226: MOVLW 02 |
|
|
470 |
0227: BSF 03.5 |
|
|
471 |
0228: BSF 03.6 |
|
|
472 |
0229: MOVWF 1A |
|
|
473 |
022A: BCF 03.5 |
|
|
474 |
022B: BCF 03.6 |
|
|
475 |
022C: CALL 125 |
|
|
476 |
.................... break; |
|
|
477 |
022D: GOTO 25A |
|
|
478 |
.................... case '\n' : lcd_gotoxy(1,2); break; // presun se na 1. znak 2. radky |
|
|
479 |
022E: MOVLW 01 |
|
|
480 |
022F: BSF 03.5 |
|
|
481 |
0230: BSF 03.6 |
|
|
482 |
0231: MOVWF 1A |
|
|
483 |
0232: MOVLW 02 |
|
|
484 |
0233: MOVWF 1B |
|
|
485 |
0234: BCF 03.5 |
|
|
486 |
0235: BCF 03.6 |
|
|
487 |
0236: CALL 1D7 |
|
|
488 |
0237: GOTO 25A |
|
|
489 |
.................... case '\r' : lcd_gotoxy(1,1); break; // presun home |
|
|
490 |
0238: MOVLW 01 |
|
|
491 |
0239: BSF 03.5 |
|
|
492 |
023A: BSF 03.6 |
|
|
493 |
023B: MOVWF 1A |
|
|
494 |
023C: MOVWF 1B |
|
|
495 |
023D: BCF 03.5 |
|
|
496 |
023E: BCF 03.6 |
|
|
497 |
023F: CALL 1D7 |
|
|
498 |
0240: GOTO 25A |
|
|
499 |
.................... case '\b' : lcd_send_byte(0,0x10); break; // posun kurzor o 1 zpet |
|
|
500 |
0241: BSF 03.5 |
|
|
501 |
0242: BSF 03.6 |
|
|
502 |
0243: CLRF 1E |
|
|
503 |
0244: MOVLW 10 |
|
|
504 |
0245: MOVWF 1F |
|
|
505 |
0246: BCF 03.5 |
|
|
506 |
0247: BCF 03.6 |
|
|
507 |
0248: CALL 157 |
|
|
508 |
0249: GOTO 25A |
|
|
509 |
.................... default : if (c<0x20) c&=0x7; // preklopeni definovatelnych znaku na rozsah 0 az 0x1F |
|
|
510 |
024A: BSF 03.5 |
|
|
511 |
024B: BSF 03.6 |
|
|
512 |
024C: MOVF 19,W |
|
|
513 |
024D: SUBLW 1F |
|
|
514 |
024E: BTFSS 03.0 |
|
|
515 |
024F: GOTO 252 |
|
|
516 |
0250: MOVLW 07 |
|
|
517 |
0251: ANDWF 19,F |
|
|
518 |
.................... lcd_send_byte(1,c); break; // zapis znak |
|
|
519 |
0252: MOVLW 01 |
|
|
520 |
0253: MOVWF 1E |
|
|
521 |
0254: MOVF 19,W |
|
|
522 |
0255: MOVWF 1F |
|
|
523 |
0256: BCF 03.5 |
|
|
524 |
0257: BCF 03.6 |
|
|
525 |
0258: CALL 157 |
|
|
526 |
0259: GOTO 25A |
|
|
527 |
.................... } |
|
|
528 |
.................... } |
|
|
529 |
025A: RETLW 00 |
|
|
530 |
.................... |
|
|
531 |
.................... |
|
|
532 |
.................... // Zapni kurzor |
|
|
533 |
.................... // |
|
|
534 |
.................... void lcd_cursor_on() |
|
|
535 |
.................... { |
|
|
536 |
.................... lcd_send_byte(0,LCD_CURSOR_ON_); |
|
|
537 |
.................... } |
|
|
538 |
.................... |
|
|
539 |
.................... |
|
|
540 |
.................... // Vypni kurzor |
|
|
541 |
.................... // |
|
|
542 |
.................... void lcd_cursor_off() |
|
|
543 |
.................... { |
|
|
544 |
.................... lcd_send_byte(0,LCD_CURSOR_OFF_); |
|
|
545 |
.................... } |
|
|
546 |
.................... |
|
|
547 |
.................... |
|
|
548 |
.................... // Definice vlastnich fontu |
|
|
549 |
.................... // |
|
|
550 |
.................... // Vlastnich definic muze byt jen 8 do pozic 0 az 7 pameti CGRAM radice lcd displeje |
|
|
551 |
.................... // Pro snadne definovani jsou pripraveny nasledujici definice a na konci souboru je uveden |
|
|
552 |
.................... // priklad pouziti definovanych znaku. |
|
|
553 |
.................... |
|
|
554 |
.................... |
|
|
555 |
.................... // Pomocna procedura pro posilani ridicich dat do radice displeje |
|
|
556 |
.................... // |
|
|
557 |
.................... void lcd_putc2(int Data) |
|
|
558 |
.................... { |
|
|
559 |
.................... lcd_send_byte(1,Data); |
|
|
560 |
.................... } |
|
|
561 |
.................... |
|
|
562 |
.................... |
|
|
563 |
.................... // Pomocne definice pro programovani obsahu CGRAM |
|
|
564 |
.................... // |
|
|
565 |
.................... #DEFINE lcd_define_start(Code) lcd_send_byte(0,0x40+(Code<<3)); delay_ms(2) |
|
|
566 |
.................... #DEFINE lcd_define_def(String) printf(lcd_putc2,String); |
|
|
567 |
.................... #DEFINE lcd_define_end() lcd_send_byte(0,3); delay_ms(2) |
|
|
568 |
.................... |
|
|
569 |
.................... |
|
|
570 |
.................... // Vlastni vykonne makro pro definovani fontu do pozice Index CGRAM s definicnim retezcem Def |
|
|
571 |
.................... // |
|
|
572 |
.................... #DEFINE lcd_define_char(Index, Def) lcd_define_start(Index); lcd_define_def(Def); lcd_define_end(); |
|
|
573 |
.................... |
|
|
574 |
.................... |
|
|
575 |
.................... // Pripravene definice fontu vybranych znaku |
|
|
576 |
.................... // V tabulce nesmi byt 00 (konec retezce v printf()), misto toho davame 80 |
|
|
577 |
.................... // |
|
|
578 |
.................... #DEFINE LCD_CHAR_BAT100 "\x0E\x1F\x1F\x1F\x1F\x1F\x1F\x1F" /* symbol plne baterie */ |
|
|
579 |
.................... #DEFINE LCD_CHAR_BAT50 "\x0E\x1F\x11\x11\x13\x17\x1F\x1F" /* symbol polovicni baterie */ |
|
|
580 |
.................... #DEFINE LCD_CHAR_BAT0 "\x0E\x1F\x11\x11\x11\x11\x11\x1F" /* symbol vybite baterie */ |
|
|
581 |
.................... #DEFINE LCD_CHAR_LUA "\x04\x0E\x11\x11\x1F\x11\x11\x80" /* A s carkou */ |
|
|
582 |
.................... #DEFINE LCD_CHAR_LLA "\x01\x02\x0E\x01\x1F\x11\x0F\x80" /* a s carkou */ |
|
|
583 |
.................... #DEFINE LCD_CHAR_HUC "\x0A\x0E\x11\x10\x10\x11\x0E\x80" /* C s hackem */ |
|
|
584 |
.................... #DEFINE LCD_CHAR_HLC "\x0A\x04\x0E\x10\x10\x11\x0E\x80" /* c s hackem */ |
|
|
585 |
.................... #DEFINE LCD_CHAR_HUD "\x0A\x1C\x12\x11\x11\x12\x1C\x80" /* D s hackem */ |
|
|
586 |
.................... #DEFINE LCD_CHAR_HLD "\x05\x03\x0D\x13\x11\x11\x0F\x80" /* d s hackem */ |
|
|
587 |
.................... #DEFINE LCD_CHAR_LUE "\x04\x1F\x10\x10\x1E\x10\x1F\x80" /* E s carkou */ |
|
|
588 |
.................... #DEFINE LCD_CHAR_LLE "\x01\x02\x0E\x11\x1F\x10\x0E\x80" /* e s carkou */ |
|
|
589 |
.................... #DEFINE LCD_CHAR_HUE "\x0A\x1F\x10\x1E\x10\x10\x1F\x80" /* E s hackem */ |
|
|
590 |
.................... #DEFINE LCD_CHAR_HLE "\x0A\x04\x0E\x11\x1F\x10\x0E\x80" /* e s hackem */ |
|
|
591 |
.................... #DEFINE LCD_CHAR_LUI "\x04\x0E\x04\x04\x04\x04\x0E\x80" /* I s carkou */ |
|
|
592 |
.................... #DEFINE LCD_CHAR_LLI "\x02\x04\x80\x0C\x04\x04\x0E\x80" /* i s carkou */ |
|
|
593 |
.................... #DEFINE LCD_CHAR_HUN "\x0A\x15\x11\x19\x15\x13\x11\x80" /* N s hackem */ |
|
|
594 |
.................... #DEFINE LCD_CHAR_HLN "\x0A\x04\x16\x19\x11\x11\x11\x80" /* n s hackem */ |
|
|
595 |
.................... #DEFINE LCD_CHAR_LUO "\x04\x0E\x11\x11\x11\x11\x0E\x80" /* O s carkou */ |
|
|
596 |
.................... #DEFINE LCD_CHAR_LLO "\x02\x04\x0E\x11\x11\x11\x0E\x80" /* o s carkou */ |
|
|
597 |
.................... #DEFINE LCD_CHAR_HUR "\x0A\x1E\x11\x1E\x14\x12\x11\x80" /* R s hackem */ |
|
|
598 |
.................... #DEFINE LCD_CHAR_HLR "\x0A\x04\x16\x19\x10\x10\x10\x80" /* r s hackem */ |
|
|
599 |
.................... #DEFINE LCD_CHAR_HUS "\x0A\x0F\x10\x0E\x01\x01\x1E\x80" /* S s hackem */ |
|
|
600 |
.................... #DEFINE LCD_CHAR_HLS "\x0A\x04\x0E\x10\x0E\x01\x1E\x80" /* s s hackem */ |
|
|
601 |
.................... #DEFINE LCD_CHAR_HUT "\x0A\x1F\x04\x04\x04\x04\x04\x80" /* T s hackem */ |
|
|
602 |
.................... #DEFINE LCD_CHAR_HLT "\x0A\x0C\x1C\x08\x08\x09\x06\x80" /* t s hackem */ |
|
|
603 |
.................... #DEFINE LCD_CHAR_LUU "\x02\x15\x11\x11\x11\x11\x0E\x80" /* U s carkou */ |
|
|
604 |
.................... #DEFINE LCD_CHAR_LLU "\x02\x04\x11\x11\x11\x13\x0D\x80" /* u s carkou */ |
|
|
605 |
.................... #DEFINE LCD_CHAR_CUU "\x06\x17\x11\x11\x11\x11\x0E\x80" /* U s krouzkem */ |
|
|
606 |
.................... #DEFINE LCD_CHAR_CLU "\x06\x06\x11\x11\x11\x11\x0E\x80" /* u s krouzkem */ |
|
|
607 |
.................... #DEFINE LCD_CHAR_LUY "\x02\x15\x11\x0A\x04\x04\x04\x80" /* Y s carkou */ |
|
|
608 |
.................... #DEFINE LCD_CHAR_LLY "\x02\x04\x11\x11\x0F\x01\x0E\x80" /* y s carkou */ |
|
|
609 |
.................... #DEFINE LCD_CHAR_HUZ "\x0A\x1F\x01\x02\x04\x08\x1F\x80" /* Z s hackem */ |
|
|
610 |
.................... #DEFINE LCD_CHAR_HLZ "\x0A\x04\x1F\x02\x04\x08\x1F\x80" /* z s hackem */ |
|
|
611 |
.................... |
|
|
612 |
.................... |
|
|
613 |
.................... // Priklad pouziti definovanych znaku |
|
|
614 |
.................... // |
|
|
615 |
.................... // |
|
|
616 |
.................... //void lcd_sample() |
|
|
617 |
.................... //{ |
|
|
618 |
.................... // lcd_define_char(0,LCD_CHAR_BAT50); // Priklad definice znaku baterie do pozice 0 |
|
|
619 |
.................... // lcd_define_char(2,LCD_CHAR_HLE LCD_CHAR_LUI); // Priklad definice znaku e s hackem a I s carkou od pozice 2 |
|
|
620 |
.................... // // vsimnete si, ze neni carka mezi retezci s definici (oba retezce definuji |
|
|
621 |
.................... // // jediny definicni retezec) |
|
|
622 |
.................... // printf(lcd_putc,"\fZnaky:\20\22\23"); // priklad vypisu znaku z pozice 0, 2 a 3 |
|
|
623 |
.................... // delay_ms(1000); |
|
|
624 |
.................... // lcd_define_char(0,LCD_CHAR_BAT0); // Predefinovani tvaru znaku v pozici 0 |
|
|
625 |
.................... // delay_ms(1000); |
|
|
626 |
.................... //} |
|
|
627 |
.................... |
|
|
628 |
.................... |
|
|
629 |
.................... void main() |
|
|
630 |
.................... { |
|
|
631 |
025B: CLRF 04 |
|
|
632 |
025C: BCF 03.7 |
|
|
633 |
025D: MOVLW 1F |
|
|
634 |
025E: ANDWF 03,F |
|
|
635 |
025F: MOVLW 0C |
|
|
636 |
0260: BSF 03.5 |
|
|
637 |
0261: MOVWF 19 |
|
|
638 |
0262: MOVLW A6 |
|
|
639 |
0263: MOVWF 18 |
|
|
640 |
0264: MOVLW 90 |
|
|
641 |
0265: BCF 03.5 |
|
|
642 |
0266: MOVWF 18 |
|
|
643 |
0267: BSF 03.5 |
|
|
644 |
0268: BSF 1F.0 |
|
|
645 |
0269: BSF 1F.1 |
|
|
646 |
026A: BSF 1F.2 |
|
|
647 |
026B: BCF 1F.3 |
|
|
648 |
026C: MOVLW 07 |
|
|
649 |
026D: MOVWF 1C |
|
|
650 |
.................... char odp[96]; |
|
|
651 |
.................... int pom,pom2,pom3,odkl,odkl2,maskovadlo,status; |
|
|
652 |
.................... |
|
|
653 |
.................... setup_adc_ports(NO_ANALOGS); |
|
|
654 |
* |
|
|
655 |
0271: BSF 03.5 |
|
|
656 |
0272: BSF 1F.0 |
|
|
657 |
0273: BSF 1F.1 |
|
|
658 |
0274: BSF 1F.2 |
|
|
659 |
0275: BCF 1F.3 |
|
|
660 |
.................... setup_adc(ADC_OFF); |
|
|
661 |
0276: BCF 03.5 |
|
|
662 |
0277: BCF 1F.0 |
|
|
663 |
.................... setup_psp(PSP_DISABLED); |
|
|
664 |
0278: BSF 03.5 |
|
|
665 |
0279: BCF 09.4 |
|
|
666 |
.................... setup_spi(SPI_SS_DISABLED); |
|
|
667 |
* |
|
|
668 |
026E: MOVLW FF |
|
|
669 |
026F: BCF 03.5 |
|
|
670 |
0270: MOVWF 20 |
|
|
671 |
* |
|
|
672 |
027A: BCF 03.5 |
|
|
673 |
027B: BCF 14.5 |
|
|
674 |
027C: BCF 20.5 |
|
|
675 |
027D: MOVF 20,W |
|
|
676 |
027E: BSF 03.5 |
|
|
677 |
027F: MOVWF 07 |
|
|
678 |
0280: BCF 03.5 |
|
|
679 |
0281: BSF 20.4 |
|
|
680 |
0282: MOVF 20,W |
|
|
681 |
0283: BSF 03.5 |
|
|
682 |
0284: MOVWF 07 |
|
|
683 |
0285: BCF 03.5 |
|
|
684 |
0286: BCF 20.3 |
|
|
685 |
0287: MOVF 20,W |
|
|
686 |
0288: BSF 03.5 |
|
|
687 |
0289: MOVWF 07 |
|
|
688 |
028A: MOVLW 01 |
|
|
689 |
028B: BCF 03.5 |
|
|
690 |
028C: MOVWF 14 |
|
|
691 |
028D: MOVLW 00 |
|
|
692 |
028E: BSF 03.5 |
|
|
693 |
028F: MOVWF 14 |
|
|
694 |
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
|
|
695 |
0290: MOVF 01,W |
|
|
696 |
0291: ANDLW C7 |
|
|
697 |
0292: IORLW 08 |
|
|
698 |
0293: MOVWF 01 |
|
|
699 |
.................... setup_timer_1(T1_DISABLED); |
|
|
700 |
0294: BCF 03.5 |
|
|
701 |
0295: CLRF 10 |
|
|
702 |
.................... setup_timer_2(T2_DISABLED,0,1); |
|
|
703 |
0296: MOVLW 00 |
|
|
704 |
0297: MOVWF 78 |
|
|
705 |
0298: MOVWF 12 |
|
|
706 |
0299: MOVLW 00 |
|
|
707 |
029A: BSF 03.5 |
|
|
708 |
029B: MOVWF 12 |
|
|
709 |
.................... setup_comparator(NC_NC_NC_NC); |
|
|
710 |
029C: MOVLW 07 |
|
|
711 |
029D: MOVWF 1C |
|
|
712 |
029E: MOVF 05,W |
|
|
713 |
029F: CLRWDT |
|
|
714 |
02A0: MOVLW 02 |
|
|
715 |
02A1: MOVWF 77 |
|
|
716 |
02A2: DECFSZ 77,F |
|
|
717 |
02A3: GOTO 2A2 |
|
|
718 |
02A4: GOTO 2A5 |
|
|
719 |
02A5: MOVF 1C,W |
|
|
720 |
02A6: BCF 03.5 |
|
|
721 |
02A7: BCF 0D.6 |
|
|
722 |
.................... setup_vref(FALSE); |
|
|
723 |
02A8: BSF 03.5 |
|
|
724 |
02A9: CLRF 1D |
|
|
725 |
.................... setup_wdt(WDT_2304MS); |
|
|
726 |
02AA: MOVLW 0F |
|
|
727 |
02AB: MOVWF 77 |
|
|
728 |
02AC: MOVLW 07 |
|
|
729 |
02AD: BCF 03.5 |
|
|
730 |
02AE: CLRF 01 |
|
|
731 |
02AF: MOVLW 81 |
|
|
732 |
02B0: MOVWF 04 |
|
|
733 |
02B1: BCF 03.7 |
|
|
734 |
02B2: MOVF 00,W |
|
|
735 |
02B3: ANDLW F0 |
|
|
736 |
02B4: IORLW 07 |
|
|
737 |
02B5: MOVWF 00 |
|
|
738 |
02B6: CLRWDT |
|
|
739 |
02B7: MOVF 00,W |
|
|
740 |
02B8: ANDLW F7 |
|
|
741 |
02B9: BTFSC 77.3 |
|
|
742 |
02BA: ANDLW F0 |
|
|
743 |
02BB: IORWF 77,W |
|
|
744 |
02BC: MOVWF 00 |
|
|
745 |
.................... lcd_init(); |
|
|
746 |
02BD: GOTO 17C |
|
|
747 |
.................... |
|
|
748 |
.................... /* |
|
|
749 |
.................... delay_us(10); |
|
|
750 |
.................... lcd_gotoxy(1,1); |
|
|
751 |
.................... printf(lcd_putc," Ovladani mobilem"); |
|
|
752 |
.................... lcd_gotoxy(1,2); |
|
|
753 |
.................... printf(lcd_putc,""); |
|
|
754 |
.................... lcd_gotoxy(1,3); |
|
|
755 |
.................... printf(lcd_putc," autor: Tomas Kapl"); |
|
|
756 |
.................... lcd_gotoxy(1,4); |
|
|
757 |
.................... printf(lcd_putc," www.kapl.cz"); |
|
|
758 |
.................... delay_ms(5000); |
|
|
759 |
.................... */ |
|
|
760 |
.................... |
|
|
761 |
.................... while(TRUE) |
|
|
762 |
.................... { |
|
|
763 |
.................... restart_wdt(); |
|
|
764 |
02BE: CLRWDT |
|
|
765 |
.................... |
|
|
766 |
.................... output_low(PIN_A4) ; |
|
|
767 |
02BF: BSF 03.5 |
|
|
768 |
02C0: BCF 05.4 |
|
|
769 |
02C1: BCF 03.5 |
|
|
770 |
02C2: BCF 05.4 |
|
|
771 |
.................... delay_ms(150); |
|
|
772 |
02C3: MOVLW 96 |
|
|
773 |
02C4: BSF 03.5 |
|
|
774 |
02C5: BSF 03.6 |
|
|
775 |
02C6: MOVWF 1A |
|
|
776 |
02C7: BCF 03.5 |
|
|
777 |
02C8: BCF 03.6 |
|
|
778 |
02C9: CALL 125 |
|
|
779 |
.................... output_high(PIN_A4); |
|
|
780 |
02CA: BSF 03.5 |
|
|
781 |
02CB: BCF 05.4 |
|
|
782 |
02CC: BCF 03.5 |
|
|
783 |
02CD: BSF 05.4 |
|
|
784 |
.................... delay_ms(150); |
|
|
785 |
02CE: MOVLW 96 |
|
|
786 |
02CF: BSF 03.5 |
|
|
787 |
02D0: BSF 03.6 |
|
|
788 |
02D1: MOVWF 1A |
|
|
789 |
02D2: BCF 03.5 |
|
|
790 |
02D3: BCF 03.6 |
|
|
791 |
02D4: CALL 125 |
|
|
792 |
.................... output_low(PIN_A4) ; |
|
|
793 |
02D5: BSF 03.5 |
|
|
794 |
02D6: BCF 05.4 |
|
|
795 |
02D7: BCF 03.5 |
|
|
796 |
02D8: BCF 05.4 |
|
|
797 |
.................... delay_ms(150); |
|
|
798 |
02D9: MOVLW 96 |
|
|
799 |
02DA: BSF 03.5 |
|
|
800 |
02DB: BSF 03.6 |
|
|
801 |
02DC: MOVWF 1A |
|
|
802 |
02DD: BCF 03.5 |
|
|
803 |
02DE: BCF 03.6 |
|
|
804 |
02DF: CALL 125 |
|
|
805 |
.................... output_high(PIN_A4); |
|
|
806 |
02E0: BSF 03.5 |
|
|
807 |
02E1: BCF 05.4 |
|
|
808 |
02E2: BCF 03.5 |
|
|
809 |
02E3: BSF 05.4 |
|
|
810 |
.................... delay_ms(150); |
|
|
811 |
02E4: MOVLW 96 |
|
|
812 |
02E5: BSF 03.5 |
|
|
813 |
02E6: BSF 03.6 |
|
|
814 |
02E7: MOVWF 1A |
|
|
815 |
02E8: BCF 03.5 |
|
|
816 |
02E9: BCF 03.6 |
|
|
817 |
02EA: CALL 125 |
|
|
818 |
.................... |
|
|
819 |
.................... printf("AT+CMGL=0\r"); //vycti prijate SMS |
|
|
820 |
02EB: CLRF 28 |
|
|
821 |
02EC: MOVF 28,W |
|
|
822 |
02ED: CALL 00C |
|
|
823 |
02EE: INCF 28,F |
|
|
824 |
02EF: MOVWF 77 |
|
|
825 |
02F0: MOVF 77,W |
|
|
826 |
02F1: BTFSS 0C.4 |
|
|
827 |
02F2: GOTO 2F1 |
|
|
828 |
02F3: MOVWF 19 |
|
|
829 |
02F4: MOVLW 0A |
|
|
830 |
02F5: SUBWF 28,W |
|
|
831 |
02F6: BTFSS 03.2 |
|
|
832 |
02F7: GOTO 2EC |
|
|
833 |
.................... |
|
|
834 |
.................... |
|
|
835 |
.................... gets(odp); //uloz odpoved prikazu do odp |
|
|
836 |
02F8: MOVLW 10 |
|
|
837 |
02F9: MOVWF 04 |
|
|
838 |
02FA: BSF 03.7 |
|
|
839 |
02FB: DECF 04,F |
|
|
840 |
02FC: INCF 04,F |
|
|
841 |
02FD: BTFSS 0C.5 |
|
|
842 |
02FE: GOTO 2FD |
|
|
843 |
02FF: MOVF 1A,W |
|
|
844 |
0300: MOVWF 00 |
|
|
845 |
0301: MOVLW 0D |
|
|
846 |
0302: SUBWF 00,W |
|
|
847 |
0303: BTFSS 03.2 |
|
|
848 |
0304: GOTO 2FC |
|
|
849 |
0305: CLRF 00 |
|
|
850 |
.................... getc(); //preskoc 0A |
|
|
851 |
0306: BTFSS 0C.5 |
|
|
852 |
0307: GOTO 306 |
|
|
853 |
0308: MOVF 1A,W |
|
|
854 |
.................... getc(); //preskoc 0D |
|
|
855 |
0309: BTFSS 0C.5 |
|
|
856 |
030A: GOTO 309 |
|
|
857 |
030B: MOVF 1A,W |
|
|
858 |
.................... gets(odp); //uloz pocatek odpovedi do odp |
|
|
859 |
030C: MOVLW 10 |
|
|
860 |
030D: MOVWF 04 |
|
|
861 |
030E: BSF 03.7 |
|
|
862 |
030F: DECF 04,F |
|
|
863 |
0310: INCF 04,F |
|
|
864 |
0311: BTFSS 0C.5 |
|
|
865 |
0312: GOTO 311 |
|
|
866 |
0313: MOVF 1A,W |
|
|
867 |
0314: MOVWF 00 |
|
|
868 |
0315: MOVLW 0D |
|
|
869 |
0316: SUBWF 00,W |
|
|
870 |
0317: BTFSS 03.2 |
|
|
871 |
0318: GOTO 310 |
|
|
872 |
0319: CLRF 00 |
|
|
873 |
.................... |
|
|
874 |
.................... |
|
|
875 |
.................... if(odp[0] == 79 && odp[1] ==75) |
|
|
876 |
031A: BSF 03.6 |
|
|
877 |
031B: MOVF 10,W |
|
|
878 |
031C: SUBLW 4F |
|
|
879 |
031D: BTFSS 03.2 |
|
|
880 |
031E: GOTO 37F |
|
|
881 |
031F: MOVF 11,W |
|
|
882 |
0320: SUBLW 4B |
|
|
883 |
0321: BTFSS 03.2 |
|
|
884 |
0322: GOTO 37F |
|
|
885 |
.................... { |
|
|
886 |
.................... lcd_gotoxy(1,1); |
|
|
887 |
0323: MOVLW 01 |
|
|
888 |
0324: BSF 03.5 |
|
|
889 |
0325: MOVWF 1A |
|
|
890 |
0326: MOVWF 1B |
|
|
891 |
0327: BCF 03.5 |
|
|
892 |
0328: BCF 03.6 |
|
|
893 |
0329: CALL 1D7 |
|
|
894 |
.................... printf(lcd_putc,"\fNeni nova SMS zprava"); |
|
|
895 |
032A: CLRF 28 |
|
|
896 |
032B: MOVF 28,W |
|
|
897 |
032C: CALL 01B |
|
|
898 |
032D: INCF 28,F |
|
|
899 |
032E: MOVWF 77 |
|
|
900 |
032F: BSF 03.5 |
|
|
901 |
0330: BSF 03.6 |
|
|
902 |
0331: MOVWF 19 |
|
|
903 |
0332: BCF 03.5 |
|
|
904 |
0333: BCF 03.6 |
|
|
905 |
0334: CALL 20C |
|
|
906 |
0335: MOVLW 15 |
|
|
907 |
0336: SUBWF 28,W |
|
|
908 |
0337: BTFSS 03.2 |
|
|
909 |
0338: GOTO 32B |
|
|
910 |
.................... lcd_gotoxy(1,2); |
|
|
911 |
0339: MOVLW 01 |
|
|
912 |
033A: BSF 03.5 |
|
|
913 |
033B: BSF 03.6 |
|
|
914 |
033C: MOVWF 1A |
|
|
915 |
033D: MOVLW 02 |
|
|
916 |
033E: MOVWF 1B |
|
|
917 |
033F: BCF 03.5 |
|
|
918 |
0340: BCF 03.6 |
|
|
919 |
0341: CALL 1D7 |
|
|
920 |
.................... printf(lcd_putc,""); |
|
|
921 |
.................... lcd_gotoxy(1,3); |
|
|
922 |
0342: MOVLW 01 |
|
|
923 |
0343: BSF 03.5 |
|
|
924 |
0344: BSF 03.6 |
|
|
925 |
0345: MOVWF 1A |
|
|
926 |
0346: MOVLW 03 |
|
|
927 |
0347: MOVWF 1B |
|
|
928 |
0348: BCF 03.5 |
|
|
929 |
0349: BCF 03.6 |
|
|
930 |
034A: CALL 1D7 |
|
|
931 |
.................... printf(lcd_putc,"Zaslete SMS na cislo"); |
|
|
932 |
034B: CLRF 28 |
|
|
933 |
034C: MOVF 28,W |
|
|
934 |
034D: CALL 035 |
|
|
935 |
034E: INCF 28,F |
|
|
936 |
034F: MOVWF 77 |
|
|
937 |
0350: BSF 03.5 |
|
|
938 |
0351: BSF 03.6 |
|
|
939 |
0352: MOVWF 19 |
|
|
940 |
0353: BCF 03.5 |
|
|
941 |
0354: BCF 03.6 |
|
|
942 |
0355: CALL 20C |
|
|
943 |
0356: MOVLW 14 |
|
|
944 |
0357: SUBWF 28,W |
|
|
945 |
0358: BTFSS 03.2 |
|
|
946 |
0359: GOTO 34C |
|
|
947 |
.................... lcd_gotoxy(1,4); |
|
|
948 |
035A: MOVLW 01 |
|
|
949 |
035B: BSF 03.5 |
|
|
950 |
035C: BSF 03.6 |
|
|
951 |
035D: MOVWF 1A |
|
|
952 |
035E: MOVLW 04 |
|
|
953 |
035F: MOVWF 1B |
|
|
954 |
0360: BCF 03.5 |
|
|
955 |
0361: BCF 03.6 |
|
|
956 |
0362: CALL 1D7 |
|
|
957 |
.................... printf(lcd_putc," 736 655 250"); |
|
|
958 |
0363: CLRF 28 |
|
|
959 |
0364: MOVF 28,W |
|
|
960 |
0365: CALL 04E |
|
|
961 |
0366: INCF 28,F |
|
|
962 |
0367: MOVWF 77 |
|
|
963 |
0368: BSF 03.5 |
|
|
964 |
0369: BSF 03.6 |
|
|
965 |
036A: MOVWF 19 |
|
|
966 |
036B: BCF 03.5 |
|
|
967 |
036C: BCF 03.6 |
|
|
968 |
036D: CALL 20C |
|
|
969 |
036E: MOVLW 0F |
|
|
970 |
036F: SUBWF 28,W |
|
|
971 |
0370: BTFSS 03.2 |
|
|
972 |
0371: GOTO 364 |
|
|
973 |
.................... delay_ms(5000); |
|
|
974 |
0372: MOVLW 14 |
|
|
975 |
0373: MOVWF 28 |
|
|
976 |
0374: MOVLW FA |
|
|
977 |
0375: BSF 03.5 |
|
|
978 |
0376: BSF 03.6 |
|
|
979 |
0377: MOVWF 1A |
|
|
980 |
0378: BCF 03.5 |
|
|
981 |
0379: BCF 03.6 |
|
|
982 |
037A: CALL 125 |
|
|
983 |
037B: DECFSZ 28,F |
|
|
984 |
037C: GOTO 374 |
|
|
985 |
.................... }else |
|
|
986 |
037D: GOTO 67E |
|
|
987 |
037E: BSF 03.6 |
|
|
988 |
.................... { |
|
|
989 |
.................... |
|
|
990 |
.................... for(pom=0;pom<55;pom++) //preskoc nedulezite informace |
|
|
991 |
037F: BCF 03.6 |
|
|
992 |
0380: CLRF 21 |
|
|
993 |
0381: MOVF 21,W |
|
|
994 |
0382: SUBLW 36 |
|
|
995 |
0383: BTFSS 03.0 |
|
|
996 |
0384: GOTO 38A |
|
|
997 |
.................... { |
|
|
998 |
.................... getc(); |
|
|
999 |
0385: BTFSS 0C.5 |
|
|
1000 |
0386: GOTO 385 |
|
|
1001 |
0387: MOVF 1A,W |
|
|
1002 |
.................... } |
|
|
1003 |
0388: INCF 21,F |
|
|
1004 |
0389: GOTO 381 |
|
|
1005 |
.................... |
|
|
1006 |
.................... //gets(odp); //uloz zakodovany text SMS |
|
|
1007 |
.................... |
|
|
1008 |
.................... odp[0]=getc(); |
|
|
1009 |
038A: BTFSS 0C.5 |
|
|
1010 |
038B: GOTO 38A |
|
|
1011 |
038C: MOVF 1A,W |
|
|
1012 |
038D: BSF 03.6 |
|
|
1013 |
038E: MOVWF 10 |
|
|
1014 |
.................... odp[1]=getc(); |
|
|
1015 |
038F: BCF 03.6 |
|
|
1016 |
0390: BTFSS 0C.5 |
|
|
1017 |
0391: GOTO 390 |
|
|
1018 |
0392: MOVF 1A,W |
|
|
1019 |
0393: BSF 03.6 |
|
|
1020 |
0394: MOVWF 11 |
|
|
1021 |
.................... odp[2]=getc(); |
|
|
1022 |
0395: BCF 03.6 |
|
|
1023 |
0396: BTFSS 0C.5 |
|
|
1024 |
0397: GOTO 396 |
|
|
1025 |
0398: MOVF 1A,W |
|
|
1026 |
0399: BSF 03.6 |
|
|
1027 |
039A: MOVWF 12 |
|
|
1028 |
.................... odp[3]=getc(); |
|
|
1029 |
039B: BCF 03.6 |
|
|
1030 |
039C: BTFSS 0C.5 |
|
|
1031 |
039D: GOTO 39C |
|
|
1032 |
039E: MOVF 1A,W |
|
|
1033 |
039F: BSF 03.6 |
|
|
1034 |
03A0: MOVWF 13 |
|
|
1035 |
.................... odp[4]=getc(); |
|
|
1036 |
03A1: BCF 03.6 |
|
|
1037 |
03A2: BTFSS 0C.5 |
|
|
1038 |
03A3: GOTO 3A2 |
|
|
1039 |
03A4: MOVF 1A,W |
|
|
1040 |
03A5: BSF 03.6 |
|
|
1041 |
03A6: MOVWF 14 |
|
|
1042 |
.................... odp[5]=getc(); |
|
|
1043 |
03A7: BCF 03.6 |
|
|
1044 |
03A8: BTFSS 0C.5 |
|
|
1045 |
03A9: GOTO 3A8 |
|
|
1046 |
03AA: MOVF 1A,W |
|
|
1047 |
03AB: BSF 03.6 |
|
|
1048 |
03AC: MOVWF 15 |
|
|
1049 |
.................... odp[6]=getc(); |
|
|
1050 |
03AD: BCF 03.6 |
|
|
1051 |
03AE: BTFSS 0C.5 |
|
|
1052 |
03AF: GOTO 3AE |
|
|
1053 |
03B0: MOVF 1A,W |
|
|
1054 |
03B1: BSF 03.6 |
|
|
1055 |
03B2: MOVWF 16 |
|
|
1056 |
.................... odp[7]=getc(); |
|
|
1057 |
03B3: BCF 03.6 |
|
|
1058 |
03B4: BTFSS 0C.5 |
|
|
1059 |
03B5: GOTO 3B4 |
|
|
1060 |
03B6: MOVF 1A,W |
|
|
1061 |
03B7: BSF 03.6 |
|
|
1062 |
03B8: MOVWF 17 |
|
|
1063 |
.................... |
|
|
1064 |
.................... /*lcd_gotoxy(1,1); |
|
|
1065 |
.................... printf(lcd_putc,"\f%s\n",odp);*/ |
|
|
1066 |
.................... |
|
|
1067 |
.................... if(odp[0]==0) odp[1]='0'; // Prevod z ASCII do BIN |
|
|
1068 |
03B9: MOVF 10,F |
|
|
1069 |
03BA: BTFSS 03.2 |
|
|
1070 |
03BB: GOTO 3BE |
|
|
1071 |
03BC: MOVLW 30 |
|
|
1072 |
03BD: MOVWF 11 |
|
|
1073 |
.................... odp[0]=odp[0] - '0'; |
|
|
1074 |
03BE: MOVLW 30 |
|
|
1075 |
03BF: SUBWF 10,F |
|
|
1076 |
.................... odp[1]=odp[1] - '0'; |
|
|
1077 |
03C0: SUBWF 11,F |
|
|
1078 |
.................... if(odp[0]>9) odp[0]=odp[0]-7; |
|
|
1079 |
03C1: MOVF 10,W |
|
|
1080 |
03C2: SUBLW 09 |
|
|
1081 |
03C3: BTFSC 03.0 |
|
|
1082 |
03C4: GOTO 3C7 |
|
|
1083 |
03C5: MOVLW 07 |
|
|
1084 |
03C6: SUBWF 10,F |
|
|
1085 |
.................... if(odp[1]>9) odp[1]=odp[1]-7; |
|
|
1086 |
03C7: MOVF 11,W |
|
|
1087 |
03C8: SUBLW 09 |
|
|
1088 |
03C9: BTFSC 03.0 |
|
|
1089 |
03CA: GOTO 3CD |
|
|
1090 |
03CB: MOVLW 07 |
|
|
1091 |
03CC: SUBWF 11,F |
|
|
1092 |
.................... odp[0]=odp[0] << 4; |
|
|
1093 |
03CD: SWAPF 10,F |
|
|
1094 |
03CE: MOVLW F0 |
|
|
1095 |
03CF: ANDWF 10,F |
|
|
1096 |
.................... odp[0] |= odp[1]; |
|
|
1097 |
03D0: MOVF 11,W |
|
|
1098 |
03D1: IORWF 10,F |
|
|
1099 |
.................... |
|
|
1100 |
.................... if(odp[2]==0) odp[3]='0'; |
|
|
1101 |
03D2: MOVF 12,F |
|
|
1102 |
03D3: BTFSS 03.2 |
|
|
1103 |
03D4: GOTO 3D7 |
|
|
1104 |
03D5: MOVLW 30 |
|
|
1105 |
03D6: MOVWF 13 |
|
|
1106 |
.................... odp[2]=odp[2] - '0'; |
|
|
1107 |
03D7: MOVLW 30 |
|
|
1108 |
03D8: SUBWF 12,F |
|
|
1109 |
.................... odp[3]=odp[3] - '0'; |
|
|
1110 |
03D9: SUBWF 13,F |
|
|
1111 |
.................... if(odp[2]>9) odp[2]=odp[2]-7; |
|
|
1112 |
03DA: MOVF 12,W |
|
|
1113 |
03DB: SUBLW 09 |
|
|
1114 |
03DC: BTFSC 03.0 |
|
|
1115 |
03DD: GOTO 3E0 |
|
|
1116 |
03DE: MOVLW 07 |
|
|
1117 |
03DF: SUBWF 12,F |
|
|
1118 |
.................... if(odp[3]>9) odp[3]=odp[3]-7; |
|
|
1119 |
03E0: MOVF 13,W |
|
|
1120 |
03E1: SUBLW 09 |
|
|
1121 |
03E2: BTFSC 03.0 |
|
|
1122 |
03E3: GOTO 3E6 |
|
|
1123 |
03E4: MOVLW 07 |
|
|
1124 |
03E5: SUBWF 13,F |
|
|
1125 |
.................... odp[2]=odp[2] << 4; |
|
|
1126 |
03E6: SWAPF 12,F |
|
|
1127 |
03E7: MOVLW F0 |
|
|
1128 |
03E8: ANDWF 12,F |
|
|
1129 |
.................... odp[2] |= odp[3]; |
|
|
1130 |
03E9: MOVF 13,W |
|
|
1131 |
03EA: IORWF 12,F |
|
|
1132 |
.................... |
|
|
1133 |
.................... if(odp[4]==0) odp[5]='0'; |
|
|
1134 |
03EB: MOVF 14,F |
|
|
1135 |
03EC: BTFSS 03.2 |
|
|
1136 |
03ED: GOTO 3F0 |
|
|
1137 |
03EE: MOVLW 30 |
|
|
1138 |
03EF: MOVWF 15 |
|
|
1139 |
.................... odp[4]=odp[4] - '0'; |
|
|
1140 |
03F0: MOVLW 30 |
|
|
1141 |
03F1: SUBWF 14,F |
|
|
1142 |
.................... odp[5]=odp[5] - '0'; |
|
|
1143 |
03F2: SUBWF 15,F |
|
|
1144 |
.................... if(odp[4]>9) odp[4]=odp[4]-7; |
|
|
1145 |
03F3: MOVF 14,W |
|
|
1146 |
03F4: SUBLW 09 |
|
|
1147 |
03F5: BTFSC 03.0 |
|
|
1148 |
03F6: GOTO 3F9 |
|
|
1149 |
03F7: MOVLW 07 |
|
|
1150 |
03F8: SUBWF 14,F |
|
|
1151 |
.................... if(odp[5]>9) odp[5]=odp[5]-7; |
|
|
1152 |
03F9: MOVF 15,W |
|
|
1153 |
03FA: SUBLW 09 |
|
|
1154 |
03FB: BTFSC 03.0 |
|
|
1155 |
03FC: GOTO 3FF |
|
|
1156 |
03FD: MOVLW 07 |
|
|
1157 |
03FE: SUBWF 15,F |
|
|
1158 |
.................... odp[4]=odp[4] << 4; |
|
|
1159 |
03FF: SWAPF 14,F |
|
|
1160 |
0400: MOVLW F0 |
|
|
1161 |
0401: ANDWF 14,F |
|
|
1162 |
.................... odp[4] |= odp[5]; |
|
|
1163 |
0402: MOVF 15,W |
|
|
1164 |
0403: IORWF 14,F |
|
|
1165 |
.................... |
|
|
1166 |
.................... if(odp[6]==0) odp[7]='0'; |
|
|
1167 |
0404: MOVF 16,F |
|
|
1168 |
0405: BTFSS 03.2 |
|
|
1169 |
0406: GOTO 409 |
|
|
1170 |
0407: MOVLW 30 |
|
|
1171 |
0408: MOVWF 17 |
|
|
1172 |
.................... odp[6]=odp[6] - '0'; |
|
|
1173 |
0409: MOVLW 30 |
|
|
1174 |
040A: SUBWF 16,F |
|
|
1175 |
.................... odp[7]=odp[7] - '0'; |
|
|
1176 |
040B: SUBWF 17,F |
|
|
1177 |
.................... if(odp[6]>9) odp[6]=odp[6]-7; |
|
|
1178 |
040C: MOVF 16,W |
|
|
1179 |
040D: SUBLW 09 |
|
|
1180 |
040E: BTFSC 03.0 |
|
|
1181 |
040F: GOTO 412 |
|
|
1182 |
0410: MOVLW 07 |
|
|
1183 |
0411: SUBWF 16,F |
|
|
1184 |
.................... if(odp[7]>9) odp[7]=odp[7]-7; |
|
|
1185 |
0412: MOVF 17,W |
|
|
1186 |
0413: SUBLW 09 |
|
|
1187 |
0414: BTFSC 03.0 |
|
|
1188 |
0415: GOTO 418 |
|
|
1189 |
0416: MOVLW 07 |
|
|
1190 |
0417: SUBWF 17,F |
|
|
1191 |
.................... odp[6]=odp[6] << 4; |
|
|
1192 |
0418: SWAPF 16,F |
|
|
1193 |
0419: MOVLW F0 |
|
|
1194 |
041A: ANDWF 16,F |
|
|
1195 |
.................... odp[6] |= odp[7]; |
|
|
1196 |
041B: MOVF 17,W |
|
|
1197 |
041C: IORWF 16,F |
|
|
1198 |
.................... |
|
|
1199 |
.................... odp[1]=odp[2]; |
|
|
1200 |
041D: MOVF 12,W |
|
|
1201 |
041E: MOVWF 11 |
|
|
1202 |
.................... odp[2]=odp[4]; |
|
|
1203 |
041F: MOVF 14,W |
|
|
1204 |
0420: MOVWF 12 |
|
|
1205 |
.................... odp[3]=odp[6]; |
|
|
1206 |
0421: MOVF 16,W |
|
|
1207 |
0422: MOVWF 13 |
|
|
1208 |
.................... odp[4],odp[5],odp[6]=""; |
|
|
1209 |
0423: CLRF 16 |
|
|
1210 |
.................... |
|
|
1211 |
.................... /*lcd_gotoxy(1,2); |
|
|
1212 |
.................... printf(lcd_putc,"%u %u %u %u",odp[0],odp[1],odp[2]odp[3]); */ |
|
|
1213 |
.................... |
|
|
1214 |
.................... pom3=0; |
|
|
1215 |
0424: BCF 03.6 |
|
|
1216 |
0425: CLRF 23 |
|
|
1217 |
.................... for (pom = 0; pom < 4;pom++) |
|
|
1218 |
0426: CLRF 21 |
|
|
1219 |
0427: MOVF 21,W |
|
|
1220 |
0428: SUBLW 03 |
|
|
1221 |
0429: BTFSS 03.0 |
|
|
1222 |
042A: GOTO 49C |
|
|
1223 |
.................... { |
|
|
1224 |
.................... maskovadlo = maskovadlo >> 1; //rotace promene urcene pro maskovani |
|
|
1225 |
042B: BCF 03.0 |
|
|
1226 |
042C: RRF 26,F |
|
|
1227 |
.................... maskovadlo = maskovadlo | 0x80; |
|
|
1228 |
042D: BSF 26.7 |
|
|
1229 |
.................... odkl = odp[pom] & maskovadlo; //odlozeni "prenosu" do odkl pomoci maskovadla |
|
|
1230 |
042E: MOVLW 10 |
|
|
1231 |
042F: ADDWF 21,W |
|
|
1232 |
0430: MOVWF 04 |
|
|
1233 |
0431: BSF 03.7 |
|
|
1234 |
0432: MOVF 00,W |
|
|
1235 |
0433: ANDWF 26,W |
|
|
1236 |
0434: MOVWF 24 |
|
|
1237 |
.................... odp[pom] = odp[pom] << pom3; //rotace znaku |
|
|
1238 |
0435: MOVLW 10 |
|
|
1239 |
0436: ADDWF 21,W |
|
|
1240 |
0437: MOVWF 78 |
|
|
1241 |
0438: MOVLW 01 |
|
|
1242 |
0439: MOVWF 7A |
|
|
1243 |
043A: BTFSC 03.0 |
|
|
1244 |
043B: INCF 7A,F |
|
|
1245 |
043C: MOVF 78,W |
|
|
1246 |
043D: MOVWF 28 |
|
|
1247 |
043E: MOVF 7A,W |
|
|
1248 |
043F: MOVWF 29 |
|
|
1249 |
0440: MOVLW 10 |
|
|
1250 |
0441: ADDWF 21,W |
|
|
1251 |
0442: MOVWF 04 |
|
|
1252 |
0443: BSF 03.7 |
|
|
1253 |
0444: MOVF 00,W |
|
|
1254 |
0445: MOVWF 77 |
|
|
1255 |
0446: MOVF 23,W |
|
|
1256 |
0447: MOVWF 78 |
|
|
1257 |
0448: BTFSC 03.2 |
|
|
1258 |
0449: GOTO 44E |
|
|
1259 |
044A: BCF 03.0 |
|
|
1260 |
044B: RLF 77,F |
|
|
1261 |
044C: DECFSZ 78,F |
|
|
1262 |
044D: GOTO 44A |
|
|
1263 |
044E: MOVF 28,W |
|
|
1264 |
044F: MOVWF 04 |
|
|
1265 |
0450: BCF 03.7 |
|
|
1266 |
0451: BTFSC 29.0 |
|
|
1267 |
0452: BSF 03.7 |
|
|
1268 |
0453: MOVF 77,W |
|
|
1269 |
0454: MOVWF 00 |
|
|
1270 |
.................... for (pom2 = 0; pom2 < (8-pom3);pom2++) //rotace odkl2 |
|
|
1271 |
0455: CLRF 22 |
|
|
1272 |
0456: MOVF 23,W |
|
|
1273 |
0457: SUBLW 08 |
|
|
1274 |
0458: SUBWF 22,W |
|
|
1275 |
0459: BTFSC 03.0 |
|
|
1276 |
045A: GOTO 460 |
|
|
1277 |
.................... { |
|
|
1278 |
.................... odkl2 = odkl2 >> 1; |
|
|
1279 |
045B: BCF 03.0 |
|
|
1280 |
045C: RRF 25,F |
|
|
1281 |
.................... odkl2 = odkl2 & 127; |
|
|
1282 |
045D: BCF 25.7 |
|
|
1283 |
.................... } |
|
|
1284 |
045E: INCF 22,F |
|
|
1285 |
045F: GOTO 456 |
|
|
1286 |
.................... odp[pom] = odp[pom] | odkl2; //pridani odkl2 ke znaku |
|
|
1287 |
0460: MOVLW 10 |
|
|
1288 |
0461: ADDWF 21,W |
|
|
1289 |
0462: MOVWF 78 |
|
|
1290 |
0463: MOVLW 01 |
|
|
1291 |
0464: MOVWF 7A |
|
|
1292 |
0465: BTFSC 03.0 |
|
|
1293 |
0466: INCF 7A,F |
|
|
1294 |
0467: MOVLW 10 |
|
|
1295 |
0468: ADDWF 21,W |
|
|
1296 |
0469: MOVWF 04 |
|
|
1297 |
046A: BSF 03.7 |
|
|
1298 |
046B: MOVF 00,W |
|
|
1299 |
046C: IORWF 25,W |
|
|
1300 |
046D: MOVWF 2B |
|
|
1301 |
046E: MOVF 78,W |
|
|
1302 |
046F: MOVWF 04 |
|
|
1303 |
0470: BCF 03.7 |
|
|
1304 |
0471: BTFSC 7A.0 |
|
|
1305 |
0472: BSF 03.7 |
|
|
1306 |
0473: MOVF 2B,W |
|
|
1307 |
0474: MOVWF 00 |
|
|
1308 |
.................... odp[pom] = odp[pom] & 127; //smazani nejvysiho bitu |
|
|
1309 |
0475: MOVLW 10 |
|
|
1310 |
0476: ADDWF 21,W |
|
|
1311 |
0477: MOVWF 78 |
|
|
1312 |
0478: MOVLW 01 |
|
|
1313 |
0479: MOVWF 7A |
|
|
1314 |
047A: BTFSC 03.0 |
|
|
1315 |
047B: INCF 7A,F |
|
|
1316 |
047C: MOVLW 10 |
|
|
1317 |
047D: ADDWF 21,W |
|
|
1318 |
047E: MOVWF 04 |
|
|
1319 |
047F: BSF 03.7 |
|
|
1320 |
0480: MOVF 00,W |
|
|
1321 |
0481: ANDLW 7F |
|
|
1322 |
0482: MOVWF 2B |
|
|
1323 |
0483: MOVF 78,W |
|
|
1324 |
0484: MOVWF 04 |
|
|
1325 |
0485: BCF 03.7 |
|
|
1326 |
0486: BTFSC 7A.0 |
|
|
1327 |
0487: BSF 03.7 |
|
|
1328 |
0488: MOVF 2B,W |
|
|
1329 |
0489: MOVWF 00 |
|
|
1330 |
.................... odkl2 = odkl; //ulozeni odlk na dalsi pruchod |
|
|
1331 |
048A: MOVF 24,W |
|
|
1332 |
048B: MOVWF 25 |
|
|
1333 |
.................... pom3++; //inkrementace citace rotace |
|
|
1334 |
048C: INCF 23,F |
|
|
1335 |
.................... if (pom3 == 8) //kazdy 8my znak |
|
|
1336 |
048D: MOVF 23,W |
|
|
1337 |
048E: SUBLW 08 |
|
|
1338 |
048F: BTFSS 03.2 |
|
|
1339 |
0490: GOTO 49A |
|
|
1340 |
.................... { |
|
|
1341 |
.................... pom3 = 0; //smaz citac |
|
|
1342 |
0491: CLRF 23 |
|
|
1343 |
.................... odp[pom+1] = odkl2; //uloz 8my znak vznikly z "prenosu" |
|
|
1344 |
0492: MOVLW 01 |
|
|
1345 |
0493: ADDWF 21,W |
|
|
1346 |
0494: ADDLW 10 |
|
|
1347 |
0495: MOVWF 04 |
|
|
1348 |
0496: BSF 03.7 |
|
|
1349 |
0497: MOVF 25,W |
|
|
1350 |
0498: MOVWF 00 |
|
|
1351 |
.................... maskovadlo = 0; //smaz maskovadlo |
|
|
1352 |
0499: CLRF 26 |
|
|
1353 |
.................... } |
|
|
1354 |
.................... } |
|
|
1355 |
049A: INCF 21,F |
|
|
1356 |
049B: GOTO 427 |
|
|
1357 |
.................... odp[pom]='\0'; |
|
|
1358 |
049C: MOVLW 10 |
|
|
1359 |
049D: ADDWF 21,W |
|
|
1360 |
049E: MOVWF 04 |
|
|
1361 |
049F: BSF 03.7 |
|
|
1362 |
04A0: CLRF 00 |
|
|
1363 |
.................... /*lcd_gotoxy(1,3); |
|
|
1364 |
.................... printf(lcd_putc,"%u %u %u %u",odp[0],odp[1],odp[2],odp[3]); */ |
|
|
1365 |
.................... lcd_gotoxy(1,1); |
|
|
1366 |
04A1: MOVLW 01 |
|
|
1367 |
04A2: BSF 03.5 |
|
|
1368 |
04A3: BSF 03.6 |
|
|
1369 |
04A4: MOVWF 1A |
|
|
1370 |
04A5: MOVWF 1B |
|
|
1371 |
04A6: BCF 03.5 |
|
|
1372 |
04A7: BCF 03.6 |
|
|
1373 |
04A8: CALL 1D7 |
|
|
1374 |
.................... printf(lcd_putc,"\fPrijata SMS s textem",); |
|
|
1375 |
04A9: CLRF 28 |
|
|
1376 |
04AA: MOVF 28,W |
|
|
1377 |
04AB: CALL 062 |
|
|
1378 |
04AC: INCF 28,F |
|
|
1379 |
04AD: MOVWF 77 |
|
|
1380 |
04AE: BSF 03.5 |
|
|
1381 |
04AF: BSF 03.6 |
|
|
1382 |
04B0: MOVWF 19 |
|
|
1383 |
04B1: BCF 03.5 |
|
|
1384 |
04B2: BCF 03.6 |
|
|
1385 |
04B3: CALL 20C |
|
|
1386 |
04B4: MOVLW 15 |
|
|
1387 |
04B5: SUBWF 28,W |
|
|
1388 |
04B6: BTFSS 03.2 |
|
|
1389 |
04B7: GOTO 4AA |
|
|
1390 |
.................... lcd_gotoxy(9,3); |
|
|
1391 |
04B8: MOVLW 09 |
|
|
1392 |
04B9: BSF 03.5 |
|
|
1393 |
04BA: BSF 03.6 |
|
|
1394 |
04BB: MOVWF 1A |
|
|
1395 |
04BC: MOVLW 03 |
|
|
1396 |
04BD: MOVWF 1B |
|
|
1397 |
04BE: BCF 03.5 |
|
|
1398 |
04BF: BCF 03.6 |
|
|
1399 |
04C0: CALL 1D7 |
|
|
1400 |
.................... printf(lcd_putc,"%s",odp); |
|
|
1401 |
04C1: MOVLW 10 |
|
|
1402 |
04C2: MOVWF 04 |
|
|
1403 |
04C3: BSF 03.7 |
|
|
1404 |
04C4: MOVLW 00 |
|
|
1405 |
04C5: IORWF 00,W |
|
|
1406 |
04C6: BTFSC 03.2 |
|
|
1407 |
04C7: GOTO 4DC |
|
|
1408 |
04C8: CLRF 29 |
|
|
1409 |
04C9: MOVF 04,W |
|
|
1410 |
04CA: MOVWF 28 |
|
|
1411 |
04CB: BCF 29.0 |
|
|
1412 |
04CC: BTFSC 03.7 |
|
|
1413 |
04CD: BSF 29.0 |
|
|
1414 |
04CE: MOVF 00,W |
|
|
1415 |
04CF: BSF 03.5 |
|
|
1416 |
04D0: BSF 03.6 |
|
|
1417 |
04D1: MOVWF 19 |
|
|
1418 |
04D2: BCF 03.5 |
|
|
1419 |
04D3: BCF 03.6 |
|
|
1420 |
04D4: CALL 20C |
|
|
1421 |
04D5: MOVF 28,W |
|
|
1422 |
04D6: MOVWF 04 |
|
|
1423 |
04D7: BCF 03.7 |
|
|
1424 |
04D8: BTFSC 29.0 |
|
|
1425 |
04D9: BSF 03.7 |
|
|
1426 |
04DA: INCF 04,F |
|
|
1427 |
04DB: GOTO 4C4 |
|
|
1428 |
.................... output_low(PIN_A4) ; |
|
|
1429 |
04DC: BSF 03.5 |
|
|
1430 |
04DD: BCF 05.4 |
|
|
1431 |
04DE: BCF 03.5 |
|
|
1432 |
04DF: BCF 05.4 |
|
|
1433 |
.................... delay_ms(5000); |
|
|
1434 |
04E0: MOVLW 14 |
|
|
1435 |
04E1: MOVWF 28 |
|
|
1436 |
04E2: MOVLW FA |
|
|
1437 |
04E3: BSF 03.5 |
|
|
1438 |
04E4: BSF 03.6 |
|
|
1439 |
04E5: MOVWF 1A |
|
|
1440 |
04E6: BCF 03.5 |
|
|
1441 |
04E7: BCF 03.6 |
|
|
1442 |
04E8: CALL 125 |
|
|
1443 |
04E9: DECFSZ 28,F |
|
|
1444 |
04EA: GOTO 4E2 |
|
|
1445 |
.................... output_high(PIN_A4); |
|
|
1446 |
04EB: BSF 03.5 |
|
|
1447 |
04EC: BCF 05.4 |
|
|
1448 |
04ED: BCF 03.5 |
|
|
1449 |
04EE: BSF 05.4 |
|
|
1450 |
.................... printf("AT+CMGD=1\r"); //smaz prijatou SMSku |
|
|
1451 |
04EF: CLRF 28 |
|
|
1452 |
04F0: MOVF 28,W |
|
|
1453 |
04F1: CALL 07C |
|
|
1454 |
04F2: INCF 28,F |
|
|
1455 |
04F3: MOVWF 77 |
|
|
1456 |
04F4: MOVF 77,W |
|
|
1457 |
04F5: BTFSS 0C.4 |
|
|
1458 |
04F6: GOTO 4F5 |
|
|
1459 |
04F7: MOVWF 19 |
|
|
1460 |
04F8: MOVLW 0A |
|
|
1461 |
04F9: SUBWF 28,W |
|
|
1462 |
04FA: BTFSS 03.2 |
|
|
1463 |
04FB: GOTO 4F0 |
|
|
1464 |
.................... |
|
|
1465 |
.................... if (odp[0] > 64 && odp[0] < 91 ) |
|
|
1466 |
04FC: BSF 03.6 |
|
|
1467 |
04FD: MOVF 10,W |
|
|
1468 |
04FE: SUBLW 40 |
|
|
1469 |
04FF: BTFSC 03.0 |
|
|
1470 |
0500: GOTO 507 |
|
|
1471 |
0501: MOVF 10,W |
|
|
1472 |
0502: SUBLW 5A |
|
|
1473 |
0503: BTFSS 03.0 |
|
|
1474 |
0504: GOTO 507 |
|
|
1475 |
.................... { |
|
|
1476 |
.................... odp[0] += 32; |
|
|
1477 |
0505: MOVLW 20 |
|
|
1478 |
0506: ADDWF 10,F |
|
|
1479 |
.................... } |
|
|
1480 |
.................... |
|
|
1481 |
.................... if (odp[1] > 64 && odp[1] < 91 ) |
|
|
1482 |
0507: MOVF 11,W |
|
|
1483 |
0508: SUBLW 40 |
|
|
1484 |
0509: BTFSC 03.0 |
|
|
1485 |
050A: GOTO 511 |
|
|
1486 |
050B: MOVF 11,W |
|
|
1487 |
050C: SUBLW 5A |
|
|
1488 |
050D: BTFSS 03.0 |
|
|
1489 |
050E: GOTO 511 |
|
|
1490 |
.................... { |
|
|
1491 |
.................... odp[1] += 32; |
|
|
1492 |
050F: MOVLW 20 |
|
|
1493 |
0510: ADDWF 11,F |
|
|
1494 |
.................... } |
|
|
1495 |
.................... |
|
|
1496 |
.................... if (odp[2] > 64 && odp[2] < 91 ) |
|
|
1497 |
0511: MOVF 12,W |
|
|
1498 |
0512: SUBLW 40 |
|
|
1499 |
0513: BTFSC 03.0 |
|
|
1500 |
0514: GOTO 51B |
|
|
1501 |
0515: MOVF 12,W |
|
|
1502 |
0516: SUBLW 5A |
|
|
1503 |
0517: BTFSS 03.0 |
|
|
1504 |
0518: GOTO 51B |
|
|
1505 |
.................... { |
|
|
1506 |
.................... odp[2] += 32; |
|
|
1507 |
0519: MOVLW 20 |
|
|
1508 |
051A: ADDWF 12,F |
|
|
1509 |
.................... } |
|
|
1510 |
.................... |
|
|
1511 |
.................... if (odp[3] > 64 && odp[3] < 91 ) |
|
|
1512 |
051B: MOVF 13,W |
|
|
1513 |
051C: SUBLW 40 |
|
|
1514 |
051D: BTFSC 03.0 |
|
|
1515 |
051E: GOTO 525 |
|
|
1516 |
051F: MOVF 13,W |
|
|
1517 |
0520: SUBLW 5A |
|
|
1518 |
0521: BTFSS 03.0 |
|
|
1519 |
0522: GOTO 525 |
|
|
1520 |
.................... { |
|
|
1521 |
.................... odp[3] += 32; |
|
|
1522 |
0523: MOVLW 20 |
|
|
1523 |
0524: ADDWF 13,F |
|
|
1524 |
.................... } |
|
|
1525 |
.................... |
|
|
1526 |
.................... lcd_gotoxy(1,1); |
|
|
1527 |
0525: MOVLW 01 |
|
|
1528 |
0526: BSF 03.5 |
|
|
1529 |
0527: MOVWF 1A |
|
|
1530 |
0528: MOVWF 1B |
|
|
1531 |
0529: BCF 03.5 |
|
|
1532 |
052A: BCF 03.6 |
|
|
1533 |
052B: CALL 1D7 |
|
|
1534 |
.................... printf(lcd_putc,"\f Odstraneni velkych",); |
|
|
1535 |
052C: CLRF 28 |
|
|
1536 |
052D: MOVF 28,W |
|
|
1537 |
052E: CALL 08B |
|
|
1538 |
052F: INCF 28,F |
|
|
1539 |
0530: MOVWF 77 |
|
|
1540 |
0531: BSF 03.5 |
|
|
1541 |
0532: BSF 03.6 |
|
|
1542 |
0533: MOVWF 19 |
|
|
1543 |
0534: BCF 03.5 |
|
|
1544 |
0535: BCF 03.6 |
|
|
1545 |
0536: CALL 20C |
|
|
1546 |
0537: MOVLW 14 |
|
|
1547 |
0538: SUBWF 28,W |
|
|
1548 |
0539: BTFSS 03.2 |
|
|
1549 |
053A: GOTO 52D |
|
|
1550 |
.................... lcd_gotoxy(1,2); |
|
|
1551 |
053B: MOVLW 01 |
|
|
1552 |
053C: BSF 03.5 |
|
|
1553 |
053D: BSF 03.6 |
|
|
1554 |
053E: MOVWF 1A |
|
|
1555 |
053F: MOVLW 02 |
|
|
1556 |
0540: MOVWF 1B |
|
|
1557 |
0541: BCF 03.5 |
|
|
1558 |
0542: BCF 03.6 |
|
|
1559 |
0543: CALL 1D7 |
|
|
1560 |
.................... printf(lcd_putc," pismen"); |
|
|
1561 |
0544: CLRF 28 |
|
|
1562 |
0545: MOVF 28,W |
|
|
1563 |
0546: CALL 0A4 |
|
|
1564 |
0547: INCF 28,F |
|
|
1565 |
0548: MOVWF 77 |
|
|
1566 |
0549: BSF 03.5 |
|
|
1567 |
054A: BSF 03.6 |
|
|
1568 |
054B: MOVWF 19 |
|
|
1569 |
054C: BCF 03.5 |
|
|
1570 |
054D: BCF 03.6 |
|
|
1571 |
054E: CALL 20C |
|
|
1572 |
054F: MOVLW 0D |
|
|
1573 |
0550: SUBWF 28,W |
|
|
1574 |
0551: BTFSS 03.2 |
|
|
1575 |
0552: GOTO 545 |
|
|
1576 |
.................... lcd_gotoxy(9,4); |
|
|
1577 |
0553: MOVLW 09 |
|
|
1578 |
0554: BSF 03.5 |
|
|
1579 |
0555: BSF 03.6 |
|
|
1580 |
0556: MOVWF 1A |
|
|
1581 |
0557: MOVLW 04 |
|
|
1582 |
0558: MOVWF 1B |
|
|
1583 |
0559: BCF 03.5 |
|
|
1584 |
055A: BCF 03.6 |
|
|
1585 |
055B: CALL 1D7 |
|
|
1586 |
.................... printf(lcd_putc,"%s",odp); |
|
|
1587 |
055C: MOVLW 10 |
|
|
1588 |
055D: MOVWF 04 |
|
|
1589 |
055E: BSF 03.7 |
|
|
1590 |
055F: MOVLW 00 |
|
|
1591 |
0560: IORWF 00,W |
|
|
1592 |
0561: BTFSC 03.2 |
|
|
1593 |
0562: GOTO 577 |
|
|
1594 |
0563: CLRF 29 |
|
|
1595 |
0564: MOVF 04,W |
|
|
1596 |
0565: MOVWF 28 |
|
|
1597 |
0566: BCF 29.0 |
|
|
1598 |
0567: BTFSC 03.7 |
|
|
1599 |
0568: BSF 29.0 |
|
|
1600 |
0569: MOVF 00,W |
|
|
1601 |
056A: BSF 03.5 |
|
|
1602 |
056B: BSF 03.6 |
|
|
1603 |
056C: MOVWF 19 |
|
|
1604 |
056D: BCF 03.5 |
|
|
1605 |
056E: BCF 03.6 |
|
|
1606 |
056F: CALL 20C |
|
|
1607 |
0570: MOVF 28,W |
|
|
1608 |
0571: MOVWF 04 |
|
|
1609 |
0572: BCF 03.7 |
|
|
1610 |
0573: BTFSC 29.0 |
|
|
1611 |
0574: BSF 03.7 |
|
|
1612 |
0575: INCF 04,F |
|
|
1613 |
0576: GOTO 55F |
|
|
1614 |
.................... output_low(PIN_A4) ; |
|
|
1615 |
0577: BSF 03.5 |
|
|
1616 |
0578: BCF 05.4 |
|
|
1617 |
0579: BCF 03.5 |
|
|
1618 |
057A: BCF 05.4 |
|
|
1619 |
.................... delay_ms(5000); |
|
|
1620 |
057B: MOVLW 14 |
|
|
1621 |
057C: MOVWF 28 |
|
|
1622 |
057D: MOVLW FA |
|
|
1623 |
057E: BSF 03.5 |
|
|
1624 |
057F: BSF 03.6 |
|
|
1625 |
0580: MOVWF 1A |
|
|
1626 |
0581: BCF 03.5 |
|
|
1627 |
0582: BCF 03.6 |
|
|
1628 |
0583: CALL 125 |
|
|
1629 |
0584: DECFSZ 28,F |
|
|
1630 |
0585: GOTO 57D |
|
|
1631 |
.................... output_high(PIN_A4); |
|
|
1632 |
0586: BSF 03.5 |
|
|
1633 |
0587: BCF 05.4 |
|
|
1634 |
0588: BCF 03.5 |
|
|
1635 |
0589: BSF 05.4 |
|
|
1636 |
.................... |
|
|
1637 |
.................... |
|
|
1638 |
.................... if (odp[0] == 122 && odp[1] == 97 && odp[2] == 112 && odp[3] == 49) //odp=="zap1" |
|
|
1639 |
058A: BSF 03.6 |
|
|
1640 |
058B: MOVF 10,W |
|
|
1641 |
058C: SUBLW 7A |
|
|
1642 |
058D: BTFSS 03.2 |
|
|
1643 |
058E: GOTO 59F |
|
|
1644 |
058F: MOVF 11,W |
|
|
1645 |
0590: SUBLW 61 |
|
|
1646 |
0591: BTFSS 03.2 |
|
|
1647 |
0592: GOTO 59F |
|
|
1648 |
0593: MOVF 12,W |
|
|
1649 |
0594: SUBLW 70 |
|
|
1650 |
0595: BTFSS 03.2 |
|
|
1651 |
0596: GOTO 59F |
|
|
1652 |
0597: MOVF 13,W |
|
|
1653 |
0598: SUBLW 31 |
|
|
1654 |
0599: BTFSS 03.2 |
|
|
1655 |
059A: GOTO 59F |
|
|
1656 |
.................... { |
|
|
1657 |
.................... status=1; |
|
|
1658 |
059B: MOVLW 01 |
|
|
1659 |
059C: BCF 03.6 |
|
|
1660 |
059D: MOVWF 27 |
|
|
1661 |
059E: BSF 03.6 |
|
|
1662 |
.................... } |
|
|
1663 |
.................... |
|
|
1664 |
.................... if (odp[0] == 118 && odp[1] == 121 && odp[2] == 112 && odp[3]== 49) //odp=="vyp1" |
|
|
1665 |
059F: MOVF 10,W |
|
|
1666 |
05A0: SUBLW 76 |
|
|
1667 |
05A1: BTFSS 03.2 |
|
|
1668 |
05A2: GOTO 5B3 |
|
|
1669 |
05A3: MOVF 11,W |
|
|
1670 |
05A4: SUBLW 79 |
|
|
1671 |
05A5: BTFSS 03.2 |
|
|
1672 |
05A6: GOTO 5B3 |
|
|
1673 |
05A7: MOVF 12,W |
|
|
1674 |
05A8: SUBLW 70 |
|
|
1675 |
05A9: BTFSS 03.2 |
|
|
1676 |
05AA: GOTO 5B3 |
|
|
1677 |
05AB: MOVF 13,W |
|
|
1678 |
05AC: SUBLW 31 |
|
|
1679 |
05AD: BTFSS 03.2 |
|
|
1680 |
05AE: GOTO 5B3 |
|
|
1681 |
.................... { |
|
|
1682 |
.................... status=2; |
|
|
1683 |
05AF: MOVLW 02 |
|
|
1684 |
05B0: BCF 03.6 |
|
|
1685 |
05B1: MOVWF 27 |
|
|
1686 |
05B2: BSF 03.6 |
|
|
1687 |
.................... } |
|
|
1688 |
.................... |
|
|
1689 |
.................... if (odp[0] == 97 && odp[1] == 104 && odp[2] == 111 && odp[3]== 106) //odp=="ahoj" |
|
|
1690 |
05B3: MOVF 10,W |
|
|
1691 |
05B4: SUBLW 61 |
|
|
1692 |
05B5: BTFSS 03.2 |
|
|
1693 |
05B6: GOTO 5C7 |
|
|
1694 |
05B7: MOVF 11,W |
|
|
1695 |
05B8: SUBLW 68 |
|
|
1696 |
05B9: BTFSS 03.2 |
|
|
1697 |
05BA: GOTO 5C7 |
|
|
1698 |
05BB: MOVF 12,W |
|
|
1699 |
05BC: SUBLW 6F |
|
|
1700 |
05BD: BTFSS 03.2 |
|
|
1701 |
05BE: GOTO 5C7 |
|
|
1702 |
05BF: MOVF 13,W |
|
|
1703 |
05C0: SUBLW 6A |
|
|
1704 |
05C1: BTFSS 03.2 |
|
|
1705 |
05C2: GOTO 5C7 |
|
|
1706 |
.................... { |
|
|
1707 |
.................... status=3; |
|
|
1708 |
05C3: MOVLW 03 |
|
|
1709 |
05C4: BCF 03.6 |
|
|
1710 |
05C5: MOVWF 27 |
|
|
1711 |
05C6: BSF 03.6 |
|
|
1712 |
.................... } |
|
|
1713 |
.................... |
|
|
1714 |
.................... switch (status) { |
|
|
1715 |
05C7: BCF 03.6 |
|
|
1716 |
05C8: MOVF 27,W |
|
|
1717 |
05C9: XORLW 01 |
|
|
1718 |
05CA: BTFSC 03.2 |
|
|
1719 |
05CB: GOTO 5D3 |
|
|
1720 |
05CC: XORLW 03 |
|
|
1721 |
05CD: BTFSC 03.2 |
|
|
1722 |
05CE: GOTO 5F7 |
|
|
1723 |
05CF: XORLW 01 |
|
|
1724 |
05D0: BTFSC 03.2 |
|
|
1725 |
05D1: GOTO 61B |
|
|
1726 |
05D2: GOTO 63B |
|
|
1727 |
.................... |
|
|
1728 |
.................... case 1: output_low(zar1); |
|
|
1729 |
05D3: BSF 03.5 |
|
|
1730 |
05D4: BCF 05.3 |
|
|
1731 |
05D5: BCF 03.5 |
|
|
1732 |
05D6: BCF 05.3 |
|
|
1733 |
.................... printf(lcd_putc,"\f"); |
|
|
1734 |
05D7: MOVLW 0C |
|
|
1735 |
05D8: BSF 03.5 |
|
|
1736 |
05D9: BSF 03.6 |
|
|
1737 |
05DA: MOVWF 19 |
|
|
1738 |
05DB: BCF 03.5 |
|
|
1739 |
05DC: BCF 03.6 |
|
|
1740 |
05DD: CALL 20C |
|
|
1741 |
.................... lcd_gotoxy(1,2); |
|
|
1742 |
05DE: MOVLW 01 |
|
|
1743 |
05DF: BSF 03.5 |
|
|
1744 |
05E0: BSF 03.6 |
|
|
1745 |
05E1: MOVWF 1A |
|
|
1746 |
05E2: MOVLW 02 |
|
|
1747 |
05E3: MOVWF 1B |
|
|
1748 |
05E4: BCF 03.5 |
|
|
1749 |
05E5: BCF 03.6 |
|
|
1750 |
05E6: CALL 1D7 |
|
|
1751 |
.................... printf(lcd_putc," Zapnuto zarizeni 1"); |
|
|
1752 |
05E7: CLRF 28 |
|
|
1753 |
05E8: MOVF 28,W |
|
|
1754 |
05E9: CALL 0B6 |
|
|
1755 |
05EA: INCF 28,F |
|
|
1756 |
05EB: MOVWF 77 |
|
|
1757 |
05EC: BSF 03.5 |
|
|
1758 |
05ED: BSF 03.6 |
|
|
1759 |
05EE: MOVWF 19 |
|
|
1760 |
05EF: BCF 03.5 |
|
|
1761 |
05F0: BCF 03.6 |
|
|
1762 |
05F1: CALL 20C |
|
|
1763 |
05F2: MOVLW 13 |
|
|
1764 |
05F3: SUBWF 28,W |
|
|
1765 |
05F4: BTFSS 03.2 |
|
|
1766 |
05F5: GOTO 5E8 |
|
|
1767 |
.................... break; |
|
|
1768 |
05F6: GOTO 673 |
|
|
1769 |
.................... |
|
|
1770 |
.................... case 2: output_high(zar1); |
|
|
1771 |
05F7: BSF 03.5 |
|
|
1772 |
05F8: BCF 05.3 |
|
|
1773 |
05F9: BCF 03.5 |
|
|
1774 |
05FA: BSF 05.3 |
|
|
1775 |
.................... printf(lcd_putc,"\f"); |
|
|
1776 |
05FB: MOVLW 0C |
|
|
1777 |
05FC: BSF 03.5 |
|
|
1778 |
05FD: BSF 03.6 |
|
|
1779 |
05FE: MOVWF 19 |
|
|
1780 |
05FF: BCF 03.5 |
|
|
1781 |
0600: BCF 03.6 |
|
|
1782 |
0601: CALL 20C |
|
|
1783 |
.................... lcd_gotoxy(1,2); |
|
|
1784 |
0602: MOVLW 01 |
|
|
1785 |
0603: BSF 03.5 |
|
|
1786 |
0604: BSF 03.6 |
|
|
1787 |
0605: MOVWF 1A |
|
|
1788 |
0606: MOVLW 02 |
|
|
1789 |
0607: MOVWF 1B |
|
|
1790 |
0608: BCF 03.5 |
|
|
1791 |
0609: BCF 03.6 |
|
|
1792 |
060A: CALL 1D7 |
|
|
1793 |
.................... printf(lcd_putc," Vypnuto zarizeni 1"); |
|
|
1794 |
060B: CLRF 28 |
|
|
1795 |
060C: MOVF 28,W |
|
|
1796 |
060D: CALL 0CE |
|
|
1797 |
060E: INCF 28,F |
|
|
1798 |
060F: MOVWF 77 |
|
|
1799 |
0610: BSF 03.5 |
|
|
1800 |
0611: BSF 03.6 |
|
|
1801 |
0612: MOVWF 19 |
|
|
1802 |
0613: BCF 03.5 |
|
|
1803 |
0614: BCF 03.6 |
|
|
1804 |
0615: CALL 20C |
|
|
1805 |
0616: MOVLW 13 |
|
|
1806 |
0617: SUBWF 28,W |
|
|
1807 |
0618: BTFSS 03.2 |
|
|
1808 |
0619: GOTO 60C |
|
|
1809 |
.................... break; |
|
|
1810 |
061A: GOTO 673 |
|
|
1811 |
.................... |
|
|
1812 |
.................... case 3: printf(lcd_putc,"\f"); |
|
|
1813 |
061B: MOVLW 0C |
|
|
1814 |
061C: BSF 03.5 |
|
|
1815 |
061D: BSF 03.6 |
|
|
1816 |
061E: MOVWF 19 |
|
|
1817 |
061F: BCF 03.5 |
|
|
1818 |
0620: BCF 03.6 |
|
|
1819 |
0621: CALL 20C |
|
|
1820 |
.................... lcd_gotoxy(1,2); |
|
|
1821 |
0622: MOVLW 01 |
|
|
1822 |
0623: BSF 03.5 |
|
|
1823 |
0624: BSF 03.6 |
|
|
1824 |
0625: MOVWF 1A |
|
|
1825 |
0626: MOVLW 02 |
|
|
1826 |
0627: MOVWF 1B |
|
|
1827 |
0628: BCF 03.5 |
|
|
1828 |
0629: BCF 03.6 |
|
|
1829 |
062A: CALL 1D7 |
|
|
1830 |
.................... printf(lcd_putc," Preji hezky den!"); |
|
|
1831 |
062B: CLRF 28 |
|
|
1832 |
062C: MOVF 28,W |
|
|
1833 |
062D: CALL 0E6 |
|
|
1834 |
062E: INCF 28,F |
|
|
1835 |
062F: MOVWF 77 |
|
|
1836 |
0630: BSF 03.5 |
|
|
1837 |
0631: BSF 03.6 |
|
|
1838 |
0632: MOVWF 19 |
|
|
1839 |
0633: BCF 03.5 |
|
|
1840 |
0634: BCF 03.6 |
|
|
1841 |
0635: CALL 20C |
|
|
1842 |
0636: MOVLW 12 |
|
|
1843 |
0637: SUBWF 28,W |
|
|
1844 |
0638: BTFSS 03.2 |
|
|
1845 |
0639: GOTO 62C |
|
|
1846 |
.................... break; |
|
|
1847 |
063A: GOTO 673 |
|
|
1848 |
.................... |
|
|
1849 |
.................... default: printf(lcd_putc,"\f"); |
|
|
1850 |
063B: MOVLW 0C |
|
|
1851 |
063C: BSF 03.5 |
|
|
1852 |
063D: BSF 03.6 |
|
|
1853 |
063E: MOVWF 19 |
|
|
1854 |
063F: BCF 03.5 |
|
|
1855 |
0640: BCF 03.6 |
|
|
1856 |
0641: CALL 20C |
|
|
1857 |
.................... lcd_gotoxy(1,2); |
|
|
1858 |
0642: MOVLW 01 |
|
|
1859 |
0643: BSF 03.5 |
|
|
1860 |
0644: BSF 03.6 |
|
|
1861 |
0645: MOVWF 1A |
|
|
1862 |
0646: MOVLW 02 |
|
|
1863 |
0647: MOVWF 1B |
|
|
1864 |
0648: BCF 03.5 |
|
|
1865 |
0649: BCF 03.6 |
|
|
1866 |
064A: CALL 1D7 |
|
|
1867 |
.................... printf(lcd_putc," Prikaz nebyl"); |
|
|
1868 |
064B: CLRF 28 |
|
|
1869 |
064C: MOVF 28,W |
|
|
1870 |
064D: CALL 0FD |
|
|
1871 |
064E: INCF 28,F |
|
|
1872 |
064F: MOVWF 77 |
|
|
1873 |
0650: BSF 03.5 |
|
|
1874 |
0651: BSF 03.6 |
|
|
1875 |
0652: MOVWF 19 |
|
|
1876 |
0653: BCF 03.5 |
|
|
1877 |
0654: BCF 03.6 |
|
|
1878 |
0655: CALL 20C |
|
|
1879 |
0656: MOVLW 10 |
|
|
1880 |
0657: SUBWF 28,W |
|
|
1881 |
0658: BTFSS 03.2 |
|
|
1882 |
0659: GOTO 64C |
|
|
1883 |
.................... lcd_gotoxy(1,3); |
|
|
1884 |
065A: MOVLW 01 |
|
|
1885 |
065B: BSF 03.5 |
|
|
1886 |
065C: BSF 03.6 |
|
|
1887 |
065D: MOVWF 1A |
|
|
1888 |
065E: MOVLW 03 |
|
|
1889 |
065F: MOVWF 1B |
|
|
1890 |
0660: BCF 03.5 |
|
|
1891 |
0661: BCF 03.6 |
|
|
1892 |
0662: CALL 1D7 |
|
|
1893 |
.................... printf(lcd_putc," rozeznan"); |
|
|
1894 |
0663: CLRF 28 |
|
|
1895 |
0664: MOVF 28,W |
|
|
1896 |
0665: CALL 112 |
|
|
1897 |
0666: INCF 28,F |
|
|
1898 |
0667: MOVWF 77 |
|
|
1899 |
0668: BSF 03.5 |
|
|
1900 |
0669: BSF 03.6 |
|
|
1901 |
066A: MOVWF 19 |
|
|
1902 |
066B: BCF 03.5 |
|
|
1903 |
066C: BCF 03.6 |
|
|
1904 |
066D: CALL 20C |
|
|
1905 |
066E: MOVLW 0E |
|
|
1906 |
066F: SUBWF 28,W |
|
|
1907 |
0670: BTFSS 03.2 |
|
|
1908 |
0671: GOTO 664 |
|
|
1909 |
.................... break; } |
|
|
1910 |
0672: GOTO 673 |
|
|
1911 |
.................... |
|
|
1912 |
.................... delay_ms(5000); |
|
|
1913 |
0673: MOVLW 14 |
|
|
1914 |
0674: MOVWF 28 |
|
|
1915 |
0675: MOVLW FA |
|
|
1916 |
0676: BSF 03.5 |
|
|
1917 |
0677: BSF 03.6 |
|
|
1918 |
0678: MOVWF 1A |
|
|
1919 |
0679: BCF 03.5 |
|
|
1920 |
067A: BCF 03.6 |
|
|
1921 |
067B: CALL 125 |
|
|
1922 |
067C: DECFSZ 28,F |
|
|
1923 |
067D: GOTO 675 |
|
|
1924 |
.................... } |
|
|
1925 |
.................... } |
|
|
1926 |
067E: GOTO 2BE |
|
|
1927 |
.................... } |
|
|
1928 |
067F: SLEEP |
|
|
1929 |
|
|
|
1930 |
Configuration Fuses: |
|
|
1931 |
Word 1: 3F3D XT WDT NOPUT NODEBUG NOPROTECT NOBROWNOUT NOLVP NOCPD NOWRT |