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