129 |
kapl |
1 |
CCS PCM C Compiler, Version 4.059d, 15399 03-I-08 17:43 |
|
|
2 |
|
|
|
3 |
Filename: C:\RS\projekty\lcdmob2\.\main.lst |
|
|
4 |
|
|
|
5 |
ROM used: 1040 words (51%) |
|
|
6 |
Largest free fragment is 1008 |
|
|
7 |
RAM used: 165 (45%) at main() level |
|
|
8 |
234 (64%) worst case |
|
|
9 |
Stack: 4 locations |
|
|
10 |
|
|
|
11 |
* |
|
|
12 |
0000: MOVLW 00 |
|
|
13 |
0001: MOVWF 0A |
|
|
14 |
0002: GOTO 14E |
|
|
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 NOWDT //No 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 |
0062: MOVLW 41 |
|
|
36 |
0063: MOVWF 04 |
|
|
37 |
0064: BSF 03.7 |
|
|
38 |
0065: MOVF 00,W |
|
|
39 |
0066: BTFSC 03.2 |
|
|
40 |
0067: GOTO 079 |
|
|
41 |
0068: MOVLW 01 |
|
|
42 |
0069: MOVWF 78 |
|
|
43 |
006A: MOVLW BF |
|
|
44 |
006B: MOVWF 77 |
|
|
45 |
006C: CLRWDT |
|
|
46 |
006D: DECFSZ 77,F |
|
|
47 |
006E: GOTO 06C |
|
|
48 |
006F: DECFSZ 78,F |
|
|
49 |
0070: GOTO 06A |
|
|
50 |
0071: MOVLW 4A |
|
|
51 |
0072: MOVWF 77 |
|
|
52 |
0073: DECFSZ 77,F |
|
|
53 |
0074: GOTO 073 |
|
|
54 |
0075: NOP |
|
|
55 |
0076: CLRWDT |
|
|
56 |
0077: DECFSZ 00,F |
|
|
57 |
0078: GOTO 068 |
|
|
58 |
0079: RETLW 00 |
|
|
59 |
.................... #use rs232(baud=19200,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8) |
|
|
60 |
.................... |
|
|
61 |
.................... |
|
|
62 |
.................... |
|
|
63 |
.................... #define LCD_RS PIN_B1 // rizeni registru LCD displeje |
|
|
64 |
.................... #define LCD_E PIN_B0 // enable LCD displeje |
|
|
65 |
.................... #define LCD_DATA_LSB PIN_C0 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou) |
|
|
66 |
.................... |
|
|
67 |
.................... #include "lcd.c" |
|
|
68 |
.................... // LCD modul pro ovladani dvouradkoveho LCD modulu se standardnim Hitachi radicem |
|
|
69 |
.................... // (c)miho 2002,2005 |
|
|
70 |
.................... // |
|
|
71 |
.................... // Historie: |
|
|
72 |
.................... // |
|
|
73 |
.................... // 0.00 Uvodni verze se snadnou definici portu LCD displeje |
|
|
74 |
.................... // 0.01 Oprava portu (zapomenute stare identifikatory) |
|
|
75 |
.................... // 0.02 Doplnena moznost pripojeni datoveho portu LCD na libovolne porty |
|
|
76 |
.................... // 0.03 Doplnena procedura lcd_clr pro smazani displeje |
|
|
77 |
.................... // |
|
|
78 |
.................... // |
|
|
79 |
.................... // Funkce: |
|
|
80 |
.................... // |
|
|
81 |
.................... // lcd_init() inicializuje LCD displej a porty, nutno volat jako prvni |
|
|
82 |
.................... // |
|
|
83 |
.................... // lcd_putc(c) zapis snaku do lcd displeje, zpracovava nasledujici ridici znaky |
|
|
84 |
.................... // \f = \x0C - nova stranka - smazani displeje |
|
|
85 |
.................... // \n = \x0A - odradkovani (prechod na druhou radku) |
|
|
86 |
.................... // \b = \x08 - backspace - posunuti kurzoru o 1 pozici zpet |
|
|
87 |
.................... // \r = \x0D - goto home to position 1,1 |
|
|
88 |
.................... // \0 .. \7 - definovatelne znaky v pozicich 0 az 7 v CGRAM |
|
|
89 |
.................... // \20 .. \27 - alternativne zapsane znaky (oktalove) v pozicich 0 az 7 CGRAM |
|
|
90 |
.................... // Pozor na to, ze funkce printf konci tisk pokud narazi na \0 (konec retezce) |
|
|
91 |
.................... // |
|
|
92 |
.................... // lcd_gotoxy(x,y) presune kurzor na uvedenou adresu |
|
|
93 |
.................... // nekontroluje parametry |
|
|
94 |
.................... // |
|
|
95 |
.................... // lcd_cursor_on zapne kurzor |
|
|
96 |
.................... // lcd_cursor_off vypne kurzor |
|
|
97 |
.................... // |
|
|
98 |
.................... // lcd_clr smaze displej |
|
|
99 |
.................... // |
|
|
100 |
.................... // lcd_define_char(Index, Def) Makro, ktere definuje znaky od pozice Index obsahem definicniho |
|
|
101 |
.................... // retezce Def. Kazdych 8 znaku retezce Def definuje dalsi znak v CGRAM. |
|
|
102 |
.................... // Kapacita CGRAM je celkem 8 znaku s indexem 0 az 7. |
|
|
103 |
.................... // Na konci se provede lcd_gotoxy(1,1). |
|
|
104 |
.................... // Na konci teto knihovny je priklad pouziti definovanych znaku |
|
|
105 |
.................... // |
|
|
106 |
.................... // |
|
|
107 |
.................... // Definice portu: // Datovy port displeje pripojeny na 4 bity za sebou na jeden port |
|
|
108 |
.................... // |
|
|
109 |
.................... // #define LCD_RS PIN_B2 // rizeni registru LCD displeje |
|
|
110 |
.................... // #define LCD_E PIN_B1 // enable LCD displeje |
|
|
111 |
.................... // #define LCD_DATA_LSB PIN_C2 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou) |
|
|
112 |
.................... // |
|
|
113 |
.................... // |
|
|
114 |
.................... // Alternativni definice: // Datovy port displeje pripojeny na libovolne 4 bitove porty (vede na kod delsi asi o 25 slov) |
|
|
115 |
.................... // |
|
|
116 |
.................... // #define LCD_RS PIN_B2 // rizeni registru LCD displeje |
|
|
117 |
.................... // #define LCD_E PIN_B1 // enable LCD displeje |
|
|
118 |
.................... // #define LCD_D0 PIN_C2 // D0 - datove bity pripojene na libovolne porty |
|
|
119 |
.................... // #define LCD_D1 PIN_C3 // D1 |
|
|
120 |
.................... // #define LCD_D2 PIN_C4 // D2 |
|
|
121 |
.................... // #define LCD_D3 PIN_C5 // D3 |
|
|
122 |
.................... |
|
|
123 |
.................... |
|
|
124 |
.................... |
|
|
125 |
.................... |
|
|
126 |
.................... // Privatni sekce, cist jen v pripade, ze neco nefunguje |
|
|
127 |
.................... |
|
|
128 |
.................... |
|
|
129 |
.................... |
|
|
130 |
.................... |
|
|
131 |
.................... #ifdef LCD_DATA_LSB |
|
|
132 |
.................... // Generovane defince portu pro ucely teto knihovny aby kod generoval spravne IO operace a soucasne |
|
|
133 |
.................... // bylo mozne jednoduse deklarovat pripojene piny LCD displeje pri pouziti teto knihovny. Problem spociva |
|
|
134 |
.................... // v tom, ze se musi spravne ridit smery portu a soucasne datovy port zabira jen 4 bity ze zadaneho portu |
|
|
135 |
.................... // |
|
|
136 |
.................... #define LCD_SHIFT (LCD_DATA_LSB&7) // pocet bitu posuvu datoveho kanalu v datovem portu |
|
|
137 |
.................... #define LCD_PORT (LCD_DATA_LSB>>3) // adresa LCD datoveho portu |
|
|
138 |
.................... #define LCD_TRIS (LCD_PORT+0x80) // adresa prislusneho TRIS registru |
|
|
139 |
.................... #define LCD_MASK (0xF<<LCD_SHIFT) // maska platnych bitu |
|
|
140 |
.................... // |
|
|
141 |
.................... #if LCD_SHIFT>4 // kontrola mezi |
|
|
142 |
.................... #error LCD data port LSB bit not in range 0..4 |
|
|
143 |
.................... #endif |
|
|
144 |
.................... #endif |
|
|
145 |
.................... |
|
|
146 |
.................... |
|
|
147 |
.................... // Definice konstant pro LCD display |
|
|
148 |
.................... // |
|
|
149 |
.................... #define LCD_CURSOR_ON_ 0x0E // kurzor jako blikajici radka pod znakem |
|
|
150 |
.................... #define LCD_CURSOR_OFF_ 0x0C // zadny kurzor |
|
|
151 |
.................... #define LCD_LINE_2 0x40 // adresa 1. znaku 2. radky |
|
|
152 |
.................... |
|
|
153 |
.................... |
|
|
154 |
.................... // Definice rezimu LCD displeje |
|
|
155 |
.................... // |
|
|
156 |
.................... BYTE const LCD_INIT_STRING[4] = |
|
|
157 |
.................... { |
|
|
158 |
.................... 0x28, // intrfejs 4 bity, 2 radky, font 5x7 |
|
|
159 |
.................... LCD_CURSOR_OFF_, // display on, kurzor off, |
|
|
160 |
.................... 0x01, // clear displeje |
|
|
161 |
.................... 0x06 // inkrement pozice kurzoru (posun kurzoru doprava) |
|
|
162 |
.................... }; |
|
|
163 |
.................... |
|
|
164 |
.................... |
|
|
165 |
.................... // Odesle nibble do displeje (posle data a klikne signalem e) |
|
|
166 |
.................... // |
|
|
167 |
.................... void lcd_send_nibble( BYTE n ) |
|
|
168 |
.................... { |
|
|
169 |
.................... #ifdef LCD_DATA_LSB |
|
|
170 |
.................... // data jsou za sebou na 4 bitech jednoho portu |
|
|
171 |
.................... *LCD_PORT = (*LCD_PORT & ~LCD_MASK) | ((n << LCD_SHIFT) & LCD_MASK); // nastav datove bity portu a ostatni zachovej |
|
|
172 |
007A: MOVF 07,W |
|
|
173 |
007B: ANDLW F0 |
|
|
174 |
007C: BSF 03.6 |
|
|
175 |
007D: MOVWF 48 |
|
|
176 |
007E: MOVF 47,W |
|
|
177 |
007F: ANDLW 0F |
|
|
178 |
0080: IORWF 48,W |
|
|
179 |
0081: BCF 03.6 |
|
|
180 |
0082: MOVWF 07 |
|
|
181 |
.................... #else |
|
|
182 |
.................... // data jsou na libovolnych 4 bitech libovolnych portu |
|
|
183 |
.................... output_bit(LCD_D0,bit_test(n,0)); |
|
|
184 |
.................... output_bit(LCD_D1,bit_test(n,1)); |
|
|
185 |
.................... output_bit(LCD_D2,bit_test(n,2)); |
|
|
186 |
.................... output_bit(LCD_D3,bit_test(n,3)); |
|
|
187 |
.................... #endif |
|
|
188 |
.................... output_bit(LCD_E,1); // vzestupna hrana |
|
|
189 |
0083: BSF 06.0 |
|
|
190 |
0084: BSF 03.5 |
|
|
191 |
0085: BCF 06.0 |
|
|
192 |
.................... delay_us(1); // pockej alespon 450ns od e nebo alespon 195ns od dat |
|
|
193 |
0086: CLRWDT |
|
|
194 |
.................... output_bit(LCD_E,0); // sestupna hrana (minimalni perioda e je 1us) |
|
|
195 |
0087: BCF 03.5 |
|
|
196 |
0088: BCF 06.0 |
|
|
197 |
0089: BSF 03.5 |
|
|
198 |
008A: BCF 06.0 |
|
|
199 |
.................... } |
|
|
200 |
008B: BCF 03.5 |
|
|
201 |
008C: RETLW 00 |
|
|
202 |
.................... |
|
|
203 |
.................... |
|
|
204 |
.................... // Odesle bajt do registru LCD |
|
|
205 |
.................... // |
|
|
206 |
.................... // Pokud je Adr=0 .. instrukcni registr |
|
|
207 |
.................... // Pokud je Adr=1 .. datovy registr |
|
|
208 |
.................... // |
|
|
209 |
.................... void lcd_send_byte( BOOLEAN Adr, BYTE n ) |
|
|
210 |
.................... { |
|
|
211 |
.................... output_bit(LCD_RS,Adr); // vyber registr |
|
|
212 |
008D: BSF 03.6 |
|
|
213 |
008E: MOVF 45,F |
|
|
214 |
008F: BTFSS 03.2 |
|
|
215 |
0090: GOTO 095 |
|
|
216 |
0091: BCF 03.6 |
|
|
217 |
0092: BCF 06.1 |
|
|
218 |
0093: GOTO 097 |
|
|
219 |
0094: BSF 03.6 |
|
|
220 |
0095: BCF 03.6 |
|
|
221 |
0096: BSF 06.1 |
|
|
222 |
0097: BSF 03.5 |
|
|
223 |
0098: BCF 06.1 |
|
|
224 |
.................... swap(n); |
|
|
225 |
0099: BCF 03.5 |
|
|
226 |
009A: BSF 03.6 |
|
|
227 |
009B: SWAPF 46,F |
|
|
228 |
.................... lcd_send_nibble(n); // posli horni pulku bajtu |
|
|
229 |
009C: MOVF 46,W |
|
|
230 |
009D: MOVWF 47 |
|
|
231 |
009E: BCF 03.6 |
|
|
232 |
009F: CALL 07A |
|
|
233 |
.................... swap(n); |
|
|
234 |
00A0: BSF 03.6 |
|
|
235 |
00A1: SWAPF 46,F |
|
|
236 |
.................... lcd_send_nibble(n); // posli spodni pulku bajtu |
|
|
237 |
00A2: MOVF 46,W |
|
|
238 |
00A3: MOVWF 47 |
|
|
239 |
00A4: BCF 03.6 |
|
|
240 |
00A5: CALL 07A |
|
|
241 |
.................... delay_us(40); // minimalni doba na provedeni prikazu |
|
|
242 |
00A6: CLRWDT |
|
|
243 |
00A7: MOVLW 0C |
|
|
244 |
00A8: MOVWF 77 |
|
|
245 |
00A9: DECFSZ 77,F |
|
|
246 |
00AA: GOTO 0A9 |
|
|
247 |
00AB: GOTO 0AC |
|
|
248 |
.................... } |
|
|
249 |
00AC: RETLW 00 |
|
|
250 |
.................... |
|
|
251 |
.................... |
|
|
252 |
.................... // Provede inicializaci LCD displeje, smaze obsah a nastavi mod displeje |
|
|
253 |
.................... // |
|
|
254 |
.................... // Tato procedura se musi volat pred pouzitim ostatnich lcd_ procedur |
|
|
255 |
.................... // |
|
|
256 |
.................... void lcd_init() |
|
|
257 |
.................... { |
|
|
258 |
.................... |
|
|
259 |
.................... int i; // pocitadlo cyklu |
|
|
260 |
.................... |
|
|
261 |
.................... delay_ms(20); // spozdeni pro provedeni startu displeje po zapnuti napajeni |
|
|
262 |
00AD: MOVLW 14 |
|
|
263 |
00AE: BSF 03.6 |
|
|
264 |
00AF: MOVWF 41 |
|
|
265 |
00B0: BCF 03.6 |
|
|
266 |
00B1: CALL 062 |
|
|
267 |
.................... |
|
|
268 |
.................... #ifdef LCD_DATA_LSB |
|
|
269 |
.................... // data jsou na 4 bitech za sebou, nastav smer pro vsechny dalsi prenosy |
|
|
270 |
.................... *LCD_TRIS = *LCD_TRIS & ~LCD_MASK; // nuluj odpovidajici bity tris registru datoveho portu LCD |
|
|
271 |
00B2: MOVLW F0 |
|
|
272 |
00B3: BSF 03.5 |
|
|
273 |
00B4: ANDWF 07,F |
|
|
274 |
.................... #endif |
|
|
275 |
.................... |
|
|
276 |
.................... output_bit(LCD_RS,0); // nastav jako vystup a nastav klidovy stav |
|
|
277 |
00B5: BCF 03.5 |
|
|
278 |
00B6: BCF 06.1 |
|
|
279 |
00B7: BSF 03.5 |
|
|
280 |
00B8: BCF 06.1 |
|
|
281 |
.................... output_bit(LCD_E, 0); // nastav jako vystup a nastav klidovy stav |
|
|
282 |
00B9: BCF 03.5 |
|
|
283 |
00BA: BCF 06.0 |
|
|
284 |
00BB: BSF 03.5 |
|
|
285 |
00BC: BCF 06.0 |
|
|
286 |
.................... |
|
|
287 |
.................... for (i=0; i<3; i++) // nastav lcd do rezimu 8 bitu sbernice |
|
|
288 |
00BD: BCF 03.5 |
|
|
289 |
00BE: BSF 03.6 |
|
|
290 |
00BF: CLRF 3D |
|
|
291 |
00C0: MOVF 3D,W |
|
|
292 |
00C1: SUBLW 02 |
|
|
293 |
00C2: BTFSS 03.0 |
|
|
294 |
00C3: GOTO 0D0 |
|
|
295 |
.................... { |
|
|
296 |
.................... delay_ms(2); // muze byt rozdelany prenos dat (2x 4 bity) nebo pomaly povel |
|
|
297 |
00C4: MOVLW 02 |
|
|
298 |
00C5: MOVWF 41 |
|
|
299 |
00C6: BCF 03.6 |
|
|
300 |
00C7: CALL 062 |
|
|
301 |
.................... lcd_send_nibble(3); // rezim 8 bitu |
|
|
302 |
00C8: MOVLW 03 |
|
|
303 |
00C9: BSF 03.6 |
|
|
304 |
00CA: MOVWF 47 |
|
|
305 |
00CB: BCF 03.6 |
|
|
306 |
00CC: CALL 07A |
|
|
307 |
.................... } |
|
|
308 |
00CD: BSF 03.6 |
|
|
309 |
00CE: INCF 3D,F |
|
|
310 |
00CF: GOTO 0C0 |
|
|
311 |
.................... |
|
|
312 |
.................... delay_us(40); // cas na zpracovani |
|
|
313 |
00D0: CLRWDT |
|
|
314 |
00D1: MOVLW 0C |
|
|
315 |
00D2: MOVWF 77 |
|
|
316 |
00D3: DECFSZ 77,F |
|
|
317 |
00D4: GOTO 0D3 |
|
|
318 |
00D5: GOTO 0D6 |
|
|
319 |
.................... lcd_send_nibble(2); // nastav rezim 4 bitu (plati od nasledujiciho prenosu) |
|
|
320 |
00D6: MOVLW 02 |
|
|
321 |
00D7: MOVWF 47 |
|
|
322 |
00D8: BCF 03.6 |
|
|
323 |
00D9: CALL 07A |
|
|
324 |
.................... delay_us(40); // cas na zpracovani |
|
|
325 |
00DA: CLRWDT |
|
|
326 |
00DB: MOVLW 0C |
|
|
327 |
00DC: MOVWF 77 |
|
|
328 |
00DD: DECFSZ 77,F |
|
|
329 |
00DE: GOTO 0DD |
|
|
330 |
00DF: GOTO 0E0 |
|
|
331 |
.................... |
|
|
332 |
.................... for (i=0;i<3;i++) // proved inicializaci (nastaveni modu, smazani apod) |
|
|
333 |
00E0: BSF 03.6 |
|
|
334 |
00E1: CLRF 3D |
|
|
335 |
00E2: MOVF 3D,W |
|
|
336 |
00E3: SUBLW 02 |
|
|
337 |
00E4: BTFSS 03.0 |
|
|
338 |
00E5: GOTO 0F8 |
|
|
339 |
.................... { |
|
|
340 |
.................... lcd_send_byte(0,LCD_INIT_STRING[i]); |
|
|
341 |
00E6: MOVF 3D,W |
|
|
342 |
00E7: BCF 03.6 |
|
|
343 |
00E8: CALL 004 |
|
|
344 |
00E9: BSF 03.6 |
|
|
345 |
00EA: MOVWF 3E |
|
|
346 |
00EB: CLRF 45 |
|
|
347 |
00EC: MOVF 3E,W |
|
|
348 |
00ED: MOVWF 46 |
|
|
349 |
00EE: BCF 03.6 |
|
|
350 |
00EF: CALL 08D |
|
|
351 |
.................... delay_ms(2); |
|
|
352 |
00F0: MOVLW 02 |
|
|
353 |
00F1: BSF 03.6 |
|
|
354 |
00F2: MOVWF 41 |
|
|
355 |
00F3: BCF 03.6 |
|
|
356 |
00F4: CALL 062 |
|
|
357 |
.................... } |
|
|
358 |
00F5: BSF 03.6 |
|
|
359 |
00F6: INCF 3D,F |
|
|
360 |
00F7: GOTO 0E2 |
|
|
361 |
.................... } |
|
|
362 |
00F8: BCF 03.6 |
|
|
363 |
00F9: GOTO 190 (RETURN) |
|
|
364 |
.................... |
|
|
365 |
.................... |
|
|
366 |
.................... // Proved presun kurzoru |
|
|
367 |
.................... // |
|
|
368 |
.................... // Pozice 1.1 je domu |
|
|
369 |
.................... // |
|
|
370 |
.................... void lcd_gotoxy( BYTE x, BYTE y) |
|
|
371 |
.................... { |
|
|
372 |
.................... |
|
|
373 |
.................... BYTE Adr; |
|
|
374 |
.................... |
|
|
375 |
.................... Adr=x-1; |
|
|
376 |
00FA: MOVLW 01 |
|
|
377 |
00FB: BSF 03.6 |
|
|
378 |
00FC: SUBWF 41,W |
|
|
379 |
00FD: MOVWF 43 |
|
|
380 |
.................... if(y==2) |
|
|
381 |
00FE: MOVF 42,W |
|
|
382 |
00FF: SUBLW 02 |
|
|
383 |
0100: BTFSS 03.2 |
|
|
384 |
0101: GOTO 104 |
|
|
385 |
.................... Adr+=LCD_LINE_2; |
|
|
386 |
0102: MOVLW 40 |
|
|
387 |
0103: ADDWF 43,F |
|
|
388 |
.................... |
|
|
389 |
.................... lcd_send_byte(0,0x80|Adr); |
|
|
390 |
0104: MOVF 43,W |
|
|
391 |
0105: IORLW 80 |
|
|
392 |
0106: MOVWF 44 |
|
|
393 |
0107: CLRF 45 |
|
|
394 |
0108: MOVF 44,W |
|
|
395 |
0109: MOVWF 46 |
|
|
396 |
010A: BCF 03.6 |
|
|
397 |
010B: CALL 08D |
|
|
398 |
.................... } |
|
|
399 |
010C: RETLW 00 |
|
|
400 |
.................... |
|
|
401 |
.................... |
|
|
402 |
.................... // Zapis znaku na displej, zpracovani ridicich znaku |
|
|
403 |
.................... // |
|
|
404 |
.................... void lcd_putc( char c) |
|
|
405 |
.................... { |
|
|
406 |
.................... |
|
|
407 |
.................... switch (c) |
|
|
408 |
.................... { |
|
|
409 |
010D: BSF 03.6 |
|
|
410 |
010E: MOVF 40,W |
|
|
411 |
010F: XORLW 0C |
|
|
412 |
0110: BCF 03.6 |
|
|
413 |
0111: BTFSC 03.2 |
|
|
414 |
0112: GOTO 11D |
|
|
415 |
0113: XORLW 06 |
|
|
416 |
0114: BTFSC 03.2 |
|
|
417 |
0115: GOTO 129 |
|
|
418 |
0116: XORLW 07 |
|
|
419 |
0117: BTFSC 03.2 |
|
|
420 |
0118: GOTO 131 |
|
|
421 |
0119: XORLW 05 |
|
|
422 |
011A: BTFSC 03.2 |
|
|
423 |
011B: GOTO 138 |
|
|
424 |
011C: GOTO 13F |
|
|
425 |
.................... case '\f' : lcd_send_byte(0,1); // smaz displej |
|
|
426 |
011D: BSF 03.6 |
|
|
427 |
011E: CLRF 45 |
|
|
428 |
011F: MOVLW 01 |
|
|
429 |
0120: MOVWF 46 |
|
|
430 |
0121: BCF 03.6 |
|
|
431 |
0122: CALL 08D |
|
|
432 |
.................... delay_ms(2); |
|
|
433 |
0123: MOVLW 02 |
|
|
434 |
0124: BSF 03.6 |
|
|
435 |
0125: MOVWF 41 |
|
|
436 |
0126: BCF 03.6 |
|
|
437 |
0127: CALL 062 |
|
|
438 |
.................... break; |
|
|
439 |
0128: GOTO 14D |
|
|
440 |
.................... case '\n' : lcd_gotoxy(1,2); break; // presun se na 1. znak 2. radky |
|
|
441 |
0129: MOVLW 01 |
|
|
442 |
012A: BSF 03.6 |
|
|
443 |
012B: MOVWF 41 |
|
|
444 |
012C: MOVLW 02 |
|
|
445 |
012D: MOVWF 42 |
|
|
446 |
012E: BCF 03.6 |
|
|
447 |
012F: CALL 0FA |
|
|
448 |
0130: GOTO 14D |
|
|
449 |
.................... case '\r' : lcd_gotoxy(1,1); break; // presun home |
|
|
450 |
0131: MOVLW 01 |
|
|
451 |
0132: BSF 03.6 |
|
|
452 |
0133: MOVWF 41 |
|
|
453 |
0134: MOVWF 42 |
|
|
454 |
0135: BCF 03.6 |
|
|
455 |
0136: CALL 0FA |
|
|
456 |
0137: GOTO 14D |
|
|
457 |
.................... case '\b' : lcd_send_byte(0,0x10); break; // posun kurzor o 1 zpet |
|
|
458 |
0138: BSF 03.6 |
|
|
459 |
0139: CLRF 45 |
|
|
460 |
013A: MOVLW 10 |
|
|
461 |
013B: MOVWF 46 |
|
|
462 |
013C: BCF 03.6 |
|
|
463 |
013D: CALL 08D |
|
|
464 |
013E: GOTO 14D |
|
|
465 |
.................... default : if (c<0x20) c&=0x7; // preklopeni definovatelnych znaku na rozsah 0 az 0x1F |
|
|
466 |
013F: BSF 03.6 |
|
|
467 |
0140: MOVF 40,W |
|
|
468 |
0141: SUBLW 1F |
|
|
469 |
0142: BTFSS 03.0 |
|
|
470 |
0143: GOTO 146 |
|
|
471 |
0144: MOVLW 07 |
|
|
472 |
0145: ANDWF 40,F |
|
|
473 |
.................... lcd_send_byte(1,c); break; // zapis znak |
|
|
474 |
0146: MOVLW 01 |
|
|
475 |
0147: MOVWF 45 |
|
|
476 |
0148: MOVF 40,W |
|
|
477 |
0149: MOVWF 46 |
|
|
478 |
014A: BCF 03.6 |
|
|
479 |
014B: CALL 08D |
|
|
480 |
014C: GOTO 14D |
|
|
481 |
.................... } |
|
|
482 |
.................... } |
|
|
483 |
014D: RETLW 00 |
|
|
484 |
.................... |
|
|
485 |
.................... |
|
|
486 |
.................... // Zapni kurzor |
|
|
487 |
.................... // |
|
|
488 |
.................... void lcd_cursor_on() |
|
|
489 |
.................... { |
|
|
490 |
.................... lcd_send_byte(0,LCD_CURSOR_ON_); |
|
|
491 |
.................... } |
|
|
492 |
.................... |
|
|
493 |
.................... |
|
|
494 |
.................... // Vypni kurzor |
|
|
495 |
.................... // |
|
|
496 |
.................... void lcd_cursor_off() |
|
|
497 |
.................... { |
|
|
498 |
.................... lcd_send_byte(0,LCD_CURSOR_OFF_); |
|
|
499 |
.................... } |
|
|
500 |
.................... |
|
|
501 |
.................... |
|
|
502 |
.................... // Smaz displej |
|
|
503 |
.................... // |
|
|
504 |
.................... void lcd_clr() |
|
|
505 |
.................... { |
|
|
506 |
.................... lcd_putc('\f'); |
|
|
507 |
.................... } |
|
|
508 |
.................... |
|
|
509 |
.................... |
|
|
510 |
.................... // Definice vlastnich fontu |
|
|
511 |
.................... // |
|
|
512 |
.................... // Vlastnich definic muze byt jen 8 do pozic 0 az 7 pameti CGRAM radice lcd displeje |
|
|
513 |
.................... // Pro snadne definovani jsou pripraveny nasledujici definice a na konci souboru je uveden |
|
|
514 |
.................... // priklad pouziti definovanych znaku. |
|
|
515 |
.................... |
|
|
516 |
.................... |
|
|
517 |
.................... // Pomocna procedura pro posilani ridicich dat do radice displeje |
|
|
518 |
.................... // |
|
|
519 |
.................... void lcd_putc2(int Data) |
|
|
520 |
.................... { |
|
|
521 |
.................... lcd_send_byte(1,Data); |
|
|
522 |
.................... } |
|
|
523 |
.................... |
|
|
524 |
.................... |
|
|
525 |
.................... // Pomocne definice pro programovani obsahu CGRAM |
|
|
526 |
.................... // |
|
|
527 |
.................... #define lcd_define_start(Code) lcd_send_byte(0,0x40+(Code<<3)); delay_ms(2) |
|
|
528 |
.................... #define lcd_define_def(String) printf(lcd_putc2,String); |
|
|
529 |
.................... #define lcd_define_end() lcd_send_byte(0,3); delay_ms(2) |
|
|
530 |
.................... |
|
|
531 |
.................... |
|
|
532 |
.................... // Vlastni vykonne makro pro definovani fontu do pozice Index CGRAM s definicnim retezcem Def |
|
|
533 |
.................... // |
|
|
534 |
.................... #define lcd_define_char(Index, Def) lcd_define_start(Index); lcd_define_def(Def); lcd_define_end(); |
|
|
535 |
.................... |
|
|
536 |
.................... |
|
|
537 |
.................... // Pripravene definice fontu vybranych znaku |
|
|
538 |
.................... // V tabulce nesmi byt 00 (konec retezce v printf()), misto toho davame 80 |
|
|
539 |
.................... // |
|
|
540 |
.................... #define LCD_CHAR_BAT100 "\x0E\x1F\x1F\x1F\x1F\x1F\x1F\x1F" /* symbol plne baterie */ |
|
|
541 |
.................... #define LCD_CHAR_BAT50 "\x0E\x1F\x11\x11\x13\x17\x1F\x1F" /* symbol polovicni baterie */ |
|
|
542 |
.................... #define LCD_CHAR_BAT0 "\x0E\x1F\x11\x11\x11\x11\x11\x1F" /* symbol vybite baterie */ |
|
|
543 |
.................... #define LCD_CHAR_UP "\x80\x04\x0E\x15\x04\x04\x04\x80" /* symbol sipka nahoru */ |
|
|
544 |
.................... #define LCD_CHAR_DOWN "\x80\x04\x04\x04\x15\x0E\x04\x80" /* symbol Sipka dolu */ |
|
|
545 |
.................... #define LCD_CHAR_LUA "\x04\x0E\x11\x11\x1F\x11\x11\x80" /* A s carkou */ |
|
|
546 |
.................... #define LCD_CHAR_LLA "\x01\x02\x0E\x01\x1F\x11\x0F\x80" /* a s carkou */ |
|
|
547 |
.................... #define LCD_CHAR_HUC "\x0A\x0E\x11\x10\x10\x11\x0E\x80" /* C s hackem */ |
|
|
548 |
.................... #define LCD_CHAR_HLC "\x0A\x04\x0E\x10\x10\x11\x0E\x80" /* c s hackem */ |
|
|
549 |
.................... #define LCD_CHAR_HUD "\x0A\x1C\x12\x11\x11\x12\x1C\x80" /* D s hackem */ |
|
|
550 |
.................... #define LCD_CHAR_HLD "\x05\x03\x0D\x13\x11\x11\x0F\x80" /* d s hackem */ |
|
|
551 |
.................... #define LCD_CHAR_LUE "\x04\x1F\x10\x10\x1E\x10\x1F\x80" /* E s carkou */ |
|
|
552 |
.................... #define LCD_CHAR_LLE "\x01\x02\x0E\x11\x1F\x10\x0E\x80" /* e s carkou */ |
|
|
553 |
.................... #define LCD_CHAR_HUE "\x0A\x1F\x10\x1E\x10\x10\x1F\x80" /* E s hackem */ |
|
|
554 |
.................... #define LCD_CHAR_HLE "\x0A\x04\x0E\x11\x1F\x10\x0E\x80" /* e s hackem */ |
|
|
555 |
.................... #define LCD_CHAR_LUI "\x04\x0E\x04\x04\x04\x04\x0E\x80" /* I s carkou */ |
|
|
556 |
.................... #define LCD_CHAR_LLI "\x02\x04\x80\x0C\x04\x04\x0E\x80" /* i s carkou */ |
|
|
557 |
.................... #define LCD_CHAR_HUN "\x0A\x15\x11\x19\x15\x13\x11\x80" /* N s hackem */ |
|
|
558 |
.................... #define LCD_CHAR_HLN "\x0A\x04\x16\x19\x11\x11\x11\x80" /* n s hackem */ |
|
|
559 |
.................... #define LCD_CHAR_LUO "\x04\x0E\x11\x11\x11\x11\x0E\x80" /* O s carkou */ |
|
|
560 |
.................... #define LCD_CHAR_LLO "\x02\x04\x0E\x11\x11\x11\x0E\x80" /* o s carkou */ |
|
|
561 |
.................... #define LCD_CHAR_HUR "\x0A\x1E\x11\x1E\x14\x12\x11\x80" /* R s hackem */ |
|
|
562 |
.................... #define LCD_CHAR_HLR "\x0A\x04\x16\x19\x10\x10\x10\x80" /* r s hackem */ |
|
|
563 |
.................... #define LCD_CHAR_HUS "\x0A\x0F\x10\x0E\x01\x01\x1E\x80" /* S s hackem */ |
|
|
564 |
.................... #define LCD_CHAR_HLS "\x0A\x04\x0E\x10\x0E\x01\x1E\x80" /* s s hackem */ |
|
|
565 |
.................... #define LCD_CHAR_HUT "\x0A\x1F\x04\x04\x04\x04\x04\x80" /* T s hackem */ |
|
|
566 |
.................... #define LCD_CHAR_HLT "\x0A\x0C\x1C\x08\x08\x09\x06\x80" /* t s hackem */ |
|
|
567 |
.................... #define LCD_CHAR_LUU "\x02\x15\x11\x11\x11\x11\x0E\x80" /* U s carkou */ |
|
|
568 |
.................... #define LCD_CHAR_LLU "\x02\x04\x11\x11\x11\x13\x0D\x80" /* u s carkou */ |
|
|
569 |
.................... #define LCD_CHAR_CUU "\x06\x17\x11\x11\x11\x11\x0E\x80" /* U s krouzkem */ |
|
|
570 |
.................... #define LCD_CHAR_CLU "\x06\x06\x11\x11\x11\x11\x0E\x80" /* u s krouzkem */ |
|
|
571 |
.................... #define LCD_CHAR_LUY "\x02\x15\x11\x0A\x04\x04\x04\x80" /* Y s carkou */ |
|
|
572 |
.................... #define LCD_CHAR_LLY "\x02\x04\x11\x11\x0F\x01\x0E\x80" /* y s carkou */ |
|
|
573 |
.................... #define LCD_CHAR_HUZ "\x0A\x1F\x01\x02\x04\x08\x1F\x80" /* Z s hackem */ |
|
|
574 |
.................... #define LCD_CHAR_HLZ "\x0A\x04\x1F\x02\x04\x08\x1F\x80" /* z s hackem */ |
|
|
575 |
.................... |
|
|
576 |
.................... |
|
|
577 |
.................... // Priklad pouziti definovanych znaku |
|
|
578 |
.................... // |
|
|
579 |
.................... // |
|
|
580 |
.................... //void lcd_sample() |
|
|
581 |
.................... //{ |
|
|
582 |
.................... // lcd_define_char(0,LCD_CHAR_BAT50); // Priklad definice znaku baterie do pozice 0 |
|
|
583 |
.................... // lcd_define_char(2,LCD_CHAR_HLE LCD_CHAR_LUI); // Priklad definice znaku e s hackem a I s carkou od pozice 2 |
|
|
584 |
.................... // // vsimnete si, ze neni carka mezi retezci s definici (oba retezce definuji |
|
|
585 |
.................... // // jediny definicni retezec) |
|
|
586 |
.................... // printf(lcd_putc,"\fZnaky:\20\22\23"); // priklad vypisu znaku z pozice 0, 2 a 3 |
|
|
587 |
.................... // delay_ms(1000); |
|
|
588 |
.................... // lcd_define_char(0,LCD_CHAR_BAT0); // Predefinovani tvaru znaku v pozici 0 |
|
|
589 |
.................... // delay_ms(1000); |
|
|
590 |
.................... //} |
|
|
591 |
.................... |
|
|
592 |
.................... |
|
|
593 |
.................... void main() |
|
|
594 |
.................... { |
|
|
595 |
014E: CLRF 04 |
|
|
596 |
014F: BCF 03.7 |
|
|
597 |
0150: MOVLW 1F |
|
|
598 |
0151: ANDWF 03,F |
|
|
599 |
0152: MOVLW 0C |
|
|
600 |
0153: BSF 03.5 |
|
|
601 |
0154: MOVWF 19 |
|
|
602 |
0155: MOVLW A6 |
|
|
603 |
0156: MOVWF 18 |
|
|
604 |
0157: MOVLW 90 |
|
|
605 |
0158: BCF 03.5 |
|
|
606 |
0159: MOVWF 18 |
|
|
607 |
015A: BSF 03.5 |
|
|
608 |
015B: BSF 1F.0 |
|
|
609 |
015C: BSF 1F.1 |
|
|
610 |
015D: BSF 1F.2 |
|
|
611 |
015E: BCF 1F.3 |
|
|
612 |
015F: MOVLW 07 |
|
|
613 |
0160: MOVWF 1C |
|
|
614 |
.................... char odp1[45]; |
|
|
615 |
.................... char odp2[10]; |
|
|
616 |
.................... char odp3[45]; |
|
|
617 |
.................... char odp4[10]; |
|
|
618 |
.................... char odp5[45]; |
|
|
619 |
.................... |
|
|
620 |
.................... |
|
|
621 |
.................... |
|
|
622 |
.................... setup_adc_ports(NO_ANALOGS); |
|
|
623 |
* |
|
|
624 |
0164: BSF 03.5 |
|
|
625 |
0165: BSF 1F.0 |
|
|
626 |
0166: BSF 1F.1 |
|
|
627 |
0167: BSF 1F.2 |
|
|
628 |
0168: BCF 1F.3 |
|
|
629 |
.................... setup_adc(ADC_OFF); |
|
|
630 |
0169: BCF 03.5 |
|
|
631 |
016A: BCF 1F.0 |
|
|
632 |
.................... setup_psp(PSP_DISABLED); |
|
|
633 |
016B: BSF 03.5 |
|
|
634 |
016C: BCF 09.4 |
|
|
635 |
.................... setup_spi(FALSE); |
|
|
636 |
* |
|
|
637 |
0161: MOVLW FF |
|
|
638 |
0162: BCF 03.5 |
|
|
639 |
0163: MOVWF 20 |
|
|
640 |
* |
|
|
641 |
016D: BCF 03.5 |
|
|
642 |
016E: BCF 14.5 |
|
|
643 |
016F: BCF 20.5 |
|
|
644 |
0170: MOVF 20,W |
|
|
645 |
0171: BSF 03.5 |
|
|
646 |
0172: MOVWF 07 |
|
|
647 |
0173: BCF 03.5 |
|
|
648 |
0174: BSF 20.4 |
|
|
649 |
0175: MOVF 20,W |
|
|
650 |
0176: BSF 03.5 |
|
|
651 |
0177: MOVWF 07 |
|
|
652 |
0178: BCF 03.5 |
|
|
653 |
0179: BCF 20.3 |
|
|
654 |
017A: MOVF 20,W |
|
|
655 |
017B: BSF 03.5 |
|
|
656 |
017C: MOVWF 07 |
|
|
657 |
017D: MOVLW 00 |
|
|
658 |
017E: BCF 03.5 |
|
|
659 |
017F: MOVWF 14 |
|
|
660 |
0180: BSF 03.5 |
|
|
661 |
0181: MOVWF 14 |
|
|
662 |
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
|
|
663 |
0182: MOVF 01,W |
|
|
664 |
0183: ANDLW C7 |
|
|
665 |
0184: IORLW 08 |
|
|
666 |
0185: MOVWF 01 |
|
|
667 |
.................... setup_timer_1(T1_DISABLED); |
|
|
668 |
0186: BCF 03.5 |
|
|
669 |
0187: CLRF 10 |
|
|
670 |
.................... setup_timer_2(T2_DISABLED,0,1); |
|
|
671 |
0188: MOVLW 00 |
|
|
672 |
0189: MOVWF 78 |
|
|
673 |
018A: MOVWF 12 |
|
|
674 |
018B: MOVLW 00 |
|
|
675 |
018C: BSF 03.5 |
|
|
676 |
018D: MOVWF 12 |
|
|
677 |
.................... |
|
|
678 |
.................... lcd_init(); |
|
|
679 |
018E: BCF 03.5 |
|
|
680 |
018F: GOTO 0AD |
|
|
681 |
.................... |
|
|
682 |
.................... delay_ms(2000); |
|
|
683 |
0190: MOVLW 08 |
|
|
684 |
0191: MOVWF 62 |
|
|
685 |
0192: MOVLW FA |
|
|
686 |
0193: BSF 03.6 |
|
|
687 |
0194: MOVWF 41 |
|
|
688 |
0195: BCF 03.6 |
|
|
689 |
0196: CALL 062 |
|
|
690 |
0197: DECFSZ 62,F |
|
|
691 |
0198: GOTO 192 |
|
|
692 |
.................... |
|
|
693 |
.................... printf(lcd_putc,"\f Z"); |
|
|
694 |
0199: MOVLW 0C |
|
|
695 |
019A: BSF 03.6 |
|
|
696 |
019B: MOVWF 40 |
|
|
697 |
019C: BCF 03.6 |
|
|
698 |
019D: CALL 10D |
|
|
699 |
019E: MOVLW 20 |
|
|
700 |
019F: BSF 03.6 |
|
|
701 |
01A0: MOVWF 40 |
|
|
702 |
01A1: BCF 03.6 |
|
|
703 |
01A2: CALL 10D |
|
|
704 |
01A3: MOVLW 5A |
|
|
705 |
01A4: BSF 03.6 |
|
|
706 |
01A5: MOVWF 40 |
|
|
707 |
01A6: BCF 03.6 |
|
|
708 |
01A7: CALL 10D |
|
|
709 |
.................... delay_ms(100); |
|
|
710 |
01A8: MOVLW 64 |
|
|
711 |
01A9: BSF 03.6 |
|
|
712 |
01AA: MOVWF 41 |
|
|
713 |
01AB: BCF 03.6 |
|
|
714 |
01AC: CALL 062 |
|
|
715 |
.................... printf(lcd_putc,"a"); |
|
|
716 |
01AD: MOVLW 61 |
|
|
717 |
01AE: BSF 03.6 |
|
|
718 |
01AF: MOVWF 40 |
|
|
719 |
01B0: BCF 03.6 |
|
|
720 |
01B1: CALL 10D |
|
|
721 |
.................... delay_ms(50); |
|
|
722 |
01B2: MOVLW 32 |
|
|
723 |
01B3: BSF 03.6 |
|
|
724 |
01B4: MOVWF 41 |
|
|
725 |
01B5: BCF 03.6 |
|
|
726 |
01B6: CALL 062 |
|
|
727 |
.................... printf(lcd_putc,"v"); |
|
|
728 |
01B7: MOVLW 76 |
|
|
729 |
01B8: BSF 03.6 |
|
|
730 |
01B9: MOVWF 40 |
|
|
731 |
01BA: BCF 03.6 |
|
|
732 |
01BB: CALL 10D |
|
|
733 |
.................... delay_ms(50); |
|
|
734 |
01BC: MOVLW 32 |
|
|
735 |
01BD: BSF 03.6 |
|
|
736 |
01BE: MOVWF 41 |
|
|
737 |
01BF: BCF 03.6 |
|
|
738 |
01C0: CALL 062 |
|
|
739 |
.................... printf(lcd_putc,"a"); |
|
|
740 |
01C1: MOVLW 61 |
|
|
741 |
01C2: BSF 03.6 |
|
|
742 |
01C3: MOVWF 40 |
|
|
743 |
01C4: BCF 03.6 |
|
|
744 |
01C5: CALL 10D |
|
|
745 |
.................... delay_ms(50); |
|
|
746 |
01C6: MOVLW 32 |
|
|
747 |
01C7: BSF 03.6 |
|
|
748 |
01C8: MOVWF 41 |
|
|
749 |
01C9: BCF 03.6 |
|
|
750 |
01CA: CALL 062 |
|
|
751 |
.................... printf(lcd_putc,"d"); |
|
|
752 |
01CB: MOVLW 64 |
|
|
753 |
01CC: BSF 03.6 |
|
|
754 |
01CD: MOVWF 40 |
|
|
755 |
01CE: BCF 03.6 |
|
|
756 |
01CF: CALL 10D |
|
|
757 |
.................... delay_ms(50); |
|
|
758 |
01D0: MOVLW 32 |
|
|
759 |
01D1: BSF 03.6 |
|
|
760 |
01D2: MOVWF 41 |
|
|
761 |
01D3: BCF 03.6 |
|
|
762 |
01D4: CALL 062 |
|
|
763 |
.................... printf(lcd_putc,"i"); |
|
|
764 |
01D5: MOVLW 69 |
|
|
765 |
01D6: BSF 03.6 |
|
|
766 |
01D7: MOVWF 40 |
|
|
767 |
01D8: BCF 03.6 |
|
|
768 |
01D9: CALL 10D |
|
|
769 |
.................... delay_ms(50); |
|
|
770 |
01DA: MOVLW 32 |
|
|
771 |
01DB: BSF 03.6 |
|
|
772 |
01DC: MOVWF 41 |
|
|
773 |
01DD: BCF 03.6 |
|
|
774 |
01DE: CALL 062 |
|
|
775 |
.................... printf(lcd_putc,"m"); |
|
|
776 |
01DF: MOVLW 6D |
|
|
777 |
01E0: BSF 03.6 |
|
|
778 |
01E1: MOVWF 40 |
|
|
779 |
01E2: BCF 03.6 |
|
|
780 |
01E3: CALL 10D |
|
|
781 |
.................... delay_ms(50); |
|
|
782 |
01E4: MOVLW 32 |
|
|
783 |
01E5: BSF 03.6 |
|
|
784 |
01E6: MOVWF 41 |
|
|
785 |
01E7: BCF 03.6 |
|
|
786 |
01E8: CALL 062 |
|
|
787 |
.................... printf(lcd_putc," "); |
|
|
788 |
01E9: MOVLW 20 |
|
|
789 |
01EA: BSF 03.6 |
|
|
790 |
01EB: MOVWF 40 |
|
|
791 |
01EC: BCF 03.6 |
|
|
792 |
01ED: CALL 10D |
|
|
793 |
.................... delay_ms(50); |
|
|
794 |
01EE: MOVLW 32 |
|
|
795 |
01EF: BSF 03.6 |
|
|
796 |
01F0: MOVWF 41 |
|
|
797 |
01F1: BCF 03.6 |
|
|
798 |
01F2: CALL 062 |
|
|
799 |
.................... printf(lcd_putc,"s"); |
|
|
800 |
01F3: MOVLW 73 |
|
|
801 |
01F4: BSF 03.6 |
|
|
802 |
01F5: MOVWF 40 |
|
|
803 |
01F6: BCF 03.6 |
|
|
804 |
01F7: CALL 10D |
|
|
805 |
.................... delay_ms(50); |
|
|
806 |
01F8: MOVLW 32 |
|
|
807 |
01F9: BSF 03.6 |
|
|
808 |
01FA: MOVWF 41 |
|
|
809 |
01FB: BCF 03.6 |
|
|
810 |
01FC: CALL 062 |
|
|
811 |
.................... printf(lcd_putc,"y"); |
|
|
812 |
01FD: MOVLW 79 |
|
|
813 |
01FE: BSF 03.6 |
|
|
814 |
01FF: MOVWF 40 |
|
|
815 |
0200: BCF 03.6 |
|
|
816 |
0201: CALL 10D |
|
|
817 |
.................... delay_ms(50); |
|
|
818 |
0202: MOVLW 32 |
|
|
819 |
0203: BSF 03.6 |
|
|
820 |
0204: MOVWF 41 |
|
|
821 |
0205: BCF 03.6 |
|
|
822 |
0206: CALL 062 |
|
|
823 |
.................... printf(lcd_putc,"s"); |
|
|
824 |
0207: MOVLW 73 |
|
|
825 |
0208: BSF 03.6 |
|
|
826 |
0209: MOVWF 40 |
|
|
827 |
020A: BCF 03.6 |
|
|
828 |
020B: CALL 10D |
|
|
829 |
.................... delay_ms(50); |
|
|
830 |
020C: MOVLW 32 |
|
|
831 |
020D: BSF 03.6 |
|
|
832 |
020E: MOVWF 41 |
|
|
833 |
020F: BCF 03.6 |
|
|
834 |
0210: CALL 062 |
|
|
835 |
.................... printf(lcd_putc,"t"); |
|
|
836 |
0211: MOVLW 74 |
|
|
837 |
0212: BSF 03.6 |
|
|
838 |
0213: MOVWF 40 |
|
|
839 |
0214: BCF 03.6 |
|
|
840 |
0215: CALL 10D |
|
|
841 |
.................... delay_ms(50); |
|
|
842 |
0216: MOVLW 32 |
|
|
843 |
0217: BSF 03.6 |
|
|
844 |
0218: MOVWF 41 |
|
|
845 |
0219: BCF 03.6 |
|
|
846 |
021A: CALL 062 |
|
|
847 |
.................... printf(lcd_putc,"e"); |
|
|
848 |
021B: MOVLW 65 |
|
|
849 |
021C: BSF 03.6 |
|
|
850 |
021D: MOVWF 40 |
|
|
851 |
021E: BCF 03.6 |
|
|
852 |
021F: CALL 10D |
|
|
853 |
.................... delay_ms(50); |
|
|
854 |
0220: MOVLW 32 |
|
|
855 |
0221: BSF 03.6 |
|
|
856 |
0222: MOVWF 41 |
|
|
857 |
0223: BCF 03.6 |
|
|
858 |
0224: CALL 062 |
|
|
859 |
.................... printf(lcd_putc,"m\n"); |
|
|
860 |
0225: MOVLW 6D |
|
|
861 |
0226: BSF 03.6 |
|
|
862 |
0227: MOVWF 40 |
|
|
863 |
0228: BCF 03.6 |
|
|
864 |
0229: CALL 10D |
|
|
865 |
022A: MOVLW 0A |
|
|
866 |
022B: BSF 03.6 |
|
|
867 |
022C: MOVWF 40 |
|
|
868 |
022D: BCF 03.6 |
|
|
869 |
022E: CALL 10D |
|
|
870 |
.................... delay_ms(150); |
|
|
871 |
022F: MOVLW 96 |
|
|
872 |
0230: BSF 03.6 |
|
|
873 |
0231: MOVWF 41 |
|
|
874 |
0232: BCF 03.6 |
|
|
875 |
0233: CALL 062 |
|
|
876 |
.................... printf(lcd_putc," ."); |
|
|
877 |
0234: CLRF 62 |
|
|
878 |
0235: MOVF 62,W |
|
|
879 |
0236: CALL 00C |
|
|
880 |
0237: INCF 62,F |
|
|
881 |
0238: MOVWF 77 |
|
|
882 |
0239: BSF 03.6 |
|
|
883 |
023A: MOVWF 40 |
|
|
884 |
023B: BCF 03.6 |
|
|
885 |
023C: CALL 10D |
|
|
886 |
023D: MOVLW 04 |
|
|
887 |
023E: SUBWF 62,W |
|
|
888 |
023F: BTFSS 03.2 |
|
|
889 |
0240: GOTO 235 |
|
|
890 |
.................... delay_ms(150); |
|
|
891 |
0241: MOVLW 96 |
|
|
892 |
0242: BSF 03.6 |
|
|
893 |
0243: MOVWF 41 |
|
|
894 |
0244: BCF 03.6 |
|
|
895 |
0245: CALL 062 |
|
|
896 |
.................... printf(lcd_putc," ."); |
|
|
897 |
0246: MOVLW 20 |
|
|
898 |
0247: BSF 03.6 |
|
|
899 |
0248: MOVWF 40 |
|
|
900 |
0249: BCF 03.6 |
|
|
901 |
024A: CALL 10D |
|
|
902 |
024B: MOVLW 2E |
|
|
903 |
024C: BSF 03.6 |
|
|
904 |
024D: MOVWF 40 |
|
|
905 |
024E: BCF 03.6 |
|
|
906 |
024F: CALL 10D |
|
|
907 |
.................... delay_ms(175); |
|
|
908 |
0250: MOVLW AF |
|
|
909 |
0251: BSF 03.6 |
|
|
910 |
0252: MOVWF 41 |
|
|
911 |
0253: BCF 03.6 |
|
|
912 |
0254: CALL 062 |
|
|
913 |
.................... printf(lcd_putc," ."); |
|
|
914 |
0255: MOVLW 20 |
|
|
915 |
0256: BSF 03.6 |
|
|
916 |
0257: MOVWF 40 |
|
|
917 |
0258: BCF 03.6 |
|
|
918 |
0259: CALL 10D |
|
|
919 |
025A: MOVLW 2E |
|
|
920 |
025B: BSF 03.6 |
|
|
921 |
025C: MOVWF 40 |
|
|
922 |
025D: BCF 03.6 |
|
|
923 |
025E: CALL 10D |
|
|
924 |
.................... delay_ms(300); |
|
|
925 |
025F: MOVLW 02 |
|
|
926 |
0260: MOVWF 62 |
|
|
927 |
0261: MOVLW 96 |
|
|
928 |
0262: BSF 03.6 |
|
|
929 |
0263: MOVWF 41 |
|
|
930 |
0264: BCF 03.6 |
|
|
931 |
0265: CALL 062 |
|
|
932 |
0266: DECFSZ 62,F |
|
|
933 |
0267: GOTO 261 |
|
|
934 |
.................... printf(lcd_putc," ."); |
|
|
935 |
0268: MOVLW 20 |
|
|
936 |
0269: BSF 03.6 |
|
|
937 |
026A: MOVWF 40 |
|
|
938 |
026B: BCF 03.6 |
|
|
939 |
026C: CALL 10D |
|
|
940 |
026D: MOVLW 2E |
|
|
941 |
026E: BSF 03.6 |
|
|
942 |
026F: MOVWF 40 |
|
|
943 |
0270: BCF 03.6 |
|
|
944 |
0271: CALL 10D |
|
|
945 |
.................... delay_ms(400); |
|
|
946 |
0272: MOVLW 02 |
|
|
947 |
0273: MOVWF 62 |
|
|
948 |
0274: MOVLW C8 |
|
|
949 |
0275: BSF 03.6 |
|
|
950 |
0276: MOVWF 41 |
|
|
951 |
0277: BCF 03.6 |
|
|
952 |
0278: CALL 062 |
|
|
953 |
0279: DECFSZ 62,F |
|
|
954 |
027A: GOTO 274 |
|
|
955 |
.................... printf(lcd_putc," ."); |
|
|
956 |
027B: MOVLW 20 |
|
|
957 |
027C: BSF 03.6 |
|
|
958 |
027D: MOVWF 40 |
|
|
959 |
027E: BCF 03.6 |
|
|
960 |
027F: CALL 10D |
|
|
961 |
0280: MOVLW 2E |
|
|
962 |
0281: BSF 03.6 |
|
|
963 |
0282: MOVWF 40 |
|
|
964 |
0283: BCF 03.6 |
|
|
965 |
0284: CALL 10D |
|
|
966 |
.................... delay_ms(550); |
|
|
967 |
0285: MOVLW 05 |
|
|
968 |
0286: MOVWF 62 |
|
|
969 |
0287: MOVLW 6E |
|
|
970 |
0288: BSF 03.6 |
|
|
971 |
0289: MOVWF 41 |
|
|
972 |
028A: BCF 03.6 |
|
|
973 |
028B: CALL 062 |
|
|
974 |
028C: DECFSZ 62,F |
|
|
975 |
028D: GOTO 287 |
|
|
976 |
.................... |
|
|
977 |
.................... while(true) |
|
|
978 |
.................... { |
|
|
979 |
.................... output_low(PIN_A4); |
|
|
980 |
028E: BSF 03.5 |
|
|
981 |
028F: BCF 05.4 |
|
|
982 |
0290: BCF 03.5 |
|
|
983 |
0291: BCF 05.4 |
|
|
984 |
.................... delay_ms(1500); |
|
|
985 |
0292: MOVLW 06 |
|
|
986 |
0293: MOVWF 62 |
|
|
987 |
0294: MOVLW FA |
|
|
988 |
0295: BSF 03.6 |
|
|
989 |
0296: MOVWF 41 |
|
|
990 |
0297: BCF 03.6 |
|
|
991 |
0298: CALL 062 |
|
|
992 |
0299: DECFSZ 62,F |
|
|
993 |
029A: GOTO 294 |
|
|
994 |
.................... output_high(PIN_A4); |
|
|
995 |
029B: BSF 03.5 |
|
|
996 |
029C: BCF 05.4 |
|
|
997 |
029D: BCF 03.5 |
|
|
998 |
029E: BSF 05.4 |
|
|
999 |
.................... |
|
|
1000 |
.................... printf("AT+CBC\r"); |
|
|
1001 |
029F: CLRF 62 |
|
|
1002 |
02A0: MOVF 62,W |
|
|
1003 |
02A1: CALL 015 |
|
|
1004 |
02A2: INCF 62,F |
|
|
1005 |
02A3: MOVWF 77 |
|
|
1006 |
02A4: MOVF 77,W |
|
|
1007 |
02A5: BTFSS 0C.4 |
|
|
1008 |
02A6: GOTO 2A5 |
|
|
1009 |
02A7: MOVWF 19 |
|
|
1010 |
02A8: MOVLW 07 |
|
|
1011 |
02A9: SUBWF 62,W |
|
|
1012 |
02AA: BTFSS 03.2 |
|
|
1013 |
02AB: GOTO 2A0 |
|
|
1014 |
.................... |
|
|
1015 |
.................... |
|
|
1016 |
.................... gets(odp1); |
|
|
1017 |
02AC: MOVLW 21 |
|
|
1018 |
02AD: MOVWF 04 |
|
|
1019 |
02AE: BCF 03.7 |
|
|
1020 |
02AF: DECF 04,F |
|
|
1021 |
02B0: INCF 04,F |
|
|
1022 |
02B1: BTFSS 0C.5 |
|
|
1023 |
02B2: GOTO 2B1 |
|
|
1024 |
02B3: MOVF 1A,W |
|
|
1025 |
02B4: MOVWF 00 |
|
|
1026 |
02B5: MOVLW 0D |
|
|
1027 |
02B6: SUBWF 00,W |
|
|
1028 |
02B7: BTFSS 03.2 |
|
|
1029 |
02B8: GOTO 2B0 |
|
|
1030 |
02B9: CLRF 00 |
|
|
1031 |
.................... gets(odp2); |
|
|
1032 |
02BA: MOVLW 4E |
|
|
1033 |
02BB: MOVWF 04 |
|
|
1034 |
02BC: BCF 03.7 |
|
|
1035 |
02BD: DECF 04,F |
|
|
1036 |
02BE: INCF 04,F |
|
|
1037 |
02BF: BTFSS 0C.5 |
|
|
1038 |
02C0: GOTO 2BF |
|
|
1039 |
02C1: MOVF 1A,W |
|
|
1040 |
02C2: MOVWF 00 |
|
|
1041 |
02C3: MOVLW 0D |
|
|
1042 |
02C4: SUBWF 00,W |
|
|
1043 |
02C5: BTFSS 03.2 |
|
|
1044 |
02C6: GOTO 2BE |
|
|
1045 |
02C7: CLRF 00 |
|
|
1046 |
.................... gets(odp3); |
|
|
1047 |
02C8: MOVLW A0 |
|
|
1048 |
02C9: MOVWF 04 |
|
|
1049 |
02CA: BCF 03.7 |
|
|
1050 |
02CB: DECF 04,F |
|
|
1051 |
02CC: INCF 04,F |
|
|
1052 |
02CD: BTFSS 0C.5 |
|
|
1053 |
02CE: GOTO 2CD |
|
|
1054 |
02CF: MOVF 1A,W |
|
|
1055 |
02D0: MOVWF 00 |
|
|
1056 |
02D1: MOVLW 0D |
|
|
1057 |
02D2: SUBWF 00,W |
|
|
1058 |
02D3: BTFSS 03.2 |
|
|
1059 |
02D4: GOTO 2CC |
|
|
1060 |
02D5: CLRF 00 |
|
|
1061 |
.................... gets(odp4); |
|
|
1062 |
02D6: MOVLW 58 |
|
|
1063 |
02D7: MOVWF 04 |
|
|
1064 |
02D8: BCF 03.7 |
|
|
1065 |
02D9: DECF 04,F |
|
|
1066 |
02DA: INCF 04,F |
|
|
1067 |
02DB: BTFSS 0C.5 |
|
|
1068 |
02DC: GOTO 2DB |
|
|
1069 |
02DD: MOVF 1A,W |
|
|
1070 |
02DE: MOVWF 00 |
|
|
1071 |
02DF: MOVLW 0D |
|
|
1072 |
02E0: SUBWF 00,W |
|
|
1073 |
02E1: BTFSS 03.2 |
|
|
1074 |
02E2: GOTO 2DA |
|
|
1075 |
02E3: CLRF 00 |
|
|
1076 |
.................... gets(odp5); |
|
|
1077 |
02E4: MOVLW 10 |
|
|
1078 |
02E5: MOVWF 04 |
|
|
1079 |
02E6: BSF 03.7 |
|
|
1080 |
02E7: DECF 04,F |
|
|
1081 |
02E8: INCF 04,F |
|
|
1082 |
02E9: BTFSS 0C.5 |
|
|
1083 |
02EA: GOTO 2E9 |
|
|
1084 |
02EB: MOVF 1A,W |
|
|
1085 |
02EC: MOVWF 00 |
|
|
1086 |
02ED: MOVLW 0D |
|
|
1087 |
02EE: SUBWF 00,W |
|
|
1088 |
02EF: BTFSS 03.2 |
|
|
1089 |
02F0: GOTO 2E8 |
|
|
1090 |
02F1: CLRF 00 |
|
|
1091 |
.................... |
|
|
1092 |
.................... |
|
|
1093 |
.................... printf(lcd_putc,"\fODP1:%s",odp1); |
|
|
1094 |
02F2: CLRF 62 |
|
|
1095 |
02F3: MOVF 62,W |
|
|
1096 |
02F4: CALL 021 |
|
|
1097 |
02F5: INCF 62,F |
|
|
1098 |
02F6: MOVWF 77 |
|
|
1099 |
02F7: BSF 03.6 |
|
|
1100 |
02F8: MOVWF 40 |
|
|
1101 |
02F9: BCF 03.6 |
|
|
1102 |
02FA: CALL 10D |
|
|
1103 |
02FB: MOVLW 06 |
|
|
1104 |
02FC: SUBWF 62,W |
|
|
1105 |
02FD: BTFSS 03.2 |
|
|
1106 |
02FE: GOTO 2F3 |
|
|
1107 |
02FF: MOVLW 21 |
|
|
1108 |
0300: MOVWF 04 |
|
|
1109 |
0301: BCF 03.7 |
|
|
1110 |
0302: MOVLW 00 |
|
|
1111 |
0303: IORWF 00,W |
|
|
1112 |
0304: BTFSC 03.2 |
|
|
1113 |
0305: GOTO 318 |
|
|
1114 |
0306: CLRF 64 |
|
|
1115 |
0307: MOVF 04,W |
|
|
1116 |
0308: MOVWF 63 |
|
|
1117 |
0309: BCF 64.0 |
|
|
1118 |
030A: BTFSC 03.7 |
|
|
1119 |
030B: BSF 64.0 |
|
|
1120 |
030C: MOVF 00,W |
|
|
1121 |
030D: BSF 03.6 |
|
|
1122 |
030E: MOVWF 40 |
|
|
1123 |
030F: BCF 03.6 |
|
|
1124 |
0310: CALL 10D |
|
|
1125 |
0311: MOVF 63,W |
|
|
1126 |
0312: MOVWF 04 |
|
|
1127 |
0313: BCF 03.7 |
|
|
1128 |
0314: BTFSC 64.0 |
|
|
1129 |
0315: BSF 03.7 |
|
|
1130 |
0316: INCF 04,F |
|
|
1131 |
0317: GOTO 302 |
|
|
1132 |
.................... delay_ms(2000); |
|
|
1133 |
0318: MOVLW 08 |
|
|
1134 |
0319: MOVWF 62 |
|
|
1135 |
031A: MOVLW FA |
|
|
1136 |
031B: BSF 03.6 |
|
|
1137 |
031C: MOVWF 41 |
|
|
1138 |
031D: BCF 03.6 |
|
|
1139 |
031E: CALL 062 |
|
|
1140 |
031F: DECFSZ 62,F |
|
|
1141 |
0320: GOTO 31A |
|
|
1142 |
.................... |
|
|
1143 |
.................... printf(lcd_putc,"\fODP2:%s",odp2); |
|
|
1144 |
0321: CLRF 62 |
|
|
1145 |
0322: MOVF 62,W |
|
|
1146 |
0323: CALL 02E |
|
|
1147 |
0324: INCF 62,F |
|
|
1148 |
0325: MOVWF 77 |
|
|
1149 |
0326: BSF 03.6 |
|
|
1150 |
0327: MOVWF 40 |
|
|
1151 |
0328: BCF 03.6 |
|
|
1152 |
0329: CALL 10D |
|
|
1153 |
032A: MOVLW 06 |
|
|
1154 |
032B: SUBWF 62,W |
|
|
1155 |
032C: BTFSS 03.2 |
|
|
1156 |
032D: GOTO 322 |
|
|
1157 |
032E: MOVLW 4E |
|
|
1158 |
032F: MOVWF 04 |
|
|
1159 |
0330: BCF 03.7 |
|
|
1160 |
0331: MOVLW 00 |
|
|
1161 |
0332: IORWF 00,W |
|
|
1162 |
0333: BTFSC 03.2 |
|
|
1163 |
0334: GOTO 347 |
|
|
1164 |
0335: CLRF 64 |
|
|
1165 |
0336: MOVF 04,W |
|
|
1166 |
0337: MOVWF 63 |
|
|
1167 |
0338: BCF 64.0 |
|
|
1168 |
0339: BTFSC 03.7 |
|
|
1169 |
033A: BSF 64.0 |
|
|
1170 |
033B: MOVF 00,W |
|
|
1171 |
033C: BSF 03.6 |
|
|
1172 |
033D: MOVWF 40 |
|
|
1173 |
033E: BCF 03.6 |
|
|
1174 |
033F: CALL 10D |
|
|
1175 |
0340: MOVF 63,W |
|
|
1176 |
0341: MOVWF 04 |
|
|
1177 |
0342: BCF 03.7 |
|
|
1178 |
0343: BTFSC 64.0 |
|
|
1179 |
0344: BSF 03.7 |
|
|
1180 |
0345: INCF 04,F |
|
|
1181 |
0346: GOTO 331 |
|
|
1182 |
.................... delay_ms(2000); |
|
|
1183 |
0347: MOVLW 08 |
|
|
1184 |
0348: MOVWF 62 |
|
|
1185 |
0349: MOVLW FA |
|
|
1186 |
034A: BSF 03.6 |
|
|
1187 |
034B: MOVWF 41 |
|
|
1188 |
034C: BCF 03.6 |
|
|
1189 |
034D: CALL 062 |
|
|
1190 |
034E: DECFSZ 62,F |
|
|
1191 |
034F: GOTO 349 |
|
|
1192 |
.................... |
|
|
1193 |
.................... printf(lcd_putc,"\fODP3:%s",odp3); |
|
|
1194 |
0350: CLRF 62 |
|
|
1195 |
0351: MOVF 62,W |
|
|
1196 |
0352: CALL 03B |
|
|
1197 |
0353: INCF 62,F |
|
|
1198 |
0354: MOVWF 77 |
|
|
1199 |
0355: BSF 03.6 |
|
|
1200 |
0356: MOVWF 40 |
|
|
1201 |
0357: BCF 03.6 |
|
|
1202 |
0358: CALL 10D |
|
|
1203 |
0359: MOVLW 06 |
|
|
1204 |
035A: SUBWF 62,W |
|
|
1205 |
035B: BTFSS 03.2 |
|
|
1206 |
035C: GOTO 351 |
|
|
1207 |
035D: MOVLW A0 |
|
|
1208 |
035E: MOVWF 04 |
|
|
1209 |
035F: BCF 03.7 |
|
|
1210 |
0360: MOVLW 00 |
|
|
1211 |
0361: IORWF 00,W |
|
|
1212 |
0362: BTFSC 03.2 |
|
|
1213 |
0363: GOTO 376 |
|
|
1214 |
0364: CLRF 64 |
|
|
1215 |
0365: MOVF 04,W |
|
|
1216 |
0366: MOVWF 63 |
|
|
1217 |
0367: BCF 64.0 |
|
|
1218 |
0368: BTFSC 03.7 |
|
|
1219 |
0369: BSF 64.0 |
|
|
1220 |
036A: MOVF 00,W |
|
|
1221 |
036B: BSF 03.6 |
|
|
1222 |
036C: MOVWF 40 |
|
|
1223 |
036D: BCF 03.6 |
|
|
1224 |
036E: CALL 10D |
|
|
1225 |
036F: MOVF 63,W |
|
|
1226 |
0370: MOVWF 04 |
|
|
1227 |
0371: BCF 03.7 |
|
|
1228 |
0372: BTFSC 64.0 |
|
|
1229 |
0373: BSF 03.7 |
|
|
1230 |
0374: INCF 04,F |
|
|
1231 |
0375: GOTO 360 |
|
|
1232 |
.................... delay_ms(2000); |
|
|
1233 |
0376: MOVLW 08 |
|
|
1234 |
0377: MOVWF 62 |
|
|
1235 |
0378: MOVLW FA |
|
|
1236 |
0379: BSF 03.6 |
|
|
1237 |
037A: MOVWF 41 |
|
|
1238 |
037B: BCF 03.6 |
|
|
1239 |
037C: CALL 062 |
|
|
1240 |
037D: DECFSZ 62,F |
|
|
1241 |
037E: GOTO 378 |
|
|
1242 |
.................... |
|
|
1243 |
.................... printf(lcd_putc,"\fODP4:%s",odp4); |
|
|
1244 |
037F: CLRF 62 |
|
|
1245 |
0380: MOVF 62,W |
|
|
1246 |
0381: CALL 048 |
|
|
1247 |
0382: INCF 62,F |
|
|
1248 |
0383: MOVWF 77 |
|
|
1249 |
0384: BSF 03.6 |
|
|
1250 |
0385: MOVWF 40 |
|
|
1251 |
0386: BCF 03.6 |
|
|
1252 |
0387: CALL 10D |
|
|
1253 |
0388: MOVLW 06 |
|
|
1254 |
0389: SUBWF 62,W |
|
|
1255 |
038A: BTFSS 03.2 |
|
|
1256 |
038B: GOTO 380 |
|
|
1257 |
038C: MOVLW 58 |
|
|
1258 |
038D: MOVWF 04 |
|
|
1259 |
038E: BCF 03.7 |
|
|
1260 |
038F: MOVLW 00 |
|
|
1261 |
0390: IORWF 00,W |
|
|
1262 |
0391: BTFSC 03.2 |
|
|
1263 |
0392: GOTO 3A5 |
|
|
1264 |
0393: CLRF 64 |
|
|
1265 |
0394: MOVF 04,W |
|
|
1266 |
0395: MOVWF 63 |
|
|
1267 |
0396: BCF 64.0 |
|
|
1268 |
0397: BTFSC 03.7 |
|
|
1269 |
0398: BSF 64.0 |
|
|
1270 |
0399: MOVF 00,W |
|
|
1271 |
039A: BSF 03.6 |
|
|
1272 |
039B: MOVWF 40 |
|
|
1273 |
039C: BCF 03.6 |
|
|
1274 |
039D: CALL 10D |
|
|
1275 |
039E: MOVF 63,W |
|
|
1276 |
039F: MOVWF 04 |
|
|
1277 |
03A0: BCF 03.7 |
|
|
1278 |
03A1: BTFSC 64.0 |
|
|
1279 |
03A2: BSF 03.7 |
|
|
1280 |
03A3: INCF 04,F |
|
|
1281 |
03A4: GOTO 38F |
|
|
1282 |
.................... delay_ms(2000); |
|
|
1283 |
03A5: MOVLW 08 |
|
|
1284 |
03A6: MOVWF 62 |
|
|
1285 |
03A7: MOVLW FA |
|
|
1286 |
03A8: BSF 03.6 |
|
|
1287 |
03A9: MOVWF 41 |
|
|
1288 |
03AA: BCF 03.6 |
|
|
1289 |
03AB: CALL 062 |
|
|
1290 |
03AC: DECFSZ 62,F |
|
|
1291 |
03AD: GOTO 3A7 |
|
|
1292 |
.................... |
|
|
1293 |
.................... printf(lcd_putc,"\fODP5:%s",odp5); |
|
|
1294 |
03AE: CLRF 62 |
|
|
1295 |
03AF: MOVF 62,W |
|
|
1296 |
03B0: CALL 055 |
|
|
1297 |
03B1: INCF 62,F |
|
|
1298 |
03B2: MOVWF 77 |
|
|
1299 |
03B3: BSF 03.6 |
|
|
1300 |
03B4: MOVWF 40 |
|
|
1301 |
03B5: BCF 03.6 |
|
|
1302 |
03B6: CALL 10D |
|
|
1303 |
03B7: MOVLW 06 |
|
|
1304 |
03B8: SUBWF 62,W |
|
|
1305 |
03B9: BTFSS 03.2 |
|
|
1306 |
03BA: GOTO 3AF |
|
|
1307 |
03BB: MOVLW 10 |
|
|
1308 |
03BC: MOVWF 04 |
|
|
1309 |
03BD: BSF 03.7 |
|
|
1310 |
03BE: MOVLW 00 |
|
|
1311 |
03BF: IORWF 00,W |
|
|
1312 |
03C0: BTFSC 03.2 |
|
|
1313 |
03C1: GOTO 3D4 |
|
|
1314 |
03C2: CLRF 64 |
|
|
1315 |
03C3: MOVF 04,W |
|
|
1316 |
03C4: MOVWF 63 |
|
|
1317 |
03C5: BCF 64.0 |
|
|
1318 |
03C6: BTFSC 03.7 |
|
|
1319 |
03C7: BSF 64.0 |
|
|
1320 |
03C8: MOVF 00,W |
|
|
1321 |
03C9: BSF 03.6 |
|
|
1322 |
03CA: MOVWF 40 |
|
|
1323 |
03CB: BCF 03.6 |
|
|
1324 |
03CC: CALL 10D |
|
|
1325 |
03CD: MOVF 63,W |
|
|
1326 |
03CE: MOVWF 04 |
|
|
1327 |
03CF: BCF 03.7 |
|
|
1328 |
03D0: BTFSC 64.0 |
|
|
1329 |
03D1: BSF 03.7 |
|
|
1330 |
03D2: INCF 04,F |
|
|
1331 |
03D3: GOTO 3BE |
|
|
1332 |
.................... |
|
|
1333 |
.................... |
|
|
1334 |
.................... output_low(PIN_A4); |
|
|
1335 |
03D4: BSF 03.5 |
|
|
1336 |
03D5: BCF 05.4 |
|
|
1337 |
03D6: BCF 03.5 |
|
|
1338 |
03D7: BCF 05.4 |
|
|
1339 |
.................... delay_ms(150); |
|
|
1340 |
03D8: MOVLW 96 |
|
|
1341 |
03D9: BSF 03.6 |
|
|
1342 |
03DA: MOVWF 41 |
|
|
1343 |
03DB: BCF 03.6 |
|
|
1344 |
03DC: CALL 062 |
|
|
1345 |
.................... output_high(PIN_A4); |
|
|
1346 |
03DD: BSF 03.5 |
|
|
1347 |
03DE: BCF 05.4 |
|
|
1348 |
03DF: BCF 03.5 |
|
|
1349 |
03E0: BSF 05.4 |
|
|
1350 |
.................... delay_ms(100); |
|
|
1351 |
03E1: MOVLW 64 |
|
|
1352 |
03E2: BSF 03.6 |
|
|
1353 |
03E3: MOVWF 41 |
|
|
1354 |
03E4: BCF 03.6 |
|
|
1355 |
03E5: CALL 062 |
|
|
1356 |
.................... output_low(PIN_A4); |
|
|
1357 |
03E6: BSF 03.5 |
|
|
1358 |
03E7: BCF 05.4 |
|
|
1359 |
03E8: BCF 03.5 |
|
|
1360 |
03E9: BCF 05.4 |
|
|
1361 |
.................... delay_ms(150); |
|
|
1362 |
03EA: MOVLW 96 |
|
|
1363 |
03EB: BSF 03.6 |
|
|
1364 |
03EC: MOVWF 41 |
|
|
1365 |
03ED: BCF 03.6 |
|
|
1366 |
03EE: CALL 062 |
|
|
1367 |
.................... output_high(PIN_A4); |
|
|
1368 |
03EF: BSF 03.5 |
|
|
1369 |
03F0: BCF 05.4 |
|
|
1370 |
03F1: BCF 03.5 |
|
|
1371 |
03F2: BSF 05.4 |
|
|
1372 |
.................... delay_ms(100); |
|
|
1373 |
03F3: MOVLW 64 |
|
|
1374 |
03F4: BSF 03.6 |
|
|
1375 |
03F5: MOVWF 41 |
|
|
1376 |
03F6: BCF 03.6 |
|
|
1377 |
03F7: CALL 062 |
|
|
1378 |
.................... output_low(PIN_A4); |
|
|
1379 |
03F8: BSF 03.5 |
|
|
1380 |
03F9: BCF 05.4 |
|
|
1381 |
03FA: BCF 03.5 |
|
|
1382 |
03FB: BCF 05.4 |
|
|
1383 |
.................... delay_ms(150); |
|
|
1384 |
03FC: MOVLW 96 |
|
|
1385 |
03FD: BSF 03.6 |
|
|
1386 |
03FE: MOVWF 41 |
|
|
1387 |
03FF: BCF 03.6 |
|
|
1388 |
0400: CALL 062 |
|
|
1389 |
.................... output_high(PIN_A4); |
|
|
1390 |
0401: BSF 03.5 |
|
|
1391 |
0402: BCF 05.4 |
|
|
1392 |
0403: BCF 03.5 |
|
|
1393 |
0404: BSF 05.4 |
|
|
1394 |
.................... delay_ms(1500); |
|
|
1395 |
0405: MOVLW 06 |
|
|
1396 |
0406: MOVWF 62 |
|
|
1397 |
0407: MOVLW FA |
|
|
1398 |
0408: BSF 03.6 |
|
|
1399 |
0409: MOVWF 41 |
|
|
1400 |
040A: BCF 03.6 |
|
|
1401 |
040B: CALL 062 |
|
|
1402 |
040C: DECFSZ 62,F |
|
|
1403 |
040D: GOTO 407 |
|
|
1404 |
.................... } |
|
|
1405 |
040E: GOTO 28E |
|
|
1406 |
.................... } |
|
|
1407 |
040F: SLEEP |
|
|
1408 |
|
|
|
1409 |
Configuration Fuses: |
|
|
1410 |
Word 1: 3F39 XT NOWDT NOPUT NODEBUG NOPROTECT NOBROWNOUT NOLVP NOCPD NOWRT |