1045 |
jacho |
1 |
CCS PCM C Compiler, Version 4.106, 47914 08-5-13 01:42 |
|
|
2 |
|
|
|
3 |
Filename: c:\users\honza\documents\pic\mereni_energie\main.lst |
|
|
4 |
|
|
|
5 |
ROM used: 3155 words (39%) |
|
|
6 |
Largest free fragment is 2048 |
|
|
7 |
RAM used: 78 (21%) at main() level |
|
|
8 |
100 (27%) worst case |
|
|
9 |
Stack: 4 locations |
|
|
10 |
|
|
|
11 |
* |
|
|
12 |
0000: MOVLW 09 |
|
|
13 |
0001: MOVWF 0A |
|
|
14 |
0002: GOTO 15B |
|
|
15 |
0003: NOP |
|
|
16 |
.................... //Mereni energie |
|
|
17 |
.................... //(c) Jan Chroust 2013 |
|
|
18 |
.................... |
|
|
19 |
.................... |
|
|
20 |
.................... #include "C:main.h" |
|
|
21 |
.................... #include <16F887.h> |
|
|
22 |
.................... //////// Standard Header file for the PIC16F887 device //////////////// |
|
|
23 |
.................... #device PIC16F887 |
|
|
24 |
.................... #list |
|
|
25 |
.................... |
|
|
26 |
.................... #device adc=8 |
|
|
27 |
.................... |
|
|
28 |
.................... #FUSES NOWDT //No Watch Dog Timer |
|
|
29 |
.................... #FUSES INTRC //Internal RC Osc |
|
|
30 |
.................... #FUSES NOPUT //No Power Up Timer |
|
|
31 |
.................... #FUSES MCLR //Master Clear pin enabled |
|
|
32 |
.................... #FUSES NOPROTECT //Code not protected from reading |
|
|
33 |
.................... #FUSES NOCPD //No EE protection |
|
|
34 |
.................... #FUSES NOBROWNOUT //No brownout reset |
|
|
35 |
.................... #FUSES IESO //Internal External Switch Over mode enabled |
|
|
36 |
.................... #FUSES FCMEN //Fail-safe clock monitor enabled |
|
|
37 |
.................... #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O |
|
|
38 |
.................... #FUSES NODEBUG //No Debug mode for ICD |
|
|
39 |
.................... #FUSES NOWRT //Program memory not write protected |
|
|
40 |
.................... #FUSES BORV40 //Brownout reset at 4.0V |
|
|
41 |
.................... |
|
|
42 |
.................... #use delay(clock=8000000) |
|
|
43 |
* |
|
|
44 |
000A: MOVLW 6A |
|
|
45 |
000B: MOVWF 04 |
|
|
46 |
000C: BCF 03.7 |
|
|
47 |
000D: MOVF 00,W |
|
|
48 |
000E: BTFSC 03.2 |
|
|
49 |
000F: GOTO 01D |
|
|
50 |
0010: MOVLW 02 |
|
|
51 |
0011: MOVWF 78 |
|
|
52 |
0012: CLRF 77 |
|
|
53 |
0013: DECFSZ 77,F |
|
|
54 |
0014: GOTO 013 |
|
|
55 |
0015: DECFSZ 78,F |
|
|
56 |
0016: GOTO 012 |
|
|
57 |
0017: MOVLW 97 |
|
|
58 |
0018: MOVWF 77 |
|
|
59 |
0019: DECFSZ 77,F |
|
|
60 |
001A: GOTO 019 |
|
|
61 |
001B: DECFSZ 00,F |
|
|
62 |
001C: GOTO 010 |
|
|
63 |
001D: RETURN |
|
|
64 |
.................... |
|
|
65 |
.................... |
|
|
66 |
.................... |
|
|
67 |
.................... #define EEPROM_SDA PIN_C4 |
|
|
68 |
.................... #define EEPROM_SCL PIN_C3 |
|
|
69 |
.................... //rele v blok sch. REL1 a REL2 |
|
|
70 |
.................... #define REL1_IN1 PIN_D6 |
|
|
71 |
.................... #define REL1_IN2 PIN_D7 |
|
|
72 |
.................... //rele v blok sch. REL5 |
|
|
73 |
.................... #define REL2_IN1 PIN_B2 |
|
|
74 |
.................... #define REL2_IN2 PIN_B3 |
|
|
75 |
.................... //rele v blok sch.REL3 |
|
|
76 |
.................... #define REL3_IN1 PIN_A0 |
|
|
77 |
.................... #define REL3_IN2 PIN_A1 |
|
|
78 |
.................... //rele v blok sch.REL3 |
|
|
79 |
.................... #define REL4_IN1 PIN_A2 |
|
|
80 |
.................... #define REL4_IN2 PIN_A3 |
|
|
81 |
.................... |
|
|
82 |
.................... #define NOC PIN_B1 //pro povoleni moznosti nabijet |
|
|
83 |
.................... |
|
|
84 |
.................... |
|
|
85 |
.................... #use i2c(master, sda=EEPROM_SDA, scl=EEPROM_SCL) |
|
|
86 |
* |
|
|
87 |
018C: MOVLW 08 |
|
|
88 |
018D: MOVWF 78 |
|
|
89 |
018E: NOP |
|
|
90 |
018F: BCF 07.3 |
|
|
91 |
0190: BCF 20.3 |
|
|
92 |
0191: MOVF 20,W |
|
|
93 |
0192: BSF 03.5 |
|
|
94 |
0193: MOVWF 07 |
|
|
95 |
0194: NOP |
|
|
96 |
0195: RLF 71,F |
|
|
97 |
0196: BCF 03.5 |
|
|
98 |
0197: BCF 07.4 |
|
|
99 |
0198: BTFSS 03.0 |
|
|
100 |
0199: GOTO 1A0 |
|
|
101 |
019A: BSF 20.4 |
|
|
102 |
019B: MOVF 20,W |
|
|
103 |
019C: BSF 03.5 |
|
|
104 |
019D: MOVWF 07 |
|
|
105 |
019E: GOTO 1A4 |
|
|
106 |
019F: BCF 03.5 |
|
|
107 |
01A0: BCF 20.4 |
|
|
108 |
01A1: MOVF 20,W |
|
|
109 |
01A2: BSF 03.5 |
|
|
110 |
01A3: MOVWF 07 |
|
|
111 |
01A4: NOP |
|
|
112 |
01A5: BCF 03.5 |
|
|
113 |
01A6: BSF 20.3 |
|
|
114 |
01A7: MOVF 20,W |
|
|
115 |
01A8: BSF 03.5 |
|
|
116 |
01A9: MOVWF 07 |
|
|
117 |
01AA: BCF 03.5 |
|
|
118 |
01AB: BTFSS 07.3 |
|
|
119 |
01AC: GOTO 1AB |
|
|
120 |
01AD: DECFSZ 78,F |
|
|
121 |
01AE: GOTO 18E |
|
|
122 |
01AF: NOP |
|
|
123 |
01B0: BCF 07.3 |
|
|
124 |
01B1: BCF 20.3 |
|
|
125 |
01B2: MOVF 20,W |
|
|
126 |
01B3: BSF 03.5 |
|
|
127 |
01B4: MOVWF 07 |
|
|
128 |
01B5: NOP |
|
|
129 |
01B6: BCF 03.5 |
|
|
130 |
01B7: BSF 20.4 |
|
|
131 |
01B8: MOVF 20,W |
|
|
132 |
01B9: BSF 03.5 |
|
|
133 |
01BA: MOVWF 07 |
|
|
134 |
01BB: NOP |
|
|
135 |
01BC: NOP |
|
|
136 |
01BD: BCF 03.5 |
|
|
137 |
01BE: BSF 20.3 |
|
|
138 |
01BF: MOVF 20,W |
|
|
139 |
01C0: BSF 03.5 |
|
|
140 |
01C1: MOVWF 07 |
|
|
141 |
01C2: BCF 03.5 |
|
|
142 |
01C3: BTFSS 07.3 |
|
|
143 |
01C4: GOTO 1C3 |
|
|
144 |
01C5: CLRF 78 |
|
|
145 |
01C6: NOP |
|
|
146 |
01C7: BTFSC 07.4 |
|
|
147 |
01C8: BSF 78.0 |
|
|
148 |
01C9: BCF 07.3 |
|
|
149 |
01CA: BCF 20.3 |
|
|
150 |
01CB: MOVF 20,W |
|
|
151 |
01CC: BSF 03.5 |
|
|
152 |
01CD: MOVWF 07 |
|
|
153 |
01CE: BCF 03.5 |
|
|
154 |
01CF: BCF 07.4 |
|
|
155 |
01D0: BCF 20.4 |
|
|
156 |
01D1: MOVF 20,W |
|
|
157 |
01D2: BSF 03.5 |
|
|
158 |
01D3: MOVWF 07 |
|
|
159 |
01D4: BCF 03.5 |
|
|
160 |
01D5: RETURN |
|
|
161 |
* |
|
|
162 |
0246: MOVLW 08 |
|
|
163 |
0247: MOVWF 72 |
|
|
164 |
0248: MOVF 77,W |
|
|
165 |
0249: MOVWF 73 |
|
|
166 |
024A: BSF 20.4 |
|
|
167 |
024B: MOVF 20,W |
|
|
168 |
024C: BSF 03.5 |
|
|
169 |
024D: MOVWF 07 |
|
|
170 |
024E: NOP |
|
|
171 |
024F: BCF 03.5 |
|
|
172 |
0250: BSF 20.3 |
|
|
173 |
0251: MOVF 20,W |
|
|
174 |
0252: BSF 03.5 |
|
|
175 |
0253: MOVWF 07 |
|
|
176 |
0254: BCF 03.5 |
|
|
177 |
0255: BTFSS 07.3 |
|
|
178 |
0256: GOTO 255 |
|
|
179 |
0257: BTFSC 07.4 |
|
|
180 |
0258: BSF 03.0 |
|
|
181 |
0259: BTFSS 07.4 |
|
|
182 |
025A: BCF 03.0 |
|
|
183 |
025B: RLF 78,F |
|
|
184 |
025C: NOP |
|
|
185 |
025D: BCF 20.3 |
|
|
186 |
025E: MOVF 20,W |
|
|
187 |
025F: BSF 03.5 |
|
|
188 |
0260: MOVWF 07 |
|
|
189 |
0261: BCF 03.5 |
|
|
190 |
0262: BCF 07.3 |
|
|
191 |
0263: DECFSZ 72,F |
|
|
192 |
0264: GOTO 24A |
|
|
193 |
0265: BSF 20.4 |
|
|
194 |
0266: MOVF 20,W |
|
|
195 |
0267: BSF 03.5 |
|
|
196 |
0268: MOVWF 07 |
|
|
197 |
0269: NOP |
|
|
198 |
026A: BCF 03.5 |
|
|
199 |
026B: BCF 07.4 |
|
|
200 |
026C: MOVF 73,W |
|
|
201 |
026D: BTFSC 03.2 |
|
|
202 |
026E: GOTO 274 |
|
|
203 |
026F: BCF 20.4 |
|
|
204 |
0270: MOVF 20,W |
|
|
205 |
0271: BSF 03.5 |
|
|
206 |
0272: MOVWF 07 |
|
|
207 |
0273: BCF 03.5 |
|
|
208 |
0274: NOP |
|
|
209 |
0275: BSF 20.3 |
|
|
210 |
0276: MOVF 20,W |
|
|
211 |
0277: BSF 03.5 |
|
|
212 |
0278: MOVWF 07 |
|
|
213 |
0279: BCF 03.5 |
|
|
214 |
027A: BTFSS 07.3 |
|
|
215 |
027B: GOTO 27A |
|
|
216 |
027C: NOP |
|
|
217 |
027D: BCF 07.3 |
|
|
218 |
027E: BCF 20.3 |
|
|
219 |
027F: MOVF 20,W |
|
|
220 |
0280: BSF 03.5 |
|
|
221 |
0281: MOVWF 07 |
|
|
222 |
0282: NOP |
|
|
223 |
0283: BCF 03.5 |
|
|
224 |
0284: BCF 07.4 |
|
|
225 |
0285: BCF 20.4 |
|
|
226 |
0286: MOVF 20,W |
|
|
227 |
0287: BSF 03.5 |
|
|
228 |
0288: MOVWF 07 |
|
|
229 |
0289: BCF 03.5 |
|
|
230 |
028A: RETURN |
|
|
231 |
.................... #use rs232(baud=9600,parity=N,xmit=PIN_C7,rcv=PIN_C6,bits=8) //rcv TXD xmit RXD |
|
|
232 |
* |
|
|
233 |
001E: BCF 20.7 |
|
|
234 |
001F: MOVF 20,W |
|
|
235 |
0020: BSF 03.5 |
|
|
236 |
0021: MOVWF 07 |
|
|
237 |
0022: BCF 03.5 |
|
|
238 |
0023: BCF 07.7 |
|
|
239 |
0024: MOVLW 08 |
|
|
240 |
0025: MOVWF 78 |
|
|
241 |
0026: GOTO 027 |
|
|
242 |
0027: NOP |
|
|
243 |
0028: BSF 78.7 |
|
|
244 |
0029: GOTO 038 |
|
|
245 |
002A: BCF 78.7 |
|
|
246 |
002B: RRF 6D,F |
|
|
247 |
002C: BTFSC 03.0 |
|
|
248 |
002D: BSF 07.7 |
|
|
249 |
002E: BTFSS 03.0 |
|
|
250 |
002F: BCF 07.7 |
|
|
251 |
0030: BSF 78.6 |
|
|
252 |
0031: GOTO 038 |
|
|
253 |
0032: BCF 78.6 |
|
|
254 |
0033: DECFSZ 78,F |
|
|
255 |
0034: GOTO 02B |
|
|
256 |
0035: GOTO 036 |
|
|
257 |
0036: NOP |
|
|
258 |
0037: BSF 07.7 |
|
|
259 |
0038: MOVLW 3F |
|
|
260 |
0039: MOVWF 04 |
|
|
261 |
003A: DECFSZ 04,F |
|
|
262 |
003B: GOTO 03A |
|
|
263 |
003C: NOP |
|
|
264 |
003D: BTFSC 78.7 |
|
|
265 |
003E: GOTO 02A |
|
|
266 |
003F: BTFSC 78.6 |
|
|
267 |
0040: GOTO 032 |
|
|
268 |
0041: RETURN |
|
|
269 |
.................... #include "BQ34Z100.h" |
|
|
270 |
.................... #define BAT_ADDR_R 0xAB //addresa pro cteni |
|
|
271 |
.................... #define BAT_ADDR_W 0xAA |
|
|
272 |
.................... |
|
|
273 |
.................... |
|
|
274 |
.................... |
|
|
275 |
.................... |
|
|
276 |
.................... |
|
|
277 |
.................... #include "BQ34Z100.c" |
|
|
278 |
.................... //Knihovna pro obvod BQ34Z100 |
|
|
279 |
.................... //(c) Jan Chroust 2013 |
|
|
280 |
.................... |
|
|
281 |
.................... |
|
|
282 |
.................... int16 cteniBAT(byte lsb, byte msb) |
|
|
283 |
.................... { |
|
|
284 |
* |
|
|
285 |
028B: CLRF 6E |
|
|
286 |
028C: CLRF 6D |
|
|
287 |
.................... int16 data = 0; |
|
|
288 |
.................... unsigned int8 h, l; |
|
|
289 |
.................... i2c_start(); |
|
|
290 |
028D: BSF 20.4 |
|
|
291 |
028E: MOVF 20,W |
|
|
292 |
028F: BSF 03.5 |
|
|
293 |
0290: MOVWF 07 |
|
|
294 |
0291: NOP |
|
|
295 |
0292: BCF 03.5 |
|
|
296 |
0293: BSF 20.3 |
|
|
297 |
0294: MOVF 20,W |
|
|
298 |
0295: BSF 03.5 |
|
|
299 |
0296: MOVWF 07 |
|
|
300 |
0297: NOP |
|
|
301 |
0298: BCF 03.5 |
|
|
302 |
0299: BCF 07.4 |
|
|
303 |
029A: BCF 20.4 |
|
|
304 |
029B: MOVF 20,W |
|
|
305 |
029C: BSF 03.5 |
|
|
306 |
029D: MOVWF 07 |
|
|
307 |
029E: NOP |
|
|
308 |
029F: BCF 03.5 |
|
|
309 |
02A0: BCF 07.3 |
|
|
310 |
02A1: BCF 20.3 |
|
|
311 |
02A2: MOVF 20,W |
|
|
312 |
02A3: BSF 03.5 |
|
|
313 |
02A4: MOVWF 07 |
|
|
314 |
.................... I2C_Write(BAT_ADDR_W); |
|
|
315 |
02A5: MOVLW AA |
|
|
316 |
02A6: MOVWF 71 |
|
|
317 |
02A7: BCF 03.5 |
|
|
318 |
02A8: CALL 18C |
|
|
319 |
.................... I2C_write(lsb); |
|
|
320 |
02A9: MOVF 6B,W |
|
|
321 |
02AA: MOVWF 71 |
|
|
322 |
02AB: CALL 18C |
|
|
323 |
.................... |
|
|
324 |
.................... i2c_start(); |
|
|
325 |
02AC: BSF 20.4 |
|
|
326 |
02AD: MOVF 20,W |
|
|
327 |
02AE: BSF 03.5 |
|
|
328 |
02AF: MOVWF 07 |
|
|
329 |
02B0: NOP |
|
|
330 |
02B1: BCF 03.5 |
|
|
331 |
02B2: BSF 20.3 |
|
|
332 |
02B3: MOVF 20,W |
|
|
333 |
02B4: BSF 03.5 |
|
|
334 |
02B5: MOVWF 07 |
|
|
335 |
02B6: NOP |
|
|
336 |
02B7: BCF 03.5 |
|
|
337 |
02B8: BTFSS 07.3 |
|
|
338 |
02B9: GOTO 2B8 |
|
|
339 |
02BA: BCF 07.4 |
|
|
340 |
02BB: BCF 20.4 |
|
|
341 |
02BC: MOVF 20,W |
|
|
342 |
02BD: BSF 03.5 |
|
|
343 |
02BE: MOVWF 07 |
|
|
344 |
02BF: NOP |
|
|
345 |
02C0: BCF 03.5 |
|
|
346 |
02C1: BCF 07.3 |
|
|
347 |
02C2: BCF 20.3 |
|
|
348 |
02C3: MOVF 20,W |
|
|
349 |
02C4: BSF 03.5 |
|
|
350 |
02C5: MOVWF 07 |
|
|
351 |
.................... I2C_Write(BAT_ADDR_R); |
|
|
352 |
02C6: MOVLW AB |
|
|
353 |
02C7: MOVWF 71 |
|
|
354 |
02C8: BCF 03.5 |
|
|
355 |
02C9: CALL 18C |
|
|
356 |
.................... l=i2c_read(0); |
|
|
357 |
02CA: CLRF 77 |
|
|
358 |
02CB: CALL 246 |
|
|
359 |
02CC: MOVF 78,W |
|
|
360 |
02CD: MOVWF 70 |
|
|
361 |
.................... i2c_stop(); |
|
|
362 |
02CE: BCF 20.4 |
|
|
363 |
02CF: MOVF 20,W |
|
|
364 |
02D0: BSF 03.5 |
|
|
365 |
02D1: MOVWF 07 |
|
|
366 |
02D2: NOP |
|
|
367 |
02D3: BCF 03.5 |
|
|
368 |
02D4: BSF 20.3 |
|
|
369 |
02D5: MOVF 20,W |
|
|
370 |
02D6: BSF 03.5 |
|
|
371 |
02D7: MOVWF 07 |
|
|
372 |
02D8: BCF 03.5 |
|
|
373 |
02D9: BTFSS 07.3 |
|
|
374 |
02DA: GOTO 2D9 |
|
|
375 |
02DB: NOP |
|
|
376 |
02DC: GOTO 2DD |
|
|
377 |
02DD: NOP |
|
|
378 |
02DE: BSF 20.4 |
|
|
379 |
02DF: MOVF 20,W |
|
|
380 |
02E0: BSF 03.5 |
|
|
381 |
02E1: MOVWF 07 |
|
|
382 |
02E2: NOP |
|
|
383 |
.................... |
|
|
384 |
.................... i2c_start(); |
|
|
385 |
02E3: BCF 03.5 |
|
|
386 |
02E4: BSF 20.4 |
|
|
387 |
02E5: MOVF 20,W |
|
|
388 |
02E6: BSF 03.5 |
|
|
389 |
02E7: MOVWF 07 |
|
|
390 |
02E8: NOP |
|
|
391 |
02E9: BCF 03.5 |
|
|
392 |
02EA: BSF 20.3 |
|
|
393 |
02EB: MOVF 20,W |
|
|
394 |
02EC: BSF 03.5 |
|
|
395 |
02ED: MOVWF 07 |
|
|
396 |
02EE: NOP |
|
|
397 |
02EF: BCF 03.5 |
|
|
398 |
02F0: BCF 07.4 |
|
|
399 |
02F1: BCF 20.4 |
|
|
400 |
02F2: MOVF 20,W |
|
|
401 |
02F3: BSF 03.5 |
|
|
402 |
02F4: MOVWF 07 |
|
|
403 |
02F5: NOP |
|
|
404 |
02F6: BCF 03.5 |
|
|
405 |
02F7: BCF 07.3 |
|
|
406 |
02F8: BCF 20.3 |
|
|
407 |
02F9: MOVF 20,W |
|
|
408 |
02FA: BSF 03.5 |
|
|
409 |
02FB: MOVWF 07 |
|
|
410 |
.................... I2C_Write(BAT_ADDR_W); |
|
|
411 |
02FC: MOVLW AA |
|
|
412 |
02FD: MOVWF 71 |
|
|
413 |
02FE: BCF 03.5 |
|
|
414 |
02FF: CALL 18C |
|
|
415 |
.................... I2C_write(msb); |
|
|
416 |
0300: MOVF 6C,W |
|
|
417 |
0301: MOVWF 71 |
|
|
418 |
0302: CALL 18C |
|
|
419 |
.................... i2c_start(); |
|
|
420 |
0303: BSF 20.4 |
|
|
421 |
0304: MOVF 20,W |
|
|
422 |
0305: BSF 03.5 |
|
|
423 |
0306: MOVWF 07 |
|
|
424 |
0307: NOP |
|
|
425 |
0308: BCF 03.5 |
|
|
426 |
0309: BSF 20.3 |
|
|
427 |
030A: MOVF 20,W |
|
|
428 |
030B: BSF 03.5 |
|
|
429 |
030C: MOVWF 07 |
|
|
430 |
030D: NOP |
|
|
431 |
030E: BCF 03.5 |
|
|
432 |
030F: BTFSS 07.3 |
|
|
433 |
0310: GOTO 30F |
|
|
434 |
0311: BCF 07.4 |
|
|
435 |
0312: BCF 20.4 |
|
|
436 |
0313: MOVF 20,W |
|
|
437 |
0314: BSF 03.5 |
|
|
438 |
0315: MOVWF 07 |
|
|
439 |
0316: NOP |
|
|
440 |
0317: BCF 03.5 |
|
|
441 |
0318: BCF 07.3 |
|
|
442 |
0319: BCF 20.3 |
|
|
443 |
031A: MOVF 20,W |
|
|
444 |
031B: BSF 03.5 |
|
|
445 |
031C: MOVWF 07 |
|
|
446 |
.................... I2C_Write(BAT_ADDR_R); |
|
|
447 |
031D: MOVLW AB |
|
|
448 |
031E: MOVWF 71 |
|
|
449 |
031F: BCF 03.5 |
|
|
450 |
0320: CALL 18C |
|
|
451 |
.................... h=i2c_read(0); |
|
|
452 |
0321: CLRF 77 |
|
|
453 |
0322: CALL 246 |
|
|
454 |
0323: MOVF 78,W |
|
|
455 |
0324: MOVWF 6F |
|
|
456 |
.................... i2c_stop(); |
|
|
457 |
0325: BCF 20.4 |
|
|
458 |
0326: MOVF 20,W |
|
|
459 |
0327: BSF 03.5 |
|
|
460 |
0328: MOVWF 07 |
|
|
461 |
0329: NOP |
|
|
462 |
032A: BCF 03.5 |
|
|
463 |
032B: BSF 20.3 |
|
|
464 |
032C: MOVF 20,W |
|
|
465 |
032D: BSF 03.5 |
|
|
466 |
032E: MOVWF 07 |
|
|
467 |
032F: BCF 03.5 |
|
|
468 |
0330: BTFSS 07.3 |
|
|
469 |
0331: GOTO 330 |
|
|
470 |
0332: NOP |
|
|
471 |
0333: GOTO 334 |
|
|
472 |
0334: NOP |
|
|
473 |
0335: BSF 20.4 |
|
|
474 |
0336: MOVF 20,W |
|
|
475 |
0337: BSF 03.5 |
|
|
476 |
0338: MOVWF 07 |
|
|
477 |
0339: NOP |
|
|
478 |
.................... |
|
|
479 |
.................... return data = (((unsigned int16) h << 8) + l ); |
|
|
480 |
033A: CLRF 72 |
|
|
481 |
033B: BCF 03.5 |
|
|
482 |
033C: MOVF 6F,W |
|
|
483 |
033D: MOVWF 71 |
|
|
484 |
033E: MOVWF 72 |
|
|
485 |
033F: CLRF 71 |
|
|
486 |
0340: MOVF 70,W |
|
|
487 |
0341: ADDWF 71,W |
|
|
488 |
0342: MOVWF 6D |
|
|
489 |
0343: MOVF 72,W |
|
|
490 |
0344: MOVWF 6E |
|
|
491 |
0345: BTFSC 03.0 |
|
|
492 |
0346: INCF 6E,F |
|
|
493 |
0347: MOVF 6D,W |
|
|
494 |
0348: MOVWF 78 |
|
|
495 |
0349: MOVF 6E,W |
|
|
496 |
034A: MOVWF 79 |
|
|
497 |
.................... } |
|
|
498 |
034B: RETURN |
|
|
499 |
.................... |
|
|
500 |
.................... int16 batintT(void) //teplota baterie (pri vyrobnim nastaveni, je mozne zmenit na teplotu v IO |
|
|
501 |
.................... { |
|
|
502 |
.................... int16 data = cteniBAT(0x0C, 0x0D); |
|
|
503 |
.................... data = (data/10)-273; |
|
|
504 |
.................... return data; |
|
|
505 |
.................... |
|
|
506 |
.................... } |
|
|
507 |
.................... |
|
|
508 |
.................... int16 batNAP(void) //napeti baterie |
|
|
509 |
.................... { |
|
|
510 |
* |
|
|
511 |
0368: MOVLW 08 |
|
|
512 |
0369: MOVWF 6B |
|
|
513 |
036A: MOVLW 09 |
|
|
514 |
036B: MOVWF 6C |
|
|
515 |
036C: CALL 28B |
|
|
516 |
036D: MOVF 79,W |
|
|
517 |
036E: MOVWF 6A |
|
|
518 |
036F: MOVF 78,W |
|
|
519 |
0370: MOVWF 69 |
|
|
520 |
.................... int16 data = cteniBAT(0x08, 0x09); |
|
|
521 |
.................... return data; |
|
|
522 |
0371: MOVF 69,W |
|
|
523 |
0372: MOVWF 78 |
|
|
524 |
0373: MOVF 6A,W |
|
|
525 |
0374: MOVWF 79 |
|
|
526 |
.................... |
|
|
527 |
.................... } |
|
|
528 |
0375: RETURN |
|
|
529 |
.................... |
|
|
530 |
.................... int16 batPROUD(void) //proud z nebo do baterie |
|
|
531 |
.................... { |
|
|
532 |
* |
|
|
533 |
034C: MOVLW 0A |
|
|
534 |
034D: MOVWF 6B |
|
|
535 |
034E: MOVLW 0B |
|
|
536 |
034F: MOVWF 6C |
|
|
537 |
0350: CALL 28B |
|
|
538 |
0351: MOVF 79,W |
|
|
539 |
0352: MOVWF 6A |
|
|
540 |
0353: MOVF 78,W |
|
|
541 |
0354: MOVWF 69 |
|
|
542 |
.................... int16 data = cteniBAT(0x0A, 0x0B); |
|
|
543 |
.................... return data; |
|
|
544 |
0355: MOVF 69,W |
|
|
545 |
0356: MOVWF 78 |
|
|
546 |
0357: MOVF 6A,W |
|
|
547 |
0358: MOVWF 79 |
|
|
548 |
.................... |
|
|
549 |
.................... } |
|
|
550 |
0359: RETURN |
|
|
551 |
.................... |
|
|
552 |
.................... int16 batKAPAKT(void) //zbyvajici kapacita |
|
|
553 |
.................... { |
|
|
554 |
.................... int16 data = cteniBAT(0x04, 0x05); |
|
|
555 |
.................... return data; |
|
|
556 |
.................... |
|
|
557 |
.................... } |
|
|
558 |
.................... int16 batKAPMAX(void) //max. kapacita |
|
|
559 |
.................... { |
|
|
560 |
.................... int16 data = cteniBAT(0x06, 0x07); |
|
|
561 |
.................... return data; |
|
|
562 |
.................... |
|
|
563 |
.................... } |
|
|
564 |
.................... |
|
|
565 |
.................... int16 batSTAV(void) //zbytek energie v baterii v % |
|
|
566 |
.................... { |
|
|
567 |
035A: MOVLW 02 |
|
|
568 |
035B: MOVWF 6B |
|
|
569 |
035C: MOVLW 03 |
|
|
570 |
035D: MOVWF 6C |
|
|
571 |
035E: CALL 28B |
|
|
572 |
035F: MOVF 79,W |
|
|
573 |
0360: MOVWF 6A |
|
|
574 |
0361: MOVF 78,W |
|
|
575 |
0362: MOVWF 69 |
|
|
576 |
.................... int16 data = cteniBAT(0x02, 0x03); |
|
|
577 |
.................... return data; |
|
|
578 |
0363: MOVF 69,W |
|
|
579 |
0364: MOVWF 78 |
|
|
580 |
0365: MOVF 6A,W |
|
|
581 |
0366: MOVWF 79 |
|
|
582 |
.................... |
|
|
583 |
.................... } |
|
|
584 |
0367: RETURN |
|
|
585 |
.................... |
|
|
586 |
.................... |
|
|
587 |
.................... |
|
|
588 |
.................... |
|
|
589 |
.................... //BAT3 - pro pohyblivý panel - LION1CELLB-1 |
|
|
590 |
.................... //BAT2 - pro fixní panel - LION1CELLB-2 |
|
|
591 |
.................... //BAT1 - hlavní baterie - LION1CELLB-3 |
|
|
592 |
.................... int16 bat1STAV,bat2STAV,bat3STAV; //zbyvajici eneregie akumulátoru v % |
|
|
593 |
.................... signed int16 bat1PROUD,bat2PROUD,bat3PROUD; //proud akumulatorem |
|
|
594 |
.................... int16 bat1NAP,bat2NAP,bat3NAP; //napeti akumulatoru |
|
|
595 |
.................... signed int16 bat1P,bat2P, bat3P; //vykon z nebo do akumulatoru |
|
|
596 |
.................... |
|
|
597 |
.................... //pro odeslání |
|
|
598 |
.................... signed int16 rozdil; |
|
|
599 |
.................... char baterka[40]; |
|
|
600 |
.................... |
|
|
601 |
.................... |
|
|
602 |
.................... void batMODE(int d) //nastavi rele do prislusneho modu |
|
|
603 |
.................... { |
|
|
604 |
.................... switch (d) { |
|
|
605 |
* |
|
|
606 |
0088: MOVF 69,W |
|
|
607 |
0089: XORLW 01 |
|
|
608 |
008A: BTFSC 03.2 |
|
|
609 |
008B: GOTO 09C |
|
|
610 |
008C: XORLW 03 |
|
|
611 |
008D: BTFSC 03.2 |
|
|
612 |
008E: GOTO 0D0 |
|
|
613 |
008F: XORLW 01 |
|
|
614 |
0090: BTFSC 03.2 |
|
|
615 |
0091: GOTO 0F4 |
|
|
616 |
0092: XORLW 07 |
|
|
617 |
0093: BTFSC 03.2 |
|
|
618 |
0094: GOTO 118 |
|
|
619 |
0095: XORLW 01 |
|
|
620 |
0096: BTFSC 03.2 |
|
|
621 |
0097: GOTO 13C |
|
|
622 |
0098: XORLW 03 |
|
|
623 |
0099: BTFSC 03.2 |
|
|
624 |
009A: GOTO 160 |
|
|
625 |
009B: GOTO 183 |
|
|
626 |
.................... |
|
|
627 |
.................... case 1: output_high(REL1_IN2); //pro mereni |
|
|
628 |
009C: BSF 03.5 |
|
|
629 |
009D: BCF 08.7 |
|
|
630 |
009E: BCF 03.5 |
|
|
631 |
009F: BSF 08.7 |
|
|
632 |
.................... output_high(REL2_IN1); |
|
|
633 |
00A0: BSF 03.5 |
|
|
634 |
00A1: BCF 06.2 |
|
|
635 |
00A2: BCF 03.5 |
|
|
636 |
00A3: BSF 06.2 |
|
|
637 |
.................... output_high(REL3_IN2); |
|
|
638 |
00A4: BSF 03.5 |
|
|
639 |
00A5: BCF 05.1 |
|
|
640 |
00A6: BCF 03.5 |
|
|
641 |
00A7: BSF 05.1 |
|
|
642 |
.................... output_high(REL4_IN2); |
|
|
643 |
00A8: BSF 03.5 |
|
|
644 |
00A9: BCF 05.3 |
|
|
645 |
00AA: BCF 03.5 |
|
|
646 |
00AB: BSF 05.3 |
|
|
647 |
.................... delay_ms(100); |
|
|
648 |
00AC: MOVLW 64 |
|
|
649 |
00AD: MOVWF 6A |
|
|
650 |
00AE: CALL 00A |
|
|
651 |
.................... output_low(REL1_IN1); |
|
|
652 |
00AF: BSF 03.5 |
|
|
653 |
00B0: BCF 08.6 |
|
|
654 |
00B1: BCF 03.5 |
|
|
655 |
00B2: BCF 08.6 |
|
|
656 |
.................... output_low(REL1_IN2); |
|
|
657 |
00B3: BSF 03.5 |
|
|
658 |
00B4: BCF 08.7 |
|
|
659 |
00B5: BCF 03.5 |
|
|
660 |
00B6: BCF 08.7 |
|
|
661 |
.................... output_low(REL2_IN1); |
|
|
662 |
00B7: BSF 03.5 |
|
|
663 |
00B8: BCF 06.2 |
|
|
664 |
00B9: BCF 03.5 |
|
|
665 |
00BA: BCF 06.2 |
|
|
666 |
.................... output_low(REL2_IN2); |
|
|
667 |
00BB: BSF 03.5 |
|
|
668 |
00BC: BCF 06.3 |
|
|
669 |
00BD: BCF 03.5 |
|
|
670 |
00BE: BCF 06.3 |
|
|
671 |
.................... output_low(REL3_IN1); |
|
|
672 |
00BF: BSF 03.5 |
|
|
673 |
00C0: BCF 05.0 |
|
|
674 |
00C1: BCF 03.5 |
|
|
675 |
00C2: BCF 05.0 |
|
|
676 |
.................... output_low(REL3_IN2); |
|
|
677 |
00C3: BSF 03.5 |
|
|
678 |
00C4: BCF 05.1 |
|
|
679 |
00C5: BCF 03.5 |
|
|
680 |
00C6: BCF 05.1 |
|
|
681 |
.................... output_low(REL4_IN1); |
|
|
682 |
00C7: BSF 03.5 |
|
|
683 |
00C8: BCF 05.2 |
|
|
684 |
00C9: BCF 03.5 |
|
|
685 |
00CA: BCF 05.2 |
|
|
686 |
.................... output_low(REL4_IN2); |
|
|
687 |
00CB: BSF 03.5 |
|
|
688 |
00CC: BCF 05.3 |
|
|
689 |
00CD: BCF 03.5 |
|
|
690 |
00CE: BCF 05.3 |
|
|
691 |
.................... |
|
|
692 |
.................... break; |
|
|
693 |
00CF: GOTO 18B |
|
|
694 |
.................... |
|
|
695 |
.................... case 2: output_high(REL1_IN2); //dobijeni Hl. clanku z bat3 |
|
|
696 |
00D0: BSF 03.5 |
|
|
697 |
00D1: BCF 08.7 |
|
|
698 |
00D2: BCF 03.5 |
|
|
699 |
00D3: BSF 08.7 |
|
|
700 |
.................... output_high(REL2_IN1); |
|
|
701 |
00D4: BSF 03.5 |
|
|
702 |
00D5: BCF 06.2 |
|
|
703 |
00D6: BCF 03.5 |
|
|
704 |
00D7: BSF 06.2 |
|
|
705 |
.................... output_high(REL3_IN1); |
|
|
706 |
00D8: BSF 03.5 |
|
|
707 |
00D9: BCF 05.0 |
|
|
708 |
00DA: BCF 03.5 |
|
|
709 |
00DB: BSF 05.0 |
|
|
710 |
.................... output_high(REL4_IN2); |
|
|
711 |
00DC: BSF 03.5 |
|
|
712 |
00DD: BCF 05.3 |
|
|
713 |
00DE: BCF 03.5 |
|
|
714 |
00DF: BSF 05.3 |
|
|
715 |
.................... delay_ms(100); |
|
|
716 |
00E0: MOVLW 64 |
|
|
717 |
00E1: MOVWF 6A |
|
|
718 |
00E2: CALL 00A |
|
|
719 |
.................... output_low(REL1_IN2); |
|
|
720 |
00E3: BSF 03.5 |
|
|
721 |
00E4: BCF 08.7 |
|
|
722 |
00E5: BCF 03.5 |
|
|
723 |
00E6: BCF 08.7 |
|
|
724 |
.................... output_low(REL2_IN1); |
|
|
725 |
00E7: BSF 03.5 |
|
|
726 |
00E8: BCF 06.2 |
|
|
727 |
00E9: BCF 03.5 |
|
|
728 |
00EA: BCF 06.2 |
|
|
729 |
.................... output_low(REL3_IN1); |
|
|
730 |
00EB: BSF 03.5 |
|
|
731 |
00EC: BCF 05.0 |
|
|
732 |
00ED: BCF 03.5 |
|
|
733 |
00EE: BCF 05.0 |
|
|
734 |
.................... output_low(REL4_IN2); |
|
|
735 |
00EF: BSF 03.5 |
|
|
736 |
00F0: BCF 05.3 |
|
|
737 |
00F1: BCF 03.5 |
|
|
738 |
00F2: BCF 05.3 |
|
|
739 |
.................... break; |
|
|
740 |
00F3: GOTO 18B |
|
|
741 |
.................... |
|
|
742 |
.................... case 3: output_high(REL1_IN2); //dobijeni Hl. clanku z bat2 |
|
|
743 |
00F4: BSF 03.5 |
|
|
744 |
00F5: BCF 08.7 |
|
|
745 |
00F6: BCF 03.5 |
|
|
746 |
00F7: BSF 08.7 |
|
|
747 |
.................... output_high(REL2_IN1); |
|
|
748 |
00F8: BSF 03.5 |
|
|
749 |
00F9: BCF 06.2 |
|
|
750 |
00FA: BCF 03.5 |
|
|
751 |
00FB: BSF 06.2 |
|
|
752 |
.................... output_high(REL3_IN2); |
|
|
753 |
00FC: BSF 03.5 |
|
|
754 |
00FD: BCF 05.1 |
|
|
755 |
00FE: BCF 03.5 |
|
|
756 |
00FF: BSF 05.1 |
|
|
757 |
.................... output_high(REL4_IN1); |
|
|
758 |
0100: BSF 03.5 |
|
|
759 |
0101: BCF 05.2 |
|
|
760 |
0102: BCF 03.5 |
|
|
761 |
0103: BSF 05.2 |
|
|
762 |
.................... delay_ms(100); |
|
|
763 |
0104: MOVLW 64 |
|
|
764 |
0105: MOVWF 6A |
|
|
765 |
0106: CALL 00A |
|
|
766 |
.................... output_low(REL1_IN2); |
|
|
767 |
0107: BSF 03.5 |
|
|
768 |
0108: BCF 08.7 |
|
|
769 |
0109: BCF 03.5 |
|
|
770 |
010A: BCF 08.7 |
|
|
771 |
.................... output_low(REL2_IN1); |
|
|
772 |
010B: BSF 03.5 |
|
|
773 |
010C: BCF 06.2 |
|
|
774 |
010D: BCF 03.5 |
|
|
775 |
010E: BCF 06.2 |
|
|
776 |
.................... output_low(REL3_IN2); |
|
|
777 |
010F: BSF 03.5 |
|
|
778 |
0110: BCF 05.1 |
|
|
779 |
0111: BCF 03.5 |
|
|
780 |
0112: BCF 05.1 |
|
|
781 |
.................... output_low(REL4_IN1); |
|
|
782 |
0113: BSF 03.5 |
|
|
783 |
0114: BCF 05.2 |
|
|
784 |
0115: BCF 03.5 |
|
|
785 |
0116: BCF 05.2 |
|
|
786 |
.................... |
|
|
787 |
.................... break; |
|
|
788 |
0117: GOTO 18B |
|
|
789 |
.................... |
|
|
790 |
.................... case 4: output_high(REL1_IN1); //dobijeni Hl. clanku ze sol. clanku |
|
|
791 |
0118: BSF 03.5 |
|
|
792 |
0119: BCF 08.6 |
|
|
793 |
011A: BCF 03.5 |
|
|
794 |
011B: BSF 08.6 |
|
|
795 |
.................... output_high(REL2_IN1); |
|
|
796 |
011C: BSF 03.5 |
|
|
797 |
011D: BCF 06.2 |
|
|
798 |
011E: BCF 03.5 |
|
|
799 |
011F: BSF 06.2 |
|
|
800 |
.................... output_high(REL3_IN2); |
|
|
801 |
0120: BSF 03.5 |
|
|
802 |
0121: BCF 05.1 |
|
|
803 |
0122: BCF 03.5 |
|
|
804 |
0123: BSF 05.1 |
|
|
805 |
.................... output_high(REL4_IN2); |
|
|
806 |
0124: BSF 03.5 |
|
|
807 |
0125: BCF 05.3 |
|
|
808 |
0126: BCF 03.5 |
|
|
809 |
0127: BSF 05.3 |
|
|
810 |
.................... delay_ms(100); |
|
|
811 |
0128: MOVLW 64 |
|
|
812 |
0129: MOVWF 6A |
|
|
813 |
012A: CALL 00A |
|
|
814 |
.................... output_low(REL1_IN1); |
|
|
815 |
012B: BSF 03.5 |
|
|
816 |
012C: BCF 08.6 |
|
|
817 |
012D: BCF 03.5 |
|
|
818 |
012E: BCF 08.6 |
|
|
819 |
.................... output_low(REL2_IN1); |
|
|
820 |
012F: BSF 03.5 |
|
|
821 |
0130: BCF 06.2 |
|
|
822 |
0131: BCF 03.5 |
|
|
823 |
0132: BCF 06.2 |
|
|
824 |
.................... output_low(REL3_IN2); |
|
|
825 |
0133: BSF 03.5 |
|
|
826 |
0134: BCF 05.1 |
|
|
827 |
0135: BCF 03.5 |
|
|
828 |
0136: BCF 05.1 |
|
|
829 |
.................... output_low(REL4_IN2); |
|
|
830 |
0137: BSF 03.5 |
|
|
831 |
0138: BCF 05.3 |
|
|
832 |
0139: BCF 03.5 |
|
|
833 |
013A: BCF 05.3 |
|
|
834 |
.................... |
|
|
835 |
.................... |
|
|
836 |
.................... break; |
|
|
837 |
013B: GOTO 18B |
|
|
838 |
.................... case 5: output_high(REL1_IN2); //vybijeni bat3 do R |
|
|
839 |
013C: BSF 03.5 |
|
|
840 |
013D: BCF 08.7 |
|
|
841 |
013E: BCF 03.5 |
|
|
842 |
013F: BSF 08.7 |
|
|
843 |
.................... output_high(REL2_IN2); |
|
|
844 |
0140: BSF 03.5 |
|
|
845 |
0141: BCF 06.3 |
|
|
846 |
0142: BCF 03.5 |
|
|
847 |
0143: BSF 06.3 |
|
|
848 |
.................... output_high(REL3_IN1); |
|
|
849 |
0144: BSF 03.5 |
|
|
850 |
0145: BCF 05.0 |
|
|
851 |
0146: BCF 03.5 |
|
|
852 |
0147: BSF 05.0 |
|
|
853 |
.................... output_high(REL4_IN2); |
|
|
854 |
0148: BSF 03.5 |
|
|
855 |
0149: BCF 05.3 |
|
|
856 |
014A: BCF 03.5 |
|
|
857 |
014B: BSF 05.3 |
|
|
858 |
.................... delay_ms(100); |
|
|
859 |
014C: MOVLW 64 |
|
|
860 |
014D: MOVWF 6A |
|
|
861 |
014E: CALL 00A |
|
|
862 |
.................... output_low(REL1_IN2); |
|
|
863 |
014F: BSF 03.5 |
|
|
864 |
0150: BCF 08.7 |
|
|
865 |
0151: BCF 03.5 |
|
|
866 |
0152: BCF 08.7 |
|
|
867 |
.................... output_low(REL2_IN2); |
|
|
868 |
0153: BSF 03.5 |
|
|
869 |
0154: BCF 06.3 |
|
|
870 |
0155: BCF 03.5 |
|
|
871 |
0156: BCF 06.3 |
|
|
872 |
.................... output_low(REL3_IN1); |
|
|
873 |
0157: BSF 03.5 |
|
|
874 |
0158: BCF 05.0 |
|
|
875 |
0159: BCF 03.5 |
|
|
876 |
015A: BCF 05.0 |
|
|
877 |
.................... output_low(REL4_IN2); |
|
|
878 |
015B: BSF 03.5 |
|
|
879 |
015C: BCF 05.3 |
|
|
880 |
015D: BCF 03.5 |
|
|
881 |
015E: BCF 05.3 |
|
|
882 |
.................... |
|
|
883 |
.................... break; |
|
|
884 |
015F: GOTO 18B |
|
|
885 |
.................... |
|
|
886 |
.................... case 6: output_high(REL1_IN2); //vybijeni bat2 do R |
|
|
887 |
0160: BSF 03.5 |
|
|
888 |
0161: BCF 08.7 |
|
|
889 |
0162: BCF 03.5 |
|
|
890 |
0163: BSF 08.7 |
|
|
891 |
.................... output_high(REL2_IN2); |
|
|
892 |
0164: BSF 03.5 |
|
|
893 |
0165: BCF 06.3 |
|
|
894 |
0166: BCF 03.5 |
|
|
895 |
0167: BSF 06.3 |
|
|
896 |
.................... output_high(REL3_IN2); |
|
|
897 |
0168: BSF 03.5 |
|
|
898 |
0169: BCF 05.1 |
|
|
899 |
016A: BCF 03.5 |
|
|
900 |
016B: BSF 05.1 |
|
|
901 |
.................... output_high(REL4_IN1); |
|
|
902 |
016C: BSF 03.5 |
|
|
903 |
016D: BCF 05.2 |
|
|
904 |
016E: BCF 03.5 |
|
|
905 |
016F: BSF 05.2 |
|
|
906 |
.................... delay_ms(100); |
|
|
907 |
0170: MOVLW 64 |
|
|
908 |
0171: MOVWF 6A |
|
|
909 |
0172: CALL 00A |
|
|
910 |
.................... output_low(REL1_IN2); |
|
|
911 |
0173: BSF 03.5 |
|
|
912 |
0174: BCF 08.7 |
|
|
913 |
0175: BCF 03.5 |
|
|
914 |
0176: BCF 08.7 |
|
|
915 |
.................... output_low(REL2_IN2); |
|
|
916 |
0177: BSF 03.5 |
|
|
917 |
0178: BCF 06.3 |
|
|
918 |
0179: BCF 03.5 |
|
|
919 |
017A: BCF 06.3 |
|
|
920 |
.................... output_low(REL3_IN2); |
|
|
921 |
017B: BSF 03.5 |
|
|
922 |
017C: BCF 05.1 |
|
|
923 |
017D: BCF 03.5 |
|
|
924 |
017E: BCF 05.1 |
|
|
925 |
.................... output_low(REL4_IN1); |
|
|
926 |
017F: BSF 03.5 |
|
|
927 |
0180: BCF 05.2 |
|
|
928 |
0181: BCF 03.5 |
|
|
929 |
0182: BCF 05.2 |
|
|
930 |
.................... |
|
|
931 |
.................... default:printf("chyba"); |
|
|
932 |
0183: MOVLW 04 |
|
|
933 |
0184: BSF 03.6 |
|
|
934 |
0185: MOVWF 0D |
|
|
935 |
0186: MOVLW 00 |
|
|
936 |
0187: MOVWF 0F |
|
|
937 |
0188: BCF 03.6 |
|
|
938 |
0189: CALL 042 |
|
|
939 |
.................... |
|
|
940 |
.................... break; } |
|
|
941 |
018A: GOTO 18B |
|
|
942 |
.................... |
|
|
943 |
.................... |
|
|
944 |
.................... } |
|
|
945 |
018B: RETURN |
|
|
946 |
.................... |
|
|
947 |
.................... |
|
|
948 |
.................... void setHUB(int d) //vstupuje 1-8 |
|
|
949 |
.................... //hodnota udava jaky port bude pripojen na master I2C |
|
|
950 |
.................... //zde je nastaveno propojeni jen jedne brany, je mozne propojit i vice bran naraz |
|
|
951 |
.................... { |
|
|
952 |
.................... switch (d) { |
|
|
953 |
* |
|
|
954 |
01D6: MOVF 69,W |
|
|
955 |
01D7: XORLW 01 |
|
|
956 |
01D8: BTFSC 03.2 |
|
|
957 |
01D9: GOTO 1F0 |
|
|
958 |
01DA: XORLW 03 |
|
|
959 |
01DB: BTFSC 03.2 |
|
|
960 |
01DC: GOTO 1F3 |
|
|
961 |
01DD: XORLW 01 |
|
|
962 |
01DE: BTFSC 03.2 |
|
|
963 |
01DF: GOTO 1F6 |
|
|
964 |
01E0: XORLW 07 |
|
|
965 |
01E1: BTFSC 03.2 |
|
|
966 |
01E2: GOTO 1F9 |
|
|
967 |
01E3: XORLW 01 |
|
|
968 |
01E4: BTFSC 03.2 |
|
|
969 |
01E5: GOTO 1FC |
|
|
970 |
01E6: XORLW 03 |
|
|
971 |
01E7: BTFSC 03.2 |
|
|
972 |
01E8: GOTO 1FF |
|
|
973 |
01E9: XORLW 01 |
|
|
974 |
01EA: BTFSC 03.2 |
|
|
975 |
01EB: GOTO 202 |
|
|
976 |
01EC: XORLW 0F |
|
|
977 |
01ED: BTFSC 03.2 |
|
|
978 |
01EE: GOTO 205 |
|
|
979 |
01EF: GOTO 208 |
|
|
980 |
.................... |
|
|
981 |
.................... case 1: d=0x01; |
|
|
982 |
01F0: MOVLW 01 |
|
|
983 |
01F1: MOVWF 69 |
|
|
984 |
.................... |
|
|
985 |
.................... break; |
|
|
986 |
01F2: GOTO 210 |
|
|
987 |
.................... |
|
|
988 |
.................... case 2: d=0x02; |
|
|
989 |
01F3: MOVLW 02 |
|
|
990 |
01F4: MOVWF 69 |
|
|
991 |
.................... |
|
|
992 |
.................... break; |
|
|
993 |
01F5: GOTO 210 |
|
|
994 |
.................... |
|
|
995 |
.................... case 3: d=0x04; |
|
|
996 |
01F6: MOVLW 04 |
|
|
997 |
01F7: MOVWF 69 |
|
|
998 |
.................... |
|
|
999 |
.................... break; |
|
|
1000 |
01F8: GOTO 210 |
|
|
1001 |
.................... |
|
|
1002 |
.................... case 4: d=0x08; |
|
|
1003 |
01F9: MOVLW 08 |
|
|
1004 |
01FA: MOVWF 69 |
|
|
1005 |
.................... |
|
|
1006 |
.................... break; |
|
|
1007 |
01FB: GOTO 210 |
|
|
1008 |
.................... case 5: d=0x10; |
|
|
1009 |
01FC: MOVLW 10 |
|
|
1010 |
01FD: MOVWF 69 |
|
|
1011 |
.................... |
|
|
1012 |
.................... break; |
|
|
1013 |
01FE: GOTO 210 |
|
|
1014 |
.................... |
|
|
1015 |
.................... case 6: d=0x20; |
|
|
1016 |
01FF: MOVLW 20 |
|
|
1017 |
0200: MOVWF 69 |
|
|
1018 |
.................... |
|
|
1019 |
.................... break; |
|
|
1020 |
0201: GOTO 210 |
|
|
1021 |
.................... case 7: d=0x40; |
|
|
1022 |
0202: MOVLW 40 |
|
|
1023 |
0203: MOVWF 69 |
|
|
1024 |
.................... |
|
|
1025 |
.................... break; |
|
|
1026 |
0204: GOTO 210 |
|
|
1027 |
.................... |
|
|
1028 |
.................... case 8: d=0x80; |
|
|
1029 |
0205: MOVLW 80 |
|
|
1030 |
0206: MOVWF 69 |
|
|
1031 |
.................... |
|
|
1032 |
.................... break; |
|
|
1033 |
0207: GOTO 210 |
|
|
1034 |
.................... |
|
|
1035 |
.................... default:printf("chyba"); |
|
|
1036 |
0208: MOVLW 07 |
|
|
1037 |
0209: BSF 03.6 |
|
|
1038 |
020A: MOVWF 0D |
|
|
1039 |
020B: MOVLW 00 |
|
|
1040 |
020C: MOVWF 0F |
|
|
1041 |
020D: BCF 03.6 |
|
|
1042 |
020E: CALL 042 |
|
|
1043 |
.................... |
|
|
1044 |
.................... break; } |
|
|
1045 |
020F: GOTO 210 |
|
|
1046 |
.................... |
|
|
1047 |
.................... i2c_start(); |
|
|
1048 |
0210: BSF 20.4 |
|
|
1049 |
0211: MOVF 20,W |
|
|
1050 |
0212: BSF 03.5 |
|
|
1051 |
0213: MOVWF 07 |
|
|
1052 |
0214: NOP |
|
|
1053 |
0215: BCF 03.5 |
|
|
1054 |
0216: BSF 20.3 |
|
|
1055 |
0217: MOVF 20,W |
|
|
1056 |
0218: BSF 03.5 |
|
|
1057 |
0219: MOVWF 07 |
|
|
1058 |
021A: NOP |
|
|
1059 |
021B: BCF 03.5 |
|
|
1060 |
021C: BCF 07.4 |
|
|
1061 |
021D: BCF 20.4 |
|
|
1062 |
021E: MOVF 20,W |
|
|
1063 |
021F: BSF 03.5 |
|
|
1064 |
0220: MOVWF 07 |
|
|
1065 |
0221: NOP |
|
|
1066 |
0222: BCF 03.5 |
|
|
1067 |
0223: BCF 07.3 |
|
|
1068 |
0224: BCF 20.3 |
|
|
1069 |
0225: MOVF 20,W |
|
|
1070 |
0226: BSF 03.5 |
|
|
1071 |
0227: MOVWF 07 |
|
|
1072 |
.................... I2C_Write(0xE0); |
|
|
1073 |
0228: MOVLW E0 |
|
|
1074 |
0229: MOVWF 71 |
|
|
1075 |
022A: BCF 03.5 |
|
|
1076 |
022B: CALL 18C |
|
|
1077 |
.................... |
|
|
1078 |
.................... I2C_write(d); |
|
|
1079 |
022C: MOVF 69,W |
|
|
1080 |
022D: MOVWF 71 |
|
|
1081 |
022E: CALL 18C |
|
|
1082 |
.................... i2c_stop(); |
|
|
1083 |
022F: BCF 20.4 |
|
|
1084 |
0230: MOVF 20,W |
|
|
1085 |
0231: BSF 03.5 |
|
|
1086 |
0232: MOVWF 07 |
|
|
1087 |
0233: NOP |
|
|
1088 |
0234: BCF 03.5 |
|
|
1089 |
0235: BSF 20.3 |
|
|
1090 |
0236: MOVF 20,W |
|
|
1091 |
0237: BSF 03.5 |
|
|
1092 |
0238: MOVWF 07 |
|
|
1093 |
0239: BCF 03.5 |
|
|
1094 |
023A: BTFSS 07.3 |
|
|
1095 |
023B: GOTO 23A |
|
|
1096 |
023C: NOP |
|
|
1097 |
023D: GOTO 23E |
|
|
1098 |
023E: NOP |
|
|
1099 |
023F: BSF 20.4 |
|
|
1100 |
0240: MOVF 20,W |
|
|
1101 |
0241: BSF 03.5 |
|
|
1102 |
0242: MOVWF 07 |
|
|
1103 |
0243: NOP |
|
|
1104 |
.................... |
|
|
1105 |
.................... } |
|
|
1106 |
0244: BCF 03.5 |
|
|
1107 |
0245: RETURN |
|
|
1108 |
.................... |
|
|
1109 |
.................... //nacitani potrebnych informaci z modulu s baterii |
|
|
1110 |
.................... void batdata(void) |
|
|
1111 |
.................... { |
|
|
1112 |
.................... setHUB(1); |
|
|
1113 |
* |
|
|
1114 |
053C: MOVLW 01 |
|
|
1115 |
053D: MOVWF 69 |
|
|
1116 |
053E: CALL 1D6 |
|
|
1117 |
.................... bat1PROUD=batPROUD(); |
|
|
1118 |
053F: CALL 34C |
|
|
1119 |
0540: MOVF 79,W |
|
|
1120 |
0541: MOVWF 28 |
|
|
1121 |
0542: MOVF 78,W |
|
|
1122 |
0543: MOVWF 27 |
|
|
1123 |
.................... bat1STAV=batSTAV(); |
|
|
1124 |
0544: CALL 35A |
|
|
1125 |
0545: MOVF 79,W |
|
|
1126 |
0546: MOVWF 22 |
|
|
1127 |
0547: MOVF 78,W |
|
|
1128 |
0548: MOVWF 21 |
|
|
1129 |
.................... bat1NAP=batNAP(); |
|
|
1130 |
0549: CALL 368 |
|
|
1131 |
054A: MOVF 79,W |
|
|
1132 |
054B: MOVWF 2E |
|
|
1133 |
054C: MOVF 78,W |
|
|
1134 |
054D: MOVWF 2D |
|
|
1135 |
.................... setHUB(2); |
|
|
1136 |
054E: MOVLW 02 |
|
|
1137 |
054F: MOVWF 69 |
|
|
1138 |
0550: CALL 1D6 |
|
|
1139 |
.................... bat2PROUD=batPROUD(); |
|
|
1140 |
0551: CALL 34C |
|
|
1141 |
0552: MOVF 79,W |
|
|
1142 |
0553: MOVWF 2A |
|
|
1143 |
0554: MOVF 78,W |
|
|
1144 |
0555: MOVWF 29 |
|
|
1145 |
.................... bat2STAV=batSTAV(); |
|
|
1146 |
0556: CALL 35A |
|
|
1147 |
0557: MOVF 79,W |
|
|
1148 |
0558: MOVWF 24 |
|
|
1149 |
0559: MOVF 78,W |
|
|
1150 |
055A: MOVWF 23 |
|
|
1151 |
.................... bat2NAP=batNAP(); |
|
|
1152 |
055B: CALL 368 |
|
|
1153 |
055C: MOVF 79,W |
|
|
1154 |
055D: MOVWF 30 |
|
|
1155 |
055E: MOVF 78,W |
|
|
1156 |
055F: MOVWF 2F |
|
|
1157 |
.................... setHUB(3); |
|
|
1158 |
0560: MOVLW 03 |
|
|
1159 |
0561: MOVWF 69 |
|
|
1160 |
0562: CALL 1D6 |
|
|
1161 |
.................... bat3PROUD=batPROUD(); |
|
|
1162 |
0563: CALL 34C |
|
|
1163 |
0564: MOVF 79,W |
|
|
1164 |
0565: MOVWF 2C |
|
|
1165 |
0566: MOVF 78,W |
|
|
1166 |
0567: MOVWF 2B |
|
|
1167 |
.................... bat3STAV=batSTAV(); |
|
|
1168 |
0568: CALL 35A |
|
|
1169 |
0569: MOVF 79,W |
|
|
1170 |
056A: MOVWF 26 |
|
|
1171 |
056B: MOVF 78,W |
|
|
1172 |
056C: MOVWF 25 |
|
|
1173 |
.................... bat3NAP=batNAP(); |
|
|
1174 |
056D: CALL 368 |
|
|
1175 |
056E: MOVF 79,W |
|
|
1176 |
056F: MOVWF 32 |
|
|
1177 |
0570: MOVF 78,W |
|
|
1178 |
0571: MOVWF 31 |
|
|
1179 |
.................... |
|
|
1180 |
.................... bat1P=(bat1PROUD*(((float)bat1NAP/1000))); |
|
|
1181 |
0572: MOVF 2E,W |
|
|
1182 |
0573: MOVWF 6A |
|
|
1183 |
0574: MOVF 2D,W |
|
|
1184 |
0575: MOVWF 69 |
|
|
1185 |
0576: CALL 376 |
|
|
1186 |
0577: MOVF 77,W |
|
|
1187 |
0578: MOVWF 69 |
|
|
1188 |
0579: MOVF 78,W |
|
|
1189 |
057A: MOVWF 6A |
|
|
1190 |
057B: MOVF 79,W |
|
|
1191 |
057C: MOVWF 6B |
|
|
1192 |
057D: MOVF 7A,W |
|
|
1193 |
057E: MOVWF 6C |
|
|
1194 |
057F: MOVWF 70 |
|
|
1195 |
0580: MOVF 79,W |
|
|
1196 |
0581: MOVWF 6F |
|
|
1197 |
0582: MOVF 78,W |
|
|
1198 |
0583: MOVWF 6E |
|
|
1199 |
0584: MOVF 77,W |
|
|
1200 |
0585: MOVWF 6D |
|
|
1201 |
0586: CLRF 74 |
|
|
1202 |
0587: CLRF 73 |
|
|
1203 |
0588: MOVLW 7A |
|
|
1204 |
0589: MOVWF 72 |
|
|
1205 |
058A: MOVLW 88 |
|
|
1206 |
058B: MOVWF 71 |
|
|
1207 |
058C: CALL 393 |
|
|
1208 |
058D: MOVF 28,W |
|
|
1209 |
058E: MOVWF 6A |
|
|
1210 |
058F: MOVF 27,W |
|
|
1211 |
0590: MOVWF 69 |
|
|
1212 |
0591: MOVF 77,W |
|
|
1213 |
0592: MOVWF 6B |
|
|
1214 |
0593: MOVF 78,W |
|
|
1215 |
0594: MOVWF 6C |
|
|
1216 |
0595: MOVF 79,W |
|
|
1217 |
0596: MOVWF 6D |
|
|
1218 |
0597: MOVF 7A,W |
|
|
1219 |
0598: MOVWF 6E |
|
|
1220 |
0599: MOVF 28,W |
|
|
1221 |
059A: MOVWF 70 |
|
|
1222 |
059B: MOVF 27,W |
|
|
1223 |
059C: MOVWF 6F |
|
|
1224 |
059D: CALL 472 |
|
|
1225 |
059E: MOVF 7A,W |
|
|
1226 |
059F: MOVWF 72 |
|
|
1227 |
05A0: MOVF 79,W |
|
|
1228 |
05A1: MOVWF 71 |
|
|
1229 |
05A2: MOVF 78,W |
|
|
1230 |
05A3: MOVWF 70 |
|
|
1231 |
05A4: MOVF 77,W |
|
|
1232 |
05A5: MOVWF 6F |
|
|
1233 |
05A6: MOVF 6E,W |
|
|
1234 |
05A7: MOVWF 76 |
|
|
1235 |
05A8: MOVF 6D,W |
|
|
1236 |
05A9: MOVWF 75 |
|
|
1237 |
05AA: MOVF 6C,W |
|
|
1238 |
05AB: MOVWF 74 |
|
|
1239 |
05AC: MOVF 6B,W |
|
|
1240 |
05AD: MOVWF 73 |
|
|
1241 |
05AE: CALL 497 |
|
|
1242 |
05AF: MOVF 7A,W |
|
|
1243 |
05B0: MOVWF 72 |
|
|
1244 |
05B1: MOVF 79,W |
|
|
1245 |
05B2: MOVWF 71 |
|
|
1246 |
05B3: MOVF 78,W |
|
|
1247 |
05B4: MOVWF 70 |
|
|
1248 |
05B5: MOVF 77,W |
|
|
1249 |
05B6: MOVWF 6F |
|
|
1250 |
05B7: CALL 51D |
|
|
1251 |
05B8: MOVF 79,W |
|
|
1252 |
05B9: MOVWF 34 |
|
|
1253 |
05BA: MOVF 78,W |
|
|
1254 |
05BB: MOVWF 33 |
|
|
1255 |
.................... bat2P=(bat2PROUD*(((float)bat2NAP/1000))); |
|
|
1256 |
05BC: MOVF 30,W |
|
|
1257 |
05BD: MOVWF 6A |
|
|
1258 |
05BE: MOVF 2F,W |
|
|
1259 |
05BF: MOVWF 69 |
|
|
1260 |
05C0: CALL 376 |
|
|
1261 |
05C1: MOVF 77,W |
|
|
1262 |
05C2: MOVWF 69 |
|
|
1263 |
05C3: MOVF 78,W |
|
|
1264 |
05C4: MOVWF 6A |
|
|
1265 |
05C5: MOVF 79,W |
|
|
1266 |
05C6: MOVWF 6B |
|
|
1267 |
05C7: MOVF 7A,W |
|
|
1268 |
05C8: MOVWF 6C |
|
|
1269 |
05C9: MOVWF 70 |
|
|
1270 |
05CA: MOVF 79,W |
|
|
1271 |
05CB: MOVWF 6F |
|
|
1272 |
05CC: MOVF 78,W |
|
|
1273 |
05CD: MOVWF 6E |
|
|
1274 |
05CE: MOVF 77,W |
|
|
1275 |
05CF: MOVWF 6D |
|
|
1276 |
05D0: CLRF 74 |
|
|
1277 |
05D1: CLRF 73 |
|
|
1278 |
05D2: MOVLW 7A |
|
|
1279 |
05D3: MOVWF 72 |
|
|
1280 |
05D4: MOVLW 88 |
|
|
1281 |
05D5: MOVWF 71 |
|
|
1282 |
05D6: CALL 393 |
|
|
1283 |
05D7: MOVF 2A,W |
|
|
1284 |
05D8: MOVWF 6A |
|
|
1285 |
05D9: MOVF 29,W |
|
|
1286 |
05DA: MOVWF 69 |
|
|
1287 |
05DB: MOVF 77,W |
|
|
1288 |
05DC: MOVWF 6B |
|
|
1289 |
05DD: MOVF 78,W |
|
|
1290 |
05DE: MOVWF 6C |
|
|
1291 |
05DF: MOVF 79,W |
|
|
1292 |
05E0: MOVWF 6D |
|
|
1293 |
05E1: MOVF 7A,W |
|
|
1294 |
05E2: MOVWF 6E |
|
|
1295 |
05E3: MOVF 2A,W |
|
|
1296 |
05E4: MOVWF 70 |
|
|
1297 |
05E5: MOVF 29,W |
|
|
1298 |
05E6: MOVWF 6F |
|
|
1299 |
05E7: CALL 472 |
|
|
1300 |
05E8: MOVF 7A,W |
|
|
1301 |
05E9: MOVWF 72 |
|
|
1302 |
05EA: MOVF 79,W |
|
|
1303 |
05EB: MOVWF 71 |
|
|
1304 |
05EC: MOVF 78,W |
|
|
1305 |
05ED: MOVWF 70 |
|
|
1306 |
05EE: MOVF 77,W |
|
|
1307 |
05EF: MOVWF 6F |
|
|
1308 |
05F0: MOVF 6E,W |
|
|
1309 |
05F1: MOVWF 76 |
|
|
1310 |
05F2: MOVF 6D,W |
|
|
1311 |
05F3: MOVWF 75 |
|
|
1312 |
05F4: MOVF 6C,W |
|
|
1313 |
05F5: MOVWF 74 |
|
|
1314 |
05F6: MOVF 6B,W |
|
|
1315 |
05F7: MOVWF 73 |
|
|
1316 |
05F8: CALL 497 |
|
|
1317 |
05F9: MOVF 7A,W |
|
|
1318 |
05FA: MOVWF 72 |
|
|
1319 |
05FB: MOVF 79,W |
|
|
1320 |
05FC: MOVWF 71 |
|
|
1321 |
05FD: MOVF 78,W |
|
|
1322 |
05FE: MOVWF 70 |
|
|
1323 |
05FF: MOVF 77,W |
|
|
1324 |
0600: MOVWF 6F |
|
|
1325 |
0601: CALL 51D |
|
|
1326 |
0602: MOVF 79,W |
|
|
1327 |
0603: MOVWF 36 |
|
|
1328 |
0604: MOVF 78,W |
|
|
1329 |
0605: MOVWF 35 |
|
|
1330 |
.................... bat3P=(bat3PROUD*(((float)bat3NAP/1000))); |
|
|
1331 |
0606: MOVF 32,W |
|
|
1332 |
0607: MOVWF 6A |
|
|
1333 |
0608: MOVF 31,W |
|
|
1334 |
0609: MOVWF 69 |
|
|
1335 |
060A: CALL 376 |
|
|
1336 |
060B: MOVF 77,W |
|
|
1337 |
060C: MOVWF 69 |
|
|
1338 |
060D: MOVF 78,W |
|
|
1339 |
060E: MOVWF 6A |
|
|
1340 |
060F: MOVF 79,W |
|
|
1341 |
0610: MOVWF 6B |
|
|
1342 |
0611: MOVF 7A,W |
|
|
1343 |
0612: MOVWF 6C |
|
|
1344 |
0613: MOVWF 70 |
|
|
1345 |
0614: MOVF 79,W |
|
|
1346 |
0615: MOVWF 6F |
|
|
1347 |
0616: MOVF 78,W |
|
|
1348 |
0617: MOVWF 6E |
|
|
1349 |
0618: MOVF 77,W |
|
|
1350 |
0619: MOVWF 6D |
|
|
1351 |
061A: CLRF 74 |
|
|
1352 |
061B: CLRF 73 |
|
|
1353 |
061C: MOVLW 7A |
|
|
1354 |
061D: MOVWF 72 |
|
|
1355 |
061E: MOVLW 88 |
|
|
1356 |
061F: MOVWF 71 |
|
|
1357 |
0620: CALL 393 |
|
|
1358 |
0621: MOVF 2C,W |
|
|
1359 |
0622: MOVWF 6A |
|
|
1360 |
0623: MOVF 2B,W |
|
|
1361 |
0624: MOVWF 69 |
|
|
1362 |
0625: MOVF 77,W |
|
|
1363 |
0626: MOVWF 6B |
|
|
1364 |
0627: MOVF 78,W |
|
|
1365 |
0628: MOVWF 6C |
|
|
1366 |
0629: MOVF 79,W |
|
|
1367 |
062A: MOVWF 6D |
|
|
1368 |
062B: MOVF 7A,W |
|
|
1369 |
062C: MOVWF 6E |
|
|
1370 |
062D: MOVF 2C,W |
|
|
1371 |
062E: MOVWF 70 |
|
|
1372 |
062F: MOVF 2B,W |
|
|
1373 |
0630: MOVWF 6F |
|
|
1374 |
0631: CALL 472 |
|
|
1375 |
0632: MOVF 7A,W |
|
|
1376 |
0633: MOVWF 72 |
|
|
1377 |
0634: MOVF 79,W |
|
|
1378 |
0635: MOVWF 71 |
|
|
1379 |
0636: MOVF 78,W |
|
|
1380 |
0637: MOVWF 70 |
|
|
1381 |
0638: MOVF 77,W |
|
|
1382 |
0639: MOVWF 6F |
|
|
1383 |
063A: MOVF 6E,W |
|
|
1384 |
063B: MOVWF 76 |
|
|
1385 |
063C: MOVF 6D,W |
|
|
1386 |
063D: MOVWF 75 |
|
|
1387 |
063E: MOVF 6C,W |
|
|
1388 |
063F: MOVWF 74 |
|
|
1389 |
0640: MOVF 6B,W |
|
|
1390 |
0641: MOVWF 73 |
|
|
1391 |
0642: CALL 497 |
|
|
1392 |
0643: MOVF 7A,W |
|
|
1393 |
0644: MOVWF 72 |
|
|
1394 |
0645: MOVF 79,W |
|
|
1395 |
0646: MOVWF 71 |
|
|
1396 |
0647: MOVF 78,W |
|
|
1397 |
0648: MOVWF 70 |
|
|
1398 |
0649: MOVF 77,W |
|
|
1399 |
064A: MOVWF 6F |
|
|
1400 |
064B: CALL 51D |
|
|
1401 |
064C: MOVF 79,W |
|
|
1402 |
064D: MOVWF 38 |
|
|
1403 |
064E: MOVF 78,W |
|
|
1404 |
064F: MOVWF 37 |
|
|
1405 |
.................... } |
|
|
1406 |
0650: RETURN |
|
|
1407 |
.................... |
|
|
1408 |
.................... |
|
|
1409 |
.................... void main() |
|
|
1410 |
.................... { |
|
|
1411 |
* |
|
|
1412 |
095B: CLRF 04 |
|
|
1413 |
095C: BCF 03.7 |
|
|
1414 |
095D: MOVLW 1F |
|
|
1415 |
095E: ANDWF 03,F |
|
|
1416 |
095F: MOVLW 71 |
|
|
1417 |
0960: BSF 03.5 |
|
|
1418 |
0961: MOVWF 0F |
|
|
1419 |
0962: MOVF 0F,W |
|
|
1420 |
0963: BCF 03.5 |
|
|
1421 |
0964: BCF 20.7 |
|
|
1422 |
0965: MOVF 20,W |
|
|
1423 |
0966: BSF 03.5 |
|
|
1424 |
0967: MOVWF 07 |
|
|
1425 |
0968: BCF 03.5 |
|
|
1426 |
0969: BSF 07.7 |
|
|
1427 |
096A: BSF 03.5 |
|
|
1428 |
096B: BSF 03.6 |
|
|
1429 |
096C: MOVF 09,W |
|
|
1430 |
096D: ANDLW C0 |
|
|
1431 |
096E: MOVWF 09 |
|
|
1432 |
096F: BCF 03.6 |
|
|
1433 |
0970: BCF 1F.4 |
|
|
1434 |
0971: BCF 1F.5 |
|
|
1435 |
0972: MOVLW 00 |
|
|
1436 |
0973: BSF 03.6 |
|
|
1437 |
0974: MOVWF 08 |
|
|
1438 |
0975: BCF 03.5 |
|
|
1439 |
0976: CLRF 07 |
|
|
1440 |
0977: CLRF 08 |
|
|
1441 |
0978: CLRF 09 |
|
|
1442 |
.................... batMODE(1); |
|
|
1443 |
* |
|
|
1444 |
097E: MOVLW 01 |
|
|
1445 |
097F: MOVWF 69 |
|
|
1446 |
0980: BCF 0A.3 |
|
|
1447 |
0981: CALL 088 |
|
|
1448 |
0982: BSF 0A.3 |
|
|
1449 |
.................... float vypocet; |
|
|
1450 |
.................... |
|
|
1451 |
.................... setup_adc_ports(NO_ANALOGS|VSS_VDD); |
|
|
1452 |
0983: BSF 03.5 |
|
|
1453 |
0984: BSF 03.6 |
|
|
1454 |
0985: MOVF 09,W |
|
|
1455 |
0986: ANDLW C0 |
|
|
1456 |
0987: MOVWF 09 |
|
|
1457 |
0988: BCF 03.6 |
|
|
1458 |
0989: BCF 1F.4 |
|
|
1459 |
098A: BCF 1F.5 |
|
|
1460 |
098B: MOVLW 00 |
|
|
1461 |
098C: BSF 03.6 |
|
|
1462 |
098D: MOVWF 08 |
|
|
1463 |
.................... setup_adc(ADC_CLOCK_DIV_2); |
|
|
1464 |
098E: BCF 03.5 |
|
|
1465 |
098F: BCF 03.6 |
|
|
1466 |
0990: BCF 1F.6 |
|
|
1467 |
0991: BCF 1F.7 |
|
|
1468 |
0992: BSF 03.5 |
|
|
1469 |
0993: BCF 1F.7 |
|
|
1470 |
0994: BCF 03.5 |
|
|
1471 |
0995: BSF 1F.0 |
|
|
1472 |
.................... setup_spi(SPI_SS_DISABLED); |
|
|
1473 |
0996: BCF 14.5 |
|
|
1474 |
0997: BCF 20.5 |
|
|
1475 |
0998: MOVF 20,W |
|
|
1476 |
0999: BSF 03.5 |
|
|
1477 |
099A: MOVWF 07 |
|
|
1478 |
099B: BCF 03.5 |
|
|
1479 |
099C: BSF 20.4 |
|
|
1480 |
099D: MOVF 20,W |
|
|
1481 |
099E: BSF 03.5 |
|
|
1482 |
099F: MOVWF 07 |
|
|
1483 |
09A0: BCF 03.5 |
|
|
1484 |
09A1: BCF 20.3 |
|
|
1485 |
09A2: MOVF 20,W |
|
|
1486 |
09A3: BSF 03.5 |
|
|
1487 |
09A4: MOVWF 07 |
|
|
1488 |
09A5: MOVLW 01 |
|
|
1489 |
09A6: BCF 03.5 |
|
|
1490 |
09A7: MOVWF 14 |
|
|
1491 |
09A8: MOVLW 00 |
|
|
1492 |
09A9: BSF 03.5 |
|
|
1493 |
09AA: MOVWF 14 |
|
|
1494 |
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
|
|
1495 |
09AB: MOVF 01,W |
|
|
1496 |
09AC: ANDLW C7 |
|
|
1497 |
09AD: IORLW 08 |
|
|
1498 |
09AE: MOVWF 01 |
|
|
1499 |
.................... setup_timer_1(T1_DISABLED); |
|
|
1500 |
09AF: BCF 03.5 |
|
|
1501 |
09B0: CLRF 10 |
|
|
1502 |
.................... setup_timer_2(T2_DISABLED,0,1); |
|
|
1503 |
09B1: MOVLW 00 |
|
|
1504 |
09B2: MOVWF 78 |
|
|
1505 |
09B3: MOVWF 12 |
|
|
1506 |
09B4: MOVLW 00 |
|
|
1507 |
09B5: BSF 03.5 |
|
|
1508 |
09B6: MOVWF 12 |
|
|
1509 |
.................... setup_ccp1(CCP_OFF); |
|
|
1510 |
09B7: BCF 03.5 |
|
|
1511 |
09B8: BSF 20.2 |
|
|
1512 |
09B9: MOVF 20,W |
|
|
1513 |
09BA: BSF 03.5 |
|
|
1514 |
09BB: MOVWF 07 |
|
|
1515 |
09BC: BCF 03.5 |
|
|
1516 |
09BD: CLRF 17 |
|
|
1517 |
09BE: BSF 03.5 |
|
|
1518 |
09BF: CLRF 1B |
|
|
1519 |
09C0: CLRF 1C |
|
|
1520 |
09C1: MOVLW 01 |
|
|
1521 |
09C2: MOVWF 1D |
|
|
1522 |
.................... setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard |
|
|
1523 |
09C3: BCF 03.5 |
|
|
1524 |
09C4: BSF 03.6 |
|
|
1525 |
09C5: CLRF 07 |
|
|
1526 |
09C6: CLRF 08 |
|
|
1527 |
09C7: CLRF 09 |
|
|
1528 |
.................... |
|
|
1529 |
.................... batMODE(1); |
|
|
1530 |
09C8: BCF 03.6 |
|
|
1531 |
09C9: MOVWF 69 |
|
|
1532 |
09CA: BCF 0A.3 |
|
|
1533 |
09CB: CALL 088 |
|
|
1534 |
09CC: BSF 0A.3 |
|
|
1535 |
.................... |
|
|
1536 |
.................... |
|
|
1537 |
.................... //printf("STAV1 STAV2 STAV3 VYKON1 VYKON2 VYKON3\r\n"); |
|
|
1538 |
.................... while(TRUE) |
|
|
1539 |
.................... { |
|
|
1540 |
.................... |
|
|
1541 |
.................... batdata(); |
|
|
1542 |
09CD: BCF 0A.3 |
|
|
1543 |
09CE: CALL 53C |
|
|
1544 |
09CF: BSF 0A.3 |
|
|
1545 |
.................... //nastane pri nedostatku energie v hl. akumulátoru |
|
|
1546 |
.................... while(bat1STAV<20) |
|
|
1547 |
.................... { |
|
|
1548 |
09D0: MOVF 22,F |
|
|
1549 |
09D1: BTFSS 03.2 |
|
|
1550 |
09D2: GOTO 26C |
|
|
1551 |
09D3: MOVF 21,W |
|
|
1552 |
09D4: SUBLW 13 |
|
|
1553 |
09D5: BTFSS 03.0 |
|
|
1554 |
09D6: GOTO 26C |
|
|
1555 |
.................... //printf("nedostatek energie\r\n"); |
|
|
1556 |
.................... if(bat2STAV>10) |
|
|
1557 |
09D7: MOVF 24,F |
|
|
1558 |
09D8: BTFSS 03.2 |
|
|
1559 |
09D9: GOTO 1DE |
|
|
1560 |
09DA: MOVF 23,W |
|
|
1561 |
09DB: SUBLW 0A |
|
|
1562 |
09DC: BTFSC 03.0 |
|
|
1563 |
09DD: GOTO 1E4 |
|
|
1564 |
.................... { |
|
|
1565 |
.................... batMODE(3); |
|
|
1566 |
09DE: MOVLW 03 |
|
|
1567 |
09DF: MOVWF 69 |
|
|
1568 |
09E0: BCF 0A.3 |
|
|
1569 |
09E1: CALL 088 |
|
|
1570 |
09E2: BSF 0A.3 |
|
|
1571 |
.................... } |
|
|
1572 |
.................... else |
|
|
1573 |
09E3: GOTO 1F6 |
|
|
1574 |
.................... { |
|
|
1575 |
.................... if(bat3STAV>10) |
|
|
1576 |
09E4: MOVF 26,F |
|
|
1577 |
09E5: BTFSS 03.2 |
|
|
1578 |
09E6: GOTO 1EB |
|
|
1579 |
09E7: MOVF 25,W |
|
|
1580 |
09E8: SUBLW 0A |
|
|
1581 |
09E9: BTFSC 03.0 |
|
|
1582 |
09EA: GOTO 1F1 |
|
|
1583 |
.................... { |
|
|
1584 |
.................... batMODE(2); |
|
|
1585 |
09EB: MOVLW 02 |
|
|
1586 |
09EC: MOVWF 69 |
|
|
1587 |
09ED: BCF 0A.3 |
|
|
1588 |
09EE: CALL 088 |
|
|
1589 |
09EF: BSF 0A.3 |
|
|
1590 |
.................... } |
|
|
1591 |
.................... else |
|
|
1592 |
09F0: GOTO 1F6 |
|
|
1593 |
.................... { |
|
|
1594 |
.................... batMODE(4); |
|
|
1595 |
09F1: MOVLW 04 |
|
|
1596 |
09F2: MOVWF 69 |
|
|
1597 |
09F3: BCF 0A.3 |
|
|
1598 |
09F4: CALL 088 |
|
|
1599 |
09F5: BSF 0A.3 |
|
|
1600 |
.................... } |
|
|
1601 |
.................... } |
|
|
1602 |
.................... batdata(); |
|
|
1603 |
09F6: BCF 0A.3 |
|
|
1604 |
09F7: CALL 53C |
|
|
1605 |
09F8: BSF 0A.3 |
|
|
1606 |
.................... sprintf(baterka, " %3.0Ld %3.0Ld %3.0Ld %5.0Ld %5.0Ld %5.0Ld %5.0Ld", bat1STAV, bat2STAV, bat3STAV, bat1P, bat2P, bat3P, 0); |
|
|
1607 |
09F9: CLRF 64 |
|
|
1608 |
09FA: MOVLW 3B |
|
|
1609 |
09FB: MOVWF 63 |
|
|
1610 |
09FC: MOVLW 20 |
|
|
1611 |
09FD: MOVWF 72 |
|
|
1612 |
09FE: BCF 0A.3 |
|
|
1613 |
09FF: CALL 651 |
|
|
1614 |
0A00: BSF 0A.3 |
|
|
1615 |
0A01: MOVLW 03 |
|
|
1616 |
0A02: MOVWF 04 |
|
|
1617 |
0A03: MOVF 22,W |
|
|
1618 |
0A04: MOVWF 6A |
|
|
1619 |
0A05: MOVF 21,W |
|
|
1620 |
0A06: MOVWF 69 |
|
|
1621 |
0A07: BCF 0A.3 |
|
|
1622 |
0A08: CALL 65E |
|
|
1623 |
0A09: BSF 0A.3 |
|
|
1624 |
0A0A: MOVLW 20 |
|
|
1625 |
0A0B: MOVWF 72 |
|
|
1626 |
0A0C: BCF 0A.3 |
|
|
1627 |
0A0D: CALL 651 |
|
|
1628 |
0A0E: BSF 0A.3 |
|
|
1629 |
0A0F: MOVLW 03 |
|
|
1630 |
0A10: MOVWF 04 |
|
|
1631 |
0A11: MOVF 24,W |
|
|
1632 |
0A12: MOVWF 6A |
|
|
1633 |
0A13: MOVF 23,W |
|
|
1634 |
0A14: MOVWF 69 |
|
|
1635 |
0A15: BCF 0A.3 |
|
|
1636 |
0A16: CALL 65E |
|
|
1637 |
0A17: BSF 0A.3 |
|
|
1638 |
0A18: MOVLW 20 |
|
|
1639 |
0A19: MOVWF 72 |
|
|
1640 |
0A1A: BCF 0A.3 |
|
|
1641 |
0A1B: CALL 651 |
|
|
1642 |
0A1C: BSF 0A.3 |
|
|
1643 |
0A1D: MOVLW 03 |
|
|
1644 |
0A1E: MOVWF 04 |
|
|
1645 |
0A1F: MOVF 26,W |
|
|
1646 |
0A20: MOVWF 6A |
|
|
1647 |
0A21: MOVF 25,W |
|
|
1648 |
0A22: MOVWF 69 |
|
|
1649 |
0A23: BCF 0A.3 |
|
|
1650 |
0A24: CALL 65E |
|
|
1651 |
0A25: BSF 0A.3 |
|
|
1652 |
0A26: MOVLW 20 |
|
|
1653 |
0A27: MOVWF 72 |
|
|
1654 |
0A28: BCF 0A.3 |
|
|
1655 |
0A29: CALL 651 |
|
|
1656 |
0A2A: BSF 0A.3 |
|
|
1657 |
0A2B: MOVLW 01 |
|
|
1658 |
0A2C: MOVWF 04 |
|
|
1659 |
0A2D: MOVF 34,W |
|
|
1660 |
0A2E: MOVWF 6A |
|
|
1661 |
0A2F: MOVF 33,W |
|
|
1662 |
0A30: MOVWF 69 |
|
|
1663 |
0A31: BCF 0A.3 |
|
|
1664 |
0A32: CALL 65E |
|
|
1665 |
0A33: BSF 0A.3 |
|
|
1666 |
0A34: MOVLW 20 |
|
|
1667 |
0A35: MOVWF 72 |
|
|
1668 |
0A36: BCF 0A.3 |
|
|
1669 |
0A37: CALL 651 |
|
|
1670 |
0A38: BSF 0A.3 |
|
|
1671 |
0A39: MOVLW 01 |
|
|
1672 |
0A3A: MOVWF 04 |
|
|
1673 |
0A3B: MOVF 36,W |
|
|
1674 |
0A3C: MOVWF 6A |
|
|
1675 |
0A3D: MOVF 35,W |
|
|
1676 |
0A3E: MOVWF 69 |
|
|
1677 |
0A3F: BCF 0A.3 |
|
|
1678 |
0A40: CALL 65E |
|
|
1679 |
0A41: BSF 0A.3 |
|
|
1680 |
0A42: MOVLW 20 |
|
|
1681 |
0A43: MOVWF 72 |
|
|
1682 |
0A44: BCF 0A.3 |
|
|
1683 |
0A45: CALL 651 |
|
|
1684 |
0A46: BSF 0A.3 |
|
|
1685 |
0A47: MOVLW 01 |
|
|
1686 |
0A48: MOVWF 04 |
|
|
1687 |
0A49: MOVF 38,W |
|
|
1688 |
0A4A: MOVWF 6A |
|
|
1689 |
0A4B: MOVF 37,W |
|
|
1690 |
0A4C: MOVWF 69 |
|
|
1691 |
0A4D: BCF 0A.3 |
|
|
1692 |
0A4E: CALL 65E |
|
|
1693 |
0A4F: BSF 0A.3 |
|
|
1694 |
0A50: MOVLW 20 |
|
|
1695 |
0A51: MOVWF 72 |
|
|
1696 |
0A52: BCF 0A.3 |
|
|
1697 |
0A53: CALL 651 |
|
|
1698 |
0A54: BSF 0A.3 |
|
|
1699 |
0A55: MOVLW 01 |
|
|
1700 |
0A56: MOVWF 04 |
|
|
1701 |
0A57: CLRF 6A |
|
|
1702 |
0A58: CLRF 69 |
|
|
1703 |
0A59: BCF 0A.3 |
|
|
1704 |
0A5A: CALL 65E |
|
|
1705 |
0A5B: BSF 0A.3 |
|
|
1706 |
.................... printf(baterka); |
|
|
1707 |
0A5C: MOVLW 3B |
|
|
1708 |
0A5D: MOVWF 04 |
|
|
1709 |
0A5E: BCF 03.7 |
|
|
1710 |
0A5F: BCF 0A.3 |
|
|
1711 |
0A60: CALL 6DE |
|
|
1712 |
0A61: BSF 0A.3 |
|
|
1713 |
.................... delay_ms(5000); |
|
|
1714 |
0A62: MOVLW 14 |
|
|
1715 |
0A63: MOVWF 69 |
|
|
1716 |
0A64: MOVLW FA |
|
|
1717 |
0A65: MOVWF 6A |
|
|
1718 |
0A66: BCF 0A.3 |
|
|
1719 |
0A67: CALL 00A |
|
|
1720 |
0A68: BSF 0A.3 |
|
|
1721 |
0A69: DECFSZ 69,F |
|
|
1722 |
0A6A: GOTO 264 |
|
|
1723 |
.................... } |
|
|
1724 |
0A6B: GOTO 1D0 |
|
|
1725 |
.................... |
|
|
1726 |
.................... //osetreni proti prebiti clanku |
|
|
1727 |
.................... while(bat2STAV>96) |
|
|
1728 |
.................... { |
|
|
1729 |
0A6C: MOVF 24,F |
|
|
1730 |
0A6D: BTFSS 03.2 |
|
|
1731 |
0A6E: GOTO 273 |
|
|
1732 |
0A6F: MOVF 23,W |
|
|
1733 |
0A70: SUBLW 60 |
|
|
1734 |
0A71: BTFSC 03.0 |
|
|
1735 |
0A72: GOTO 301 |
|
|
1736 |
.................... //printf("bat2 prebita"); |
|
|
1737 |
.................... if(bat1STAV>98) |
|
|
1738 |
0A73: MOVF 22,F |
|
|
1739 |
0A74: BTFSS 03.2 |
|
|
1740 |
0A75: GOTO 27A |
|
|
1741 |
0A76: MOVF 21,W |
|
|
1742 |
0A77: SUBLW 62 |
|
|
1743 |
0A78: BTFSC 03.0 |
|
|
1744 |
0A79: GOTO 280 |
|
|
1745 |
.................... { |
|
|
1746 |
.................... batMODE(6); //vybijeni do rezistoru |
|
|
1747 |
0A7A: MOVLW 06 |
|
|
1748 |
0A7B: MOVWF 69 |
|
|
1749 |
0A7C: BCF 0A.3 |
|
|
1750 |
0A7D: CALL 088 |
|
|
1751 |
0A7E: BSF 0A.3 |
|
|
1752 |
.................... } |
|
|
1753 |
.................... else |
|
|
1754 |
0A7F: GOTO 285 |
|
|
1755 |
.................... { |
|
|
1756 |
.................... batMODE(3); //nabijeni hl. akumulatoru |
|
|
1757 |
0A80: MOVLW 03 |
|
|
1758 |
0A81: MOVWF 69 |
|
|
1759 |
0A82: BCF 0A.3 |
|
|
1760 |
0A83: CALL 088 |
|
|
1761 |
0A84: BSF 0A.3 |
|
|
1762 |
.................... } |
|
|
1763 |
.................... |
|
|
1764 |
.................... batdata(); |
|
|
1765 |
0A85: BCF 0A.3 |
|
|
1766 |
0A86: CALL 53C |
|
|
1767 |
0A87: BSF 0A.3 |
|
|
1768 |
.................... sprintf(baterka, " %3.0Ld %3.0Ld %3.0Ld %5.0Ld %5.0Ld %5.0Ld %5.0Ld", bat1STAV, bat2STAV, bat3STAV, bat1P, bat2P, bat3P, 0); |
|
|
1769 |
0A88: CLRF 64 |
|
|
1770 |
0A89: MOVLW 3B |
|
|
1771 |
0A8A: MOVWF 63 |
|
|
1772 |
0A8B: MOVLW 20 |
|
|
1773 |
0A8C: MOVWF 72 |
|
|
1774 |
0A8D: BCF 0A.3 |
|
|
1775 |
0A8E: CALL 651 |
|
|
1776 |
0A8F: BSF 0A.3 |
|
|
1777 |
0A90: MOVLW 03 |
|
|
1778 |
0A91: MOVWF 04 |
|
|
1779 |
0A92: MOVF 22,W |
|
|
1780 |
0A93: MOVWF 6A |
|
|
1781 |
0A94: MOVF 21,W |
|
|
1782 |
0A95: MOVWF 69 |
|
|
1783 |
0A96: BCF 0A.3 |
|
|
1784 |
0A97: CALL 65E |
|
|
1785 |
0A98: BSF 0A.3 |
|
|
1786 |
0A99: MOVLW 20 |
|
|
1787 |
0A9A: MOVWF 72 |
|
|
1788 |
0A9B: BCF 0A.3 |
|
|
1789 |
0A9C: CALL 651 |
|
|
1790 |
0A9D: BSF 0A.3 |
|
|
1791 |
0A9E: MOVLW 03 |
|
|
1792 |
0A9F: MOVWF 04 |
|
|
1793 |
0AA0: MOVF 24,W |
|
|
1794 |
0AA1: MOVWF 6A |
|
|
1795 |
0AA2: MOVF 23,W |
|
|
1796 |
0AA3: MOVWF 69 |
|
|
1797 |
0AA4: BCF 0A.3 |
|
|
1798 |
0AA5: CALL 65E |
|
|
1799 |
0AA6: BSF 0A.3 |
|
|
1800 |
0AA7: MOVLW 20 |
|
|
1801 |
0AA8: MOVWF 72 |
|
|
1802 |
0AA9: BCF 0A.3 |
|
|
1803 |
0AAA: CALL 651 |
|
|
1804 |
0AAB: BSF 0A.3 |
|
|
1805 |
0AAC: MOVLW 03 |
|
|
1806 |
0AAD: MOVWF 04 |
|
|
1807 |
0AAE: MOVF 26,W |
|
|
1808 |
0AAF: MOVWF 6A |
|
|
1809 |
0AB0: MOVF 25,W |
|
|
1810 |
0AB1: MOVWF 69 |
|
|
1811 |
0AB2: BCF 0A.3 |
|
|
1812 |
0AB3: CALL 65E |
|
|
1813 |
0AB4: BSF 0A.3 |
|
|
1814 |
0AB5: MOVLW 20 |
|
|
1815 |
0AB6: MOVWF 72 |
|
|
1816 |
0AB7: BCF 0A.3 |
|
|
1817 |
0AB8: CALL 651 |
|
|
1818 |
0AB9: BSF 0A.3 |
|
|
1819 |
0ABA: MOVLW 01 |
|
|
1820 |
0ABB: MOVWF 04 |
|
|
1821 |
0ABC: MOVF 34,W |
|
|
1822 |
0ABD: MOVWF 6A |
|
|
1823 |
0ABE: MOVF 33,W |
|
|
1824 |
0ABF: MOVWF 69 |
|
|
1825 |
0AC0: BCF 0A.3 |
|
|
1826 |
0AC1: CALL 65E |
|
|
1827 |
0AC2: BSF 0A.3 |
|
|
1828 |
0AC3: MOVLW 20 |
|
|
1829 |
0AC4: MOVWF 72 |
|
|
1830 |
0AC5: BCF 0A.3 |
|
|
1831 |
0AC6: CALL 651 |
|
|
1832 |
0AC7: BSF 0A.3 |
|
|
1833 |
0AC8: MOVLW 01 |
|
|
1834 |
0AC9: MOVWF 04 |
|
|
1835 |
0ACA: MOVF 36,W |
|
|
1836 |
0ACB: MOVWF 6A |
|
|
1837 |
0ACC: MOVF 35,W |
|
|
1838 |
0ACD: MOVWF 69 |
|
|
1839 |
0ACE: BCF 0A.3 |
|
|
1840 |
0ACF: CALL 65E |
|
|
1841 |
0AD0: BSF 0A.3 |
|
|
1842 |
0AD1: MOVLW 20 |
|
|
1843 |
0AD2: MOVWF 72 |
|
|
1844 |
0AD3: BCF 0A.3 |
|
|
1845 |
0AD4: CALL 651 |
|
|
1846 |
0AD5: BSF 0A.3 |
|
|
1847 |
0AD6: MOVLW 01 |
|
|
1848 |
0AD7: MOVWF 04 |
|
|
1849 |
0AD8: MOVF 38,W |
|
|
1850 |
0AD9: MOVWF 6A |
|
|
1851 |
0ADA: MOVF 37,W |
|
|
1852 |
0ADB: MOVWF 69 |
|
|
1853 |
0ADC: BCF 0A.3 |
|
|
1854 |
0ADD: CALL 65E |
|
|
1855 |
0ADE: BSF 0A.3 |
|
|
1856 |
0ADF: MOVLW 20 |
|
|
1857 |
0AE0: MOVWF 72 |
|
|
1858 |
0AE1: BCF 0A.3 |
|
|
1859 |
0AE2: CALL 651 |
|
|
1860 |
0AE3: BSF 0A.3 |
|
|
1861 |
0AE4: MOVLW 01 |
|
|
1862 |
0AE5: MOVWF 04 |
|
|
1863 |
0AE6: CLRF 6A |
|
|
1864 |
0AE7: CLRF 69 |
|
|
1865 |
0AE8: BCF 0A.3 |
|
|
1866 |
0AE9: CALL 65E |
|
|
1867 |
0AEA: BSF 0A.3 |
|
|
1868 |
.................... printf(baterka); |
|
|
1869 |
0AEB: MOVLW 3B |
|
|
1870 |
0AEC: MOVWF 04 |
|
|
1871 |
0AED: BCF 03.7 |
|
|
1872 |
0AEE: BCF 0A.3 |
|
|
1873 |
0AEF: CALL 6DE |
|
|
1874 |
0AF0: BSF 0A.3 |
|
|
1875 |
.................... bat2STAV=bat2STAV-2; |
|
|
1876 |
0AF1: MOVLW 02 |
|
|
1877 |
0AF2: SUBWF 23,F |
|
|
1878 |
0AF3: MOVLW 00 |
|
|
1879 |
0AF4: BTFSS 03.0 |
|
|
1880 |
0AF5: MOVLW 01 |
|
|
1881 |
0AF6: SUBWF 24,F |
|
|
1882 |
.................... delay_ms(5000); |
|
|
1883 |
0AF7: MOVLW 14 |
|
|
1884 |
0AF8: MOVWF 69 |
|
|
1885 |
0AF9: MOVLW FA |
|
|
1886 |
0AFA: MOVWF 6A |
|
|
1887 |
0AFB: BCF 0A.3 |
|
|
1888 |
0AFC: CALL 00A |
|
|
1889 |
0AFD: BSF 0A.3 |
|
|
1890 |
0AFE: DECFSZ 69,F |
|
|
1891 |
0AFF: GOTO 2F9 |
|
|
1892 |
.................... } |
|
|
1893 |
0B00: GOTO 26C |
|
|
1894 |
.................... |
|
|
1895 |
.................... while(bat3STAV>96) |
|
|
1896 |
.................... { |
|
|
1897 |
0B01: MOVF 26,F |
|
|
1898 |
0B02: BTFSS 03.2 |
|
|
1899 |
0B03: GOTO 308 |
|
|
1900 |
0B04: MOVF 25,W |
|
|
1901 |
0B05: SUBLW 60 |
|
|
1902 |
0B06: BTFSC 03.0 |
|
|
1903 |
0B07: GOTO 396 |
|
|
1904 |
.................... //printf("bat3 prebyta\r\n"); |
|
|
1905 |
.................... if(bat1STAV>98) |
|
|
1906 |
0B08: MOVF 22,F |
|
|
1907 |
0B09: BTFSS 03.2 |
|
|
1908 |
0B0A: GOTO 30F |
|
|
1909 |
0B0B: MOVF 21,W |
|
|
1910 |
0B0C: SUBLW 62 |
|
|
1911 |
0B0D: BTFSC 03.0 |
|
|
1912 |
0B0E: GOTO 315 |
|
|
1913 |
.................... { |
|
|
1914 |
.................... batMODE(5); //vybijeni do rezistoru |
|
|
1915 |
0B0F: MOVLW 05 |
|
|
1916 |
0B10: MOVWF 69 |
|
|
1917 |
0B11: BCF 0A.3 |
|
|
1918 |
0B12: CALL 088 |
|
|
1919 |
0B13: BSF 0A.3 |
|
|
1920 |
.................... } |
|
|
1921 |
.................... else |
|
|
1922 |
0B14: GOTO 31A |
|
|
1923 |
.................... { |
|
|
1924 |
.................... batMODE(2); //vybijeni do hl. akumulatoru |
|
|
1925 |
0B15: MOVLW 02 |
|
|
1926 |
0B16: MOVWF 69 |
|
|
1927 |
0B17: BCF 0A.3 |
|
|
1928 |
0B18: CALL 088 |
|
|
1929 |
0B19: BSF 0A.3 |
|
|
1930 |
.................... } |
|
|
1931 |
.................... |
|
|
1932 |
.................... batdata(); |
|
|
1933 |
0B1A: BCF 0A.3 |
|
|
1934 |
0B1B: CALL 53C |
|
|
1935 |
0B1C: BSF 0A.3 |
|
|
1936 |
.................... sprintf(baterka, " %3.0Ld %3.0Ld %3.0Ld %5.0Ld %5.0Ld %5.0Ld %5.0Ld", bat1STAV, bat2STAV, bat3STAV, bat1P, bat2P, bat3P, 0); |
|
|
1937 |
0B1D: CLRF 64 |
|
|
1938 |
0B1E: MOVLW 3B |
|
|
1939 |
0B1F: MOVWF 63 |
|
|
1940 |
0B20: MOVLW 20 |
|
|
1941 |
0B21: MOVWF 72 |
|
|
1942 |
0B22: BCF 0A.3 |
|
|
1943 |
0B23: CALL 651 |
|
|
1944 |
0B24: BSF 0A.3 |
|
|
1945 |
0B25: MOVLW 03 |
|
|
1946 |
0B26: MOVWF 04 |
|
|
1947 |
0B27: MOVF 22,W |
|
|
1948 |
0B28: MOVWF 6A |
|
|
1949 |
0B29: MOVF 21,W |
|
|
1950 |
0B2A: MOVWF 69 |
|
|
1951 |
0B2B: BCF 0A.3 |
|
|
1952 |
0B2C: CALL 65E |
|
|
1953 |
0B2D: BSF 0A.3 |
|
|
1954 |
0B2E: MOVLW 20 |
|
|
1955 |
0B2F: MOVWF 72 |
|
|
1956 |
0B30: BCF 0A.3 |
|
|
1957 |
0B31: CALL 651 |
|
|
1958 |
0B32: BSF 0A.3 |
|
|
1959 |
0B33: MOVLW 03 |
|
|
1960 |
0B34: MOVWF 04 |
|
|
1961 |
0B35: MOVF 24,W |
|
|
1962 |
0B36: MOVWF 6A |
|
|
1963 |
0B37: MOVF 23,W |
|
|
1964 |
0B38: MOVWF 69 |
|
|
1965 |
0B39: BCF 0A.3 |
|
|
1966 |
0B3A: CALL 65E |
|
|
1967 |
0B3B: BSF 0A.3 |
|
|
1968 |
0B3C: MOVLW 20 |
|
|
1969 |
0B3D: MOVWF 72 |
|
|
1970 |
0B3E: BCF 0A.3 |
|
|
1971 |
0B3F: CALL 651 |
|
|
1972 |
0B40: BSF 0A.3 |
|
|
1973 |
0B41: MOVLW 03 |
|
|
1974 |
0B42: MOVWF 04 |
|
|
1975 |
0B43: MOVF 26,W |
|
|
1976 |
0B44: MOVWF 6A |
|
|
1977 |
0B45: MOVF 25,W |
|
|
1978 |
0B46: MOVWF 69 |
|
|
1979 |
0B47: BCF 0A.3 |
|
|
1980 |
0B48: CALL 65E |
|
|
1981 |
0B49: BSF 0A.3 |
|
|
1982 |
0B4A: MOVLW 20 |
|
|
1983 |
0B4B: MOVWF 72 |
|
|
1984 |
0B4C: BCF 0A.3 |
|
|
1985 |
0B4D: CALL 651 |
|
|
1986 |
0B4E: BSF 0A.3 |
|
|
1987 |
0B4F: MOVLW 01 |
|
|
1988 |
0B50: MOVWF 04 |
|
|
1989 |
0B51: MOVF 34,W |
|
|
1990 |
0B52: MOVWF 6A |
|
|
1991 |
0B53: MOVF 33,W |
|
|
1992 |
0B54: MOVWF 69 |
|
|
1993 |
0B55: BCF 0A.3 |
|
|
1994 |
0B56: CALL 65E |
|
|
1995 |
0B57: BSF 0A.3 |
|
|
1996 |
0B58: MOVLW 20 |
|
|
1997 |
0B59: MOVWF 72 |
|
|
1998 |
0B5A: BCF 0A.3 |
|
|
1999 |
0B5B: CALL 651 |
|
|
2000 |
0B5C: BSF 0A.3 |
|
|
2001 |
0B5D: MOVLW 01 |
|
|
2002 |
0B5E: MOVWF 04 |
|
|
2003 |
0B5F: MOVF 36,W |
|
|
2004 |
0B60: MOVWF 6A |
|
|
2005 |
0B61: MOVF 35,W |
|
|
2006 |
0B62: MOVWF 69 |
|
|
2007 |
0B63: BCF 0A.3 |
|
|
2008 |
0B64: CALL 65E |
|
|
2009 |
0B65: BSF 0A.3 |
|
|
2010 |
0B66: MOVLW 20 |
|
|
2011 |
0B67: MOVWF 72 |
|
|
2012 |
0B68: BCF 0A.3 |
|
|
2013 |
0B69: CALL 651 |
|
|
2014 |
0B6A: BSF 0A.3 |
|
|
2015 |
0B6B: MOVLW 01 |
|
|
2016 |
0B6C: MOVWF 04 |
|
|
2017 |
0B6D: MOVF 38,W |
|
|
2018 |
0B6E: MOVWF 6A |
|
|
2019 |
0B6F: MOVF 37,W |
|
|
2020 |
0B70: MOVWF 69 |
|
|
2021 |
0B71: BCF 0A.3 |
|
|
2022 |
0B72: CALL 65E |
|
|
2023 |
0B73: BSF 0A.3 |
|
|
2024 |
0B74: MOVLW 20 |
|
|
2025 |
0B75: MOVWF 72 |
|
|
2026 |
0B76: BCF 0A.3 |
|
|
2027 |
0B77: CALL 651 |
|
|
2028 |
0B78: BSF 0A.3 |
|
|
2029 |
0B79: MOVLW 01 |
|
|
2030 |
0B7A: MOVWF 04 |
|
|
2031 |
0B7B: CLRF 6A |
|
|
2032 |
0B7C: CLRF 69 |
|
|
2033 |
0B7D: BCF 0A.3 |
|
|
2034 |
0B7E: CALL 65E |
|
|
2035 |
0B7F: BSF 0A.3 |
|
|
2036 |
.................... printf(baterka); |
|
|
2037 |
0B80: MOVLW 3B |
|
|
2038 |
0B81: MOVWF 04 |
|
|
2039 |
0B82: BCF 03.7 |
|
|
2040 |
0B83: BCF 0A.3 |
|
|
2041 |
0B84: CALL 6DE |
|
|
2042 |
0B85: BSF 0A.3 |
|
|
2043 |
.................... bat3STAV=bat3STAV-2; |
|
|
2044 |
0B86: MOVLW 02 |
|
|
2045 |
0B87: SUBWF 25,F |
|
|
2046 |
0B88: MOVLW 00 |
|
|
2047 |
0B89: BTFSS 03.0 |
|
|
2048 |
0B8A: MOVLW 01 |
|
|
2049 |
0B8B: SUBWF 26,F |
|
|
2050 |
.................... delay_ms(5000); |
|
|
2051 |
0B8C: MOVLW 14 |
|
|
2052 |
0B8D: MOVWF 69 |
|
|
2053 |
0B8E: MOVLW FA |
|
|
2054 |
0B8F: MOVWF 6A |
|
|
2055 |
0B90: BCF 0A.3 |
|
|
2056 |
0B91: CALL 00A |
|
|
2057 |
0B92: BSF 0A.3 |
|
|
2058 |
0B93: DECFSZ 69,F |
|
|
2059 |
0B94: GOTO 38E |
|
|
2060 |
.................... } |
|
|
2061 |
0B95: GOTO 301 |
|
|
2062 |
.................... |
|
|
2063 |
.................... while(input(NOC)==1) //nastane pri zapadu Slunce |
|
|
2064 |
.................... { |
|
|
2065 |
0B96: BSF 03.5 |
|
|
2066 |
0B97: BSF 06.1 |
|
|
2067 |
0B98: BCF 03.5 |
|
|
2068 |
0B99: BTFSS 06.1 |
|
|
2069 |
0B9A: GOTO 45D |
|
|
2070 |
.................... //printf("noc\r\n"); |
|
|
2071 |
.................... batdata(); |
|
|
2072 |
0B9B: BCF 0A.3 |
|
|
2073 |
0B9C: CALL 53C |
|
|
2074 |
0B9D: BSF 0A.3 |
|
|
2075 |
.................... |
|
|
2076 |
.................... if(bat1STAV<98) //dobiti hl. akumulatoru |
|
|
2077 |
0B9E: MOVF 22,F |
|
|
2078 |
0B9F: BTFSS 03.2 |
|
|
2079 |
0BA0: GOTO 3C8 |
|
|
2080 |
0BA1: MOVF 21,W |
|
|
2081 |
0BA2: SUBLW 61 |
|
|
2082 |
0BA3: BTFSS 03.0 |
|
|
2083 |
0BA4: GOTO 3C8 |
|
|
2084 |
.................... { |
|
|
2085 |
.................... |
|
|
2086 |
.................... if(bat2STAV>20) |
|
|
2087 |
0BA5: MOVF 24,F |
|
|
2088 |
0BA6: BTFSS 03.2 |
|
|
2089 |
0BA7: GOTO 3AC |
|
|
2090 |
0BA8: MOVF 23,W |
|
|
2091 |
0BA9: SUBLW 14 |
|
|
2092 |
0BAA: BTFSC 03.0 |
|
|
2093 |
0BAB: GOTO 3B2 |
|
|
2094 |
.................... { |
|
|
2095 |
.................... batMODE(3); |
|
|
2096 |
0BAC: MOVLW 03 |
|
|
2097 |
0BAD: MOVWF 69 |
|
|
2098 |
0BAE: BCF 0A.3 |
|
|
2099 |
0BAF: CALL 088 |
|
|
2100 |
0BB0: BSF 0A.3 |
|
|
2101 |
.................... } |
|
|
2102 |
.................... else |
|
|
2103 |
0BB1: GOTO 3C4 |
|
|
2104 |
.................... { |
|
|
2105 |
.................... |
|
|
2106 |
.................... if(bat3STAV>20) |
|
|
2107 |
0BB2: MOVF 26,F |
|
|
2108 |
0BB3: BTFSS 03.2 |
|
|
2109 |
0BB4: GOTO 3B9 |
|
|
2110 |
0BB5: MOVF 25,W |
|
|
2111 |
0BB6: SUBLW 14 |
|
|
2112 |
0BB7: BTFSC 03.0 |
|
|
2113 |
0BB8: GOTO 3BF |
|
|
2114 |
.................... { |
|
|
2115 |
.................... batMODE(2); |
|
|
2116 |
0BB9: MOVLW 02 |
|
|
2117 |
0BBA: MOVWF 69 |
|
|
2118 |
0BBB: BCF 0A.3 |
|
|
2119 |
0BBC: CALL 088 |
|
|
2120 |
0BBD: BSF 0A.3 |
|
|
2121 |
.................... } |
|
|
2122 |
.................... else |
|
|
2123 |
0BBE: GOTO 3C4 |
|
|
2124 |
.................... { |
|
|
2125 |
.................... batMODE(1); |
|
|
2126 |
0BBF: MOVLW 01 |
|
|
2127 |
0BC0: MOVWF 69 |
|
|
2128 |
0BC1: BCF 0A.3 |
|
|
2129 |
0BC2: CALL 088 |
|
|
2130 |
0BC3: BSF 0A.3 |
|
|
2131 |
.................... } |
|
|
2132 |
.................... |
|
|
2133 |
.................... } |
|
|
2134 |
.................... batdata(); |
|
|
2135 |
0BC4: BCF 0A.3 |
|
|
2136 |
0BC5: CALL 53C |
|
|
2137 |
0BC6: BSF 0A.3 |
|
|
2138 |
.................... } |
|
|
2139 |
.................... else //prebitecna energie do rezistoru |
|
|
2140 |
0BC7: GOTO 3E7 |
|
|
2141 |
.................... { |
|
|
2142 |
.................... if(bat2STAV>20) |
|
|
2143 |
0BC8: MOVF 24,F |
|
|
2144 |
0BC9: BTFSS 03.2 |
|
|
2145 |
0BCA: GOTO 3CF |
|
|
2146 |
0BCB: MOVF 23,W |
|
|
2147 |
0BCC: SUBLW 14 |
|
|
2148 |
0BCD: BTFSC 03.0 |
|
|
2149 |
0BCE: GOTO 3D5 |
|
|
2150 |
.................... { |
|
|
2151 |
.................... batMODE(6); |
|
|
2152 |
0BCF: MOVLW 06 |
|
|
2153 |
0BD0: MOVWF 69 |
|
|
2154 |
0BD1: BCF 0A.3 |
|
|
2155 |
0BD2: CALL 088 |
|
|
2156 |
0BD3: BSF 0A.3 |
|
|
2157 |
.................... } |
|
|
2158 |
.................... else |
|
|
2159 |
0BD4: GOTO 3E7 |
|
|
2160 |
.................... { |
|
|
2161 |
.................... if(bat3STAV>20) |
|
|
2162 |
0BD5: MOVF 26,F |
|
|
2163 |
0BD6: BTFSS 03.2 |
|
|
2164 |
0BD7: GOTO 3DC |
|
|
2165 |
0BD8: MOVF 25,W |
|
|
2166 |
0BD9: SUBLW 14 |
|
|
2167 |
0BDA: BTFSC 03.0 |
|
|
2168 |
0BDB: GOTO 3E2 |
|
|
2169 |
.................... { |
|
|
2170 |
.................... batMODE(5); |
|
|
2171 |
0BDC: MOVLW 05 |
|
|
2172 |
0BDD: MOVWF 69 |
|
|
2173 |
0BDE: BCF 0A.3 |
|
|
2174 |
0BDF: CALL 088 |
|
|
2175 |
0BE0: BSF 0A.3 |
|
|
2176 |
.................... } |
|
|
2177 |
.................... else |
|
|
2178 |
0BE1: GOTO 3E7 |
|
|
2179 |
.................... { |
|
|
2180 |
.................... batMODE(1); |
|
|
2181 |
0BE2: MOVLW 01 |
|
|
2182 |
0BE3: MOVWF 69 |
|
|
2183 |
0BE4: BCF 0A.3 |
|
|
2184 |
0BE5: CALL 088 |
|
|
2185 |
0BE6: BSF 0A.3 |
|
|
2186 |
.................... } |
|
|
2187 |
.................... } |
|
|
2188 |
.................... } |
|
|
2189 |
.................... |
|
|
2190 |
.................... batdata(); |
|
|
2191 |
0BE7: BCF 0A.3 |
|
|
2192 |
0BE8: CALL 53C |
|
|
2193 |
0BE9: BSF 0A.3 |
|
|
2194 |
.................... sprintf(baterka, " %3.0Ld %3.0Ld %3.0Ld %5.0Ld %5.0Ld %5.0Ld %5.0Ld", bat1STAV, bat2STAV, bat3STAV, bat1P, bat2P, bat3P, 0); |
|
|
2195 |
0BEA: CLRF 64 |
|
|
2196 |
0BEB: MOVLW 3B |
|
|
2197 |
0BEC: MOVWF 63 |
|
|
2198 |
0BED: MOVLW 20 |
|
|
2199 |
0BEE: MOVWF 72 |
|
|
2200 |
0BEF: BCF 0A.3 |
|
|
2201 |
0BF0: CALL 651 |
|
|
2202 |
0BF1: BSF 0A.3 |
|
|
2203 |
0BF2: MOVLW 03 |
|
|
2204 |
0BF3: MOVWF 04 |
|
|
2205 |
0BF4: MOVF 22,W |
|
|
2206 |
0BF5: MOVWF 6A |
|
|
2207 |
0BF6: MOVF 21,W |
|
|
2208 |
0BF7: MOVWF 69 |
|
|
2209 |
0BF8: BCF 0A.3 |
|
|
2210 |
0BF9: CALL 65E |
|
|
2211 |
0BFA: BSF 0A.3 |
|
|
2212 |
0BFB: MOVLW 20 |
|
|
2213 |
0BFC: MOVWF 72 |
|
|
2214 |
0BFD: BCF 0A.3 |
|
|
2215 |
0BFE: CALL 651 |
|
|
2216 |
0BFF: BSF 0A.3 |
|
|
2217 |
0C00: MOVLW 03 |
|
|
2218 |
0C01: MOVWF 04 |
|
|
2219 |
0C02: MOVF 24,W |
|
|
2220 |
0C03: MOVWF 6A |
|
|
2221 |
0C04: MOVF 23,W |
|
|
2222 |
0C05: MOVWF 69 |
|
|
2223 |
0C06: BCF 0A.3 |
|
|
2224 |
0C07: CALL 65E |
|
|
2225 |
0C08: BSF 0A.3 |
|
|
2226 |
0C09: MOVLW 20 |
|
|
2227 |
0C0A: MOVWF 72 |
|
|
2228 |
0C0B: BCF 0A.3 |
|
|
2229 |
0C0C: CALL 651 |
|
|
2230 |
0C0D: BSF 0A.3 |
|
|
2231 |
0C0E: MOVLW 03 |
|
|
2232 |
0C0F: MOVWF 04 |
|
|
2233 |
0C10: MOVF 26,W |
|
|
2234 |
0C11: MOVWF 6A |
|
|
2235 |
0C12: MOVF 25,W |
|
|
2236 |
0C13: MOVWF 69 |
|
|
2237 |
0C14: BCF 0A.3 |
|
|
2238 |
0C15: CALL 65E |
|
|
2239 |
0C16: BSF 0A.3 |
|
|
2240 |
0C17: MOVLW 20 |
|
|
2241 |
0C18: MOVWF 72 |
|
|
2242 |
0C19: BCF 0A.3 |
|
|
2243 |
0C1A: CALL 651 |
|
|
2244 |
0C1B: BSF 0A.3 |
|
|
2245 |
0C1C: MOVLW 01 |
|
|
2246 |
0C1D: MOVWF 04 |
|
|
2247 |
0C1E: MOVF 34,W |
|
|
2248 |
0C1F: MOVWF 6A |
|
|
2249 |
0C20: MOVF 33,W |
|
|
2250 |
0C21: MOVWF 69 |
|
|
2251 |
0C22: BCF 0A.3 |
|
|
2252 |
0C23: CALL 65E |
|
|
2253 |
0C24: BSF 0A.3 |
|
|
2254 |
0C25: MOVLW 20 |
|
|
2255 |
0C26: MOVWF 72 |
|
|
2256 |
0C27: BCF 0A.3 |
|
|
2257 |
0C28: CALL 651 |
|
|
2258 |
0C29: BSF 0A.3 |
|
|
2259 |
0C2A: MOVLW 01 |
|
|
2260 |
0C2B: MOVWF 04 |
|
|
2261 |
0C2C: MOVF 36,W |
|
|
2262 |
0C2D: MOVWF 6A |
|
|
2263 |
0C2E: MOVF 35,W |
|
|
2264 |
0C2F: MOVWF 69 |
|
|
2265 |
0C30: BCF 0A.3 |
|
|
2266 |
0C31: CALL 65E |
|
|
2267 |
0C32: BSF 0A.3 |
|
|
2268 |
0C33: MOVLW 20 |
|
|
2269 |
0C34: MOVWF 72 |
|
|
2270 |
0C35: BCF 0A.3 |
|
|
2271 |
0C36: CALL 651 |
|
|
2272 |
0C37: BSF 0A.3 |
|
|
2273 |
0C38: MOVLW 01 |
|
|
2274 |
0C39: MOVWF 04 |
|
|
2275 |
0C3A: MOVF 38,W |
|
|
2276 |
0C3B: MOVWF 6A |
|
|
2277 |
0C3C: MOVF 37,W |
|
|
2278 |
0C3D: MOVWF 69 |
|
|
2279 |
0C3E: BCF 0A.3 |
|
|
2280 |
0C3F: CALL 65E |
|
|
2281 |
0C40: BSF 0A.3 |
|
|
2282 |
0C41: MOVLW 20 |
|
|
2283 |
0C42: MOVWF 72 |
|
|
2284 |
0C43: BCF 0A.3 |
|
|
2285 |
0C44: CALL 651 |
|
|
2286 |
0C45: BSF 0A.3 |
|
|
2287 |
0C46: MOVLW 01 |
|
|
2288 |
0C47: MOVWF 04 |
|
|
2289 |
0C48: CLRF 6A |
|
|
2290 |
0C49: CLRF 69 |
|
|
2291 |
0C4A: BCF 0A.3 |
|
|
2292 |
0C4B: CALL 65E |
|
|
2293 |
0C4C: BSF 0A.3 |
|
|
2294 |
.................... //sprintf(baterka, "%Ld %Ld %Ld 0 0 0 0" bat1STAV, bat2STAV, bat3STAV); |
|
|
2295 |
.................... printf(baterka); |
|
|
2296 |
0C4D: MOVLW 3B |
|
|
2297 |
0C4E: MOVWF 04 |
|
|
2298 |
0C4F: BCF 03.7 |
|
|
2299 |
0C50: BCF 0A.3 |
|
|
2300 |
0C51: CALL 6DE |
|
|
2301 |
0C52: BSF 0A.3 |
|
|
2302 |
.................... delay_ms(5000); |
|
|
2303 |
0C53: MOVLW 14 |
|
|
2304 |
0C54: MOVWF 69 |
|
|
2305 |
0C55: MOVLW FA |
|
|
2306 |
0C56: MOVWF 6A |
|
|
2307 |
0C57: BCF 0A.3 |
|
|
2308 |
0C58: CALL 00A |
|
|
2309 |
0C59: BSF 0A.3 |
|
|
2310 |
0C5A: DECFSZ 69,F |
|
|
2311 |
0C5B: GOTO 455 |
|
|
2312 |
.................... } |
|
|
2313 |
0C5C: GOTO 396 |
|
|
2314 |
.................... |
|
|
2315 |
.................... batMODE(1); |
|
|
2316 |
0C5D: MOVLW 01 |
|
|
2317 |
0C5E: MOVWF 69 |
|
|
2318 |
0C5F: BCF 0A.3 |
|
|
2319 |
0C60: CALL 088 |
|
|
2320 |
0C61: BSF 0A.3 |
|
|
2321 |
.................... if(bat2P==0) //osetreni deleni nulou |
|
|
2322 |
0C62: MOVF 35,F |
|
|
2323 |
0C63: BTFSS 03.2 |
|
|
2324 |
0C64: GOTO 46D |
|
|
2325 |
0C65: MOVF 36,F |
|
|
2326 |
0C66: BTFSS 03.2 |
|
|
2327 |
0C67: GOTO 46D |
|
|
2328 |
.................... { |
|
|
2329 |
.................... rozdil=9999; |
|
|
2330 |
0C68: MOVLW 27 |
|
|
2331 |
0C69: MOVWF 3A |
|
|
2332 |
0C6A: MOVLW 0F |
|
|
2333 |
0C6B: MOVWF 39 |
|
|
2334 |
.................... } |
|
|
2335 |
.................... else |
|
|
2336 |
0C6C: GOTO 4E9 |
|
|
2337 |
.................... { |
|
|
2338 |
.................... vypocet=(((float)bat3P-bat2P)/bat2P)*100; //vypocet rozdilu dodavane enengie dodavane solárnim panelem sledujícím Slunce a fixnim solarnim panelem |
|
|
2339 |
0C6D: MOVF 38,W |
|
|
2340 |
0C6E: MOVWF 70 |
|
|
2341 |
0C6F: MOVF 37,W |
|
|
2342 |
0C70: MOVWF 6F |
|
|
2343 |
0C71: BCF 0A.3 |
|
|
2344 |
0C72: CALL 472 |
|
|
2345 |
0C73: BSF 0A.3 |
|
|
2346 |
0C74: MOVF 77,W |
|
|
2347 |
0C75: MOVWF 69 |
|
|
2348 |
0C76: MOVF 78,W |
|
|
2349 |
0C77: MOVWF 6A |
|
|
2350 |
0C78: MOVF 79,W |
|
|
2351 |
0C79: MOVWF 6B |
|
|
2352 |
0C7A: MOVF 7A,W |
|
|
2353 |
0C7B: MOVWF 6C |
|
|
2354 |
0C7C: MOVF 36,W |
|
|
2355 |
0C7D: MOVWF 70 |
|
|
2356 |
0C7E: MOVF 35,W |
|
|
2357 |
0C7F: MOVWF 6F |
|
|
2358 |
0C80: BCF 0A.3 |
|
|
2359 |
0C81: CALL 472 |
|
|
2360 |
0C82: BSF 0A.3 |
|
|
2361 |
0C83: BSF 03.1 |
|
|
2362 |
0C84: MOVF 6C,W |
|
|
2363 |
0C85: MOVWF 70 |
|
|
2364 |
0C86: MOVF 6B,W |
|
|
2365 |
0C87: MOVWF 6F |
|
|
2366 |
0C88: MOVF 6A,W |
|
|
2367 |
0C89: MOVWF 6E |
|
|
2368 |
0C8A: MOVF 69,W |
|
|
2369 |
0C8B: MOVWF 6D |
|
|
2370 |
0C8C: MOVF 7A,W |
|
|
2371 |
0C8D: MOVWF 74 |
|
|
2372 |
0C8E: MOVF 79,W |
|
|
2373 |
0C8F: MOVWF 73 |
|
|
2374 |
0C90: MOVF 78,W |
|
|
2375 |
0C91: MOVWF 72 |
|
|
2376 |
0C92: MOVF 77,W |
|
|
2377 |
0C93: MOVWF 71 |
|
|
2378 |
0C94: GOTO 000 |
|
|
2379 |
0C95: MOVF 77,W |
|
|
2380 |
0C96: MOVWF 69 |
|
|
2381 |
0C97: MOVF 78,W |
|
|
2382 |
0C98: MOVWF 6A |
|
|
2383 |
0C99: MOVF 79,W |
|
|
2384 |
0C9A: MOVWF 6B |
|
|
2385 |
0C9B: MOVF 7A,W |
|
|
2386 |
0C9C: MOVWF 6C |
|
|
2387 |
0C9D: MOVF 36,W |
|
|
2388 |
0C9E: MOVWF 70 |
|
|
2389 |
0C9F: MOVF 35,W |
|
|
2390 |
0CA0: MOVWF 6F |
|
|
2391 |
0CA1: BCF 0A.3 |
|
|
2392 |
0CA2: CALL 472 |
|
|
2393 |
0CA3: BSF 0A.3 |
|
|
2394 |
0CA4: MOVF 6C,W |
|
|
2395 |
0CA5: MOVWF 70 |
|
|
2396 |
0CA6: MOVF 6B,W |
|
|
2397 |
0CA7: MOVWF 6F |
|
|
2398 |
0CA8: MOVF 6A,W |
|
|
2399 |
0CA9: MOVWF 6E |
|
|
2400 |
0CAA: MOVF 69,W |
|
|
2401 |
0CAB: MOVWF 6D |
|
|
2402 |
0CAC: MOVF 7A,W |
|
|
2403 |
0CAD: MOVWF 74 |
|
|
2404 |
0CAE: MOVF 79,W |
|
|
2405 |
0CAF: MOVWF 73 |
|
|
2406 |
0CB0: MOVF 78,W |
|
|
2407 |
0CB1: MOVWF 72 |
|
|
2408 |
0CB2: MOVF 77,W |
|
|
2409 |
0CB3: MOVWF 71 |
|
|
2410 |
0CB4: BCF 0A.3 |
|
|
2411 |
0CB5: CALL 393 |
|
|
2412 |
0CB6: BSF 0A.3 |
|
|
2413 |
0CB7: MOVF 77,W |
|
|
2414 |
0CB8: MOVWF 69 |
|
|
2415 |
0CB9: MOVF 78,W |
|
|
2416 |
0CBA: MOVWF 6A |
|
|
2417 |
0CBB: MOVF 79,W |
|
|
2418 |
0CBC: MOVWF 6B |
|
|
2419 |
0CBD: MOVF 7A,W |
|
|
2420 |
0CBE: MOVWF 6C |
|
|
2421 |
0CBF: MOVWF 72 |
|
|
2422 |
0CC0: MOVF 79,W |
|
|
2423 |
0CC1: MOVWF 71 |
|
|
2424 |
0CC2: MOVF 78,W |
|
|
2425 |
0CC3: MOVWF 70 |
|
|
2426 |
0CC4: MOVF 77,W |
|
|
2427 |
0CC5: MOVWF 6F |
|
|
2428 |
0CC6: CLRF 76 |
|
|
2429 |
0CC7: CLRF 75 |
|
|
2430 |
0CC8: MOVLW 48 |
|
|
2431 |
0CC9: MOVWF 74 |
|
|
2432 |
0CCA: MOVLW 85 |
|
|
2433 |
0CCB: MOVWF 73 |
|
|
2434 |
0CCC: BCF 0A.3 |
|
|
2435 |
0CCD: CALL 497 |
|
|
2436 |
0CCE: BSF 0A.3 |
|
|
2437 |
0CCF: MOVF 7A,W |
|
|
2438 |
0CD0: MOVWF 68 |
|
|
2439 |
0CD1: MOVF 79,W |
|
|
2440 |
0CD2: MOVWF 67 |
|
|
2441 |
0CD3: MOVF 78,W |
|
|
2442 |
0CD4: MOVWF 66 |
|
|
2443 |
0CD5: MOVF 77,W |
|
|
2444 |
0CD6: MOVWF 65 |
|
|
2445 |
.................... rozdil=(signed int)vypocet; |
|
|
2446 |
0CD7: MOVF 68,W |
|
|
2447 |
0CD8: MOVWF 72 |
|
|
2448 |
0CD9: MOVF 67,W |
|
|
2449 |
0CDA: MOVWF 71 |
|
|
2450 |
0CDB: MOVF 66,W |
|
|
2451 |
0CDC: MOVWF 70 |
|
|
2452 |
0CDD: MOVF 65,W |
|
|
2453 |
0CDE: MOVWF 6F |
|
|
2454 |
0CDF: BCF 0A.3 |
|
|
2455 |
0CE0: CALL 51D |
|
|
2456 |
0CE1: BSF 0A.3 |
|
|
2457 |
0CE2: CLRF 7A |
|
|
2458 |
0CE3: MOVF 78,W |
|
|
2459 |
0CE4: BTFSC 78.7 |
|
|
2460 |
0CE5: DECF 7A,F |
|
|
2461 |
0CE6: MOVWF 39 |
|
|
2462 |
0CE7: MOVF 7A,W |
|
|
2463 |
0CE8: MOVWF 3A |
|
|
2464 |
.................... } |
|
|
2465 |
.................... |
|
|
2466 |
.................... //zaslani namerenych udaju na seriovou linku |
|
|
2467 |
.................... sprintf(baterka, " %3.0Ld %3.0Ld %3.0Ld %5.0Ld %5.0Ld %5.0Ld %5.0Ld", bat1STAV, bat2STAV, bat3STAV, bat1P, bat2P, bat3P, rozdil); |
|
|
2468 |
0CE9: CLRF 64 |
|
|
2469 |
0CEA: MOVLW 3B |
|
|
2470 |
0CEB: MOVWF 63 |
|
|
2471 |
0CEC: MOVLW 20 |
|
|
2472 |
0CED: MOVWF 72 |
|
|
2473 |
0CEE: BCF 0A.3 |
|
|
2474 |
0CEF: CALL 651 |
|
|
2475 |
0CF0: BSF 0A.3 |
|
|
2476 |
0CF1: MOVLW 03 |
|
|
2477 |
0CF2: MOVWF 04 |
|
|
2478 |
0CF3: MOVF 22,W |
|
|
2479 |
0CF4: MOVWF 6A |
|
|
2480 |
0CF5: MOVF 21,W |
|
|
2481 |
0CF6: MOVWF 69 |
|
|
2482 |
0CF7: BCF 0A.3 |
|
|
2483 |
0CF8: CALL 65E |
|
|
2484 |
0CF9: BSF 0A.3 |
|
|
2485 |
0CFA: MOVLW 20 |
|
|
2486 |
0CFB: MOVWF 72 |
|
|
2487 |
0CFC: BCF 0A.3 |
|
|
2488 |
0CFD: CALL 651 |
|
|
2489 |
0CFE: BSF 0A.3 |
|
|
2490 |
0CFF: MOVLW 03 |
|
|
2491 |
0D00: MOVWF 04 |
|
|
2492 |
0D01: MOVF 24,W |
|
|
2493 |
0D02: MOVWF 6A |
|
|
2494 |
0D03: MOVF 23,W |
|
|
2495 |
0D04: MOVWF 69 |
|
|
2496 |
0D05: BCF 0A.3 |
|
|
2497 |
0D06: CALL 65E |
|
|
2498 |
0D07: BSF 0A.3 |
|
|
2499 |
0D08: MOVLW 20 |
|
|
2500 |
0D09: MOVWF 72 |
|
|
2501 |
0D0A: BCF 0A.3 |
|
|
2502 |
0D0B: CALL 651 |
|
|
2503 |
0D0C: BSF 0A.3 |
|
|
2504 |
0D0D: MOVLW 03 |
|
|
2505 |
0D0E: MOVWF 04 |
|
|
2506 |
0D0F: MOVF 26,W |
|
|
2507 |
0D10: MOVWF 6A |
|
|
2508 |
0D11: MOVF 25,W |
|
|
2509 |
0D12: MOVWF 69 |
|
|
2510 |
0D13: BCF 0A.3 |
|
|
2511 |
0D14: CALL 65E |
|
|
2512 |
0D15: BSF 0A.3 |
|
|
2513 |
0D16: MOVLW 20 |
|
|
2514 |
0D17: MOVWF 72 |
|
|
2515 |
0D18: BCF 0A.3 |
|
|
2516 |
0D19: CALL 651 |
|
|
2517 |
0D1A: BSF 0A.3 |
|
|
2518 |
0D1B: MOVLW 01 |
|
|
2519 |
0D1C: MOVWF 04 |
|
|
2520 |
0D1D: MOVF 34,W |
|
|
2521 |
0D1E: MOVWF 6A |
|
|
2522 |
0D1F: MOVF 33,W |
|
|
2523 |
0D20: MOVWF 69 |
|
|
2524 |
0D21: BCF 0A.3 |
|
|
2525 |
0D22: CALL 65E |
|
|
2526 |
0D23: BSF 0A.3 |
|
|
2527 |
0D24: MOVLW 20 |
|
|
2528 |
0D25: MOVWF 72 |
|
|
2529 |
0D26: BCF 0A.3 |
|
|
2530 |
0D27: CALL 651 |
|
|
2531 |
0D28: BSF 0A.3 |
|
|
2532 |
0D29: MOVLW 01 |
|
|
2533 |
0D2A: MOVWF 04 |
|
|
2534 |
0D2B: MOVF 36,W |
|
|
2535 |
0D2C: MOVWF 6A |
|
|
2536 |
0D2D: MOVF 35,W |
|
|
2537 |
0D2E: MOVWF 69 |
|
|
2538 |
0D2F: BCF 0A.3 |
|
|
2539 |
0D30: CALL 65E |
|
|
2540 |
0D31: BSF 0A.3 |
|
|
2541 |
0D32: MOVLW 20 |
|
|
2542 |
0D33: MOVWF 72 |
|
|
2543 |
0D34: BCF 0A.3 |
|
|
2544 |
0D35: CALL 651 |
|
|
2545 |
0D36: BSF 0A.3 |
|
|
2546 |
0D37: MOVLW 01 |
|
|
2547 |
0D38: MOVWF 04 |
|
|
2548 |
0D39: MOVF 38,W |
|
|
2549 |
0D3A: MOVWF 6A |
|
|
2550 |
0D3B: MOVF 37,W |
|
|
2551 |
0D3C: MOVWF 69 |
|
|
2552 |
0D3D: BCF 0A.3 |
|
|
2553 |
0D3E: CALL 65E |
|
|
2554 |
0D3F: BSF 0A.3 |
|
|
2555 |
0D40: MOVLW 20 |
|
|
2556 |
0D41: MOVWF 72 |
|
|
2557 |
0D42: BCF 0A.3 |
|
|
2558 |
0D43: CALL 651 |
|
|
2559 |
0D44: BSF 0A.3 |
|
|
2560 |
0D45: MOVLW 01 |
|
|
2561 |
0D46: MOVWF 04 |
|
|
2562 |
0D47: MOVF 3A,W |
|
|
2563 |
0D48: MOVWF 6A |
|
|
2564 |
0D49: MOVF 39,W |
|
|
2565 |
0D4A: MOVWF 69 |
|
|
2566 |
0D4B: BCF 0A.3 |
|
|
2567 |
0D4C: CALL 65E |
|
|
2568 |
0D4D: BSF 0A.3 |
|
|
2569 |
.................... printf(baterka); |
|
|
2570 |
0D4E: MOVLW 3B |
|
|
2571 |
0D4F: MOVWF 04 |
|
|
2572 |
0D50: BCF 03.7 |
|
|
2573 |
0D51: BCF 0A.3 |
|
|
2574 |
0D52: CALL 6DE |
|
|
2575 |
0D53: BSF 0A.3 |
|
|
2576 |
.................... delay_ms (20000); |
|
|
2577 |
0D54: MOVLW 50 |
|
|
2578 |
0D55: MOVWF 69 |
|
|
2579 |
0D56: MOVLW FA |
|
|
2580 |
0D57: MOVWF 6A |
|
|
2581 |
0D58: BCF 0A.3 |
|
|
2582 |
0D59: CALL 00A |
|
|
2583 |
0D5A: BSF 0A.3 |
|
|
2584 |
0D5B: DECFSZ 69,F |
|
|
2585 |
0D5C: GOTO 556 |
|
|
2586 |
.................... } |
|
|
2587 |
0D5D: GOTO 1CD |
|
|
2588 |
.................... } |
|
|
2589 |
.................... |
|
|
2590 |
0D5E: SLEEP |
|
|
2591 |
|
|
|
2592 |
Configuration Fuses: |
|
|
2593 |
Word 1: 2CF5 INTRC NOWDT NOPUT MCLR NOPROTECT NOCPD NOBROWNOUT IESO FCMEN NOLVP NODEBUG |
|
|
2594 |
Word 2: 3FFF NOWRT BORV40 |