Line 1... |
Line 1... |
1 |
CCS PCM C Compiler, Version 4.059d, 15399 28-XII-07 11:02 |
1 |
CCS PCM C Compiler, Version 4.059d, 15399 28-XII-07 22:58 |
2 |
|
2 |
|
3 |
Filename: main.lst |
3 |
Filename: D:\MLAB_E\projekty\Ovladani_mobilnim_telefonem\SW\lcdmob\.\main.lst |
4 |
|
4 |
|
5 |
ROM used: 318 words (16%) |
5 |
ROM used: 363 words (18%) |
6 |
Largest free fragment is 1730 |
6 |
Largest free fragment is 1685 |
7 |
RAM used: 8 (2%) at main() level |
7 |
RAM used: 20 (5%) at main() level |
8 |
18 (5%) worst case |
8 |
30 (8%) worst case |
9 |
Stack: 4 locations |
9 |
Stack: 4 locations |
10 |
|
10 |
|
11 |
* |
11 |
* |
12 |
0000: MOVLW 00 |
12 |
0000: MOVLW 00 |
13 |
0001: MOVWF 0A |
13 |
0001: MOVWF 0A |
14 |
0002: GOTO 0EC |
14 |
0002: GOTO 0DB |
15 |
0003: NOP |
15 |
0003: NOP |
16 |
.................... #include "main.h" |
16 |
.................... #include "main.h" |
17 |
.................... #include <16F877A.h> |
17 |
.................... #include <16F877A.h> |
18 |
.................... //////// Standard Header file for the PIC16F877A device //////////////// |
18 |
.................... //////// Standard Header file for the PIC16F877A device //////////////// |
19 |
.................... #device PIC16F877A |
19 |
.................... #device PIC16F877A |
Line 30... |
Line 30... |
30 |
.................... #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O |
30 |
.................... #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O |
31 |
.................... #FUSES NOCPD //No EE protection |
31 |
.................... #FUSES NOCPD //No EE protection |
32 |
.................... #FUSES NOWRT //Program memory not write protected |
32 |
.................... #FUSES NOWRT //Program memory not write protected |
33 |
.................... |
33 |
.................... |
34 |
.................... #use delay(clock=4000000,RESTART_WDT) |
34 |
.................... #use delay(clock=4000000,RESTART_WDT) |
35 |
002A: MOVLW 23 |
35 |
0019: MOVLW 2F |
36 |
002B: MOVWF 04 |
36 |
001A: MOVWF 04 |
37 |
002C: BCF 03.7 |
37 |
001B: BCF 03.7 |
38 |
002D: MOVF 00,W |
38 |
001C: MOVF 00,W |
39 |
002E: BTFSC 03.2 |
39 |
001D: BTFSC 03.2 |
40 |
002F: GOTO 041 |
40 |
001E: GOTO 030 |
41 |
0030: MOVLW 01 |
41 |
001F: MOVLW 01 |
42 |
0031: MOVWF 78 |
42 |
0020: MOVWF 78 |
43 |
0032: MOVLW BF |
43 |
0021: MOVLW BF |
44 |
0033: MOVWF 77 |
44 |
0022: MOVWF 77 |
45 |
0034: CLRWDT |
45 |
0023: CLRWDT |
46 |
0035: DECFSZ 77,F |
46 |
0024: DECFSZ 77,F |
47 |
0036: GOTO 034 |
47 |
0025: GOTO 023 |
48 |
0037: DECFSZ 78,F |
48 |
0026: DECFSZ 78,F |
49 |
0038: GOTO 032 |
49 |
0027: GOTO 021 |
50 |
0039: MOVLW 4A |
50 |
0028: MOVLW 4A |
51 |
003A: MOVWF 77 |
51 |
0029: MOVWF 77 |
52 |
003B: DECFSZ 77,F |
52 |
002A: DECFSZ 77,F |
53 |
003C: GOTO 03B |
53 |
002B: GOTO 02A |
54 |
003D: NOP |
54 |
002C: NOP |
55 |
003E: CLRWDT |
55 |
002D: CLRWDT |
56 |
003F: DECFSZ 00,F |
56 |
002E: DECFSZ 00,F |
57 |
0040: GOTO 030 |
57 |
002F: GOTO 01F |
58 |
0041: RETLW 00 |
58 |
0030: RETLW 00 |
59 |
.................... #use rs232(baud=19200,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8) |
59 |
.................... #use rs232(baud=19200,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8) |
60 |
.................... |
60 |
.................... |
61 |
.................... |
61 |
.................... |
62 |
.................... |
62 |
.................... |
63 |
.................... |
- |
|
64 |
.................... |
- |
|
65 |
.................... #define LCD_RS PIN_B1 // rizeni registru LCD displeje |
63 |
.................... #define LCD_RS PIN_B1 // rizeni registru LCD displeje |
66 |
.................... #define LCD_E PIN_B0 // enable LCD displeje |
64 |
.................... #define LCD_E PIN_B0 // enable LCD displeje |
67 |
.................... #define LCD_DATA_LSB PIN_C0 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou) |
65 |
.................... #define LCD_DATA_LSB PIN_C0 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou) |
68 |
.................... |
66 |
.................... |
69 |
.................... #include "lcd.c" |
67 |
.................... #include "lcd.c" |
Line 169... |
Line 167... |
169 |
.................... void lcd_send_nibble( BYTE n ) |
167 |
.................... void lcd_send_nibble( BYTE n ) |
170 |
.................... { |
168 |
.................... { |
171 |
.................... #ifdef LCD_DATA_LSB |
169 |
.................... #ifdef LCD_DATA_LSB |
172 |
.................... // data jsou za sebou na 4 bitech jednoho portu |
170 |
.................... // data jsou za sebou na 4 bitech jednoho portu |
173 |
.................... *LCD_PORT = (*LCD_PORT & ~LCD_MASK) | ((n << LCD_SHIFT) & LCD_MASK); // nastav datove bity portu a ostatni zachovej |
171 |
.................... *LCD_PORT = (*LCD_PORT & ~LCD_MASK) | ((n << LCD_SHIFT) & LCD_MASK); // nastav datove bity portu a ostatni zachovej |
174 |
0042: MOVF 07,W |
172 |
0031: MOVF 07,W |
175 |
0043: ANDLW F0 |
173 |
0032: ANDLW F0 |
176 |
0044: MOVWF 2A |
174 |
0033: MOVWF 36 |
177 |
0045: MOVF 29,W |
175 |
0034: MOVF 35,W |
178 |
0046: ANDLW 0F |
176 |
0035: ANDLW 0F |
179 |
0047: IORWF 2A,W |
177 |
0036: IORWF 36,W |
180 |
0048: MOVWF 07 |
178 |
0037: MOVWF 07 |
181 |
.................... #else |
179 |
.................... #else |
182 |
.................... // data jsou na libovolnych 4 bitech libovolnych portu |
180 |
.................... // data jsou na libovolnych 4 bitech libovolnych portu |
183 |
.................... output_bit(LCD_D0,bit_test(n,0)); |
181 |
.................... output_bit(LCD_D0,bit_test(n,0)); |
184 |
.................... output_bit(LCD_D1,bit_test(n,1)); |
182 |
.................... output_bit(LCD_D1,bit_test(n,1)); |
185 |
.................... output_bit(LCD_D2,bit_test(n,2)); |
183 |
.................... output_bit(LCD_D2,bit_test(n,2)); |
186 |
.................... output_bit(LCD_D3,bit_test(n,3)); |
184 |
.................... output_bit(LCD_D3,bit_test(n,3)); |
187 |
.................... #endif |
185 |
.................... #endif |
188 |
.................... output_bit(LCD_E,1); // vzestupna hrana |
186 |
.................... output_bit(LCD_E,1); // vzestupna hrana |
189 |
0049: BSF 06.0 |
187 |
0038: BSF 06.0 |
190 |
004A: BSF 03.5 |
188 |
0039: BSF 03.5 |
191 |
004B: BCF 06.0 |
189 |
003A: BCF 06.0 |
192 |
.................... delay_us(1); // pockej alespon 450ns od e nebo alespon 195ns od dat |
190 |
.................... delay_us(1); // pockej alespon 450ns od e nebo alespon 195ns od dat |
193 |
004C: CLRWDT |
191 |
003B: CLRWDT |
194 |
.................... output_bit(LCD_E,0); // sestupna hrana (minimalni perioda e je 1us) |
192 |
.................... output_bit(LCD_E,0); // sestupna hrana (minimalni perioda e je 1us) |
195 |
004D: BCF 03.5 |
193 |
003C: BCF 03.5 |
196 |
004E: BCF 06.0 |
194 |
003D: BCF 06.0 |
197 |
004F: BSF 03.5 |
195 |
003E: BSF 03.5 |
198 |
0050: BCF 06.0 |
196 |
003F: BCF 06.0 |
199 |
.................... } |
197 |
.................... } |
200 |
0051: BCF 03.5 |
198 |
0040: BCF 03.5 |
201 |
0052: RETLW 00 |
199 |
0041: RETLW 00 |
202 |
.................... |
200 |
.................... |
203 |
.................... |
201 |
.................... |
204 |
.................... // Odesle bajt do registru LCD |
202 |
.................... // Odesle bajt do registru LCD |
205 |
.................... // |
203 |
.................... // |
206 |
.................... // Pokud je Adr=0 .. instrukcni registr |
204 |
.................... // Pokud je Adr=0 .. instrukcni registr |
207 |
.................... // Pokud je Adr=1 .. datovy registr |
205 |
.................... // Pokud je Adr=1 .. datovy registr |
208 |
.................... // |
206 |
.................... // |
209 |
.................... void lcd_send_byte( BOOLEAN Adr, BYTE n ) |
207 |
.................... void lcd_send_byte( BOOLEAN Adr, BYTE n ) |
210 |
.................... { |
208 |
.................... { |
211 |
.................... output_bit(LCD_RS,Adr); // vyber registr |
209 |
.................... output_bit(LCD_RS,Adr); // vyber registr |
212 |
0053: MOVF 27,F |
210 |
0042: MOVF 33,F |
213 |
0054: BTFSS 03.2 |
211 |
0043: BTFSS 03.2 |
214 |
0055: GOTO 058 |
212 |
0044: GOTO 047 |
215 |
0056: BCF 06.1 |
213 |
0045: BCF 06.1 |
216 |
0057: GOTO 059 |
214 |
0046: GOTO 048 |
217 |
0058: BSF 06.1 |
215 |
0047: BSF 06.1 |
218 |
0059: BSF 03.5 |
216 |
0048: BSF 03.5 |
219 |
005A: BCF 06.1 |
217 |
0049: BCF 06.1 |
220 |
.................... swap(n); |
218 |
.................... swap(n); |
221 |
005B: BCF 03.5 |
219 |
004A: BCF 03.5 |
222 |
005C: SWAPF 28,F |
220 |
004B: SWAPF 34,F |
223 |
.................... lcd_send_nibble(n); // posli horni pulku bajtu |
221 |
.................... lcd_send_nibble(n); // posli horni pulku bajtu |
224 |
005D: MOVF 28,W |
222 |
004C: MOVF 34,W |
225 |
005E: MOVWF 29 |
223 |
004D: MOVWF 35 |
226 |
005F: CALL 042 |
224 |
004E: CALL 031 |
227 |
.................... swap(n); |
225 |
.................... swap(n); |
228 |
0060: SWAPF 28,F |
226 |
004F: SWAPF 34,F |
229 |
.................... lcd_send_nibble(n); // posli spodni pulku bajtu |
227 |
.................... lcd_send_nibble(n); // posli spodni pulku bajtu |
230 |
0061: MOVF 28,W |
228 |
0050: MOVF 34,W |
231 |
0062: MOVWF 29 |
229 |
0051: MOVWF 35 |
232 |
0063: CALL 042 |
230 |
0052: CALL 031 |
233 |
.................... delay_us(40); // minimalni doba na provedeni prikazu |
231 |
.................... delay_us(40); // minimalni doba na provedeni prikazu |
234 |
0064: CLRWDT |
232 |
0053: CLRWDT |
235 |
0065: MOVLW 0C |
233 |
0054: MOVLW 0C |
236 |
0066: MOVWF 77 |
234 |
0055: MOVWF 77 |
237 |
0067: DECFSZ 77,F |
235 |
0056: DECFSZ 77,F |
238 |
0068: GOTO 067 |
236 |
0057: GOTO 056 |
239 |
0069: GOTO 06A |
237 |
0058: GOTO 059 |
240 |
.................... } |
238 |
.................... } |
241 |
006A: RETLW 00 |
239 |
0059: RETLW 00 |
242 |
.................... |
240 |
.................... |
243 |
.................... |
241 |
.................... |
244 |
.................... // Provede inicializaci LCD displeje, smaze obsah a nastavi mod displeje |
242 |
.................... // Provede inicializaci LCD displeje, smaze obsah a nastavi mod displeje |
245 |
.................... // |
243 |
.................... // |
246 |
.................... // Tato procedura se musi volat pred pouzitim ostatnich lcd_ procedur |
244 |
.................... // Tato procedura se musi volat pred pouzitim ostatnich lcd_ procedur |
Line 249... |
Line 247... |
249 |
.................... { |
247 |
.................... { |
250 |
.................... |
248 |
.................... |
251 |
.................... int i; // pocitadlo cyklu |
249 |
.................... int i; // pocitadlo cyklu |
252 |
.................... |
250 |
.................... |
253 |
.................... delay_ms(20); // spozdeni pro provedeni startu displeje po zapnuti napajeni |
251 |
.................... delay_ms(20); // spozdeni pro provedeni startu displeje po zapnuti napajeni |
254 |
006B: MOVLW 14 |
252 |
005A: MOVLW 14 |
255 |
006C: MOVWF 23 |
253 |
005B: MOVWF 2F |
256 |
006D: CALL 02A |
254 |
005C: CALL 019 |
257 |
.................... |
255 |
.................... |
258 |
.................... #ifdef LCD_DATA_LSB |
256 |
.................... #ifdef LCD_DATA_LSB |
259 |
.................... // data jsou na 4 bitech za sebou, nastav smer pro vsechny dalsi prenosy |
257 |
.................... // data jsou na 4 bitech za sebou, nastav smer pro vsechny dalsi prenosy |
260 |
.................... *LCD_TRIS = *LCD_TRIS & ~LCD_MASK; // nuluj odpovidajici bity tris registru datoveho portu LCD |
258 |
.................... *LCD_TRIS = *LCD_TRIS & ~LCD_MASK; // nuluj odpovidajici bity tris registru datoveho portu LCD |
261 |
006E: MOVLW F0 |
259 |
005D: MOVLW F0 |
262 |
006F: BSF 03.5 |
260 |
005E: BSF 03.5 |
263 |
0070: ANDWF 07,F |
261 |
005F: ANDWF 07,F |
264 |
.................... #endif |
262 |
.................... #endif |
265 |
.................... |
263 |
.................... |
266 |
.................... output_bit(LCD_RS,0); // nastav jako vystup a nastav klidovy stav |
264 |
.................... output_bit(LCD_RS,0); // nastav jako vystup a nastav klidovy stav |
267 |
0071: BCF 03.5 |
265 |
0060: BCF 03.5 |
268 |
0072: BCF 06.1 |
266 |
0061: BCF 06.1 |
269 |
0073: BSF 03.5 |
267 |
0062: BSF 03.5 |
270 |
0074: BCF 06.1 |
268 |
0063: BCF 06.1 |
271 |
.................... output_bit(LCD_E, 0); // nastav jako vystup a nastav klidovy stav |
269 |
.................... output_bit(LCD_E, 0); // nastav jako vystup a nastav klidovy stav |
272 |
0075: BCF 03.5 |
270 |
0064: BCF 03.5 |
273 |
0076: BCF 06.0 |
271 |
0065: BCF 06.0 |
274 |
0077: BSF 03.5 |
272 |
0066: BSF 03.5 |
275 |
0078: BCF 06.0 |
273 |
0067: BCF 06.0 |
276 |
.................... |
274 |
.................... |
277 |
.................... for (i=0; i<3; i++) // nastav lcd do rezimu 8 bitu sbernice |
275 |
.................... for (i=0; i<3; i++) // nastav lcd do rezimu 8 bitu sbernice |
278 |
0079: BCF 03.5 |
276 |
0068: BCF 03.5 |
279 |
007A: CLRF 21 |
277 |
0069: CLRF 2B |
280 |
007B: MOVF 21,W |
278 |
006A: MOVF 2B,W |
281 |
007C: SUBLW 02 |
279 |
006B: SUBLW 02 |
282 |
007D: BTFSS 03.0 |
280 |
006C: BTFSS 03.0 |
283 |
007E: GOTO 087 |
281 |
006D: GOTO 076 |
284 |
.................... { |
282 |
.................... { |
285 |
.................... delay_ms(2); // muze byt rozdelany prenos dat (2x 4 bity) nebo pomaly povel |
283 |
.................... delay_ms(2); // muze byt rozdelany prenos dat (2x 4 bity) nebo pomaly povel |
286 |
007F: MOVLW 02 |
284 |
006E: MOVLW 02 |
287 |
0080: MOVWF 23 |
285 |
006F: MOVWF 2F |
288 |
0081: CALL 02A |
286 |
0070: CALL 019 |
289 |
.................... lcd_send_nibble(3); // rezim 8 bitu |
287 |
.................... lcd_send_nibble(3); // rezim 8 bitu |
290 |
0082: MOVLW 03 |
288 |
0071: MOVLW 03 |
291 |
0083: MOVWF 29 |
289 |
0072: MOVWF 35 |
292 |
0084: CALL 042 |
290 |
0073: CALL 031 |
293 |
.................... } |
291 |
.................... } |
294 |
0085: INCF 21,F |
292 |
0074: INCF 2B,F |
295 |
0086: GOTO 07B |
293 |
0075: GOTO 06A |
296 |
.................... |
294 |
.................... |
297 |
.................... delay_us(40); // cas na zpracovani |
295 |
.................... delay_us(40); // cas na zpracovani |
298 |
0087: CLRWDT |
296 |
0076: CLRWDT |
299 |
0088: MOVLW 0C |
297 |
0077: MOVLW 0C |
300 |
0089: MOVWF 77 |
298 |
0078: MOVWF 77 |
301 |
008A: DECFSZ 77,F |
299 |
0079: DECFSZ 77,F |
302 |
008B: GOTO 08A |
300 |
007A: GOTO 079 |
303 |
008C: GOTO 08D |
301 |
007B: GOTO 07C |
304 |
.................... lcd_send_nibble(2); // nastav rezim 4 bitu (plati od nasledujiciho prenosu) |
302 |
.................... lcd_send_nibble(2); // nastav rezim 4 bitu (plati od nasledujiciho prenosu) |
305 |
008D: MOVLW 02 |
303 |
007C: MOVLW 02 |
306 |
008E: MOVWF 29 |
304 |
007D: MOVWF 35 |
307 |
008F: CALL 042 |
305 |
007E: CALL 031 |
308 |
.................... delay_us(40); // cas na zpracovani |
306 |
.................... delay_us(40); // cas na zpracovani |
309 |
0090: CLRWDT |
307 |
007F: CLRWDT |
310 |
0091: MOVLW 0C |
308 |
0080: MOVLW 0C |
311 |
0092: MOVWF 77 |
309 |
0081: MOVWF 77 |
312 |
0093: DECFSZ 77,F |
310 |
0082: DECFSZ 77,F |
313 |
0094: GOTO 093 |
311 |
0083: GOTO 082 |
314 |
0095: GOTO 096 |
312 |
0084: GOTO 085 |
315 |
.................... |
313 |
.................... |
316 |
.................... for (i=0;i<3;i++) // proved inicializaci (nastaveni modu, smazani apod) |
314 |
.................... for (i=0;i<3;i++) // proved inicializaci (nastaveni modu, smazani apod) |
317 |
0096: CLRF 21 |
315 |
0085: CLRF 2B |
318 |
0097: MOVF 21,W |
316 |
0086: MOVF 2B,W |
319 |
0098: SUBLW 02 |
317 |
0087: SUBLW 02 |
320 |
0099: BTFSS 03.0 |
318 |
0088: BTFSS 03.0 |
321 |
009A: GOTO 0A7 |
319 |
0089: GOTO 096 |
322 |
.................... { |
320 |
.................... { |
323 |
.................... lcd_send_byte(0,LCD_INIT_STRING[i]); |
321 |
.................... lcd_send_byte(0,LCD_INIT_STRING[i]); |
324 |
009B: MOVF 21,W |
322 |
008A: MOVF 2B,W |
325 |
009C: CALL 004 |
323 |
008B: CALL 004 |
326 |
009D: MOVWF 22 |
324 |
008C: MOVWF 2C |
327 |
009E: CLRF 27 |
325 |
008D: CLRF 33 |
328 |
009F: MOVF 22,W |
326 |
008E: MOVF 2C,W |
329 |
00A0: MOVWF 28 |
327 |
008F: MOVWF 34 |
330 |
00A1: CALL 053 |
328 |
0090: CALL 042 |
331 |
.................... delay_ms(2); |
329 |
.................... delay_ms(2); |
332 |
00A2: MOVLW 02 |
330 |
0091: MOVLW 02 |
333 |
00A3: MOVWF 23 |
331 |
0092: MOVWF 2F |
334 |
00A4: CALL 02A |
332 |
0093: CALL 019 |
335 |
.................... } |
333 |
.................... } |
336 |
00A5: INCF 21,F |
334 |
0094: INCF 2B,F |
337 |
00A6: GOTO 097 |
335 |
0095: GOTO 086 |
338 |
.................... } |
336 |
.................... } |
339 |
00A7: GOTO 12E (RETURN) |
337 |
0096: GOTO 11D (RETURN) |
340 |
.................... |
338 |
.................... |
341 |
.................... |
339 |
.................... |
342 |
.................... // Proved presun kurzoru |
340 |
.................... // Proved presun kurzoru |
343 |
.................... // |
341 |
.................... // |
344 |
.................... // Pozice 1.1 je domu |
342 |
.................... // Pozice 1.1 je domu |
Line 347... |
Line 345... |
347 |
.................... { |
345 |
.................... { |
348 |
.................... |
346 |
.................... |
349 |
.................... BYTE Adr; |
347 |
.................... BYTE Adr; |
350 |
.................... |
348 |
.................... |
351 |
.................... Adr=x-1; |
349 |
.................... Adr=x-1; |
352 |
00A8: MOVLW 01 |
350 |
0097: MOVLW 01 |
353 |
00A9: SUBWF 23,W |
351 |
0098: SUBWF 2F,W |
354 |
00AA: MOVWF 25 |
352 |
0099: MOVWF 31 |
355 |
.................... if(y==2) |
353 |
.................... if(y==2) |
356 |
00AB: MOVF 24,W |
354 |
009A: MOVF 30,W |
357 |
00AC: SUBLW 02 |
355 |
009B: SUBLW 02 |
358 |
00AD: BTFSS 03.2 |
356 |
009C: BTFSS 03.2 |
359 |
00AE: GOTO 0B1 |
357 |
009D: GOTO 0A0 |
360 |
.................... Adr+=LCD_LINE_2; |
358 |
.................... Adr+=LCD_LINE_2; |
361 |
00AF: MOVLW 40 |
359 |
009E: MOVLW 40 |
362 |
00B0: ADDWF 25,F |
360 |
009F: ADDWF 31,F |
363 |
.................... |
361 |
.................... |
364 |
.................... lcd_send_byte(0,0x80|Adr); |
362 |
.................... lcd_send_byte(0,0x80|Adr); |
365 |
00B1: MOVF 25,W |
363 |
00A0: MOVF 31,W |
366 |
00B2: IORLW 80 |
364 |
00A1: IORLW 80 |
367 |
00B3: MOVWF 26 |
365 |
00A2: MOVWF 32 |
368 |
00B4: CLRF 27 |
366 |
00A3: CLRF 33 |
369 |
00B5: MOVF 26,W |
367 |
00A4: MOVF 32,W |
370 |
00B6: MOVWF 28 |
368 |
00A5: MOVWF 34 |
371 |
00B7: CALL 053 |
369 |
00A6: CALL 042 |
372 |
.................... } |
370 |
.................... } |
373 |
00B8: RETLW 00 |
371 |
00A7: RETLW 00 |
374 |
.................... |
372 |
.................... |
375 |
.................... |
373 |
.................... |
376 |
.................... // Zapis znaku na displej, zpracovani ridicich znaku |
374 |
.................... // Zapis znaku na displej, zpracovani ridicich znaku |
377 |
.................... // |
375 |
.................... // |
378 |
.................... void lcd_putc( char c) |
376 |
.................... void lcd_putc( char c) |
379 |
.................... { |
377 |
.................... { |
380 |
.................... |
378 |
.................... |
381 |
.................... switch (c) |
379 |
.................... switch (c) |
382 |
.................... { |
380 |
.................... { |
383 |
00B9: MOVF 22,W |
381 |
00A8: MOVF 2E,W |
384 |
00BA: XORLW 0C |
382 |
00A9: XORLW 0C |
385 |
00BB: BTFSC 03.2 |
383 |
00AA: BTFSC 03.2 |
386 |
00BC: GOTO 0C7 |
384 |
00AB: GOTO 0B6 |
387 |
00BD: XORLW 06 |
385 |
00AC: XORLW 06 |
388 |
00BE: BTFSC 03.2 |
386 |
00AD: BTFSC 03.2 |
389 |
00BF: GOTO 0CF |
387 |
00AE: GOTO 0BE |
390 |
00C0: XORLW 07 |
388 |
00AF: XORLW 07 |
391 |
00C1: BTFSC 03.2 |
389 |
00B0: BTFSC 03.2 |
392 |
00C2: GOTO 0D5 |
390 |
00B1: GOTO 0C4 |
393 |
00C3: XORLW 05 |
391 |
00B2: XORLW 05 |
394 |
00C4: BTFSC 03.2 |
392 |
00B3: BTFSC 03.2 |
395 |
00C5: GOTO 0DA |
393 |
00B4: GOTO 0C9 |
396 |
00C6: GOTO 0DF |
394 |
00B5: GOTO 0CE |
397 |
.................... case '\f' : lcd_send_byte(0,1); // smaz displej |
395 |
.................... case '\f' : lcd_send_byte(0,1); // smaz displej |
398 |
00C7: CLRF 27 |
396 |
00B6: CLRF 33 |
399 |
00C8: MOVLW 01 |
397 |
00B7: MOVLW 01 |
400 |
00C9: MOVWF 28 |
398 |
00B8: MOVWF 34 |
401 |
00CA: CALL 053 |
399 |
00B9: CALL 042 |
402 |
.................... delay_ms(2); |
400 |
.................... delay_ms(2); |
403 |
00CB: MOVLW 02 |
401 |
00BA: MOVLW 02 |
404 |
00CC: MOVWF 23 |
402 |
00BB: MOVWF 2F |
405 |
00CD: CALL 02A |
403 |
00BC: CALL 019 |
406 |
.................... break; |
404 |
.................... break; |
407 |
00CE: GOTO 0EB |
405 |
00BD: GOTO 0DA |
408 |
.................... case '\n' : lcd_gotoxy(1,2); break; // presun se na 1. znak 2. radky |
406 |
.................... case '\n' : lcd_gotoxy(1,2); break; // presun se na 1. znak 2. radky |
409 |
00CF: MOVLW 01 |
407 |
00BE: MOVLW 01 |
410 |
00D0: MOVWF 23 |
408 |
00BF: MOVWF 2F |
411 |
00D1: MOVLW 02 |
409 |
00C0: MOVLW 02 |
412 |
00D2: MOVWF 24 |
410 |
00C1: MOVWF 30 |
413 |
00D3: CALL 0A8 |
411 |
00C2: CALL 097 |
414 |
00D4: GOTO 0EB |
412 |
00C3: GOTO 0DA |
415 |
.................... case '\r' : lcd_gotoxy(1,1); break; // presun home |
413 |
.................... case '\r' : lcd_gotoxy(1,1); break; // presun home |
416 |
00D5: MOVLW 01 |
414 |
00C4: MOVLW 01 |
417 |
00D6: MOVWF 23 |
415 |
00C5: MOVWF 2F |
418 |
00D7: MOVWF 24 |
416 |
00C6: MOVWF 30 |
419 |
00D8: CALL 0A8 |
417 |
00C7: CALL 097 |
420 |
00D9: GOTO 0EB |
418 |
00C8: GOTO 0DA |
421 |
.................... case '\b' : lcd_send_byte(0,0x10); break; // posun kurzor o 1 zpet |
419 |
.................... case '\b' : lcd_send_byte(0,0x10); break; // posun kurzor o 1 zpet |
422 |
00DA: CLRF 27 |
420 |
00C9: CLRF 33 |
423 |
00DB: MOVLW 10 |
421 |
00CA: MOVLW 10 |
424 |
00DC: MOVWF 28 |
422 |
00CB: MOVWF 34 |
425 |
00DD: CALL 053 |
423 |
00CC: CALL 042 |
426 |
00DE: GOTO 0EB |
424 |
00CD: GOTO 0DA |
427 |
.................... default : if (c<0x20) c&=0x7; // preklopeni definovatelnych znaku na rozsah 0 az 0x1F |
425 |
.................... default : if (c<0x20) c&=0x7; // preklopeni definovatelnych znaku na rozsah 0 az 0x1F |
428 |
00DF: MOVF 22,W |
426 |
00CE: MOVF 2E,W |
429 |
00E0: SUBLW 1F |
427 |
00CF: SUBLW 1F |
430 |
00E1: BTFSS 03.0 |
428 |
00D0: BTFSS 03.0 |
431 |
00E2: GOTO 0E5 |
429 |
00D1: GOTO 0D4 |
432 |
00E3: MOVLW 07 |
430 |
00D2: MOVLW 07 |
433 |
00E4: ANDWF 22,F |
431 |
00D3: ANDWF 2E,F |
434 |
.................... lcd_send_byte(1,c); break; // zapis znak |
432 |
.................... lcd_send_byte(1,c); break; // zapis znak |
435 |
00E5: MOVLW 01 |
433 |
00D4: MOVLW 01 |
436 |
00E6: MOVWF 27 |
434 |
00D5: MOVWF 33 |
437 |
00E7: MOVF 22,W |
435 |
00D6: MOVF 2E,W |
438 |
00E8: MOVWF 28 |
436 |
00D7: MOVWF 34 |
439 |
00E9: CALL 053 |
437 |
00D8: CALL 042 |
440 |
00EA: GOTO 0EB |
438 |
00D9: GOTO 0DA |
441 |
.................... } |
439 |
.................... } |
442 |
.................... } |
440 |
.................... } |
443 |
00EB: GOTO 138 (RETURN) |
441 |
00DA: RETLW 00 |
444 |
.................... |
442 |
.................... |
445 |
.................... |
443 |
.................... |
446 |
.................... // Zapni kurzor |
444 |
.................... // Zapni kurzor |
447 |
.................... // |
445 |
.................... // |
448 |
.................... void lcd_cursor_on() |
446 |
.................... void lcd_cursor_on() |
Line 550... |
Line 548... |
550 |
.................... //} |
548 |
.................... //} |
551 |
.................... |
549 |
.................... |
552 |
.................... |
550 |
.................... |
553 |
.................... void main() |
551 |
.................... void main() |
554 |
.................... { |
552 |
.................... { |
555 |
00EC: CLRF 04 |
553 |
00DB: CLRF 04 |
556 |
00ED: BCF 03.7 |
554 |
00DC: BCF 03.7 |
557 |
00EE: MOVLW 1F |
555 |
00DD: MOVLW 1F |
558 |
00EF: ANDWF 03,F |
556 |
00DE: ANDWF 03,F |
559 |
00F0: MOVLW 0C |
557 |
00DF: MOVLW 0C |
560 |
00F1: BSF 03.5 |
558 |
00E0: BSF 03.5 |
561 |
00F2: MOVWF 19 |
559 |
00E1: MOVWF 19 |
562 |
00F3: MOVLW A6 |
560 |
00E2: MOVLW A6 |
563 |
00F4: MOVWF 18 |
561 |
00E3: MOVWF 18 |
564 |
00F5: MOVLW 90 |
562 |
00E4: MOVLW 90 |
565 |
00F6: BCF 03.5 |
563 |
00E5: BCF 03.5 |
566 |
00F7: MOVWF 18 |
564 |
00E6: MOVWF 18 |
567 |
00F8: BSF 03.5 |
565 |
00E7: BSF 03.5 |
568 |
00F9: BSF 1F.0 |
566 |
00E8: BSF 1F.0 |
569 |
00FA: BSF 1F.1 |
567 |
00E9: BSF 1F.1 |
570 |
00FB: BSF 1F.2 |
568 |
00EA: BSF 1F.2 |
571 |
00FC: BCF 1F.3 |
569 |
00EB: BCF 1F.3 |
572 |
00FD: MOVLW 07 |
570 |
00EC: MOVLW 07 |
573 |
00FE: MOVWF 1C |
571 |
00ED: MOVWF 1C |
- |
|
572 |
.................... char odp[10]; |
574 |
.................... |
573 |
.................... |
575 |
.................... setup_adc_ports(NO_ANALOGS); |
574 |
.................... setup_adc_ports(NO_ANALOGS); |
576 |
* |
575 |
* |
577 |
0102: BSF 03.5 |
576 |
00F1: BSF 03.5 |
578 |
0103: BSF 1F.0 |
577 |
00F2: BSF 1F.0 |
579 |
0104: BSF 1F.1 |
578 |
00F3: BSF 1F.1 |
580 |
0105: BSF 1F.2 |
579 |
00F4: BSF 1F.2 |
581 |
0106: BCF 1F.3 |
580 |
00F5: BCF 1F.3 |
582 |
.................... setup_adc(ADC_OFF); |
581 |
.................... setup_adc(ADC_OFF); |
583 |
0107: BCF 03.5 |
582 |
00F6: BCF 03.5 |
584 |
0108: BCF 1F.0 |
583 |
00F7: BCF 1F.0 |
585 |
.................... setup_psp(PSP_DISABLED); |
584 |
.................... setup_psp(PSP_DISABLED); |
586 |
0109: BSF 03.5 |
585 |
00F8: BSF 03.5 |
587 |
010A: BCF 09.4 |
586 |
00F9: BCF 09.4 |
588 |
.................... setup_spi(FALSE); |
587 |
.................... setup_spi(FALSE); |
589 |
* |
588 |
* |
590 |
00FF: MOVLW FF |
589 |
00EE: MOVLW FF |
591 |
0100: BCF 03.5 |
590 |
00EF: BCF 03.5 |
592 |
0101: MOVWF 20 |
591 |
00F0: MOVWF 20 |
593 |
* |
592 |
* |
- |
|
593 |
00FA: BCF 03.5 |
- |
|
594 |
00FB: BCF 14.5 |
- |
|
595 |
00FC: BCF 20.5 |
- |
|
596 |
00FD: MOVF 20,W |
- |
|
597 |
00FE: BSF 03.5 |
- |
|
598 |
00FF: MOVWF 07 |
- |
|
599 |
0100: BCF 03.5 |
- |
|
600 |
0101: BSF 20.4 |
- |
|
601 |
0102: MOVF 20,W |
- |
|
602 |
0103: BSF 03.5 |
- |
|
603 |
0104: MOVWF 07 |
- |
|
604 |
0105: BCF 03.5 |
- |
|
605 |
0106: BCF 20.3 |
- |
|
606 |
0107: MOVF 20,W |
- |
|
607 |
0108: BSF 03.5 |
- |
|
608 |
0109: MOVWF 07 |
- |
|
609 |
010A: MOVLW 00 |
594 |
010B: BCF 03.5 |
610 |
010B: BCF 03.5 |
595 |
010C: BCF 14.5 |
- |
|
596 |
010D: BCF 20.5 |
- |
|
597 |
010E: MOVF 20,W |
- |
|
598 |
010F: BSF 03.5 |
- |
|
599 |
0110: MOVWF 07 |
- |
|
600 |
0111: BCF 03.5 |
- |
|
601 |
0112: BSF 20.4 |
- |
|
602 |
0113: MOVF 20,W |
- |
|
603 |
0114: BSF 03.5 |
- |
|
604 |
0115: MOVWF 07 |
- |
|
605 |
0116: BCF 03.5 |
- |
|
606 |
0117: BCF 20.3 |
- |
|
607 |
0118: MOVF 20,W |
- |
|
608 |
0119: BSF 03.5 |
- |
|
609 |
011A: MOVWF 07 |
- |
|
610 |
011B: MOVLW 00 |
- |
|
611 |
011C: BCF 03.5 |
- |
|
612 |
011D: MOVWF 14 |
611 |
010C: MOVWF 14 |
613 |
011E: BSF 03.5 |
612 |
010D: BSF 03.5 |
614 |
011F: MOVWF 14 |
613 |
010E: MOVWF 14 |
615 |
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
614 |
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
616 |
0120: MOVF 01,W |
615 |
010F: MOVF 01,W |
617 |
0121: ANDLW C7 |
616 |
0110: ANDLW C7 |
618 |
0122: IORLW 08 |
617 |
0111: IORLW 08 |
619 |
0123: MOVWF 01 |
618 |
0112: MOVWF 01 |
620 |
.................... setup_timer_1(T1_DISABLED); |
619 |
.................... setup_timer_1(T1_DISABLED); |
621 |
0124: BCF 03.5 |
620 |
0113: BCF 03.5 |
622 |
0125: CLRF 10 |
621 |
0114: CLRF 10 |
623 |
.................... setup_timer_2(T2_DISABLED,0,1); |
622 |
.................... setup_timer_2(T2_DISABLED,0,1); |
624 |
0126: MOVLW 00 |
623 |
0115: MOVLW 00 |
625 |
0127: MOVWF 78 |
624 |
0116: MOVWF 78 |
626 |
0128: MOVWF 12 |
625 |
0117: MOVWF 12 |
627 |
0129: MOVLW 00 |
626 |
0118: MOVLW 00 |
628 |
012A: BSF 03.5 |
627 |
0119: BSF 03.5 |
629 |
012B: MOVWF 12 |
628 |
011A: MOVWF 12 |
630 |
.................... |
629 |
.................... |
631 |
.................... lcd_init(); |
630 |
.................... lcd_init(); |
632 |
012C: BCF 03.5 |
631 |
011B: BCF 03.5 |
633 |
012D: GOTO 06B |
632 |
011C: GOTO 05A |
- |
|
633 |
.................... |
634 |
.................... |
634 |
.................... |
635 |
.................... while(true) |
635 |
.................... while(true) |
636 |
.................... { |
636 |
.................... { |
- |
|
637 |
.................... output_low(PIN_A4); |
- |
|
638 |
011D: BSF 03.5 |
- |
|
639 |
011E: BCF 05.4 |
- |
|
640 |
011F: BCF 03.5 |
- |
|
641 |
0120: BCF 05.4 |
637 |
.................... Delay_ms(100); |
642 |
.................... delay_ms(1500); |
- |
|
643 |
0121: MOVLW 06 |
- |
|
644 |
0122: MOVWF 2B |
638 |
012E: MOVLW 64 |
645 |
0123: MOVLW FA |
639 |
012F: MOVWF 23 |
646 |
0124: MOVWF 2F |
640 |
0130: CALL 02A |
647 |
0125: CALL 019 |
- |
|
648 |
0126: DECFSZ 2B,F |
- |
|
649 |
0127: GOTO 123 |
- |
|
650 |
.................... output_high(PIN_A4); |
- |
|
651 |
0128: BSF 03.5 |
- |
|
652 |
0129: BCF 05.4 |
- |
|
653 |
012A: BCF 03.5 |
- |
|
654 |
012B: BSF 05.4 |
641 |
.................... |
655 |
.................... |
- |
|
656 |
.................... printf("AT\r"); |
- |
|
657 |
012C: MOVLW 41 |
- |
|
658 |
012D: BTFSS 0C.4 |
- |
|
659 |
012E: GOTO 12D |
- |
|
660 |
012F: MOVWF 19 |
- |
|
661 |
0130: MOVLW 54 |
- |
|
662 |
0131: BTFSS 0C.4 |
- |
|
663 |
0132: GOTO 131 |
- |
|
664 |
0133: MOVWF 19 |
- |
|
665 |
0134: MOVLW 0D |
- |
|
666 |
0135: BTFSS 0C.4 |
- |
|
667 |
0136: GOTO 135 |
- |
|
668 |
0137: MOVWF 19 |
- |
|
669 |
.................... odp[0]=getc(); |
- |
|
670 |
0138: BTFSS 0C.5 |
- |
|
671 |
0139: GOTO 138 |
- |
|
672 |
013A: MOVF 1A,W |
- |
|
673 |
013B: MOVWF 21 |
642 |
.................... // LCD_gotoxy(1,1); |
674 |
.................... odp[1]=getc(); |
- |
|
675 |
013C: BTFSS 0C.5 |
- |
|
676 |
013D: GOTO 13C |
- |
|
677 |
013E: MOVF 1A,W |
- |
|
678 |
013F: MOVWF 22 |
- |
|
679 |
.................... odp[2]=0; |
- |
|
680 |
0140: CLRF 23 |
- |
|
681 |
.................... |
643 |
.................... printf(lcd_putc,"\fZkouska vypisu.\nFunguje!"); |
682 |
.................... printf(lcd_putc,"ble:%s\n\r",odp); |
644 |
0131: CLRF 21 |
683 |
0141: CLRF 2B |
645 |
0132: MOVF 21,W |
684 |
0142: MOVF 2B,W |
646 |
0133: CALL 00C |
685 |
0143: CALL 00C |
647 |
0134: INCF 21,F |
686 |
0144: INCF 2B,F |
648 |
0135: MOVWF 77 |
687 |
0145: MOVWF 77 |
649 |
0136: MOVWF 22 |
688 |
0146: MOVWF 2E |
650 |
0137: GOTO 0B9 |
689 |
0147: CALL 0A8 |
651 |
0138: MOVLW 19 |
690 |
0148: MOVLW 04 |
652 |
0139: SUBWF 21,W |
691 |
0149: SUBWF 2B,W |
653 |
013A: BTFSS 03.2 |
692 |
014A: BTFSS 03.2 |
654 |
013B: GOTO 132 |
693 |
014B: GOTO 142 |
- |
|
694 |
014C: MOVLW 21 |
- |
|
695 |
014D: MOVWF 04 |
- |
|
696 |
014E: BCF 03.7 |
- |
|
697 |
014F: MOVLW 00 |
- |
|
698 |
0150: IORWF 00,W |
- |
|
699 |
0151: BTFSC 03.2 |
- |
|
700 |
0152: GOTO 163 |
- |
|
701 |
0153: CLRF 2D |
- |
|
702 |
0154: MOVF 04,W |
- |
|
703 |
0155: MOVWF 2C |
- |
|
704 |
0156: BCF 2D.0 |
- |
|
705 |
0157: BTFSC 03.7 |
- |
|
706 |
0158: BSF 2D.0 |
- |
|
707 |
0159: MOVF 00,W |
- |
|
708 |
015A: MOVWF 2E |
- |
|
709 |
015B: CALL 0A8 |
- |
|
710 |
015C: MOVF 2C,W |
- |
|
711 |
015D: MOVWF 04 |
- |
|
712 |
015E: BCF 03.7 |
- |
|
713 |
015F: BTFSC 2D.0 |
- |
|
714 |
0160: BSF 03.7 |
- |
|
715 |
0161: INCF 04,F |
- |
|
716 |
0162: GOTO 14F |
- |
|
717 |
0163: MOVLW 0A |
- |
|
718 |
0164: MOVWF 2E |
- |
|
719 |
0165: CALL 0A8 |
- |
|
720 |
0166: MOVLW 0D |
- |
|
721 |
0167: MOVWF 2E |
- |
|
722 |
0168: CALL 0A8 |
655 |
.................... |
723 |
.................... |
656 |
.................... } |
724 |
.................... } |
657 |
013C: GOTO 12E |
725 |
0169: GOTO 11D |
658 |
.................... |
- |
|
659 |
.................... } |
726 |
.................... } |
660 |
.................... |
- |
|
661 |
.................... /* |
- |
|
662 |
.................... |
- |
|
663 |
.................... #include "C:\RS\projekty\lcdmob\main.h" |
- |
|
664 |
.................... |
- |
|
665 |
.................... |
- |
|
666 |
.................... void main() |
- |
|
667 |
.................... { |
- |
|
668 |
.................... |
- |
|
669 |
.................... setup_adc_ports(NO_ANALOGS); |
- |
|
670 |
.................... setup_adc(ADC_OFF); |
- |
|
671 |
.................... setup_psp(PSP_DISABLED); |
- |
|
672 |
.................... setup_spi(SPI_SS_DISABLED); |
- |
|
673 |
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
- |
|
674 |
.................... setup_timer_1(T1_DISABLED); |
- |
|
675 |
.................... setup_timer_2(T2_DISABLED,0,1); |
- |
|
676 |
.................... setup_comparator(NC_NC_NC_NC); |
- |
|
677 |
.................... setup_vref(FALSE); |
- |
|
678 |
.................... |
- |
|
679 |
.................... // TODO: USER CODE!! |
- |
|
680 |
.................... |
- |
|
681 |
.................... }*/ |
- |
|
682 |
013D: SLEEP |
727 |
016A: SLEEP |
683 |
|
728 |
|
684 |
Configuration Fuses: |
729 |
Configuration Fuses: |
685 |
Word 1: 3F39 XT NOWDT NOPUT NODEBUG NOPROTECT NOBROWNOUT NOLVP NOCPD NOWRT |
730 |
Word 1: 3F39 XT NOWDT NOPUT NODEBUG NOPROTECT NOBROWNOUT NOLVP NOCPD NOWRT |