Rev Author Line No. Line
2953 jacho 1 CCS PCM C Compiler, Version 4.106, 47914 22-4-13 22:26
2  
3 Filename: C:\Users\Honza\Documents\pic\I2C_bat_pam\Q_MAX\main.lst
4  
5 ROM used: 1306 words (16%)
6 Largest free fragment is 2048
7 RAM used: 6 (2%) at main() level
8 22 (6%) worst case
9 Stack: 2 locations
10  
11 *
12 0000: MOVLW 01
13 0001: MOVWF 0A
14 0002: GOTO 19B
15 0003: NOP
16 .................... #include "C:\Users\Honza\Documents\pic\I2C_bat_pam\Q_MAX\main.h"
17 .................... #include <16F887.h>
18 .................... //////// Standard Header file for the PIC16F887 device ////////////////
19 .................... #device PIC16F887
20 .................... #list
21 ....................
22 .................... #device adc=8
23 ....................
24 .................... #FUSES NOWDT //No Watch Dog Timer
25 .................... #FUSES INTRC //Internal RC Osc
26 .................... #FUSES NOPUT //No Power Up Timer
27 .................... #FUSES MCLR //Master Clear pin enabled
28 .................... #FUSES NOPROTECT //Code not protected from reading
29 .................... #FUSES NOCPD //No EE protection
30 .................... #FUSES NOBROWNOUT //No brownout reset
31 .................... #FUSES IESO //Internal External Switch Over mode enabled
32 .................... #FUSES FCMEN //Fail-safe clock monitor enabled
33 .................... #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
34 .................... #FUSES NODEBUG //No Debug mode for ICD
35 .................... #FUSES NOWRT //Program memory not write protected
36 .................... #FUSES BORV40 //Brownout reset at 4.0V
37 ....................
38 .................... #use delay(clock=8000000)
39 *
40 00D0: MOVLW 2C
41 00D1: MOVWF 04
42 00D2: BCF 03.7
43 00D3: MOVF 00,W
44 00D4: BTFSC 03.2
45 00D5: GOTO 0E3
46 00D6: MOVLW 02
47 00D7: MOVWF 78
48 00D8: CLRF 77
49 00D9: DECFSZ 77,F
50 00DA: GOTO 0D9
51 00DB: DECFSZ 78,F
52 00DC: GOTO 0D8
53 00DD: MOVLW 97
54 00DE: MOVWF 77
55 00DF: DECFSZ 77,F
56 00E0: GOTO 0DF
57 00E1: DECFSZ 00,F
58 00E2: GOTO 0D6
59 00E3: RETURN
60 ....................
61 ....................
62 ....................
63 ....................
64 ....................
65 .................... #define EEPROM_SDA PIN_C4
66 .................... #define EEPROM_SCL PIN_C3
67 .................... #use i2c(master, sda=EEPROM_SDA, scl=EEPROM_SCL)
68 *
69 0086: MOVLW 08
70 0087: MOVWF 78
71 0088: NOP
72 0089: BCF 07.3
73 008A: BCF 20.3
74 008B: MOVF 20,W
75 008C: BSF 03.5
76 008D: MOVWF 07
77 008E: NOP
78 008F: BCF 03.5
79 0090: RLF 2C,F
80 0091: BCF 07.4
81 0092: BTFSS 03.0
82 0093: GOTO 09A
83 0094: BSF 20.4
84 0095: MOVF 20,W
85 0096: BSF 03.5
86 0097: MOVWF 07
87 0098: GOTO 09E
88 0099: BCF 03.5
89 009A: BCF 20.4
90 009B: MOVF 20,W
91 009C: BSF 03.5
92 009D: MOVWF 07
93 009E: NOP
94 009F: BCF 03.5
95 00A0: BSF 20.3
96 00A1: MOVF 20,W
97 00A2: BSF 03.5
98 00A3: MOVWF 07
99 00A4: BCF 03.5
100 00A5: BTFSS 07.3
101 00A6: GOTO 0A5
102 00A7: DECFSZ 78,F
103 00A8: GOTO 088
104 00A9: NOP
105 00AA: BCF 07.3
106 00AB: BCF 20.3
107 00AC: MOVF 20,W
108 00AD: BSF 03.5
109 00AE: MOVWF 07
110 00AF: NOP
111 00B0: BCF 03.5
112 00B1: BSF 20.4
113 00B2: MOVF 20,W
114 00B3: BSF 03.5
115 00B4: MOVWF 07
116 00B5: NOP
117 00B6: NOP
118 00B7: BCF 03.5
119 00B8: BSF 20.3
120 00B9: MOVF 20,W
121 00BA: BSF 03.5
122 00BB: MOVWF 07
123 00BC: BCF 03.5
124 00BD: BTFSS 07.3
125 00BE: GOTO 0BD
126 00BF: CLRF 78
127 00C0: NOP
128 00C1: BTFSC 07.4
129 00C2: BSF 78.0
130 00C3: BCF 07.3
131 00C4: BCF 20.3
132 00C5: MOVF 20,W
133 00C6: BSF 03.5
134 00C7: MOVWF 07
135 00C8: BCF 03.5
136 00C9: BCF 07.4
137 00CA: BCF 20.4
138 00CB: MOVF 20,W
139 00CC: BSF 03.5
140 00CD: MOVWF 07
141 00CE: BCF 03.5
142 00CF: RETURN
143 *
144 00E4: MOVLW 08
145 00E5: MOVWF 2D
146 00E6: MOVF 77,W
147 00E7: MOVWF 2E
148 00E8: BSF 20.4
149 00E9: MOVF 20,W
150 00EA: BSF 03.5
151 00EB: MOVWF 07
152 00EC: NOP
153 00ED: BCF 03.5
154 00EE: BSF 20.3
155 00EF: MOVF 20,W
156 00F0: BSF 03.5
157 00F1: MOVWF 07
158 00F2: BCF 03.5
159 00F3: BTFSS 07.3
160 00F4: GOTO 0F3
161 00F5: BTFSC 07.4
162 00F6: BSF 03.0
163 00F7: BTFSS 07.4
164 00F8: BCF 03.0
165 00F9: RLF 78,F
166 00FA: NOP
167 00FB: BCF 20.3
168 00FC: MOVF 20,W
169 00FD: BSF 03.5
170 00FE: MOVWF 07
171 00FF: BCF 03.5
172 0100: BCF 07.3
173 0101: DECFSZ 2D,F
174 0102: GOTO 0E8
175 0103: BSF 20.4
176 0104: MOVF 20,W
177 0105: BSF 03.5
178 0106: MOVWF 07
179 0107: NOP
180 0108: BCF 03.5
181 0109: BCF 07.4
182 010A: MOVF 2E,W
183 010B: BTFSC 03.2
184 010C: GOTO 112
185 010D: BCF 20.4
186 010E: MOVF 20,W
187 010F: BSF 03.5
188 0110: MOVWF 07
189 0111: BCF 03.5
190 0112: NOP
191 0113: BSF 20.3
192 0114: MOVF 20,W
193 0115: BSF 03.5
194 0116: MOVWF 07
195 0117: BCF 03.5
196 0118: BTFSS 07.3
197 0119: GOTO 118
198 011A: NOP
199 011B: BCF 07.3
200 011C: BCF 20.3
201 011D: MOVF 20,W
202 011E: BSF 03.5
203 011F: MOVWF 07
204 0120: NOP
205 0121: BCF 03.5
206 0122: BCF 07.4
207 0123: BCF 20.4
208 0124: MOVF 20,W
209 0125: BSF 03.5
210 0126: MOVWF 07
211 0127: BCF 03.5
212 0128: RETURN
213 .................... #use rs232(baud=9600,parity=N,xmit=PIN_C7,rcv=PIN_C6,bits=8) //rcv TXD xmit RXD
214 *
215 001A: BCF 20.7
216 001B: MOVF 20,W
217 001C: BSF 03.5
218 001D: MOVWF 07
219 001E: BCF 03.5
220 001F: BCF 07.7
221 0020: MOVLW 08
222 0021: MOVWF 78
223 0022: GOTO 023
224 0023: NOP
225 0024: BSF 78.7
226 0025: GOTO 034
227 0026: BCF 78.7
228 0027: RRF 30,F
229 0028: BTFSC 03.0
230 0029: BSF 07.7
231 002A: BTFSS 03.0
232 002B: BCF 07.7
233 002C: BSF 78.6
234 002D: GOTO 034
235 002E: BCF 78.6
236 002F: DECFSZ 78,F
237 0030: GOTO 027
238 0031: GOTO 032
239 0032: NOP
240 0033: BSF 07.7
241 0034: MOVLW 3F
242 0035: MOVWF 04
243 0036: DECFSZ 04,F
244 0037: GOTO 036
245 0038: NOP
246 0039: BTFSC 78.7
247 003A: GOTO 026
248 003B: BTFSC 78.6
249 003C: GOTO 02E
250 003D: RETURN
251 ....................
252 ....................
253 .................... void main()
254 .................... {
255 *
256 019B: CLRF 04
257 019C: BCF 03.7
258 019D: MOVLW 1F
259 019E: ANDWF 03,F
260 019F: MOVLW 71
261 01A0: BSF 03.5
262 01A1: MOVWF 0F
263 01A2: MOVF 0F,W
264 01A3: BCF 03.5
265 01A4: BCF 20.7
266 01A5: MOVF 20,W
267 01A6: BSF 03.5
268 01A7: MOVWF 07
269 01A8: BCF 03.5
270 01A9: BSF 07.7
271 01AA: BSF 03.5
272 01AB: BSF 03.6
273 01AC: MOVF 09,W
274 01AD: ANDLW C0
275 01AE: MOVWF 09
276 01AF: BCF 03.6
277 01B0: BCF 1F.4
278 01B1: BCF 1F.5
279 01B2: MOVLW 00
280 01B3: BSF 03.6
281 01B4: MOVWF 08
282 01B5: BCF 03.5
283 01B6: CLRF 07
284 01B7: CLRF 08
285 01B8: CLRF 09
286 ....................
287 .................... setup_adc_ports(NO_ANALOGS|VSS_VDD);
288 *
289 01BC: BSF 03.5
290 01BD: BSF 03.6
291 01BE: MOVF 09,W
292 01BF: ANDLW C0
293 01C0: MOVWF 09
294 01C1: BCF 03.6
295 01C2: BCF 1F.4
296 01C3: BCF 1F.5
297 01C4: MOVLW 00
298 01C5: BSF 03.6
299 01C6: MOVWF 08
300 .................... setup_adc(ADC_CLOCK_DIV_2);
301 01C7: BCF 03.5
302 01C8: BCF 03.6
303 01C9: BCF 1F.6
304 01CA: BCF 1F.7
305 01CB: BSF 03.5
306 01CC: BCF 1F.7
307 01CD: BCF 03.5
308 01CE: BSF 1F.0
309 .................... setup_spi(SPI_SS_DISABLED);
310 01CF: BCF 14.5
311 01D0: BCF 20.5
312 01D1: MOVF 20,W
313 01D2: BSF 03.5
314 01D3: MOVWF 07
315 01D4: BCF 03.5
316 01D5: BSF 20.4
317 01D6: MOVF 20,W
318 01D7: BSF 03.5
319 01D8: MOVWF 07
320 01D9: BCF 03.5
321 01DA: BCF 20.3
322 01DB: MOVF 20,W
323 01DC: BSF 03.5
324 01DD: MOVWF 07
325 01DE: MOVLW 01
326 01DF: BCF 03.5
327 01E0: MOVWF 14
328 01E1: MOVLW 00
329 01E2: BSF 03.5
330 01E3: MOVWF 14
331 .................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
332 01E4: MOVF 01,W
333 01E5: ANDLW C7
334 01E6: IORLW 08
335 01E7: MOVWF 01
336 .................... setup_timer_1(T1_DISABLED);
337 01E8: BCF 03.5
338 01E9: CLRF 10
339 .................... setup_timer_2(T2_DISABLED,0,1);
340 01EA: MOVLW 00
341 01EB: MOVWF 78
342 01EC: MOVWF 12
343 01ED: MOVLW 00
344 01EE: BSF 03.5
345 01EF: MOVWF 12
346 .................... setup_ccp1(CCP_OFF);
347 01F0: BCF 03.5
348 01F1: BSF 20.2
349 01F2: MOVF 20,W
350 01F3: BSF 03.5
351 01F4: MOVWF 07
352 01F5: BCF 03.5
353 01F6: CLRF 17
354 01F7: BSF 03.5
355 01F8: CLRF 1B
356 01F9: CLRF 1C
357 01FA: MOVLW 01
358 01FB: MOVWF 1D
359 .................... setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard
360 01FC: BCF 03.5
361 01FD: BSF 03.6
362 01FE: CLRF 07
363 01FF: CLRF 08
364 0200: CLRF 09
365 ....................
366 .................... printf("Simple Thermomether \r\n",);
367 0201: MOVLW 04
368 0202: MOVWF 0D
369 0203: MOVLW 00
370 0204: MOVWF 0F
371 0205: BCF 03.6
372 0206: GOTO 03E
373 .................... unsigned int8 STAV1,STAV2;
374 ....................
375 .................... unsigned int16 SOUCET, SOUCET1;
376 .................... unsigned int8 LSB=0,ZK,k=0,VH,VL;
377 0207: CLRF 27
378 0208: CLRF 29
379 .................... //unsigned int8
380 ....................
381 .................... while(TRUE)
382 .................... {
383 ....................
384 ....................
385 ....................
386 ....................
387 .................... i2c_start(); //blockdatacontrol
388 0209: BSF 20.4
389 020A: MOVF 20,W
390 020B: BSF 03.5
391 020C: MOVWF 07
392 020D: NOP
393 020E: BCF 03.5
394 020F: BSF 20.3
395 0210: MOVF 20,W
396 0211: BSF 03.5
397 0212: MOVWF 07
398 0213: NOP
399 0214: BCF 03.5
400 0215: BCF 07.4
401 0216: BCF 20.4
402 0217: MOVF 20,W
403 0218: BSF 03.5
404 0219: MOVWF 07
405 021A: NOP
406 021B: BCF 03.5
407 021C: BCF 07.3
408 021D: BCF 20.3
409 021E: MOVF 20,W
410 021F: BSF 03.5
411 0220: MOVWF 07
412 .................... I2C_Write(0xAA);
413 0221: MOVLW AA
414 0222: BCF 03.5
415 0223: MOVWF 2C
416 0224: CALL 086
417 .................... I2C_write(0x61);
418 0225: MOVLW 61
419 0226: MOVWF 2C
420 0227: CALL 086
421 .................... i2c_start();
422 0228: BSF 20.4
423 0229: MOVF 20,W
424 022A: BSF 03.5
425 022B: MOVWF 07
426 022C: NOP
427 022D: BCF 03.5
428 022E: BSF 20.3
429 022F: MOVF 20,W
430 0230: BSF 03.5
431 0231: MOVWF 07
432 0232: NOP
433 0233: BCF 03.5
434 0234: BTFSS 07.3
435 0235: GOTO 234
436 0236: BCF 07.4
437 0237: BCF 20.4
438 0238: MOVF 20,W
439 0239: BSF 03.5
440 023A: MOVWF 07
441 023B: NOP
442 023C: BCF 03.5
443 023D: BCF 07.3
444 023E: BCF 20.3
445 023F: MOVF 20,W
446 0240: BSF 03.5
447 0241: MOVWF 07
448 .................... I2C_Write(0xAA);
449 0242: MOVLW AA
450 0243: BCF 03.5
451 0244: MOVWF 2C
452 0245: CALL 086
453 .................... i2c_write(0x00);
454 0246: CLRF 2C
455 0247: CALL 086
456 .................... i2c_stop();
457 0248: BCF 20.4
458 0249: MOVF 20,W
459 024A: BSF 03.5
460 024B: MOVWF 07
461 024C: NOP
462 024D: BCF 03.5
463 024E: BSF 20.3
464 024F: MOVF 20,W
465 0250: BSF 03.5
466 0251: MOVWF 07
467 0252: BCF 03.5
468 0253: BTFSS 07.3
469 0254: GOTO 253
470 0255: NOP
471 0256: GOTO 257
472 0257: NOP
473 0258: BSF 20.4
474 0259: MOVF 20,W
475 025A: BSF 03.5
476 025B: MOVWF 07
477 025C: NOP
478 .................... delay_ms (1);
479 025D: MOVLW 01
480 025E: BCF 03.5
481 025F: MOVWF 2C
482 0260: CALL 0D0
483 ....................
484 ....................
485 .................... i2c_start();//dataflashclass
486 0261: BSF 20.4
487 0262: MOVF 20,W
488 0263: BSF 03.5
489 0264: MOVWF 07
490 0265: NOP
491 0266: BCF 03.5
492 0267: BSF 20.3
493 0268: MOVF 20,W
494 0269: BSF 03.5
495 026A: MOVWF 07
496 026B: NOP
497 026C: BCF 03.5
498 026D: BCF 07.4
499 026E: BCF 20.4
500 026F: MOVF 20,W
501 0270: BSF 03.5
502 0271: MOVWF 07
503 0272: NOP
504 0273: BCF 03.5
505 0274: BCF 07.3
506 0275: BCF 20.3
507 0276: MOVF 20,W
508 0277: BSF 03.5
509 0278: MOVWF 07
510 .................... I2C_Write(0xAA);
511 0279: MOVLW AA
512 027A: BCF 03.5
513 027B: MOVWF 2C
514 027C: CALL 086
515 .................... I2C_write(0x3e);
516 027D: MOVLW 3E
517 027E: MOVWF 2C
518 027F: CALL 086
519 ....................
520 .................... i2c_start();
521 0280: BSF 20.4
522 0281: MOVF 20,W
523 0282: BSF 03.5
524 0283: MOVWF 07
525 0284: NOP
526 0285: BCF 03.5
527 0286: BSF 20.3
528 0287: MOVF 20,W
529 0288: BSF 03.5
530 0289: MOVWF 07
531 028A: NOP
532 028B: BCF 03.5
533 028C: BTFSS 07.3
534 028D: GOTO 28C
535 028E: BCF 07.4
536 028F: BCF 20.4
537 0290: MOVF 20,W
538 0291: BSF 03.5
539 0292: MOVWF 07
540 0293: NOP
541 0294: BCF 03.5
542 0295: BCF 07.3
543 0296: BCF 20.3
544 0297: MOVF 20,W
545 0298: BSF 03.5
546 0299: MOVWF 07
547 .................... I2C_Write(0xAA);
548 029A: MOVLW AA
549 029B: BCF 03.5
550 029C: MOVWF 2C
551 029D: CALL 086
552 .................... i2c_write(0x52);
553 029E: MOVLW 52
554 029F: MOVWF 2C
555 02A0: CALL 086
556 .................... i2c_stop();
557 02A1: BCF 20.4
558 02A2: MOVF 20,W
559 02A3: BSF 03.5
560 02A4: MOVWF 07
561 02A5: NOP
562 02A6: BCF 03.5
563 02A7: BSF 20.3
564 02A8: MOVF 20,W
565 02A9: BSF 03.5
566 02AA: MOVWF 07
567 02AB: BCF 03.5
568 02AC: BTFSS 07.3
569 02AD: GOTO 2AC
570 02AE: NOP
571 02AF: GOTO 2B0
572 02B0: NOP
573 02B1: BSF 20.4
574 02B2: MOVF 20,W
575 02B3: BSF 03.5
576 02B4: MOVWF 07
577 02B5: NOP
578 .................... delay_ms (1);
579 02B6: MOVLW 01
580 02B7: BCF 03.5
581 02B8: MOVWF 2C
582 02B9: CALL 0D0
583 ....................
584 ....................
585 .................... i2c_start();//dataflashblock
586 02BA: BSF 20.4
587 02BB: MOVF 20,W
588 02BC: BSF 03.5
589 02BD: MOVWF 07
590 02BE: NOP
591 02BF: BCF 03.5
592 02C0: BSF 20.3
593 02C1: MOVF 20,W
594 02C2: BSF 03.5
595 02C3: MOVWF 07
596 02C4: NOP
597 02C5: BCF 03.5
598 02C6: BCF 07.4
599 02C7: BCF 20.4
600 02C8: MOVF 20,W
601 02C9: BSF 03.5
602 02CA: MOVWF 07
603 02CB: NOP
604 02CC: BCF 03.5
605 02CD: BCF 07.3
606 02CE: BCF 20.3
607 02CF: MOVF 20,W
608 02D0: BSF 03.5
609 02D1: MOVWF 07
610 .................... I2C_Write(0xAA);
611 02D2: MOVLW AA
612 02D3: BCF 03.5
613 02D4: MOVWF 2C
614 02D5: CALL 086
615 .................... I2C_write(0x3f);
616 02D6: MOVLW 3F
617 02D7: MOVWF 2C
618 02D8: CALL 086
619 ....................
620 .................... i2c_start();
621 02D9: BSF 20.4
622 02DA: MOVF 20,W
623 02DB: BSF 03.5
624 02DC: MOVWF 07
625 02DD: NOP
626 02DE: BCF 03.5
627 02DF: BSF 20.3
628 02E0: MOVF 20,W
629 02E1: BSF 03.5
630 02E2: MOVWF 07
631 02E3: NOP
632 02E4: BCF 03.5
633 02E5: BTFSS 07.3
634 02E6: GOTO 2E5
635 02E7: BCF 07.4
636 02E8: BCF 20.4
637 02E9: MOVF 20,W
638 02EA: BSF 03.5
639 02EB: MOVWF 07
640 02EC: NOP
641 02ED: BCF 03.5
642 02EE: BCF 07.3
643 02EF: BCF 20.3
644 02F0: MOVF 20,W
645 02F1: BSF 03.5
646 02F2: MOVWF 07
647 .................... I2C_Write(0xAA);
648 02F3: MOVLW AA
649 02F4: BCF 03.5
650 02F5: MOVWF 2C
651 02F6: CALL 086
652 .................... I2C_write(0x00);
653 02F7: CLRF 2C
654 02F8: CALL 086
655 .................... i2c_stop();
656 02F9: BCF 20.4
657 02FA: MOVF 20,W
658 02FB: BSF 03.5
659 02FC: MOVWF 07
660 02FD: NOP
661 02FE: BCF 03.5
662 02FF: BSF 20.3
663 0300: MOVF 20,W
664 0301: BSF 03.5
665 0302: MOVWF 07
666 0303: BCF 03.5
667 0304: BTFSS 07.3
668 0305: GOTO 304
669 0306: NOP
670 0307: GOTO 308
671 0308: NOP
672 0309: BSF 20.4
673 030A: MOVF 20,W
674 030B: BSF 03.5
675 030C: MOVWF 07
676 030D: NOP
677 ....................
678 .................... delay_ms (1);
679 030E: MOVLW 01
680 030F: BCF 03.5
681 0310: MOVWF 2C
682 0311: CALL 0D0
683 ....................
684 ....................
685 ....................
686 ....................
687 .................... i2c_start();//blockdata
688 0312: BSF 20.4
689 0313: MOVF 20,W
690 0314: BSF 03.5
691 0315: MOVWF 07
692 0316: NOP
693 0317: BCF 03.5
694 0318: BSF 20.3
695 0319: MOVF 20,W
696 031A: BSF 03.5
697 031B: MOVWF 07
698 031C: NOP
699 031D: BCF 03.5
700 031E: BCF 07.4
701 031F: BCF 20.4
702 0320: MOVF 20,W
703 0321: BSF 03.5
704 0322: MOVWF 07
705 0323: NOP
706 0324: BCF 03.5
707 0325: BCF 07.3
708 0326: BCF 20.3
709 0327: MOVF 20,W
710 0328: BSF 03.5
711 0329: MOVWF 07
712 .................... I2C_Write(0xAA);
713 032A: MOVLW AA
714 032B: BCF 03.5
715 032C: MOVWF 2C
716 032D: CALL 086
717 .................... I2C_write(0x40);
718 032E: MOVLW 40
719 032F: MOVWF 2C
720 0330: CALL 086
721 ....................
722 .................... i2c_start();
723 0331: BSF 20.4
724 0332: MOVF 20,W
725 0333: BSF 03.5
726 0334: MOVWF 07
727 0335: NOP
728 0336: BCF 03.5
729 0337: BSF 20.3
730 0338: MOVF 20,W
731 0339: BSF 03.5
732 033A: MOVWF 07
733 033B: NOP
734 033C: BCF 03.5
735 033D: BTFSS 07.3
736 033E: GOTO 33D
737 033F: BCF 07.4
738 0340: BCF 20.4
739 0341: MOVF 20,W
740 0342: BSF 03.5
741 0343: MOVWF 07
742 0344: NOP
743 0345: BCF 03.5
744 0346: BCF 07.3
745 0347: BCF 20.3
746 0348: MOVF 20,W
747 0349: BSF 03.5
748 034A: MOVWF 07
749 .................... I2C_Write(0xAB);
750 034B: MOVLW AB
751 034C: BCF 03.5
752 034D: MOVWF 2C
753 034E: CALL 086
754 .................... VH=I2C_read(0);
755 034F: CLRF 77
756 0350: CALL 0E4
757 0351: MOVF 78,W
758 0352: MOVWF 2A
759 ....................
760 .................... i2c_stop();
761 0353: BCF 20.4
762 0354: MOVF 20,W
763 0355: BSF 03.5
764 0356: MOVWF 07
765 0357: NOP
766 0358: BCF 03.5
767 0359: BSF 20.3
768 035A: MOVF 20,W
769 035B: BSF 03.5
770 035C: MOVWF 07
771 035D: BCF 03.5
772 035E: BTFSS 07.3
773 035F: GOTO 35E
774 0360: NOP
775 0361: GOTO 362
776 0362: NOP
777 0363: BSF 20.4
778 0364: MOVF 20,W
779 0365: BSF 03.5
780 0366: MOVWF 07
781 0367: NOP
782 ....................
783 .................... i2c_start();//blockdata
784 0368: BCF 03.5
785 0369: BSF 20.4
786 036A: MOVF 20,W
787 036B: BSF 03.5
788 036C: MOVWF 07
789 036D: NOP
790 036E: BCF 03.5
791 036F: BSF 20.3
792 0370: MOVF 20,W
793 0371: BSF 03.5
794 0372: MOVWF 07
795 0373: NOP
796 0374: BCF 03.5
797 0375: BCF 07.4
798 0376: BCF 20.4
799 0377: MOVF 20,W
800 0378: BSF 03.5
801 0379: MOVWF 07
802 037A: NOP
803 037B: BCF 03.5
804 037C: BCF 07.3
805 037D: BCF 20.3
806 037E: MOVF 20,W
807 037F: BSF 03.5
808 0380: MOVWF 07
809 .................... I2C_Write(0xAA);
810 0381: MOVLW AA
811 0382: BCF 03.5
812 0383: MOVWF 2C
813 0384: CALL 086
814 .................... I2C_write(0x41);
815 0385: MOVLW 41
816 0386: MOVWF 2C
817 0387: CALL 086
818 ....................
819 .................... i2c_start();
820 0388: BSF 20.4
821 0389: MOVF 20,W
822 038A: BSF 03.5
823 038B: MOVWF 07
824 038C: NOP
825 038D: BCF 03.5
826 038E: BSF 20.3
827 038F: MOVF 20,W
828 0390: BSF 03.5
829 0391: MOVWF 07
830 0392: NOP
831 0393: BCF 03.5
832 0394: BTFSS 07.3
833 0395: GOTO 394
834 0396: BCF 07.4
835 0397: BCF 20.4
836 0398: MOVF 20,W
837 0399: BSF 03.5
838 039A: MOVWF 07
839 039B: NOP
840 039C: BCF 03.5
841 039D: BCF 07.3
842 039E: BCF 20.3
843 039F: MOVF 20,W
844 03A0: BSF 03.5
845 03A1: MOVWF 07
846 .................... I2C_Write(0xAB);
847 03A2: MOVLW AB
848 03A3: BCF 03.5
849 03A4: MOVWF 2C
850 03A5: CALL 086
851 ....................
852 .................... VL=I2C_read(0);
853 03A6: CLRF 77
854 03A7: CALL 0E4
855 03A8: MOVF 78,W
856 03A9: MOVWF 2B
857 .................... i2c_stop();
858 03AA: BCF 20.4
859 03AB: MOVF 20,W
860 03AC: BSF 03.5
861 03AD: MOVWF 07
862 03AE: NOP
863 03AF: BCF 03.5
864 03B0: BSF 20.3
865 03B1: MOVF 20,W
866 03B2: BSF 03.5
867 03B3: MOVWF 07
868 03B4: BCF 03.5
869 03B5: BTFSS 07.3
870 03B6: GOTO 3B5
871 03B7: NOP
872 03B8: GOTO 3B9
873 03B9: NOP
874 03BA: BSF 20.4
875 03BB: MOVF 20,W
876 03BC: BSF 03.5
877 03BD: MOVWF 07
878 03BE: NOP
879 ....................
880 ....................
881 .................... delay_ms (10);
882 03BF: MOVLW 0A
883 03C0: BCF 03.5
884 03C1: MOVWF 2C
885 03C2: CALL 0D0
886 ....................
887 .................... printf("VL %lX \r\n", VL);
888 03C3: MOVLW 56
889 03C4: MOVWF 30
890 03C5: CALL 01A
891 03C6: MOVLW 4C
892 03C7: MOVWF 30
893 03C8: CALL 01A
894 03C9: MOVLW 20
895 03CA: MOVWF 30
896 03CB: CALL 01A
897 03CC: MOVF 2B,W
898 03CD: MOVWF 2C
899 03CE: MOVLW 37
900 03CF: MOVWF 2D
901 03D0: CALL 129
902 03D1: MOVLW 20
903 03D2: MOVWF 30
904 03D3: CALL 01A
905 03D4: MOVLW 0D
906 03D5: MOVWF 30
907 03D6: CALL 01A
908 03D7: MOVLW 0A
909 03D8: MOVWF 30
910 03D9: CALL 01A
911 .................... printf("LH %lX \r\n", VH);
912 03DA: MOVLW 4C
913 03DB: MOVWF 30
914 03DC: CALL 01A
915 03DD: MOVLW 48
916 03DE: MOVWF 30
917 03DF: CALL 01A
918 03E0: MOVLW 20
919 03E1: MOVWF 30
920 03E2: CALL 01A
921 03E3: MOVF 2A,W
922 03E4: MOVWF 2C
923 03E5: MOVLW 37
924 03E6: MOVWF 2D
925 03E7: CALL 129
926 03E8: MOVLW 20
927 03E9: MOVWF 30
928 03EA: CALL 01A
929 03EB: MOVLW 0D
930 03EC: MOVWF 30
931 03ED: CALL 01A
932 03EE: MOVLW 0A
933 03EF: MOVWF 30
934 03F0: CALL 01A
935 ....................
936 .................... if(VL==0x48)
937 03F1: MOVF 2B,W
938 03F2: SUBLW 48
939 03F3: BTFSS 03.2
940 03F4: GOTO 411
941 .................... {
942 .................... LSB=LSB-1;
943 03F5: MOVLW 01
944 03F6: SUBWF 27,F
945 .................... printf("Vysledne LSB %lX \r\n", LSB);
946 03F7: MOVLW 10
947 03F8: BSF 03.6
948 03F9: MOVWF 0D
949 03FA: MOVLW 00
950 03FB: MOVWF 0F
951 03FC: BCF 03.0
952 03FD: MOVLW 0D
953 03FE: BCF 03.6
954 03FF: MOVWF 2C
955 0400: GOTO 14A
956 0401: MOVF 27,W
957 0402: MOVWF 2C
958 0403: MOVLW 37
959 0404: MOVWF 2D
960 0405: CALL 129
961 0406: MOVLW 20
962 0407: MOVWF 30
963 0408: CALL 01A
964 0409: MOVLW 0D
965 040A: MOVWF 30
966 040B: CALL 01A
967 040C: MOVLW 0A
968 040D: MOVWF 30
969 040E: CALL 01A
970 .................... while(TRUE)
971 .................... {
972 .................... }
973 040F: GOTO 40F
974 .................... }
975 ....................
976 .................... else
977 0410: GOTO 4BD
978 .................... {
979 .................... i2c_start();//blockdata
980 0411: BSF 20.4
981 0412: MOVF 20,W
982 0413: BSF 03.5
983 0414: MOVWF 07
984 0415: NOP
985 0416: BCF 03.5
986 0417: BSF 20.3
987 0418: MOVF 20,W
988 0419: BSF 03.5
989 041A: MOVWF 07
990 041B: NOP
991 041C: BCF 03.5
992 041D: BCF 07.4
993 041E: BCF 20.4
994 041F: MOVF 20,W
995 0420: BSF 03.5
996 0421: MOVWF 07
997 0422: NOP
998 0423: BCF 03.5
999 0424: BCF 07.3
1000 0425: BCF 20.3
1001 0426: MOVF 20,W
1002 0427: BSF 03.5
1003 0428: MOVWF 07
1004 .................... I2C_Write(0xAA);
1005 0429: MOVLW AA
1006 042A: BCF 03.5
1007 042B: MOVWF 2C
1008 042C: CALL 086
1009 .................... I2C_write(0x40);
1010 042D: MOVLW 40
1011 042E: MOVWF 2C
1012 042F: CALL 086
1013 ....................
1014 .................... i2c_start();
1015 0430: BSF 20.4
1016 0431: MOVF 20,W
1017 0432: BSF 03.5
1018 0433: MOVWF 07
1019 0434: NOP
1020 0435: BCF 03.5
1021 0436: BSF 20.3
1022 0437: MOVF 20,W
1023 0438: BSF 03.5
1024 0439: MOVWF 07
1025 043A: NOP
1026 043B: BCF 03.5
1027 043C: BTFSS 07.3
1028 043D: GOTO 43C
1029 043E: BCF 07.4
1030 043F: BCF 20.4
1031 0440: MOVF 20,W
1032 0441: BSF 03.5
1033 0442: MOVWF 07
1034 0443: NOP
1035 0444: BCF 03.5
1036 0445: BCF 07.3
1037 0446: BCF 20.3
1038 0447: MOVF 20,W
1039 0448: BSF 03.5
1040 0449: MOVWF 07
1041 .................... I2C_Write(0xAA);
1042 044A: MOVLW AA
1043 044B: BCF 03.5
1044 044C: MOVWF 2C
1045 044D: CALL 086
1046 .................... I2C_write(0x0D);
1047 044E: MOVLW 0D
1048 044F: MOVWF 2C
1049 0450: CALL 086
1050 .................... i2c_stop();
1051 0451: BCF 20.4
1052 0452: MOVF 20,W
1053 0453: BSF 03.5
1054 0454: MOVWF 07
1055 0455: NOP
1056 0456: BCF 03.5
1057 0457: BSF 20.3
1058 0458: MOVF 20,W
1059 0459: BSF 03.5
1060 045A: MOVWF 07
1061 045B: BCF 03.5
1062 045C: BTFSS 07.3
1063 045D: GOTO 45C
1064 045E: NOP
1065 045F: GOTO 460
1066 0460: NOP
1067 0461: BSF 20.4
1068 0462: MOVF 20,W
1069 0463: BSF 03.5
1070 0464: MOVWF 07
1071 0465: NOP
1072 ....................
1073 .................... i2c_start();//blockdata
1074 0466: BCF 03.5
1075 0467: BSF 20.4
1076 0468: MOVF 20,W
1077 0469: BSF 03.5
1078 046A: MOVWF 07
1079 046B: NOP
1080 046C: BCF 03.5
1081 046D: BSF 20.3
1082 046E: MOVF 20,W
1083 046F: BSF 03.5
1084 0470: MOVWF 07
1085 0471: NOP
1086 0472: BCF 03.5
1087 0473: BCF 07.4
1088 0474: BCF 20.4
1089 0475: MOVF 20,W
1090 0476: BSF 03.5
1091 0477: MOVWF 07
1092 0478: NOP
1093 0479: BCF 03.5
1094 047A: BCF 07.3
1095 047B: BCF 20.3
1096 047C: MOVF 20,W
1097 047D: BSF 03.5
1098 047E: MOVWF 07
1099 .................... I2C_Write(0xAA);
1100 047F: MOVLW AA
1101 0480: BCF 03.5
1102 0481: MOVWF 2C
1103 0482: CALL 086
1104 .................... I2C_write(0x41);
1105 0483: MOVLW 41
1106 0484: MOVWF 2C
1107 0485: CALL 086
1108 ....................
1109 .................... i2c_start();
1110 0486: BSF 20.4
1111 0487: MOVF 20,W
1112 0488: BSF 03.5
1113 0489: MOVWF 07
1114 048A: NOP
1115 048B: BCF 03.5
1116 048C: BSF 20.3
1117 048D: MOVF 20,W
1118 048E: BSF 03.5
1119 048F: MOVWF 07
1120 0490: NOP
1121 0491: BCF 03.5
1122 0492: BTFSS 07.3
1123 0493: GOTO 492
1124 0494: BCF 07.4
1125 0495: BCF 20.4
1126 0496: MOVF 20,W
1127 0497: BSF 03.5
1128 0498: MOVWF 07
1129 0499: NOP
1130 049A: BCF 03.5
1131 049B: BCF 07.3
1132 049C: BCF 20.3
1133 049D: MOVF 20,W
1134 049E: BSF 03.5
1135 049F: MOVWF 07
1136 .................... I2C_Write(0xAA);
1137 04A0: MOVLW AA
1138 04A1: BCF 03.5
1139 04A2: MOVWF 2C
1140 04A3: CALL 086
1141 .................... I2C_write(0x48);
1142 04A4: MOVLW 48
1143 04A5: MOVWF 2C
1144 04A6: CALL 086
1145 .................... i2c_stop();
1146 04A7: BCF 20.4
1147 04A8: MOVF 20,W
1148 04A9: BSF 03.5
1149 04AA: MOVWF 07
1150 04AB: NOP
1151 04AC: BCF 03.5
1152 04AD: BSF 20.3
1153 04AE: MOVF 20,W
1154 04AF: BSF 03.5
1155 04B0: MOVWF 07
1156 04B1: BCF 03.5
1157 04B2: BTFSS 07.3
1158 04B3: GOTO 4B2
1159 04B4: NOP
1160 04B5: GOTO 4B6
1161 04B6: NOP
1162 04B7: BSF 20.4
1163 04B8: MOVF 20,W
1164 04B9: BSF 03.5
1165 04BA: MOVWF 07
1166 04BB: NOP
1167 04BC: BCF 03.5
1168 ....................
1169 ....................
1170 ....................
1171 ....................
1172 ....................
1173 ....................
1174 .................... }
1175 ....................
1176 .................... i2c_start();//blockdata
1177 04BD: BSF 20.4
1178 04BE: MOVF 20,W
1179 04BF: BSF 03.5
1180 04C0: MOVWF 07
1181 04C1: NOP
1182 04C2: BCF 03.5
1183 04C3: BSF 20.3
1184 04C4: MOVF 20,W
1185 04C5: BSF 03.5
1186 04C6: MOVWF 07
1187 04C7: NOP
1188 04C8: BCF 03.5
1189 04C9: BCF 07.4
1190 04CA: BCF 20.4
1191 04CB: MOVF 20,W
1192 04CC: BSF 03.5
1193 04CD: MOVWF 07
1194 04CE: NOP
1195 04CF: BCF 03.5
1196 04D0: BCF 07.3
1197 04D1: BCF 20.3
1198 04D2: MOVF 20,W
1199 04D3: BSF 03.5
1200 04D4: MOVWF 07
1201 .................... I2C_Write(0xAA);
1202 04D5: MOVLW AA
1203 04D6: BCF 03.5
1204 04D7: MOVWF 2C
1205 04D8: CALL 086
1206 .................... I2C_write(0x60);
1207 04D9: MOVLW 60
1208 04DA: MOVWF 2C
1209 04DB: CALL 086
1210 ....................
1211 .................... i2c_start();
1212 04DC: BSF 20.4
1213 04DD: MOVF 20,W
1214 04DE: BSF 03.5
1215 04DF: MOVWF 07
1216 04E0: NOP
1217 04E1: BCF 03.5
1218 04E2: BSF 20.3
1219 04E3: MOVF 20,W
1220 04E4: BSF 03.5
1221 04E5: MOVWF 07
1222 04E6: NOP
1223 04E7: BCF 03.5
1224 04E8: BTFSS 07.3
1225 04E9: GOTO 4E8
1226 04EA: BCF 07.4
1227 04EB: BCF 20.4
1228 04EC: MOVF 20,W
1229 04ED: BSF 03.5
1230 04EE: MOVWF 07
1231 04EF: NOP
1232 04F0: BCF 03.5
1233 04F1: BCF 07.3
1234 04F2: BCF 20.3
1235 04F3: MOVF 20,W
1236 04F4: BSF 03.5
1237 04F5: MOVWF 07
1238 .................... I2C_Write(0xAA);
1239 04F6: MOVLW AA
1240 04F7: BCF 03.5
1241 04F8: MOVWF 2C
1242 04F9: CALL 086
1243 .................... I2C_write(LSB);
1244 04FA: MOVF 27,W
1245 04FB: MOVWF 2C
1246 04FC: CALL 086
1247 .................... i2c_stop();
1248 04FD: BCF 20.4
1249 04FE: MOVF 20,W
1250 04FF: BSF 03.5
1251 0500: MOVWF 07
1252 0501: NOP
1253 0502: BCF 03.5
1254 0503: BSF 20.3
1255 0504: MOVF 20,W
1256 0505: BSF 03.5
1257 0506: MOVWF 07
1258 0507: BCF 03.5
1259 0508: BTFSS 07.3
1260 0509: GOTO 508
1261 050A: NOP
1262 050B: GOTO 50C
1263 050C: NOP
1264 050D: BSF 20.4
1265 050E: MOVF 20,W
1266 050F: BSF 03.5
1267 0510: MOVWF 07
1268 0511: NOP
1269 ....................
1270 .................... LSB=LSB+1;
1271 0512: MOVLW 01
1272 0513: BCF 03.5
1273 0514: ADDWF 27,F
1274 ....................
1275 .................... delay_ms (100);
1276 0515: MOVLW 64
1277 0516: MOVWF 2C
1278 0517: CALL 0D0
1279 ....................
1280 ....................
1281 ....................
1282 ....................
1283 ....................
1284 ....................
1285 ....................
1286 ....................
1287 .................... }
1288 0518: GOTO 209
1289 ....................
1290 .................... }
1291 ....................
1292 0519: SLEEP
1293  
1294 Configuration Fuses:
1295 Word 1: 2CF5 INTRC NOWDT NOPUT MCLR NOPROTECT NOCPD NOBROWNOUT IESO FCMEN NOLVP NODEBUG
1296 Word 2: 3FFF NOWRT BORV40