3021 |
kaklik |
1 |
CCS PCM C Compiler, Version 4.106, 47914 23-V-13 16:19 |
3020 |
jacho |
2 |
|
3021 |
kaklik |
3 |
Filename: Z:\home\kaklik\MLAB\Designs\Measuring_instruments\GM_counter\SW\counter\main.lst |
3020 |
jacho |
4 |
|
3021 |
kaklik |
5 |
ROM used: 3009 words (37%) |
3020 |
jacho |
6 |
Largest free fragment is 2048 |
3021 |
kaklik |
7 |
RAM used: 37 (10%) at main() level |
|
|
8 |
56 (15%) worst case |
3020 |
jacho |
9 |
Stack: 6 worst case (5 in main + 1 for interrupts) |
|
|
10 |
|
|
|
11 |
* |
|
|
12 |
0000: MOVLW 08 |
|
|
13 |
0001: MOVWF 0A |
|
|
14 |
0002: GOTO 000 |
|
|
15 |
0003: NOP |
|
|
16 |
0004: MOVWF 7F |
|
|
17 |
0005: SWAPF 03,W |
|
|
18 |
0006: CLRF 03 |
|
|
19 |
0007: MOVWF 21 |
|
|
20 |
0008: MOVF 0A,W |
|
|
21 |
0009: MOVWF 20 |
|
|
22 |
000A: CLRF 0A |
|
|
23 |
000B: MOVF 04,W |
|
|
24 |
000C: MOVWF 22 |
|
|
25 |
000D: MOVF 77,W |
|
|
26 |
000E: MOVWF 23 |
|
|
27 |
000F: MOVF 78,W |
|
|
28 |
0010: MOVWF 24 |
|
|
29 |
0011: MOVF 79,W |
|
|
30 |
0012: MOVWF 25 |
|
|
31 |
0013: MOVF 7A,W |
|
|
32 |
0014: MOVWF 26 |
|
|
33 |
0015: BCF 03.7 |
|
|
34 |
0016: BCF 03.5 |
|
|
35 |
0017: BTFSS 0B.5 |
|
|
36 |
0018: GOTO 01B |
|
|
37 |
0019: BTFSC 0B.2 |
|
|
38 |
001A: GOTO 032 |
|
|
39 |
001B: MOVLW 8C |
|
|
40 |
001C: MOVWF 04 |
|
|
41 |
001D: BTFSS 00.0 |
|
|
42 |
001E: GOTO 021 |
|
|
43 |
001F: BTFSC 0C.0 |
|
|
44 |
0020: GOTO 035 |
|
|
45 |
0021: MOVF 22,W |
|
|
46 |
0022: MOVWF 04 |
|
|
47 |
0023: MOVF 23,W |
|
|
48 |
0024: MOVWF 77 |
|
|
49 |
0025: MOVF 24,W |
|
|
50 |
0026: MOVWF 78 |
|
|
51 |
0027: MOVF 25,W |
|
|
52 |
0028: MOVWF 79 |
|
|
53 |
0029: MOVF 26,W |
|
|
54 |
002A: MOVWF 7A |
|
|
55 |
002B: MOVF 20,W |
|
|
56 |
002C: MOVWF 0A |
|
|
57 |
002D: SWAPF 21,W |
|
|
58 |
002E: MOVWF 03 |
|
|
59 |
002F: SWAPF 7F,F |
|
|
60 |
0030: SWAPF 7F,W |
|
|
61 |
0031: RETFIE |
|
|
62 |
0032: BCF 0A.3 |
|
|
63 |
0033: BCF 0A.4 |
|
|
64 |
0034: GOTO 040 |
|
|
65 |
0035: BCF 0A.3 |
|
|
66 |
0036: BCF 0A.4 |
|
|
67 |
0037: GOTO 047 |
|
|
68 |
.................... #include ".\main.h" |
|
|
69 |
.................... #include <16F887.h> |
|
|
70 |
.................... //////// Standard Header file for the PIC16F887 device //////////////// |
|
|
71 |
.................... #device PIC16F887 |
|
|
72 |
.................... #list |
|
|
73 |
.................... |
|
|
74 |
.................... #device adc=10 |
|
|
75 |
.................... |
|
|
76 |
.................... #FUSES NOWDT //No Watch Dog Timer |
|
|
77 |
.................... #FUSES INTRC //Internal RC Osc |
|
|
78 |
.................... #FUSES NOPUT //No Power Up Timer |
|
|
79 |
.................... #FUSES MCLR //Master Clear pin enabled |
|
|
80 |
.................... #FUSES NOPROTECT //Code not protected from reading |
|
|
81 |
.................... #FUSES NOCPD //No EE protection |
|
|
82 |
.................... #FUSES NOBROWNOUT //No brownout reset |
|
|
83 |
.................... #FUSES IESO //Internal External Switch Over mode enabled |
|
|
84 |
.................... #FUSES FCMEN //Fail-safe clock monitor enabled |
|
|
85 |
.................... #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O |
|
|
86 |
.................... #FUSES NODEBUG //No Debug mode for ICD |
|
|
87 |
.................... #FUSES NOWRT //Program memory not write protected |
|
|
88 |
.................... #FUSES BORV40 //Brownout reset at 4.0V |
|
|
89 |
.................... |
|
|
90 |
.................... #use delay(clock=8000000) |
|
|
91 |
* |
3021 |
kaklik |
92 |
00A4: MOVLW 47 |
|
|
93 |
00A5: MOVWF 04 |
|
|
94 |
00A6: BCF 03.7 |
|
|
95 |
00A7: MOVF 00,W |
|
|
96 |
00A8: BTFSC 03.2 |
|
|
97 |
00A9: GOTO 0B7 |
|
|
98 |
00AA: MOVLW 02 |
|
|
99 |
00AB: MOVWF 78 |
|
|
100 |
00AC: CLRF 77 |
|
|
101 |
00AD: DECFSZ 77,F |
|
|
102 |
00AE: GOTO 0AD |
|
|
103 |
00AF: DECFSZ 78,F |
|
|
104 |
00B0: GOTO 0AC |
|
|
105 |
00B1: MOVLW 97 |
|
|
106 |
00B2: MOVWF 77 |
|
|
107 |
00B3: DECFSZ 77,F |
|
|
108 |
00B4: GOTO 0B3 |
|
|
109 |
00B5: DECFSZ 00,F |
|
|
110 |
00B6: GOTO 0AA |
|
|
111 |
00B7: RETURN |
3020 |
jacho |
112 |
* |
3021 |
kaklik |
113 |
0643: MOVLW 08 |
|
|
114 |
0644: SUBWF 41,F |
|
|
115 |
0645: BTFSS 03.0 |
|
|
116 |
0646: GOTO 653 |
|
|
117 |
0647: MOVLW 41 |
|
|
118 |
0648: MOVWF 04 |
|
|
119 |
0649: BCF 03.7 |
|
|
120 |
064A: BCF 03.0 |
|
|
121 |
064B: RRF 00,F |
|
|
122 |
064C: MOVF 00,W |
|
|
123 |
064D: BTFSC 03.2 |
|
|
124 |
064E: GOTO 653 |
|
|
125 |
064F: GOTO 651 |
|
|
126 |
0650: NOP |
|
|
127 |
0651: DECFSZ 00,F |
|
|
128 |
0652: GOTO 650 |
|
|
129 |
0653: RETURN |
3020 |
jacho |
130 |
.................... #use rs232(baud=9600,parity=N,xmit=PIN_B7,rcv=PIN_B6,bits=8) |
|
|
131 |
* |
3021 |
kaklik |
132 |
0230: BSF 03.5 |
|
|
133 |
0231: BCF 06.7 |
|
|
134 |
0232: BCF 03.5 |
|
|
135 |
0233: BCF 06.7 |
|
|
136 |
0234: MOVLW 08 |
|
|
137 |
0235: MOVWF 78 |
|
|
138 |
0236: GOTO 237 |
|
|
139 |
0237: NOP |
|
|
140 |
0238: BSF 78.7 |
|
|
141 |
0239: GOTO 248 |
|
|
142 |
023A: BCF 78.7 |
|
|
143 |
023B: RRF 46,F |
|
|
144 |
023C: BTFSC 03.0 |
|
|
145 |
023D: BSF 06.7 |
|
|
146 |
023E: BTFSS 03.0 |
|
|
147 |
023F: BCF 06.7 |
|
|
148 |
0240: BSF 78.6 |
|
|
149 |
0241: GOTO 248 |
|
|
150 |
0242: BCF 78.6 |
|
|
151 |
0243: DECFSZ 78,F |
|
|
152 |
0244: GOTO 23B |
|
|
153 |
0245: GOTO 246 |
|
|
154 |
0246: NOP |
|
|
155 |
0247: BSF 06.7 |
|
|
156 |
0248: MOVLW 3F |
|
|
157 |
0249: MOVWF 04 |
|
|
158 |
024A: DECFSZ 04,F |
|
|
159 |
024B: GOTO 24A |
|
|
160 |
024C: NOP |
|
|
161 |
024D: BTFSC 78.7 |
|
|
162 |
024E: GOTO 23A |
|
|
163 |
024F: BTFSC 78.6 |
|
|
164 |
0250: GOTO 242 |
|
|
165 |
0251: RETURN |
3020 |
jacho |
166 |
.................... |
|
|
167 |
.................... |
|
|
168 |
.................... |
|
|
169 |
.................... #define LED1 PIN_C6 //CHANGE PIN_XX TO YOUR LED PIN NUMBER, EX: PIN_A5 |
|
|
170 |
.................... #define LED2 PIN_C5 //CHANGE PIN_XX TO YOUR LED PIN NUMBER, EX: PIN_A5 |
|
|
171 |
.................... #define LED3 PIN_C4 // pulse detect |
|
|
172 |
.................... #define LED4 PIN_D3 //CHANGE PIN_XX TO YOUR LED PIN NUMBER |
|
|
173 |
.................... |
|
|
174 |
.................... #define S1 PIN_C2 // raw up |
|
|
175 |
.................... #define S2 PIN_C3 // raw down |
|
|
176 |
.................... #define S3 PIN_D0 // fine up |
|
|
177 |
.................... #define S4 PIN_D1 // fine down |
|
|
178 |
.................... #define S5 PIN_B1 // time setup |
|
|
179 |
.................... #define S6 PIN_B2 // treshold setup |
|
|
180 |
.................... |
|
|
181 |
.................... #define BEEP PIN_D2 //piezo beeper |
|
|
182 |
.................... |
|
|
183 |
.................... #define LCD_ENABLE_PIN PIN_E0 //// |
|
|
184 |
.................... #define LCD_RS_PIN PIN_E1 //// |
|
|
185 |
.................... #define LCD_RW_PIN PIN_E2 //// |
|
|
186 |
.................... #define LCD_DATA4 PIN_D4 //// |
|
|
187 |
.................... #define LCD_DATA5 PIN_D5 //// |
|
|
188 |
.................... #define LCD_DATA6 PIN_D6 //// |
|
|
189 |
.................... #define LCD_DATA7 PIN_D7 |
|
|
190 |
.................... #include <lcd.c> |
|
|
191 |
.................... /////////////////////////////////////////////////////////////////////////////// |
|
|
192 |
.................... //// LCD.C //// |
|
|
193 |
.................... //// Driver for common LCD modules //// |
|
|
194 |
.................... //// //// |
|
|
195 |
.................... //// lcd_init() Must be called before any other function. //// |
|
|
196 |
.................... //// //// |
|
|
197 |
.................... //// lcd_putc(c) Will display c on the next position of the LCD. //// |
|
|
198 |
.................... //// \a Set cursor position to upper left //// |
|
|
199 |
.................... //// \f Clear display, set cursor to upper left //// |
|
|
200 |
.................... //// \n Go to start of second line //// |
|
|
201 |
.................... //// \b Move back one position //// |
|
|
202 |
.................... //// If LCD_EXTENDED_NEWLINE is defined, the \n character //// |
|
|
203 |
.................... //// will erase all remanining characters on the current //// |
|
|
204 |
.................... //// line, and move the cursor to the beginning of the next //// |
|
|
205 |
.................... //// line. //// |
|
|
206 |
.................... //// If LCD_EXTENDED_NEWLINE is defined, the \r character //// |
|
|
207 |
.................... //// will move the cursor to the start of the current //// |
|
|
208 |
.................... //// line. //// |
|
|
209 |
.................... //// //// |
|
|
210 |
.................... //// lcd_gotoxy(x,y) Set write position on LCD (upper left is 1,1) //// |
|
|
211 |
.................... //// //// |
|
|
212 |
.................... //// lcd_getc(x,y) Returns character at position x,y on LCD //// |
|
|
213 |
.................... //// //// |
|
|
214 |
.................... //// CONFIGURATION //// |
|
|
215 |
.................... //// The LCD can be configured in one of two ways: a.) port access or //// |
|
|
216 |
.................... //// b.) pin access. Port access requires the entire 7 bit interface //// |
|
|
217 |
.................... //// connected to one GPIO port, and the data bits (D4:D7 of the LCD) //// |
|
|
218 |
.................... //// connected to sequential pins on the GPIO. Pin access //// |
|
|
219 |
.................... //// has no requirements, all 7 bits of the control interface can //// |
|
|
220 |
.................... //// can be connected to any GPIO using several ports. //// |
|
|
221 |
.................... //// //// |
|
|
222 |
.................... //// To use port access, #define LCD_DATA_PORT to the SFR location of //// |
|
|
223 |
.................... //// of the GPIO port that holds the interface, -AND- edit LCD_PIN_MAP //// |
|
|
224 |
.................... //// of this file to configure the pin order. If you are using a //// |
|
|
225 |
.................... //// baseline PIC (PCB), then LCD_OUTPUT_MAP and LCD_INPUT_MAP also must //// |
|
|
226 |
.................... //// be defined. //// |
|
|
227 |
.................... //// //// |
|
|
228 |
.................... //// Example of port access: //// |
|
|
229 |
.................... //// #define LCD_DATA_PORT getenv("SFR:PORTD") //// |
|
|
230 |
.................... //// //// |
|
|
231 |
.................... //// To use pin access, the following pins must be defined: //// |
|
|
232 |
.................... //// LCD_ENABLE_PIN //// |
|
|
233 |
.................... //// LCD_RS_PIN //// |
|
|
234 |
.................... //// LCD_RW_PIN //// |
|
|
235 |
.................... //// LCD_DATA4 //// |
|
|
236 |
.................... //// LCD_DATA5 //// |
|
|
237 |
.................... //// LCD_DATA6 //// |
|
|
238 |
.................... //// LCD_DATA7 //// |
|
|
239 |
.................... //// //// |
|
|
240 |
.................... //// Example of pin access: //// |
|
|
241 |
.................... //// #define LCD_ENABLE_PIN PIN_E0 //// |
|
|
242 |
.................... //// #define LCD_RS_PIN PIN_E1 //// |
|
|
243 |
.................... //// #define LCD_RW_PIN PIN_E2 //// |
|
|
244 |
.................... //// #define LCD_DATA4 PIN_D4 //// |
|
|
245 |
.................... //// #define LCD_DATA5 PIN_D5 //// |
|
|
246 |
.................... //// #define LCD_DATA6 PIN_D6 //// |
|
|
247 |
.................... //// #define LCD_DATA7 PIN_D7 //// |
|
|
248 |
.................... //// //// |
|
|
249 |
.................... /////////////////////////////////////////////////////////////////////////////// |
|
|
250 |
.................... //// (C) Copyright 1996,2010 Custom Computer Services //// |
|
|
251 |
.................... //// This source code may only be used by licensed users of the CCS C //// |
|
|
252 |
.................... //// compiler. This source code may only be distributed to other //// |
|
|
253 |
.................... //// licensed users of the CCS C compiler. No other use, reproduction //// |
|
|
254 |
.................... //// or distribution is permitted without written permission. //// |
|
|
255 |
.................... //// Derivative programs created using this software in object code //// |
|
|
256 |
.................... //// form are not restricted in any way. //// |
|
|
257 |
.................... /////////////////////////////////////////////////////////////////////////// |
|
|
258 |
.................... |
|
|
259 |
.................... // define the pinout. |
|
|
260 |
.................... // only required if port access is being used. |
|
|
261 |
.................... typedef struct |
|
|
262 |
.................... { // This structure is overlayed |
|
|
263 |
.................... BOOLEAN enable; // on to an I/O port to gain |
|
|
264 |
.................... BOOLEAN rs; // access to the LCD pins. |
|
|
265 |
.................... BOOLEAN rw; // The bits are allocated from |
|
|
266 |
.................... BOOLEAN unused; // low order up. ENABLE will |
|
|
267 |
.................... int data : 4; // be LSB pin of that port. |
|
|
268 |
.................... #if defined(__PCD__) // The port used will be LCD_DATA_PORT. |
|
|
269 |
.................... int reserved: 8; |
|
|
270 |
.................... #endif |
|
|
271 |
.................... } LCD_PIN_MAP; |
|
|
272 |
.................... |
|
|
273 |
.................... // this is to improve compatability with previous LCD drivers that accepted |
|
|
274 |
.................... // a define labeled 'use_portb_lcd' that configured the LCD onto port B. |
|
|
275 |
.................... #if ((defined(use_portb_lcd)) && (use_portb_lcd==TRUE)) |
|
|
276 |
.................... #define LCD_DATA_PORT getenv("SFR:PORTB") |
|
|
277 |
.................... #endif |
|
|
278 |
.................... |
|
|
279 |
.................... #if defined(__PCB__) |
|
|
280 |
.................... // these definitions only need to be modified for baseline PICs. |
|
|
281 |
.................... // all other PICs use LCD_PIN_MAP or individual LCD_xxx pin definitions. |
|
|
282 |
.................... /* EN, RS, RW, UNUSED, DATA */ |
|
|
283 |
.................... const LCD_PIN_MAP LCD_OUTPUT_MAP = {0, 0, 0, 0, 0}; |
|
|
284 |
.................... const LCD_PIN_MAP LCD_INPUT_MAP = {0, 0, 0, 0, 0xF}; |
|
|
285 |
.................... #endif |
|
|
286 |
.................... |
|
|
287 |
.................... ////////////////////// END CONFIGURATION /////////////////////////////////// |
|
|
288 |
.................... |
|
|
289 |
.................... #ifndef LCD_ENABLE_PIN |
|
|
290 |
.................... #define lcd_output_enable(x) lcdlat.enable=x |
|
|
291 |
.................... #define lcd_enable_tris() lcdtris.enable=0 |
|
|
292 |
.................... #else |
|
|
293 |
.................... #define lcd_output_enable(x) output_bit(LCD_ENABLE_PIN, x) |
|
|
294 |
.................... #define lcd_enable_tris() output_drive(LCD_ENABLE_PIN) |
|
|
295 |
.................... #endif |
|
|
296 |
.................... |
|
|
297 |
.................... #ifndef LCD_RS_PIN |
|
|
298 |
.................... #define lcd_output_rs(x) lcdlat.rs=x |
|
|
299 |
.................... #define lcd_rs_tris() lcdtris.rs=0 |
|
|
300 |
.................... #else |
|
|
301 |
.................... #define lcd_output_rs(x) output_bit(LCD_RS_PIN, x) |
|
|
302 |
.................... #define lcd_rs_tris() output_drive(LCD_RS_PIN) |
|
|
303 |
.................... #endif |
|
|
304 |
.................... |
|
|
305 |
.................... #ifndef LCD_RW_PIN |
|
|
306 |
.................... #define lcd_output_rw(x) lcdlat.rw=x |
|
|
307 |
.................... #define lcd_rw_tris() lcdtris.rw=0 |
|
|
308 |
.................... #else |
|
|
309 |
.................... #define lcd_output_rw(x) output_bit(LCD_RW_PIN, x) |
|
|
310 |
.................... #define lcd_rw_tris() output_drive(LCD_RW_PIN) |
|
|
311 |
.................... #endif |
|
|
312 |
.................... |
|
|
313 |
.................... // original version of this library incorrectly labeled LCD_DATA0 as LCD_DATA4, |
|
|
314 |
.................... // LCD_DATA1 as LCD_DATA5, and so on. this block of code makes the driver |
|
|
315 |
.................... // compatible with any code written for the original library |
|
|
316 |
.................... #if (defined(LCD_DATA0) && defined(LCD_DATA1) && defined(LCD_DATA2) && defined(LCD_DATA3) && !defined(LCD_DATA4) && !defined(LCD_DATA5) && !defined(LCD_DATA6) && !defined(LCD_DATA7)) |
|
|
317 |
.................... #define LCD_DATA4 LCD_DATA0 |
|
|
318 |
.................... #define LCD_DATA5 LCD_DATA1 |
|
|
319 |
.................... #define LCD_DATA6 LCD_DATA2 |
|
|
320 |
.................... #define LCD_DATA7 LCD_DATA3 |
|
|
321 |
.................... #endif |
|
|
322 |
.................... |
|
|
323 |
.................... #ifndef LCD_DATA4 |
|
|
324 |
.................... #ifndef LCD_DATA_PORT |
|
|
325 |
.................... #if defined(__PCB__) |
|
|
326 |
.................... #define LCD_DATA_PORT 0x06 //portb |
|
|
327 |
.................... #define set_tris_lcd(x) set_tris_b(x) |
|
|
328 |
.................... #else |
|
|
329 |
.................... #if defined(PIN_D0) |
|
|
330 |
.................... #define LCD_DATA_PORT getenv("SFR:PORTD") //portd |
|
|
331 |
.................... #else |
|
|
332 |
.................... #define LCD_DATA_PORT getenv("SFR:PORTB") //portb |
|
|
333 |
.................... #endif |
|
|
334 |
.................... #endif |
|
|
335 |
.................... #endif |
|
|
336 |
.................... |
|
|
337 |
.................... #if defined(__PCB__) |
|
|
338 |
.................... LCD_PIN_MAP lcd, lcdlat; |
|
|
339 |
.................... #byte lcd = LCD_DATA_PORT |
|
|
340 |
.................... #byte lcdlat = LCD_DATA_PORT |
|
|
341 |
.................... #elif defined(__PCM__) |
|
|
342 |
.................... LCD_PIN_MAP lcd, lcdlat, lcdtris; |
|
|
343 |
.................... #byte lcd = LCD_DATA_PORT |
|
|
344 |
.................... #byte lcdlat = LCD_DATA_PORT |
|
|
345 |
.................... #byte lcdtris = LCD_DATA_PORT+0x80 |
|
|
346 |
.................... #elif defined(__PCH__) |
|
|
347 |
.................... LCD_PIN_MAP lcd, lcdlat, lcdtris; |
|
|
348 |
.................... #byte lcd = LCD_DATA_PORT |
|
|
349 |
.................... #byte lcdlat = LCD_DATA_PORT+9 |
|
|
350 |
.................... #byte lcdtris = LCD_DATA_PORT+0x12 |
|
|
351 |
.................... #elif defined(__PCD__) |
|
|
352 |
.................... LCD_PIN_MAP lcd, lcdlat, lcdtris; |
|
|
353 |
.................... #word lcd = LCD_DATA_PORT |
|
|
354 |
.................... #word lcdlat = LCD_DATA_PORT+2 |
|
|
355 |
.................... #word lcdtris = LCD_DATA_PORT-0x02 |
|
|
356 |
.................... #endif |
|
|
357 |
.................... #endif //LCD_DATA4 not defined |
|
|
358 |
.................... |
|
|
359 |
.................... #ifndef LCD_TYPE |
|
|
360 |
.................... #define LCD_TYPE 2 // 0=5x7, 1=5x10, 2=2 lines |
|
|
361 |
.................... #endif |
|
|
362 |
.................... |
|
|
363 |
.................... #ifndef LCD_LINE_TWO |
|
|
364 |
.................... #define LCD_LINE_TWO 0x40 // LCD RAM address for the second line |
|
|
365 |
.................... #endif |
|
|
366 |
.................... |
|
|
367 |
.................... #ifndef LCD_LINE_LENGTH |
|
|
368 |
.................... #define LCD_LINE_LENGTH 20 |
|
|
369 |
.................... #endif |
|
|
370 |
.................... |
|
|
371 |
.................... BYTE const LCD_INIT_STRING[4] = {0x20 | (LCD_TYPE << 2), 0xc, 1, 6}; |
|
|
372 |
.................... // These bytes need to be sent to the LCD |
|
|
373 |
.................... // to start it up. |
|
|
374 |
.................... |
|
|
375 |
.................... BYTE lcd_read_nibble(void); |
|
|
376 |
.................... |
|
|
377 |
.................... BYTE lcd_read_byte(void) |
|
|
378 |
.................... { |
|
|
379 |
.................... BYTE low,high; |
|
|
380 |
.................... |
|
|
381 |
.................... #if defined(__PCB__) |
|
|
382 |
.................... set_tris_lcd(LCD_INPUT_MAP); |
|
|
383 |
.................... #else |
|
|
384 |
.................... #if (defined(LCD_DATA4) && defined(LCD_DATA5) && defined(LCD_DATA6) && defined(LCD_DATA7)) |
|
|
385 |
.................... output_float(LCD_DATA4); |
|
|
386 |
* |
3021 |
kaklik |
387 |
011D: BSF 08.4 |
3020 |
jacho |
388 |
.................... output_float(LCD_DATA5); |
3021 |
kaklik |
389 |
011E: BSF 08.5 |
3020 |
jacho |
390 |
.................... output_float(LCD_DATA6); |
3021 |
kaklik |
391 |
011F: BSF 08.6 |
3020 |
jacho |
392 |
.................... output_float(LCD_DATA7); |
3021 |
kaklik |
393 |
0120: BSF 08.7 |
3020 |
jacho |
394 |
.................... #else |
|
|
395 |
.................... lcdtris.data = 0xF; |
|
|
396 |
.................... #endif |
|
|
397 |
.................... #endif |
|
|
398 |
.................... |
|
|
399 |
.................... lcd_output_rw(1); |
3021 |
kaklik |
400 |
0121: BCF 03.5 |
|
|
401 |
0122: BSF 09.2 |
|
|
402 |
0123: BSF 03.5 |
|
|
403 |
0124: BCF 09.2 |
|
|
404 |
.................... delay_cycles(1); |
|
|
405 |
0125: NOP |
|
|
406 |
.................... lcd_output_enable(1); |
3020 |
jacho |
407 |
0126: BCF 03.5 |
3021 |
kaklik |
408 |
0127: BSF 09.0 |
3020 |
jacho |
409 |
0128: BSF 03.5 |
3021 |
kaklik |
410 |
0129: BCF 09.0 |
3020 |
jacho |
411 |
.................... delay_cycles(1); |
|
|
412 |
012A: NOP |
3021 |
kaklik |
413 |
.................... high = lcd_read_nibble(); |
3020 |
jacho |
414 |
012B: BCF 03.5 |
3021 |
kaklik |
415 |
012C: CALL 0E4 |
|
|
416 |
012D: MOVF 78,W |
|
|
417 |
012E: MOVWF 4E |
3020 |
jacho |
418 |
.................... |
|
|
419 |
.................... lcd_output_enable(0); |
3021 |
kaklik |
420 |
012F: BCF 09.0 |
|
|
421 |
0130: BSF 03.5 |
|
|
422 |
0131: BCF 09.0 |
|
|
423 |
.................... delay_cycles(1); |
|
|
424 |
0132: NOP |
|
|
425 |
.................... lcd_output_enable(1); |
|
|
426 |
0133: BCF 03.5 |
|
|
427 |
0134: BSF 09.0 |
3020 |
jacho |
428 |
0135: BSF 03.5 |
|
|
429 |
0136: BCF 09.0 |
|
|
430 |
.................... delay_us(1); |
3021 |
kaklik |
431 |
0137: GOTO 138 |
3020 |
jacho |
432 |
.................... low = lcd_read_nibble(); |
3021 |
kaklik |
433 |
0138: BCF 03.5 |
|
|
434 |
0139: CALL 0E4 |
|
|
435 |
013A: MOVF 78,W |
|
|
436 |
013B: MOVWF 4D |
3020 |
jacho |
437 |
.................... |
|
|
438 |
.................... lcd_output_enable(0); |
3021 |
kaklik |
439 |
013C: BCF 09.0 |
|
|
440 |
013D: BSF 03.5 |
|
|
441 |
013E: BCF 09.0 |
3020 |
jacho |
442 |
.................... |
|
|
443 |
.................... #if defined(__PCB__) |
|
|
444 |
.................... set_tris_lcd(LCD_OUTPUT_MAP); |
|
|
445 |
.................... #else |
|
|
446 |
.................... #if (defined(LCD_DATA4) && defined(LCD_DATA5) && defined(LCD_DATA6) && defined(LCD_DATA7)) |
|
|
447 |
.................... output_drive(LCD_DATA4); |
3021 |
kaklik |
448 |
013F: BCF 08.4 |
3020 |
jacho |
449 |
.................... output_drive(LCD_DATA5); |
3021 |
kaklik |
450 |
0140: BCF 08.5 |
3020 |
jacho |
451 |
.................... output_drive(LCD_DATA6); |
3021 |
kaklik |
452 |
0141: BCF 08.6 |
3020 |
jacho |
453 |
.................... output_drive(LCD_DATA7); |
3021 |
kaklik |
454 |
0142: BCF 08.7 |
3020 |
jacho |
455 |
.................... #else |
|
|
456 |
.................... lcdtris.data = 0x0; |
|
|
457 |
.................... #endif |
|
|
458 |
.................... #endif |
|
|
459 |
.................... |
|
|
460 |
.................... return( (high<<4) | low); |
3021 |
kaklik |
461 |
0143: BCF 03.5 |
|
|
462 |
0144: SWAPF 4E,W |
|
|
463 |
0145: MOVWF 77 |
|
|
464 |
0146: MOVLW F0 |
|
|
465 |
0147: ANDWF 77,F |
|
|
466 |
0148: MOVF 77,W |
|
|
467 |
0149: IORWF 4D,W |
|
|
468 |
014A: MOVWF 78 |
3020 |
jacho |
469 |
.................... } |
|
|
470 |
.................... |
|
|
471 |
.................... BYTE lcd_read_nibble(void) |
|
|
472 |
.................... { |
|
|
473 |
.................... #if (defined(LCD_DATA4) && defined(LCD_DATA5) && defined(LCD_DATA6) && defined(LCD_DATA7)) |
|
|
474 |
* |
3021 |
kaklik |
475 |
00E4: CLRF 4F |
3020 |
jacho |
476 |
.................... BYTE n = 0x00; |
|
|
477 |
.................... |
|
|
478 |
.................... /* Read the data port */ |
|
|
479 |
.................... n |= input(LCD_DATA4); |
3021 |
kaklik |
480 |
00E5: BSF 03.5 |
|
|
481 |
00E6: BSF 08.4 |
|
|
482 |
00E7: MOVLW 00 |
|
|
483 |
00E8: BCF 03.5 |
|
|
484 |
00E9: BTFSC 08.4 |
|
|
485 |
00EA: MOVLW 01 |
|
|
486 |
00EB: IORWF 4F,F |
3020 |
jacho |
487 |
.................... n |= input(LCD_DATA5) << 1; |
3021 |
kaklik |
488 |
00EC: BSF 03.5 |
|
|
489 |
00ED: BSF 08.5 |
|
|
490 |
00EE: MOVLW 00 |
|
|
491 |
00EF: BCF 03.5 |
|
|
492 |
00F0: BTFSC 08.5 |
|
|
493 |
00F1: MOVLW 01 |
|
|
494 |
00F2: MOVWF 77 |
|
|
495 |
00F3: BCF 03.0 |
|
|
496 |
00F4: RLF 77,F |
|
|
497 |
00F5: MOVF 77,W |
|
|
498 |
00F6: IORWF 4F,F |
3020 |
jacho |
499 |
.................... n |= input(LCD_DATA6) << 2; |
3021 |
kaklik |
500 |
00F7: BSF 03.5 |
|
|
501 |
00F8: BSF 08.6 |
|
|
502 |
00F9: MOVLW 00 |
|
|
503 |
00FA: BCF 03.5 |
|
|
504 |
00FB: BTFSC 08.6 |
|
|
505 |
00FC: MOVLW 01 |
|
|
506 |
00FD: MOVWF 77 |
|
|
507 |
00FE: RLF 77,F |
|
|
508 |
00FF: RLF 77,F |
|
|
509 |
0100: MOVLW FC |
|
|
510 |
0101: ANDWF 77,F |
|
|
511 |
0102: MOVF 77,W |
|
|
512 |
0103: IORWF 4F,F |
3020 |
jacho |
513 |
.................... n |= input(LCD_DATA7) << 3; |
3021 |
kaklik |
514 |
0104: BSF 03.5 |
|
|
515 |
0105: BSF 08.7 |
|
|
516 |
0106: MOVLW 00 |
|
|
517 |
0107: BCF 03.5 |
|
|
518 |
0108: BTFSC 08.7 |
|
|
519 |
0109: MOVLW 01 |
|
|
520 |
010A: MOVWF 77 |
|
|
521 |
010B: RLF 77,F |
|
|
522 |
010C: RLF 77,F |
|
|
523 |
010D: RLF 77,F |
|
|
524 |
010E: MOVLW F8 |
|
|
525 |
010F: ANDWF 77,F |
|
|
526 |
0110: MOVF 77,W |
|
|
527 |
0111: IORWF 4F,F |
3020 |
jacho |
528 |
.................... |
|
|
529 |
.................... return(n); |
3021 |
kaklik |
530 |
0112: MOVF 4F,W |
|
|
531 |
0113: MOVWF 78 |
3020 |
jacho |
532 |
.................... #else |
|
|
533 |
.................... return(lcd.data); |
|
|
534 |
.................... #endif |
|
|
535 |
.................... } |
3021 |
kaklik |
536 |
0114: RETURN |
3020 |
jacho |
537 |
.................... |
|
|
538 |
.................... void lcd_send_nibble(BYTE n) |
|
|
539 |
.................... { |
|
|
540 |
.................... #if (defined(LCD_DATA4) && defined(LCD_DATA5) && defined(LCD_DATA6) && defined(LCD_DATA7)) |
|
|
541 |
.................... /* Write to the data port */ |
|
|
542 |
.................... output_bit(LCD_DATA4, bit_test(n, 0)); |
|
|
543 |
* |
3021 |
kaklik |
544 |
00B8: BTFSC 4E.0 |
|
|
545 |
00B9: GOTO 0BC |
|
|
546 |
00BA: BCF 08.4 |
|
|
547 |
00BB: GOTO 0BD |
|
|
548 |
00BC: BSF 08.4 |
|
|
549 |
00BD: BSF 03.5 |
|
|
550 |
00BE: BCF 08.4 |
3020 |
jacho |
551 |
.................... output_bit(LCD_DATA5, bit_test(n, 1)); |
3021 |
kaklik |
552 |
00BF: BCF 03.5 |
|
|
553 |
00C0: BTFSC 4E.1 |
|
|
554 |
00C1: GOTO 0C4 |
|
|
555 |
00C2: BCF 08.5 |
|
|
556 |
00C3: GOTO 0C5 |
|
|
557 |
00C4: BSF 08.5 |
|
|
558 |
00C5: BSF 03.5 |
|
|
559 |
00C6: BCF 08.5 |
3020 |
jacho |
560 |
.................... output_bit(LCD_DATA6, bit_test(n, 2)); |
3021 |
kaklik |
561 |
00C7: BCF 03.5 |
|
|
562 |
00C8: BTFSC 4E.2 |
|
|
563 |
00C9: GOTO 0CC |
|
|
564 |
00CA: BCF 08.6 |
|
|
565 |
00CB: GOTO 0CD |
|
|
566 |
00CC: BSF 08.6 |
|
|
567 |
00CD: BSF 03.5 |
|
|
568 |
00CE: BCF 08.6 |
3020 |
jacho |
569 |
.................... output_bit(LCD_DATA7, bit_test(n, 3)); |
3021 |
kaklik |
570 |
00CF: BCF 03.5 |
|
|
571 |
00D0: BTFSC 4E.3 |
|
|
572 |
00D1: GOTO 0D4 |
|
|
573 |
00D2: BCF 08.7 |
|
|
574 |
00D3: GOTO 0D5 |
|
|
575 |
00D4: BSF 08.7 |
|
|
576 |
00D5: BSF 03.5 |
|
|
577 |
00D6: BCF 08.7 |
3020 |
jacho |
578 |
.................... #else |
|
|
579 |
.................... lcdlat.data = n; |
|
|
580 |
.................... #endif |
|
|
581 |
.................... |
|
|
582 |
.................... delay_cycles(1); |
3021 |
kaklik |
583 |
00D7: NOP |
3020 |
jacho |
584 |
.................... lcd_output_enable(1); |
3021 |
kaklik |
585 |
00D8: BCF 03.5 |
|
|
586 |
00D9: BSF 09.0 |
|
|
587 |
00DA: BSF 03.5 |
|
|
588 |
00DB: BCF 09.0 |
3020 |
jacho |
589 |
.................... delay_us(2); |
3021 |
kaklik |
590 |
00DC: GOTO 0DD |
|
|
591 |
00DD: GOTO 0DE |
3020 |
jacho |
592 |
.................... lcd_output_enable(0); |
3021 |
kaklik |
593 |
00DE: BCF 03.5 |
|
|
594 |
00DF: BCF 09.0 |
|
|
595 |
00E0: BSF 03.5 |
|
|
596 |
00E1: BCF 09.0 |
3020 |
jacho |
597 |
.................... } |
3021 |
kaklik |
598 |
00E2: BCF 03.5 |
|
|
599 |
00E3: RETURN |
3020 |
jacho |
600 |
.................... |
|
|
601 |
.................... void lcd_send_byte(BYTE address, BYTE n) |
|
|
602 |
.................... { |
|
|
603 |
.................... #if defined(__PCB__) |
|
|
604 |
.................... set_tris_lcd(LCD_OUTPUT_MAP); |
|
|
605 |
.................... #else |
|
|
606 |
.................... lcd_enable_tris(); |
|
|
607 |
* |
3021 |
kaklik |
608 |
0115: BSF 03.5 |
|
|
609 |
0116: BCF 09.0 |
3020 |
jacho |
610 |
.................... lcd_rs_tris(); |
3021 |
kaklik |
611 |
0117: BCF 09.1 |
3020 |
jacho |
612 |
.................... lcd_rw_tris(); |
3021 |
kaklik |
613 |
0118: BCF 09.2 |
3020 |
jacho |
614 |
.................... #endif |
|
|
615 |
.................... |
|
|
616 |
.................... lcd_output_rs(0); |
3021 |
kaklik |
617 |
0119: BCF 03.5 |
|
|
618 |
011A: BCF 09.1 |
|
|
619 |
011B: BSF 03.5 |
|
|
620 |
011C: BCF 09.1 |
3020 |
jacho |
621 |
.................... while ( bit_test(lcd_read_byte(),7) ) ; |
|
|
622 |
* |
3021 |
kaklik |
623 |
014B: MOVF 78,W |
|
|
624 |
014C: MOVWF 4D |
|
|
625 |
014D: BTFSS 4D.7 |
|
|
626 |
014E: GOTO 151 |
|
|
627 |
014F: BSF 03.5 |
|
|
628 |
0150: GOTO 11D |
|
|
629 |
.................... lcd_output_rs(address); |
|
|
630 |
0151: MOVF 4B,F |
|
|
631 |
0152: BTFSS 03.2 |
3020 |
jacho |
632 |
0153: GOTO 156 |
3021 |
kaklik |
633 |
0154: BCF 09.1 |
|
|
634 |
0155: GOTO 157 |
|
|
635 |
0156: BSF 09.1 |
|
|
636 |
0157: BSF 03.5 |
|
|
637 |
0158: BCF 09.1 |
|
|
638 |
.................... delay_cycles(1); |
|
|
639 |
0159: NOP |
|
|
640 |
.................... lcd_output_rw(0); |
|
|
641 |
015A: BCF 03.5 |
|
|
642 |
015B: BCF 09.2 |
3020 |
jacho |
643 |
015C: BSF 03.5 |
3021 |
kaklik |
644 |
015D: BCF 09.2 |
3020 |
jacho |
645 |
.................... delay_cycles(1); |
|
|
646 |
015E: NOP |
3021 |
kaklik |
647 |
.................... lcd_output_enable(0); |
3020 |
jacho |
648 |
015F: BCF 03.5 |
3021 |
kaklik |
649 |
0160: BCF 09.0 |
3020 |
jacho |
650 |
0161: BSF 03.5 |
3021 |
kaklik |
651 |
0162: BCF 09.0 |
3020 |
jacho |
652 |
.................... lcd_send_nibble(n >> 4); |
3021 |
kaklik |
653 |
0163: BCF 03.5 |
|
|
654 |
0164: SWAPF 4C,W |
|
|
655 |
0165: MOVWF 4D |
|
|
656 |
0166: MOVLW 0F |
|
|
657 |
0167: ANDWF 4D,F |
|
|
658 |
0168: MOVF 4D,W |
|
|
659 |
0169: MOVWF 4E |
|
|
660 |
016A: CALL 0B8 |
3020 |
jacho |
661 |
.................... lcd_send_nibble(n & 0xf); |
3021 |
kaklik |
662 |
016B: MOVF 4C,W |
|
|
663 |
016C: ANDLW 0F |
|
|
664 |
016D: MOVWF 4D |
|
|
665 |
016E: MOVWF 4E |
|
|
666 |
016F: CALL 0B8 |
3020 |
jacho |
667 |
.................... } |
3021 |
kaklik |
668 |
0170: RETURN |
3020 |
jacho |
669 |
.................... |
|
|
670 |
.................... #if defined(LCD_EXTENDED_NEWLINE) |
|
|
671 |
.................... unsigned int8 g_LcdX, g_LcdY; |
|
|
672 |
.................... #endif |
|
|
673 |
.................... |
|
|
674 |
.................... void lcd_init(void) |
|
|
675 |
.................... { |
|
|
676 |
.................... BYTE i; |
|
|
677 |
.................... |
|
|
678 |
.................... #if defined(__PCB__) |
|
|
679 |
.................... set_tris_lcd(LCD_OUTPUT_MAP); |
|
|
680 |
.................... #else |
|
|
681 |
.................... #if (defined(LCD_DATA4) && defined(LCD_DATA5) && defined(LCD_DATA6) && defined(LCD_DATA7)) |
|
|
682 |
.................... output_drive(LCD_DATA4); |
3021 |
kaklik |
683 |
0171: BSF 03.5 |
|
|
684 |
0172: BCF 08.4 |
3020 |
jacho |
685 |
.................... output_drive(LCD_DATA5); |
3021 |
kaklik |
686 |
0173: BCF 08.5 |
3020 |
jacho |
687 |
.................... output_drive(LCD_DATA6); |
3021 |
kaklik |
688 |
0174: BCF 08.6 |
3020 |
jacho |
689 |
.................... output_drive(LCD_DATA7); |
3021 |
kaklik |
690 |
0175: BCF 08.7 |
3020 |
jacho |
691 |
.................... #else |
|
|
692 |
.................... lcdtris.data = 0x0; |
|
|
693 |
.................... #endif |
|
|
694 |
.................... lcd_enable_tris(); |
3021 |
kaklik |
695 |
0176: BCF 09.0 |
3020 |
jacho |
696 |
.................... lcd_rs_tris(); |
3021 |
kaklik |
697 |
0177: BCF 09.1 |
3020 |
jacho |
698 |
.................... lcd_rw_tris(); |
3021 |
kaklik |
699 |
0178: BCF 09.2 |
3020 |
jacho |
700 |
.................... #endif |
|
|
701 |
.................... |
|
|
702 |
.................... lcd_output_rs(0); |
3021 |
kaklik |
703 |
0179: BCF 03.5 |
|
|
704 |
017A: BCF 09.1 |
|
|
705 |
017B: BSF 03.5 |
|
|
706 |
017C: BCF 09.1 |
3020 |
jacho |
707 |
.................... lcd_output_rw(0); |
3021 |
kaklik |
708 |
017D: BCF 03.5 |
|
|
709 |
017E: BCF 09.2 |
|
|
710 |
017F: BSF 03.5 |
|
|
711 |
0180: BCF 09.2 |
3020 |
jacho |
712 |
.................... lcd_output_enable(0); |
3021 |
kaklik |
713 |
0181: BCF 03.5 |
|
|
714 |
0182: BCF 09.0 |
|
|
715 |
0183: BSF 03.5 |
|
|
716 |
0184: BCF 09.0 |
3020 |
jacho |
717 |
.................... |
|
|
718 |
.................... delay_ms(15); |
3021 |
kaklik |
719 |
0185: MOVLW 0F |
|
|
720 |
0186: BCF 03.5 |
|
|
721 |
0187: MOVWF 47 |
|
|
722 |
0188: CALL 0A4 |
3020 |
jacho |
723 |
.................... for(i=1;i<=3;++i) |
3021 |
kaklik |
724 |
0189: MOVLW 01 |
|
|
725 |
018A: MOVWF 3A |
|
|
726 |
018B: MOVF 3A,W |
|
|
727 |
018C: SUBLW 03 |
|
|
728 |
018D: BTFSS 03.0 |
|
|
729 |
018E: GOTO 197 |
3020 |
jacho |
730 |
.................... { |
|
|
731 |
.................... lcd_send_nibble(3); |
3021 |
kaklik |
732 |
018F: MOVLW 03 |
|
|
733 |
0190: MOVWF 4E |
|
|
734 |
0191: CALL 0B8 |
3020 |
jacho |
735 |
.................... delay_ms(5); |
3021 |
kaklik |
736 |
0192: MOVLW 05 |
|
|
737 |
0193: MOVWF 47 |
|
|
738 |
0194: CALL 0A4 |
3020 |
jacho |
739 |
.................... } |
3021 |
kaklik |
740 |
0195: INCF 3A,F |
|
|
741 |
0196: GOTO 18B |
3020 |
jacho |
742 |
.................... |
|
|
743 |
.................... lcd_send_nibble(2); |
3021 |
kaklik |
744 |
0197: MOVLW 02 |
|
|
745 |
0198: MOVWF 4E |
|
|
746 |
0199: CALL 0B8 |
3020 |
jacho |
747 |
.................... for(i=0;i<=3;++i) |
3021 |
kaklik |
748 |
019A: CLRF 3A |
|
|
749 |
019B: MOVF 3A,W |
|
|
750 |
019C: SUBLW 03 |
|
|
751 |
019D: BTFSS 03.0 |
|
|
752 |
019E: GOTO 1A8 |
3020 |
jacho |
753 |
.................... lcd_send_byte(0,LCD_INIT_STRING[i]); |
3021 |
kaklik |
754 |
019F: MOVF 3A,W |
|
|
755 |
01A0: CALL 038 |
|
|
756 |
01A1: MOVWF 3B |
|
|
757 |
01A2: CLRF 4B |
|
|
758 |
01A3: MOVF 3B,W |
|
|
759 |
01A4: MOVWF 4C |
|
|
760 |
01A5: CALL 115 |
3020 |
jacho |
761 |
.................... |
|
|
762 |
.................... #if defined(LCD_EXTENDED_NEWLINE) |
3021 |
kaklik |
763 |
01A6: INCF 3A,F |
|
|
764 |
01A7: GOTO 19B |
3020 |
jacho |
765 |
.................... g_LcdX = 0; |
|
|
766 |
.................... g_LcdY = 0; |
|
|
767 |
.................... #endif |
|
|
768 |
.................... } |
3021 |
kaklik |
769 |
01A8: BSF 0A.3 |
|
|
770 |
01A9: BCF 0A.4 |
|
|
771 |
01AA: GOTO 0BA (RETURN) |
3020 |
jacho |
772 |
.................... |
|
|
773 |
.................... void lcd_gotoxy(BYTE x, BYTE y) |
|
|
774 |
.................... { |
|
|
775 |
.................... BYTE address; |
|
|
776 |
.................... |
|
|
777 |
.................... if(y!=1) |
3021 |
kaklik |
778 |
01AB: DECFSZ 48,W |
|
|
779 |
01AC: GOTO 1AE |
|
|
780 |
01AD: GOTO 1B1 |
3020 |
jacho |
781 |
.................... address=LCD_LINE_TWO; |
3021 |
kaklik |
782 |
01AE: MOVLW 40 |
|
|
783 |
01AF: MOVWF 49 |
3020 |
jacho |
784 |
.................... else |
3021 |
kaklik |
785 |
01B0: GOTO 1B2 |
3020 |
jacho |
786 |
.................... address=0; |
3021 |
kaklik |
787 |
01B1: CLRF 49 |
3020 |
jacho |
788 |
.................... |
|
|
789 |
.................... address+=x-1; |
3021 |
kaklik |
790 |
01B2: MOVLW 01 |
|
|
791 |
01B3: SUBWF 47,W |
|
|
792 |
01B4: ADDWF 49,F |
3020 |
jacho |
793 |
.................... lcd_send_byte(0,0x80|address); |
3021 |
kaklik |
794 |
01B5: MOVF 49,W |
|
|
795 |
01B6: IORLW 80 |
|
|
796 |
01B7: MOVWF 4A |
|
|
797 |
01B8: CLRF 4B |
|
|
798 |
01B9: MOVF 4A,W |
|
|
799 |
01BA: MOVWF 4C |
|
|
800 |
01BB: CALL 115 |
3020 |
jacho |
801 |
.................... |
|
|
802 |
.................... #if defined(LCD_EXTENDED_NEWLINE) |
|
|
803 |
.................... g_LcdX = x - 1; |
|
|
804 |
.................... g_LcdY = y - 1; |
|
|
805 |
.................... #endif |
|
|
806 |
.................... } |
3021 |
kaklik |
807 |
01BC: RETURN |
3020 |
jacho |
808 |
.................... |
|
|
809 |
.................... void lcd_putc(char c) |
|
|
810 |
.................... { |
|
|
811 |
.................... switch (c) |
|
|
812 |
.................... { |
3021 |
kaklik |
813 |
01BD: MOVF 46,W |
|
|
814 |
01BE: XORLW 07 |
|
|
815 |
01BF: BTFSC 03.2 |
|
|
816 |
01C0: GOTO 1CB |
|
|
817 |
01C1: XORLW 0B |
|
|
818 |
01C2: BTFSC 03.2 |
|
|
819 |
01C3: GOTO 1D0 |
|
|
820 |
01C4: XORLW 06 |
|
|
821 |
01C5: BTFSC 03.2 |
|
|
822 |
01C6: GOTO 1D8 |
|
|
823 |
01C7: XORLW 02 |
|
|
824 |
01C8: BTFSC 03.2 |
|
|
825 |
01C9: GOTO 1DE |
|
|
826 |
01CA: GOTO 1E3 |
3020 |
jacho |
827 |
.................... case '\a' : lcd_gotoxy(1,1); break; |
3021 |
kaklik |
828 |
01CB: MOVLW 01 |
|
|
829 |
01CC: MOVWF 47 |
|
|
830 |
01CD: MOVWF 48 |
|
|
831 |
01CE: CALL 1AB |
|
|
832 |
01CF: GOTO 1E9 |
3020 |
jacho |
833 |
.................... |
|
|
834 |
.................... case '\f' : lcd_send_byte(0,1); |
3021 |
kaklik |
835 |
01D0: CLRF 4B |
|
|
836 |
01D1: MOVLW 01 |
|
|
837 |
01D2: MOVWF 4C |
|
|
838 |
01D3: CALL 115 |
3020 |
jacho |
839 |
.................... delay_ms(2); |
3021 |
kaklik |
840 |
01D4: MOVLW 02 |
|
|
841 |
01D5: MOVWF 47 |
|
|
842 |
01D6: CALL 0A4 |
3020 |
jacho |
843 |
.................... #if defined(LCD_EXTENDED_NEWLINE) |
|
|
844 |
.................... g_LcdX = 0; |
|
|
845 |
.................... g_LcdY = 0; |
|
|
846 |
.................... #endif |
|
|
847 |
.................... break; |
3021 |
kaklik |
848 |
01D7: GOTO 1E9 |
3020 |
jacho |
849 |
.................... |
|
|
850 |
.................... #if defined(LCD_EXTENDED_NEWLINE) |
|
|
851 |
.................... case '\r' : lcd_gotoxy(1, g_LcdY+1); break; |
|
|
852 |
.................... case '\n' : |
|
|
853 |
.................... while (g_LcdX++ < LCD_LINE_LENGTH) |
|
|
854 |
.................... { |
|
|
855 |
.................... lcd_send_byte(1, ' '); |
|
|
856 |
.................... } |
|
|
857 |
.................... lcd_gotoxy(1, g_LcdY+2); |
|
|
858 |
.................... break; |
|
|
859 |
.................... #else |
|
|
860 |
.................... case '\n' : lcd_gotoxy(1,2); break; |
3021 |
kaklik |
861 |
01D8: MOVLW 01 |
|
|
862 |
01D9: MOVWF 47 |
|
|
863 |
01DA: MOVLW 02 |
|
|
864 |
01DB: MOVWF 48 |
|
|
865 |
01DC: CALL 1AB |
|
|
866 |
01DD: GOTO 1E9 |
3020 |
jacho |
867 |
.................... #endif |
|
|
868 |
.................... |
|
|
869 |
.................... case '\b' : lcd_send_byte(0,0x10); break; |
3021 |
kaklik |
870 |
01DE: CLRF 4B |
|
|
871 |
01DF: MOVLW 10 |
|
|
872 |
01E0: MOVWF 4C |
|
|
873 |
01E1: CALL 115 |
|
|
874 |
01E2: GOTO 1E9 |
3020 |
jacho |
875 |
.................... |
|
|
876 |
.................... #if defined(LCD_EXTENDED_NEWLINE) |
|
|
877 |
.................... default : |
|
|
878 |
.................... if (g_LcdX < LCD_LINE_LENGTH) |
|
|
879 |
.................... { |
|
|
880 |
.................... lcd_send_byte(1, c); |
|
|
881 |
.................... g_LcdX++; |
|
|
882 |
.................... } |
|
|
883 |
.................... break; |
|
|
884 |
.................... #else |
|
|
885 |
.................... default : lcd_send_byte(1,c); break; |
3021 |
kaklik |
886 |
01E3: MOVLW 01 |
|
|
887 |
01E4: MOVWF 4B |
|
|
888 |
01E5: MOVF 46,W |
|
|
889 |
01E6: MOVWF 4C |
|
|
890 |
01E7: CALL 115 |
|
|
891 |
01E8: GOTO 1E9 |
3020 |
jacho |
892 |
.................... #endif |
|
|
893 |
.................... } |
|
|
894 |
.................... } |
3021 |
kaklik |
895 |
01E9: RETURN |
3020 |
jacho |
896 |
.................... |
|
|
897 |
.................... char lcd_getc(BYTE x, BYTE y) |
|
|
898 |
.................... { |
|
|
899 |
.................... char value; |
|
|
900 |
.................... |
|
|
901 |
.................... lcd_gotoxy(x,y); |
|
|
902 |
.................... while ( bit_test(lcd_read_byte(),7) ); // wait until busy flag is low |
|
|
903 |
.................... lcd_output_rs(1); |
|
|
904 |
.................... value = lcd_read_byte(); |
|
|
905 |
.................... lcd_output_rs(0); |
|
|
906 |
.................... |
|
|
907 |
.................... return(value); |
|
|
908 |
.................... } |
|
|
909 |
.................... |
|
|
910 |
.................... |
|
|
911 |
.................... |
|
|
912 |
.................... unsigned int32 pulse_count=0; |
|
|
913 |
.................... unsigned int16 overflow_count=0; |
|
|
914 |
.................... unsigned int16 time_overflow_count=0; |
|
|
915 |
.................... |
|
|
916 |
.................... |
|
|
917 |
.................... #int_RTCC |
|
|
918 |
.................... void RTCC_isr(void) |
|
|
919 |
.................... { |
|
|
920 |
.................... time_overflow_count++; |
|
|
921 |
* |
|
|
922 |
0040: INCF 2D,F |
|
|
923 |
0041: BTFSC 03.2 |
|
|
924 |
0042: INCF 2E,F |
|
|
925 |
.................... } |
|
|
926 |
.................... |
|
|
927 |
0043: BCF 0B.2 |
|
|
928 |
0044: BCF 0A.3 |
|
|
929 |
0045: BCF 0A.4 |
|
|
930 |
0046: GOTO 021 |
|
|
931 |
.................... #int_TIMER1 |
|
|
932 |
.................... void TIMER1_isr(void) |
|
|
933 |
.................... { |
|
|
934 |
.................... overflow_count++; |
|
|
935 |
0047: INCF 2B,F |
|
|
936 |
0048: BTFSC 03.2 |
|
|
937 |
0049: INCF 2C,F |
|
|
938 |
.................... output_toggle(LED3); |
|
|
939 |
004A: BCF 2F.4 |
|
|
940 |
004B: MOVF 2F,W |
|
|
941 |
004C: BSF 03.5 |
|
|
942 |
004D: MOVWF 07 |
|
|
943 |
004E: MOVLW 10 |
|
|
944 |
004F: BCF 03.5 |
|
|
945 |
0050: XORWF 07,F |
|
|
946 |
.................... output_toggle(BEEP); |
|
|
947 |
0051: BSF 03.5 |
|
|
948 |
0052: BCF 08.2 |
|
|
949 |
0053: MOVLW 04 |
|
|
950 |
0054: BCF 03.5 |
|
|
951 |
0055: XORWF 08,F |
|
|
952 |
.................... } |
|
|
953 |
.................... |
|
|
954 |
0056: BCF 0C.0 |
|
|
955 |
0057: BCF 0A.3 |
|
|
956 |
0058: BCF 0A.4 |
|
|
957 |
0059: GOTO 021 |
|
|
958 |
.................... void sound_beep( unsigned int lenght, int16 frequency) |
|
|
959 |
.................... { |
|
|
960 |
.................... unsigned int i; |
|
|
961 |
.................... |
|
|
962 |
.................... for(i=0;i<=lenght;i++) |
|
|
963 |
* |
3021 |
kaklik |
964 |
0654: CLRF 3D |
|
|
965 |
0655: MOVF 3D,W |
|
|
966 |
0656: SUBWF 3A,W |
|
|
967 |
0657: BTFSS 03.0 |
|
|
968 |
0658: GOTO 69C |
3020 |
jacho |
969 |
.................... { |
|
|
970 |
.................... output_toggle(BEEP); |
3021 |
kaklik |
971 |
0659: BSF 03.5 |
|
|
972 |
065A: BCF 08.2 |
|
|
973 |
065B: MOVLW 04 |
|
|
974 |
065C: BCF 03.5 |
|
|
975 |
065D: XORWF 08,F |
3020 |
jacho |
976 |
.................... delay_us(1/frequency); |
3021 |
kaklik |
977 |
065E: CLRF 3F |
|
|
978 |
065F: MOVLW 01 |
|
|
979 |
0660: MOVWF 3E |
|
|
980 |
0661: MOVF 3C,W |
|
|
981 |
0662: MOVWF 41 |
|
|
982 |
0663: MOVF 3B,W |
|
|
983 |
0664: MOVWF 40 |
3020 |
jacho |
984 |
* |
3021 |
kaklik |
985 |
0689: MOVF 79,W |
|
|
986 |
068A: MOVWF 3F |
|
|
987 |
068B: MOVF 78,W |
|
|
988 |
068C: MOVWF 3E |
|
|
989 |
068D: MOVF 3F,W |
|
|
990 |
068E: MOVWF 40 |
|
|
991 |
068F: INCF 40,F |
|
|
992 |
0690: DECF 40,F |
|
|
993 |
0691: BTFSC 03.2 |
|
|
994 |
0692: GOTO 697 |
|
|
995 |
0693: MOVLW FF |
|
|
996 |
0694: MOVWF 41 |
|
|
997 |
0695: CALL 643 |
|
|
998 |
0696: GOTO 690 |
|
|
999 |
0697: MOVF 3E,W |
|
|
1000 |
0698: MOVWF 41 |
|
|
1001 |
0699: CALL 643 |
3020 |
jacho |
1002 |
.................... } |
3021 |
kaklik |
1003 |
069A: INCF 3D,F |
|
|
1004 |
069B: GOTO 655 |
3020 |
jacho |
1005 |
.................... } |
3021 |
kaklik |
1006 |
069C: RETURN |
3020 |
jacho |
1007 |
.................... |
3021 |
kaklik |
1008 |
.................... #define TRESHOLD_setup 1 |
|
|
1009 |
.................... #define INTERVAL_setup 0 |
|
|
1010 |
.................... |
|
|
1011 |
.................... |
3020 |
jacho |
1012 |
.................... void main() |
|
|
1013 |
.................... { |
|
|
1014 |
* |
|
|
1015 |
0800: CLRF 04 |
|
|
1016 |
0801: BCF 03.7 |
|
|
1017 |
0802: MOVLW 1F |
|
|
1018 |
0803: ANDWF 03,F |
|
|
1019 |
0804: MOVLW 71 |
|
|
1020 |
0805: BSF 03.5 |
|
|
1021 |
0806: MOVWF 0F |
|
|
1022 |
0807: MOVF 0F,W |
|
|
1023 |
0808: BCF 06.7 |
|
|
1024 |
0809: BCF 03.5 |
|
|
1025 |
080A: BSF 06.7 |
|
|
1026 |
080B: CLRF 2A |
|
|
1027 |
080C: CLRF 29 |
|
|
1028 |
080D: CLRF 28 |
|
|
1029 |
080E: CLRF 27 |
|
|
1030 |
080F: CLRF 2C |
|
|
1031 |
0810: CLRF 2B |
|
|
1032 |
0811: CLRF 2E |
|
|
1033 |
0812: CLRF 2D |
|
|
1034 |
0813: BSF 03.5 |
|
|
1035 |
0814: BSF 03.6 |
|
|
1036 |
0815: MOVF 09,W |
|
|
1037 |
0816: ANDLW C0 |
|
|
1038 |
0817: MOVWF 09 |
|
|
1039 |
0818: BCF 03.6 |
|
|
1040 |
0819: BCF 1F.4 |
|
|
1041 |
081A: BCF 1F.5 |
|
|
1042 |
081B: MOVLW 00 |
|
|
1043 |
081C: BSF 03.6 |
|
|
1044 |
081D: MOVWF 08 |
|
|
1045 |
081E: BCF 03.5 |
|
|
1046 |
081F: CLRF 07 |
|
|
1047 |
0820: CLRF 08 |
|
|
1048 |
0821: CLRF 09 |
|
|
1049 |
* |
|
|
1050 |
0825: CLRF 31 |
|
|
1051 |
0826: MOVLW 3C |
|
|
1052 |
0827: MOVWF 30 |
3021 |
kaklik |
1053 |
0828: BCF 36.1 |
|
|
1054 |
0829: CLRF 38 |
|
|
1055 |
082A: CLRF 37 |
|
|
1056 |
082B: MOVLW 06 |
|
|
1057 |
082C: MOVWF 39 |
3020 |
jacho |
1058 |
.................... unsigned int16 integration_time=60; |
|
|
1059 |
.................... unsigned int16 time; |
|
|
1060 |
.................... unsigned int16 last_timer; // promena pro praskani |
3021 |
kaklik |
1061 |
.................... unsigned int1 button_press,setup_mode=INTERVAL_setup; // semafor pro cteni tlacitek |
3020 |
jacho |
1062 |
.................... unsigned int16 measurement_number=0; |
3021 |
kaklik |
1063 |
.................... unsigned int8 treshold=6; |
3020 |
jacho |
1064 |
.................... |
|
|
1065 |
.................... setup_adc_ports(sAN0|VSS_VDD); |
3021 |
kaklik |
1066 |
082D: BSF 03.5 |
|
|
1067 |
082E: BSF 03.6 |
|
|
1068 |
082F: MOVF 09,W |
|
|
1069 |
0830: ANDLW C0 |
|
|
1070 |
0831: MOVWF 09 |
|
|
1071 |
0832: BCF 03.6 |
|
|
1072 |
0833: BCF 1F.4 |
|
|
1073 |
0834: BCF 1F.5 |
|
|
1074 |
0835: MOVLW 01 |
|
|
1075 |
0836: BSF 03.6 |
|
|
1076 |
0837: MOVWF 08 |
3020 |
jacho |
1077 |
.................... setup_adc(ADC_CLOCK_DIV_32); |
3021 |
kaklik |
1078 |
0838: BCF 03.5 |
|
|
1079 |
0839: BCF 03.6 |
|
|
1080 |
083A: BCF 1F.6 |
|
|
1081 |
083B: BSF 1F.7 |
|
|
1082 |
083C: BSF 03.5 |
|
|
1083 |
083D: BSF 1F.7 |
|
|
1084 |
083E: BCF 03.5 |
|
|
1085 |
083F: BSF 1F.0 |
3020 |
jacho |
1086 |
.................... setup_spi(SPI_SS_DISABLED); |
3021 |
kaklik |
1087 |
0840: BCF 14.5 |
|
|
1088 |
0841: BCF 2F.5 |
|
|
1089 |
0842: MOVF 2F,W |
|
|
1090 |
0843: BSF 03.5 |
|
|
1091 |
0844: MOVWF 07 |
|
|
1092 |
0845: BCF 03.5 |
|
|
1093 |
0846: BSF 2F.4 |
|
|
1094 |
0847: MOVF 2F,W |
|
|
1095 |
0848: BSF 03.5 |
|
|
1096 |
0849: MOVWF 07 |
|
|
1097 |
084A: BCF 03.5 |
|
|
1098 |
084B: BCF 2F.3 |
|
|
1099 |
084C: MOVF 2F,W |
|
|
1100 |
084D: BSF 03.5 |
|
|
1101 |
084E: MOVWF 07 |
|
|
1102 |
084F: MOVLW 01 |
|
|
1103 |
0850: BCF 03.5 |
3020 |
jacho |
1104 |
0851: MOVWF 14 |
3021 |
kaklik |
1105 |
0852: MOVLW 00 |
|
|
1106 |
0853: BSF 03.5 |
|
|
1107 |
0854: MOVWF 14 |
3020 |
jacho |
1108 |
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_256); |
3021 |
kaklik |
1109 |
0855: MOVF 01,W |
|
|
1110 |
0856: ANDLW C0 |
|
|
1111 |
0857: IORLW 07 |
|
|
1112 |
0858: MOVWF 01 |
3020 |
jacho |
1113 |
.................... setup_timer_1(T1_EXTERNAL|T1_DIV_BY_1); |
3021 |
kaklik |
1114 |
0859: MOVLW 07 |
|
|
1115 |
085A: BCF 03.5 |
|
|
1116 |
085B: MOVWF 10 |
3020 |
jacho |
1117 |
.................... setup_timer_2(T2_DISABLED,0,1); |
|
|
1118 |
085C: MOVLW 00 |
3021 |
kaklik |
1119 |
085D: MOVWF 78 |
3020 |
jacho |
1120 |
085E: MOVWF 12 |
3021 |
kaklik |
1121 |
085F: MOVLW 00 |
|
|
1122 |
0860: BSF 03.5 |
|
|
1123 |
0861: MOVWF 12 |
3020 |
jacho |
1124 |
.................... setup_ccp1(CCP_PWM); |
3021 |
kaklik |
1125 |
0862: BCF 03.5 |
|
|
1126 |
0863: BCF 2F.2 |
|
|
1127 |
0864: MOVF 2F,W |
|
|
1128 |
0865: BSF 03.5 |
|
|
1129 |
0866: MOVWF 07 |
|
|
1130 |
0867: BCF 03.5 |
|
|
1131 |
0868: BCF 07.2 |
|
|
1132 |
0869: BSF 03.5 |
|
|
1133 |
086A: BCF 09.6 |
|
|
1134 |
086B: MOVLW 0C |
|
|
1135 |
086C: BCF 03.5 |
|
|
1136 |
086D: MOVWF 17 |
|
|
1137 |
086E: BSF 03.5 |
|
|
1138 |
086F: CLRF 1B |
|
|
1139 |
0870: CLRF 1C |
|
|
1140 |
0871: MOVLW 01 |
|
|
1141 |
0872: MOVWF 1D |
3020 |
jacho |
1142 |
.................... setup_ccp2(CCP_PWM); |
3021 |
kaklik |
1143 |
0873: BCF 03.5 |
|
|
1144 |
0874: BCF 2F.1 |
|
|
1145 |
0875: MOVF 2F,W |
|
|
1146 |
0876: BSF 03.5 |
|
|
1147 |
0877: MOVWF 07 |
|
|
1148 |
0878: BCF 03.5 |
|
|
1149 |
0879: BCF 07.1 |
|
|
1150 |
087A: MOVLW 0C |
|
|
1151 |
087B: MOVWF 1D |
|
|
1152 |
087C: MOVLW 01 |
|
|
1153 |
087D: MOVWF 00 |
3020 |
jacho |
1154 |
.................... setup_oscillator(OSC_8MHZ); |
3021 |
kaklik |
1155 |
087E: MOVLW 71 |
|
|
1156 |
087F: BSF 03.5 |
|
|
1157 |
0880: MOVWF 0F |
|
|
1158 |
0881: MOVF 0F,W |
3020 |
jacho |
1159 |
.................... |
|
|
1160 |
.................... set_pwm1_duty(0); |
3021 |
kaklik |
1161 |
0882: BCF 03.5 |
|
|
1162 |
0883: CLRF 15 |
3020 |
jacho |
1163 |
.................... set_pwm2_duty(0); |
3021 |
kaklik |
1164 |
0884: CLRF 1B |
3020 |
jacho |
1165 |
.................... |
|
|
1166 |
.................... output_high(LED1); |
3021 |
kaklik |
1167 |
0885: BCF 2F.6 |
|
|
1168 |
0886: MOVF 2F,W |
|
|
1169 |
0887: BSF 03.5 |
|
|
1170 |
0888: MOVWF 07 |
|
|
1171 |
0889: BCF 03.5 |
|
|
1172 |
088A: BSF 07.6 |
3020 |
jacho |
1173 |
.................... output_high(LED2); |
3021 |
kaklik |
1174 |
088B: BCF 2F.5 |
|
|
1175 |
088C: MOVF 2F,W |
|
|
1176 |
088D: BSF 03.5 |
|
|
1177 |
088E: MOVWF 07 |
|
|
1178 |
088F: BCF 03.5 |
|
|
1179 |
0890: BSF 07.5 |
3020 |
jacho |
1180 |
.................... output_high(LED3); |
3021 |
kaklik |
1181 |
0891: BCF 2F.4 |
|
|
1182 |
0892: MOVF 2F,W |
|
|
1183 |
0893: BSF 03.5 |
|
|
1184 |
0894: MOVWF 07 |
|
|
1185 |
0895: BCF 03.5 |
|
|
1186 |
0896: BSF 07.4 |
3020 |
jacho |
1187 |
.................... output_high(LED4); |
3021 |
kaklik |
1188 |
0897: BSF 03.5 |
|
|
1189 |
0898: BCF 08.3 |
|
|
1190 |
0899: BCF 03.5 |
|
|
1191 |
089A: BSF 08.3 |
3020 |
jacho |
1192 |
.................... output_low(BEEP); |
3021 |
kaklik |
1193 |
089B: BSF 03.5 |
|
|
1194 |
089C: BCF 08.2 |
|
|
1195 |
089D: BCF 03.5 |
|
|
1196 |
089E: BCF 08.2 |
3020 |
jacho |
1197 |
.................... |
|
|
1198 |
.................... setup_comparator(CP2_A0_VREF|CP2_OUT_ON_A5); // sets two comparators(A1 and VR and A2 as the output) |
3021 |
kaklik |
1199 |
089F: BSF 03.6 |
|
|
1200 |
08A0: CLRF 07 |
|
|
1201 |
08A1: MOVLW A4 |
|
|
1202 |
08A2: MOVWF 08 |
|
|
1203 |
08A3: MOVLW 10 |
|
|
1204 |
08A4: MOVWF 09 |
|
|
1205 |
08A5: BSF 03.5 |
|
|
1206 |
08A6: BCF 03.6 |
|
|
1207 |
08A7: BCF 05.5 |
|
|
1208 |
08A8: BSF 05.0 |
|
|
1209 |
.................... setup_vref(VREF_HIGH|treshold); //sets 3.6(vdd *value/32 +vdd/4) if vdd is 5.0V |
|
|
1210 |
08A9: BCF 03.5 |
|
|
1211 |
08AA: MOVF 39,W |
|
|
1212 |
08AB: IORLW 80 |
|
|
1213 |
08AC: MOVWF 3A |
|
|
1214 |
08AD: BSF 03.5 |
|
|
1215 |
08AE: MOVWF 17 |
3020 |
jacho |
1216 |
.................... enable_interrupts(INT_COMP); //enables the comparator interrupt |
3021 |
kaklik |
1217 |
08AF: BSF 0D.5 |
3020 |
jacho |
1218 |
.................... enable_interrupts(INT_RTCC); |
3021 |
kaklik |
1219 |
08B0: BCF 03.5 |
|
|
1220 |
08B1: BSF 0B.5 |
3020 |
jacho |
1221 |
.................... enable_interrupts(INT_TIMER1); |
3021 |
kaklik |
1222 |
08B2: BSF 03.5 |
|
|
1223 |
08B3: BSF 0C.0 |
3020 |
jacho |
1224 |
.................... enable_interrupts(INT_TIMER2); |
3021 |
kaklik |
1225 |
08B4: BSF 0C.1 |
3020 |
jacho |
1226 |
.................... enable_interrupts(GLOBAL); |
3021 |
kaklik |
1227 |
08B5: MOVLW C0 |
|
|
1228 |
08B6: BCF 03.5 |
|
|
1229 |
08B7: IORWF 0B,F |
3020 |
jacho |
1230 |
.................... lcd_init(); |
3021 |
kaklik |
1231 |
08B8: BCF 0A.3 |
|
|
1232 |
08B9: GOTO 171 |
|
|
1233 |
08BA: BSF 0A.3 |
3020 |
jacho |
1234 |
.................... |
|
|
1235 |
.................... lcd_putc("\fGM counter V1.0 \n 2013 MLAB"); |
3021 |
kaklik |
1236 |
08BB: MOVLW 5A |
|
|
1237 |
08BC: BSF 03.6 |
|
|
1238 |
08BD: MOVWF 0D |
|
|
1239 |
08BE: MOVLW 00 |
|
|
1240 |
08BF: MOVWF 0F |
|
|
1241 |
08C0: BCF 0A.3 |
|
|
1242 |
08C1: BCF 03.6 |
|
|
1243 |
08C2: CALL 1EA |
|
|
1244 |
08C3: BSF 0A.3 |
3020 |
jacho |
1245 |
.................... printf("Geiger-Muller Counter V1.0 \r\n"); |
3021 |
kaklik |
1246 |
08C4: MOVLW 6A |
|
|
1247 |
08C5: BSF 03.6 |
|
|
1248 |
08C6: MOVWF 0D |
|
|
1249 |
08C7: MOVLW 00 |
|
|
1250 |
08C8: MOVWF 0F |
|
|
1251 |
08C9: BCF 0A.3 |
|
|
1252 |
08CA: BCF 03.6 |
|
|
1253 |
08CB: CALL 252 |
|
|
1254 |
08CC: BSF 0A.3 |
3020 |
jacho |
1255 |
.................... printf("(c) 2013 MLAB and UST.cz \r\n"); |
3021 |
kaklik |
1256 |
08CD: MOVLW 79 |
|
|
1257 |
08CE: BSF 03.6 |
|
|
1258 |
08CF: MOVWF 0D |
|
|
1259 |
08D0: MOVLW 00 |
|
|
1260 |
08D1: MOVWF 0F |
|
|
1261 |
08D2: BCF 0A.3 |
|
|
1262 |
08D3: BCF 03.6 |
|
|
1263 |
08D4: CALL 252 |
|
|
1264 |
08D5: BSF 0A.3 |
3020 |
jacho |
1265 |
.................... Delay_ms(1000); |
3021 |
kaklik |
1266 |
08D6: MOVLW 04 |
|
|
1267 |
08D7: MOVWF 3A |
|
|
1268 |
08D8: MOVLW FA |
|
|
1269 |
08D9: MOVWF 47 |
|
|
1270 |
08DA: BCF 0A.3 |
|
|
1271 |
08DB: CALL 0A4 |
|
|
1272 |
08DC: BSF 0A.3 |
|
|
1273 |
08DD: DECFSZ 3A,F |
|
|
1274 |
08DE: GOTO 0D8 |
3020 |
jacho |
1275 |
.................... |
|
|
1276 |
.................... lcd_putc("\f"); |
3021 |
kaklik |
1277 |
08DF: MOVLW 87 |
|
|
1278 |
08E0: BSF 03.6 |
|
|
1279 |
08E1: MOVWF 0D |
|
|
1280 |
08E2: MOVLW 00 |
|
|
1281 |
08E3: MOVWF 0F |
|
|
1282 |
08E4: BCF 0A.3 |
|
|
1283 |
08E5: BCF 03.6 |
|
|
1284 |
08E6: CALL 1EA |
|
|
1285 |
08E7: BSF 0A.3 |
3020 |
jacho |
1286 |
.................... printf("\r\n"); |
3021 |
kaklik |
1287 |
08E8: MOVLW 0D |
|
|
1288 |
08E9: MOVWF 46 |
|
|
1289 |
08EA: BCF 0A.3 |
|
|
1290 |
08EB: CALL 230 |
|
|
1291 |
08EC: BSF 0A.3 |
|
|
1292 |
08ED: MOVLW 0A |
|
|
1293 |
08EE: MOVWF 46 |
|
|
1294 |
08EF: BCF 0A.3 |
|
|
1295 |
08F0: CALL 230 |
|
|
1296 |
08F1: BSF 0A.3 |
3020 |
jacho |
1297 |
.................... |
|
|
1298 |
.................... set_timer1(0); |
3021 |
kaklik |
1299 |
08F2: CLRF 0F |
|
|
1300 |
08F3: CLRF 0E |
3020 |
jacho |
1301 |
.................... |
|
|
1302 |
.................... lcd_gotoxy(1,1); // vypsani hodnoty count, abz byla na LCD hned od zapnuti |
3021 |
kaklik |
1303 |
08F4: MOVLW 01 |
|
|
1304 |
08F5: MOVWF 47 |
|
|
1305 |
08F6: MOVWF 48 |
|
|
1306 |
08F7: BCF 0A.3 |
|
|
1307 |
08F8: CALL 1AB |
|
|
1308 |
08F9: BSF 0A.3 |
3020 |
jacho |
1309 |
.................... printf(lcd_putc,"Count:%lu ",pulse_count); |
3021 |
kaklik |
1310 |
08FA: MOVLW 88 |
|
|
1311 |
08FB: BSF 03.6 |
|
|
1312 |
08FC: MOVWF 0D |
|
|
1313 |
08FD: MOVLW 00 |
|
|
1314 |
08FE: MOVWF 0F |
|
|
1315 |
08FF: BCF 03.0 |
|
|
1316 |
0900: MOVLW 06 |
|
|
1317 |
0901: BCF 03.6 |
|
|
1318 |
0902: MOVWF 3A |
|
|
1319 |
0903: BCF 0A.3 |
|
|
1320 |
0904: CALL 298 |
|
|
1321 |
0905: BSF 0A.3 |
|
|
1322 |
0906: MOVLW 41 |
|
|
1323 |
0907: MOVWF 04 |
|
|
1324 |
0908: MOVF 2A,W |
|
|
1325 |
0909: MOVWF 3D |
|
|
1326 |
090A: MOVF 29,W |
|
|
1327 |
090B: MOVWF 3C |
|
|
1328 |
090C: MOVF 28,W |
|
|
1329 |
090D: MOVWF 3B |
|
|
1330 |
090E: MOVF 27,W |
|
|
1331 |
090F: MOVWF 3A |
|
|
1332 |
0910: BCF 0A.3 |
|
|
1333 |
0911: CALL 329 |
|
|
1334 |
0912: BSF 0A.3 |
|
|
1335 |
0913: MOVLW 8C |
|
|
1336 |
0914: BSF 03.6 |
|
|
1337 |
0915: MOVWF 0D |
|
|
1338 |
0916: MOVLW 00 |
|
|
1339 |
0917: MOVWF 0F |
|
|
1340 |
0918: BSF 03.0 |
|
|
1341 |
0919: MOVLW 05 |
|
|
1342 |
091A: BCF 03.6 |
|
|
1343 |
091B: MOVWF 3A |
|
|
1344 |
091C: BCF 0A.3 |
|
|
1345 |
091D: CALL 298 |
|
|
1346 |
091E: BSF 0A.3 |
3020 |
jacho |
1347 |
.................... |
|
|
1348 |
.................... while(true) |
|
|
1349 |
.................... { |
|
|
1350 |
.................... pulse_count = get_timer1() + (0xffff * overflow_count); // compute pulse count |
3021 |
kaklik |
1351 |
091F: MOVF 0F,W |
|
|
1352 |
0920: MOVWF 7A |
|
|
1353 |
0921: MOVF 0E,W |
|
|
1354 |
0922: MOVWF 77 |
|
|
1355 |
0923: MOVF 0F,W |
|
|
1356 |
0924: SUBWF 7A,W |
|
|
1357 |
0925: BTFSS 03.2 |
|
|
1358 |
0926: GOTO 11F |
|
|
1359 |
0927: MOVF 77,W |
|
|
1360 |
0928: MOVWF 3A |
|
|
1361 |
0929: MOVF 7A,W |
|
|
1362 |
092A: MOVWF 3B |
|
|
1363 |
092B: MOVLW FF |
|
|
1364 |
092C: MOVWF 3D |
|
|
1365 |
092D: MOVWF 3C |
|
|
1366 |
092E: MOVF 2C,W |
|
|
1367 |
092F: MOVWF 3F |
|
|
1368 |
0930: MOVF 2B,W |
|
|
1369 |
0931: MOVWF 3E |
|
|
1370 |
0932: BCF 0A.3 |
|
|
1371 |
0933: GOTO 385 |
|
|
1372 |
0934: BSF 0A.3 |
|
|
1373 |
0935: MOVF 79,W |
|
|
1374 |
0936: MOVWF 7A |
|
|
1375 |
0937: MOVF 78,W |
|
|
1376 |
0938: ADDWF 3A,W |
|
|
1377 |
0939: MOVWF 27 |
|
|
1378 |
093A: MOVF 3B,W |
|
|
1379 |
093B: MOVWF 28 |
|
|
1380 |
093C: MOVF 7A,W |
|
|
1381 |
093D: BTFSC 03.0 |
|
|
1382 |
093E: INCFSZ 7A,W |
|
|
1383 |
093F: ADDWF 28,F |
|
|
1384 |
0940: CLRF 29 |
|
|
1385 |
0941: CLRF 2A |
3020 |
jacho |
1386 |
.................... time = integration_time + 1 - (time_overflow_count * 0.0327); // compute time interval |
3021 |
kaklik |
1387 |
0942: MOVLW 01 |
|
|
1388 |
0943: ADDWF 30,W |
|
|
1389 |
0944: MOVWF 3A |
|
|
1390 |
0945: MOVF 31,W |
|
|
1391 |
0946: MOVWF 3B |
|
|
1392 |
0947: BTFSC 03.0 |
|
|
1393 |
0948: INCF 3B,F |
|
|
1394 |
0949: MOVF 2E,W |
|
|
1395 |
094A: MOVWF 41 |
|
|
1396 |
094B: MOVF 2D,W |
|
|
1397 |
094C: MOVWF 40 |
|
|
1398 |
094D: BCF 0A.3 |
|
|
1399 |
094E: CALL 39C |
|
|
1400 |
094F: BSF 0A.3 |
|
|
1401 |
0950: MOVF 7A,W |
|
|
1402 |
0951: MOVWF 3F |
|
|
1403 |
0952: MOVF 79,W |
|
|
1404 |
0953: MOVWF 3E |
|
|
1405 |
0954: MOVF 78,W |
|
|
1406 |
0955: MOVWF 3D |
|
|
1407 |
0956: MOVF 77,W |
|
|
1408 |
0957: MOVWF 3C |
|
|
1409 |
0958: MOVLW 6F |
|
|
1410 |
0959: MOVWF 43 |
|
|
1411 |
095A: MOVLW F0 |
|
|
1412 |
095B: MOVWF 42 |
|
|
1413 |
095C: MOVLW 05 |
|
|
1414 |
095D: MOVWF 41 |
|
|
1415 |
095E: MOVLW 7A |
|
|
1416 |
095F: MOVWF 40 |
|
|
1417 |
0960: BCF 0A.3 |
|
|
1418 |
0961: GOTO 3B9 |
|
|
1419 |
0962: BSF 0A.3 |
|
|
1420 |
0963: MOVF 77,W |
|
|
1421 |
0964: MOVWF 3C |
|
|
1422 |
0965: MOVF 78,W |
|
|
1423 |
0966: MOVWF 3D |
|
|
1424 |
0967: MOVF 79,W |
|
|
1425 |
0968: MOVWF 3E |
|
|
1426 |
0969: MOVF 7A,W |
|
|
1427 |
096A: MOVWF 3F |
|
|
1428 |
096B: MOVF 3B,W |
|
|
1429 |
096C: MOVWF 41 |
|
|
1430 |
096D: MOVF 3A,W |
|
|
1431 |
096E: MOVWF 40 |
|
|
1432 |
096F: BCF 0A.3 |
|
|
1433 |
0970: CALL 39C |
|
|
1434 |
0971: BSF 0A.3 |
|
|
1435 |
0972: BSF 03.1 |
|
|
1436 |
0973: MOVF 7A,W |
|
|
1437 |
0974: MOVWF 43 |
|
|
1438 |
0975: MOVF 79,W |
|
|
1439 |
0976: MOVWF 42 |
|
|
1440 |
0977: MOVF 78,W |
|
|
1441 |
0978: MOVWF 41 |
|
|
1442 |
0979: MOVF 77,W |
|
|
1443 |
097A: MOVWF 40 |
|
|
1444 |
097B: MOVF 3F,W |
|
|
1445 |
097C: MOVWF 47 |
|
|
1446 |
097D: MOVF 3E,W |
|
|
1447 |
097E: MOVWF 46 |
|
|
1448 |
097F: MOVF 3D,W |
|
|
1449 |
0980: MOVWF 45 |
|
|
1450 |
0981: MOVF 3C,W |
|
|
1451 |
0982: MOVWF 44 |
|
|
1452 |
0983: BCF 0A.3 |
|
|
1453 |
0984: GOTO 430 |
|
|
1454 |
0985: BSF 0A.3 |
|
|
1455 |
0986: MOVF 7A,W |
|
|
1456 |
0987: MOVWF 43 |
|
|
1457 |
0988: MOVF 79,W |
|
|
1458 |
0989: MOVWF 42 |
|
|
1459 |
098A: MOVF 78,W |
|
|
1460 |
098B: MOVWF 41 |
|
|
1461 |
098C: MOVF 77,W |
|
|
1462 |
098D: MOVWF 40 |
|
|
1463 |
098E: BCF 0A.3 |
|
|
1464 |
098F: GOTO 573 |
|
|
1465 |
0990: BSF 0A.3 |
|
|
1466 |
0991: MOVF 79,W |
|
|
1467 |
0992: MOVWF 33 |
|
|
1468 |
0993: MOVF 78,W |
|
|
1469 |
0994: MOVWF 32 |
3020 |
jacho |
1470 |
.................... |
|
|
1471 |
.................... if(get_timer1() != last_timer) // timer count increment detection |
3021 |
kaklik |
1472 |
0995: MOVF 0F,W |
|
|
1473 |
0996: MOVWF 7A |
|
|
1474 |
0997: MOVF 0E,W |
|
|
1475 |
0998: MOVWF 77 |
|
|
1476 |
0999: MOVF 0F,W |
|
|
1477 |
099A: SUBWF 7A,W |
|
|
1478 |
099B: BTFSS 03.2 |
|
|
1479 |
099C: GOTO 195 |
|
|
1480 |
099D: MOVF 77,W |
|
|
1481 |
099E: MOVWF 3A |
|
|
1482 |
099F: MOVF 7A,W |
|
|
1483 |
09A0: MOVWF 3B |
|
|
1484 |
09A1: MOVF 34,W |
|
|
1485 |
09A2: SUBWF 3A,W |
|
|
1486 |
09A3: BTFSS 03.2 |
|
|
1487 |
09A4: GOTO 1A9 |
|
|
1488 |
09A5: MOVF 35,W |
|
|
1489 |
09A6: SUBWF 3B,W |
|
|
1490 |
09A7: BTFSC 03.2 |
|
|
1491 |
09A8: GOTO 1F6 |
3020 |
jacho |
1492 |
.................... { |
|
|
1493 |
.................... output_toggle(BEEP); |
3021 |
kaklik |
1494 |
09A9: BSF 03.5 |
|
|
1495 |
09AA: BCF 08.2 |
|
|
1496 |
09AB: MOVLW 04 |
|
|
1497 |
09AC: BCF 03.5 |
|
|
1498 |
09AD: XORWF 08,F |
3020 |
jacho |
1499 |
.................... delay_ms(1); |
3021 |
kaklik |
1500 |
09AE: MOVLW 01 |
|
|
1501 |
09AF: MOVWF 47 |
|
|
1502 |
09B0: BCF 0A.3 |
|
|
1503 |
09B1: CALL 0A4 |
|
|
1504 |
09B2: BSF 0A.3 |
3020 |
jacho |
1505 |
.................... output_toggle(BEEP); |
|
|
1506 |
09B3: BSF 03.5 |
3021 |
kaklik |
1507 |
09B4: BCF 08.2 |
|
|
1508 |
09B5: MOVLW 04 |
3020 |
jacho |
1509 |
09B6: BCF 03.5 |
3021 |
kaklik |
1510 |
09B7: XORWF 08,F |
|
|
1511 |
.................... output_toggle(LED3); |
|
|
1512 |
09B8: BCF 2F.4 |
|
|
1513 |
09B9: MOVF 2F,W |
|
|
1514 |
09BA: BSF 03.5 |
|
|
1515 |
09BB: MOVWF 07 |
|
|
1516 |
09BC: MOVLW 10 |
|
|
1517 |
09BD: BCF 03.5 |
|
|
1518 |
09BE: XORWF 07,F |
3020 |
jacho |
1519 |
.................... last_timer=get_timer1(); |
3021 |
kaklik |
1520 |
09BF: MOVF 0F,W |
|
|
1521 |
09C0: MOVWF 7A |
|
|
1522 |
09C1: MOVF 0E,W |
|
|
1523 |
09C2: MOVWF 77 |
|
|
1524 |
09C3: MOVF 0F,W |
|
|
1525 |
09C4: SUBWF 7A,W |
|
|
1526 |
09C5: BTFSS 03.2 |
|
|
1527 |
09C6: GOTO 1BF |
|
|
1528 |
09C7: MOVF 77,W |
|
|
1529 |
09C8: MOVWF 34 |
|
|
1530 |
09C9: MOVF 7A,W |
|
|
1531 |
09CA: MOVWF 35 |
3020 |
jacho |
1532 |
.................... lcd_gotoxy(1,1); // prepsani dat na displeje |
3021 |
kaklik |
1533 |
09CB: MOVLW 01 |
|
|
1534 |
09CC: MOVWF 47 |
|
|
1535 |
09CD: MOVWF 48 |
|
|
1536 |
09CE: BCF 0A.3 |
|
|
1537 |
09CF: CALL 1AB |
|
|
1538 |
09D0: BSF 0A.3 |
3020 |
jacho |
1539 |
.................... printf(lcd_putc,"Count:%lu ",pulse_count); |
3021 |
kaklik |
1540 |
09D1: MOVLW 90 |
|
|
1541 |
09D2: BSF 03.6 |
|
|
1542 |
09D3: MOVWF 0D |
|
|
1543 |
09D4: MOVLW 00 |
|
|
1544 |
09D5: MOVWF 0F |
|
|
1545 |
09D6: BCF 03.0 |
|
|
1546 |
09D7: MOVLW 06 |
|
|
1547 |
09D8: BCF 03.6 |
|
|
1548 |
09D9: MOVWF 3A |
|
|
1549 |
09DA: BCF 0A.3 |
|
|
1550 |
09DB: CALL 298 |
|
|
1551 |
09DC: BSF 0A.3 |
|
|
1552 |
09DD: MOVLW 41 |
|
|
1553 |
09DE: MOVWF 04 |
|
|
1554 |
09DF: MOVF 2A,W |
|
|
1555 |
09E0: MOVWF 3D |
|
|
1556 |
09E1: MOVF 29,W |
|
|
1557 |
09E2: MOVWF 3C |
|
|
1558 |
09E3: MOVF 28,W |
|
|
1559 |
09E4: MOVWF 3B |
|
|
1560 |
09E5: MOVF 27,W |
|
|
1561 |
09E6: MOVWF 3A |
|
|
1562 |
09E7: BCF 0A.3 |
|
|
1563 |
09E8: CALL 329 |
|
|
1564 |
09E9: BSF 0A.3 |
|
|
1565 |
09EA: MOVLW 94 |
|
|
1566 |
09EB: BSF 03.6 |
|
|
1567 |
09EC: MOVWF 0D |
|
|
1568 |
09ED: MOVLW 00 |
|
|
1569 |
09EE: MOVWF 0F |
|
|
1570 |
09EF: BSF 03.0 |
|
|
1571 |
09F0: MOVLW 05 |
|
|
1572 |
09F1: BCF 03.6 |
|
|
1573 |
09F2: MOVWF 3A |
|
|
1574 |
09F3: BCF 0A.3 |
|
|
1575 |
09F4: CALL 298 |
|
|
1576 |
09F5: BSF 0A.3 |
3020 |
jacho |
1577 |
.................... } |
|
|
1578 |
.................... |
|
|
1579 |
.................... lcd_gotoxy(1,2); |
3021 |
kaklik |
1580 |
09F6: MOVLW 01 |
|
|
1581 |
09F7: MOVWF 47 |
|
|
1582 |
09F8: MOVLW 02 |
|
|
1583 |
09F9: MOVWF 48 |
|
|
1584 |
09FA: BCF 0A.3 |
|
|
1585 |
09FB: CALL 1AB |
|
|
1586 |
09FC: BSF 0A.3 |
|
|
1587 |
.................... printf(lcd_putc,"T:%3lu I:%3lu U:%2u ",time,integration_time,treshold); |
|
|
1588 |
09FD: MOVLW 54 |
|
|
1589 |
09FE: MOVWF 46 |
|
|
1590 |
09FF: BCF 0A.3 |
|
|
1591 |
0A00: CALL 1BD |
|
|
1592 |
0A01: BSF 0A.3 |
|
|
1593 |
0A02: MOVLW 3A |
|
|
1594 |
0A03: MOVWF 46 |
|
|
1595 |
0A04: BCF 0A.3 |
|
|
1596 |
0A05: CALL 1BD |
|
|
1597 |
0A06: BSF 0A.3 |
|
|
1598 |
0A07: MOVLW 02 |
|
|
1599 |
0A08: MOVWF 04 |
|
|
1600 |
0A09: MOVF 33,W |
|
|
1601 |
0A0A: MOVWF 3B |
|
|
1602 |
0A0B: MOVF 32,W |
|
|
1603 |
0A0C: MOVWF 3A |
|
|
1604 |
0A0D: BCF 0A.3 |
|
|
1605 |
0A0E: CALL 594 |
|
|
1606 |
0A0F: BSF 0A.3 |
|
|
1607 |
0A10: MOVLW 20 |
|
|
1608 |
0A11: MOVWF 46 |
|
|
1609 |
0A12: BCF 0A.3 |
|
|
1610 |
0A13: CALL 1BD |
|
|
1611 |
0A14: BSF 0A.3 |
|
|
1612 |
0A15: MOVLW 49 |
|
|
1613 |
0A16: MOVWF 46 |
|
|
1614 |
0A17: BCF 0A.3 |
|
|
1615 |
0A18: CALL 1BD |
|
|
1616 |
0A19: BSF 0A.3 |
|
|
1617 |
0A1A: MOVLW 3A |
|
|
1618 |
0A1B: MOVWF 46 |
3020 |
jacho |
1619 |
0A1C: BCF 0A.3 |
3021 |
kaklik |
1620 |
0A1D: CALL 1BD |
3020 |
jacho |
1621 |
0A1E: BSF 0A.3 |
3021 |
kaklik |
1622 |
0A1F: MOVLW 02 |
|
|
1623 |
0A20: MOVWF 04 |
|
|
1624 |
0A21: MOVF 31,W |
|
|
1625 |
0A22: MOVWF 3B |
|
|
1626 |
0A23: MOVF 30,W |
|
|
1627 |
0A24: MOVWF 3A |
|
|
1628 |
0A25: BCF 0A.3 |
|
|
1629 |
0A26: CALL 594 |
|
|
1630 |
0A27: BSF 0A.3 |
|
|
1631 |
0A28: MOVLW 20 |
|
|
1632 |
0A29: MOVWF 46 |
|
|
1633 |
0A2A: BCF 0A.3 |
|
|
1634 |
0A2B: CALL 1BD |
|
|
1635 |
0A2C: BSF 0A.3 |
|
|
1636 |
0A2D: MOVLW 55 |
|
|
1637 |
0A2E: MOVWF 46 |
3020 |
jacho |
1638 |
0A2F: BCF 0A.3 |
3021 |
kaklik |
1639 |
0A30: CALL 1BD |
3020 |
jacho |
1640 |
0A31: BSF 0A.3 |
3021 |
kaklik |
1641 |
0A32: MOVLW 3A |
|
|
1642 |
0A33: MOVWF 46 |
|
|
1643 |
0A34: BCF 0A.3 |
|
|
1644 |
0A35: CALL 1BD |
|
|
1645 |
0A36: BSF 0A.3 |
|
|
1646 |
0A37: MOVF 39,W |
|
|
1647 |
0A38: MOVWF 3A |
|
|
1648 |
0A39: MOVLW 11 |
|
|
1649 |
0A3A: MOVWF 3B |
3020 |
jacho |
1650 |
0A3B: BCF 0A.3 |
3021 |
kaklik |
1651 |
0A3C: GOTO 60C |
3020 |
jacho |
1652 |
0A3D: BSF 0A.3 |
3021 |
kaklik |
1653 |
0A3E: MOVLW 20 |
|
|
1654 |
0A3F: MOVWF 46 |
|
|
1655 |
0A40: BCF 0A.3 |
|
|
1656 |
0A41: CALL 1BD |
|
|
1657 |
0A42: BSF 0A.3 |
|
|
1658 |
.................... // printf(lcd_putc,"I:%4lu ", integration_time); |
3020 |
jacho |
1659 |
.................... |
|
|
1660 |
.................... if(time == 0) // po uplynuti mereneho intervalu vypis na seriovku |
3021 |
kaklik |
1661 |
0A43: MOVF 32,F |
|
|
1662 |
0A44: BTFSS 03.2 |
|
|
1663 |
0A45: GOTO 29D |
|
|
1664 |
0A46: MOVF 33,F |
|
|
1665 |
0A47: BTFSS 03.2 |
|
|
1666 |
0A48: GOTO 29D |
3020 |
jacho |
1667 |
.................... { |
|
|
1668 |
.................... set_timer0(0); |
3021 |
kaklik |
1669 |
0A49: CLRF 01 |
3020 |
jacho |
1670 |
.................... time_overflow_count=0; |
3021 |
kaklik |
1671 |
0A4A: CLRF 2E |
|
|
1672 |
0A4B: CLRF 2D |
3020 |
jacho |
1673 |
.................... sound_beep(1000,700); |
3021 |
kaklik |
1674 |
0A4C: MOVLW E8 |
|
|
1675 |
0A4D: MOVWF 3A |
|
|
1676 |
0A4E: MOVLW 02 |
|
|
1677 |
0A4F: MOVWF 3C |
|
|
1678 |
0A50: MOVLW BC |
|
|
1679 |
0A51: MOVWF 3B |
|
|
1680 |
0A52: BCF 0A.3 |
|
|
1681 |
0A53: CALL 654 |
|
|
1682 |
0A54: BSF 0A.3 |
3020 |
jacho |
1683 |
.................... printf("$GMC1.0 %lu %lu %lu \r\n", measurement_number, integration_time, pulse_count); |
3021 |
kaklik |
1684 |
0A55: MOVLW 98 |
|
|
1685 |
0A56: BSF 03.6 |
|
|
1686 |
0A57: MOVWF 0D |
|
|
1687 |
0A58: MOVLW 00 |
|
|
1688 |
0A59: MOVWF 0F |
|
|
1689 |
0A5A: BCF 03.0 |
|
|
1690 |
0A5B: MOVLW 08 |
|
|
1691 |
0A5C: BCF 03.6 |
|
|
1692 |
0A5D: MOVWF 3A |
|
|
1693 |
0A5E: BCF 0A.3 |
|
|
1694 |
0A5F: CALL 69D |
|
|
1695 |
0A60: BSF 0A.3 |
|
|
1696 |
0A61: MOVLW 10 |
|
|
1697 |
0A62: MOVWF 04 |
|
|
1698 |
0A63: MOVF 38,W |
|
|
1699 |
0A64: MOVWF 3B |
|
|
1700 |
0A65: MOVF 37,W |
|
|
1701 |
0A66: MOVWF 3A |
3020 |
jacho |
1702 |
0A67: BCF 0A.3 |
3021 |
kaklik |
1703 |
0A68: CALL 6EC |
3020 |
jacho |
1704 |
0A69: BSF 0A.3 |
3021 |
kaklik |
1705 |
0A6A: MOVLW 20 |
|
|
1706 |
0A6B: MOVWF 46 |
|
|
1707 |
0A6C: BCF 0A.3 |
|
|
1708 |
0A6D: CALL 230 |
|
|
1709 |
0A6E: BSF 0A.3 |
|
|
1710 |
0A6F: MOVLW 10 |
|
|
1711 |
0A70: MOVWF 04 |
|
|
1712 |
0A71: MOVF 31,W |
|
|
1713 |
0A72: MOVWF 3B |
|
|
1714 |
0A73: MOVF 30,W |
|
|
1715 |
0A74: MOVWF 3A |
3020 |
jacho |
1716 |
0A75: BCF 0A.3 |
3021 |
kaklik |
1717 |
0A76: CALL 6EC |
3020 |
jacho |
1718 |
0A77: BSF 0A.3 |
3021 |
kaklik |
1719 |
0A78: MOVLW 20 |
|
|
1720 |
0A79: MOVWF 46 |
|
|
1721 |
0A7A: BCF 0A.3 |
|
|
1722 |
0A7B: CALL 230 |
|
|
1723 |
0A7C: BSF 0A.3 |
|
|
1724 |
0A7D: MOVLW 41 |
|
|
1725 |
0A7E: MOVWF 04 |
|
|
1726 |
0A7F: MOVF 2A,W |
|
|
1727 |
0A80: MOVWF 3D |
|
|
1728 |
0A81: MOVF 29,W |
|
|
1729 |
0A82: MOVWF 3C |
|
|
1730 |
0A83: MOVF 28,W |
|
|
1731 |
0A84: MOVWF 3B |
|
|
1732 |
0A85: MOVF 27,W |
|
|
1733 |
0A86: MOVWF 3A |
|
|
1734 |
0A87: BCF 0A.3 |
|
|
1735 |
0A88: GOTO 74F |
|
|
1736 |
0A89: BSF 0A.3 |
|
|
1737 |
0A8A: MOVLW A1 |
|
|
1738 |
0A8B: BSF 03.6 |
|
|
1739 |
0A8C: MOVWF 0D |
|
|
1740 |
0A8D: MOVLW 00 |
|
|
1741 |
0A8E: MOVWF 0F |
|
|
1742 |
0A8F: BSF 03.0 |
|
|
1743 |
0A90: MOVLW 04 |
|
|
1744 |
0A91: BCF 03.6 |
|
|
1745 |
0A92: MOVWF 3A |
|
|
1746 |
0A93: BCF 0A.3 |
|
|
1747 |
0A94: CALL 69D |
|
|
1748 |
0A95: BSF 0A.3 |
3020 |
jacho |
1749 |
.................... set_timer1(0); |
3021 |
kaklik |
1750 |
0A96: CLRF 0F |
|
|
1751 |
0A97: CLRF 0E |
3020 |
jacho |
1752 |
.................... overflow_count=0; |
3021 |
kaklik |
1753 |
0A98: CLRF 2C |
|
|
1754 |
0A99: CLRF 2B |
3020 |
jacho |
1755 |
.................... measurement_number++; |
3021 |
kaklik |
1756 |
0A9A: INCF 37,F |
|
|
1757 |
0A9B: BTFSC 03.2 |
|
|
1758 |
0A9C: INCF 38,F |
3020 |
jacho |
1759 |
.................... } |
|
|
1760 |
.................... |
|
|
1761 |
.................... if(button_press==false ) // tlacitka se ctou znovu pouze pokud v redchozim cyklu nebyla zmacknuta. |
3021 |
kaklik |
1762 |
0A9D: BTFSC 36.0 |
|
|
1763 |
0A9E: GOTO 3EF |
3020 |
jacho |
1764 |
.................... { |
|
|
1765 |
.................... if(!input(S1)) |
3021 |
kaklik |
1766 |
0A9F: BSF 2F.2 |
|
|
1767 |
0AA0: MOVF 2F,W |
|
|
1768 |
0AA1: BSF 03.5 |
|
|
1769 |
0AA2: MOVWF 07 |
|
|
1770 |
0AA3: BCF 03.5 |
|
|
1771 |
0AA4: BTFSC 07.2 |
|
|
1772 |
0AA5: GOTO 2E2 |
3020 |
jacho |
1773 |
.................... { |
|
|
1774 |
.................... delay_ms(20); |
3021 |
kaklik |
1775 |
0AA6: MOVLW 14 |
|
|
1776 |
0AA7: MOVWF 47 |
|
|
1777 |
0AA8: BCF 0A.3 |
|
|
1778 |
0AA9: CALL 0A4 |
|
|
1779 |
0AAA: BSF 0A.3 |
3020 |
jacho |
1780 |
.................... if(!input(S1)) |
3021 |
kaklik |
1781 |
0AAB: BSF 2F.2 |
|
|
1782 |
0AAC: MOVF 2F,W |
|
|
1783 |
0AAD: BSF 03.5 |
|
|
1784 |
0AAE: MOVWF 07 |
|
|
1785 |
0AAF: BCF 03.5 |
|
|
1786 |
0AB0: BTFSC 07.2 |
|
|
1787 |
0AB1: GOTO 2E2 |
3020 |
jacho |
1788 |
.................... { |
|
|
1789 |
.................... button_press=true; |
3021 |
kaklik |
1790 |
0AB2: BSF 36.0 |
|
|
1791 |
.................... sound_beep(100,700); |
|
|
1792 |
0AB3: MOVLW 64 |
|
|
1793 |
0AB4: MOVWF 3A |
|
|
1794 |
0AB5: MOVLW 02 |
|
|
1795 |
0AB6: MOVWF 3C |
|
|
1796 |
0AB7: MOVLW BC |
|
|
1797 |
0AB8: MOVWF 3B |
|
|
1798 |
0AB9: BCF 0A.3 |
|
|
1799 |
0ABA: CALL 654 |
|
|
1800 |
0ABB: BSF 0A.3 |
|
|
1801 |
.................... switch (setup_mode) |
3020 |
jacho |
1802 |
.................... { |
3021 |
kaklik |
1803 |
0ABC: MOVLW 00 |
|
|
1804 |
0ABD: BTFSC 36.1 |
|
|
1805 |
0ABE: MOVLW 01 |
|
|
1806 |
0ABF: XORLW 00 |
|
|
1807 |
0AC0: BTFSC 03.2 |
|
|
1808 |
0AC1: GOTO 2C6 |
|
|
1809 |
0AC2: XORLW 01 |
|
|
1810 |
0AC3: BTFSC 03.2 |
|
|
1811 |
0AC4: GOTO 2D5 |
|
|
1812 |
0AC5: GOTO 2E2 |
|
|
1813 |
.................... case INTERVAL_setup: |
|
|
1814 |
.................... if(integration_time < 0xfffa ) integration_time+=5; |
|
|
1815 |
0AC6: MOVF 31,W |
|
|
1816 |
0AC7: SUBLW FF |
|
|
1817 |
0AC8: BTFSS 03.0 |
|
|
1818 |
0AC9: GOTO 2D4 |
|
|
1819 |
0ACA: BTFSS 03.2 |
|
|
1820 |
0ACB: GOTO 2D0 |
|
|
1821 |
0ACC: MOVF 30,W |
|
|
1822 |
0ACD: SUBLW F9 |
|
|
1823 |
0ACE: BTFSS 03.0 |
|
|
1824 |
0ACF: GOTO 2D4 |
|
|
1825 |
0AD0: MOVLW 05 |
|
|
1826 |
0AD1: ADDWF 30,F |
|
|
1827 |
0AD2: BTFSC 03.0 |
|
|
1828 |
0AD3: INCF 31,F |
|
|
1829 |
.................... break; |
|
|
1830 |
0AD4: GOTO 2E2 |
|
|
1831 |
.................... |
|
|
1832 |
.................... case TRESHOLD_setup: |
|
|
1833 |
.................... if(treshold < 0x0a ) treshold +=5; |
|
|
1834 |
0AD5: MOVF 39,W |
|
|
1835 |
0AD6: SUBLW 09 |
|
|
1836 |
0AD7: BTFSS 03.0 |
|
|
1837 |
0AD8: GOTO 2DB |
|
|
1838 |
0AD9: MOVLW 05 |
|
|
1839 |
0ADA: ADDWF 39,F |
|
|
1840 |
.................... setup_vref(VREF_HIGH|treshold); //sets 3.6(vdd *value/32 +vdd/4) if vdd is 5.0V |
|
|
1841 |
0ADB: MOVF 39,W |
|
|
1842 |
0ADC: IORLW 80 |
|
|
1843 |
0ADD: MOVWF 3A |
|
|
1844 |
0ADE: BSF 03.5 |
|
|
1845 |
0ADF: MOVWF 17 |
|
|
1846 |
.................... break; |
|
|
1847 |
0AE0: BCF 03.5 |
|
|
1848 |
0AE1: GOTO 2E2 |
3020 |
jacho |
1849 |
.................... } |
|
|
1850 |
.................... } |
|
|
1851 |
.................... } |
|
|
1852 |
.................... |
|
|
1853 |
.................... if(!input(S2)) |
3021 |
kaklik |
1854 |
0AE2: BSF 2F.3 |
|
|
1855 |
0AE3: MOVF 2F,W |
|
|
1856 |
0AE4: BSF 03.5 |
|
|
1857 |
0AE5: MOVWF 07 |
|
|
1858 |
0AE6: BCF 03.5 |
|
|
1859 |
0AE7: BTFSC 07.3 |
|
|
1860 |
0AE8: GOTO 32B |
3020 |
jacho |
1861 |
.................... { |
|
|
1862 |
.................... delay_ms(20); |
3021 |
kaklik |
1863 |
0AE9: MOVLW 14 |
|
|
1864 |
0AEA: MOVWF 47 |
|
|
1865 |
0AEB: BCF 0A.3 |
|
|
1866 |
0AEC: CALL 0A4 |
|
|
1867 |
0AED: BSF 0A.3 |
3020 |
jacho |
1868 |
.................... if(!input(S2)) |
3021 |
kaklik |
1869 |
0AEE: BSF 2F.3 |
|
|
1870 |
0AEF: MOVF 2F,W |
|
|
1871 |
0AF0: BSF 03.5 |
|
|
1872 |
0AF1: MOVWF 07 |
|
|
1873 |
0AF2: BCF 03.5 |
|
|
1874 |
0AF3: BTFSC 07.3 |
|
|
1875 |
0AF4: GOTO 32B |
3020 |
jacho |
1876 |
.................... { |
|
|
1877 |
.................... button_press=true; |
3021 |
kaklik |
1878 |
0AF5: BSF 36.0 |
|
|
1879 |
.................... sound_beep(100,600); |
|
|
1880 |
0AF6: MOVLW 64 |
|
|
1881 |
0AF7: MOVWF 3A |
|
|
1882 |
0AF8: MOVLW 02 |
|
|
1883 |
0AF9: MOVWF 3C |
|
|
1884 |
0AFA: MOVLW 58 |
|
|
1885 |
0AFB: MOVWF 3B |
|
|
1886 |
0AFC: BCF 0A.3 |
|
|
1887 |
0AFD: CALL 654 |
|
|
1888 |
0AFE: BSF 0A.3 |
|
|
1889 |
.................... switch (setup_mode) |
3020 |
jacho |
1890 |
.................... { |
3021 |
kaklik |
1891 |
0AFF: MOVLW 00 |
|
|
1892 |
0B00: BTFSC 36.1 |
|
|
1893 |
0B01: MOVLW 01 |
|
|
1894 |
0B02: XORLW 00 |
|
|
1895 |
0B03: BTFSC 03.2 |
|
|
1896 |
0B04: GOTO 309 |
|
|
1897 |
0B05: XORLW 01 |
|
|
1898 |
0B06: BTFSC 03.2 |
|
|
1899 |
0B07: GOTO 31E |
|
|
1900 |
0B08: GOTO 32B |
|
|
1901 |
.................... case INTERVAL_setup: |
|
|
1902 |
.................... if(integration_time > 0x0005 ) integration_time-=5; |
|
|
1903 |
0B09: MOVF 31,F |
|
|
1904 |
0B0A: BTFSS 03.2 |
|
|
1905 |
0B0B: GOTO 310 |
|
|
1906 |
0B0C: MOVF 30,W |
|
|
1907 |
0B0D: SUBLW 05 |
|
|
1908 |
0B0E: BTFSC 03.0 |
|
|
1909 |
0B0F: GOTO 316 |
|
|
1910 |
0B10: MOVLW 05 |
|
|
1911 |
0B11: SUBWF 30,F |
|
|
1912 |
0B12: MOVLW 00 |
|
|
1913 |
0B13: BTFSS 03.0 |
|
|
1914 |
0B14: MOVLW 01 |
|
|
1915 |
0B15: SUBWF 31,F |
|
|
1916 |
.................... set_timer0(0); // vynulovani pocitadel, kdyz uzivatel sahne na tlacitka |
|
|
1917 |
0B16: CLRF 01 |
|
|
1918 |
.................... time_overflow_count=0; |
|
|
1919 |
0B17: CLRF 2E |
|
|
1920 |
0B18: CLRF 2D |
|
|
1921 |
.................... set_timer1(0); |
|
|
1922 |
0B19: CLRF 0F |
|
|
1923 |
0B1A: CLRF 0E |
|
|
1924 |
.................... overflow_count=0; |
|
|
1925 |
0B1B: CLRF 2C |
|
|
1926 |
0B1C: CLRF 2B |
|
|
1927 |
.................... break; |
|
|
1928 |
0B1D: GOTO 32B |
|
|
1929 |
.................... case TRESHOLD_setup: |
|
|
1930 |
.................... if(treshold > 0x05 ) treshold +=5; |
|
|
1931 |
0B1E: MOVF 39,W |
|
|
1932 |
0B1F: SUBLW 05 |
|
|
1933 |
0B20: BTFSC 03.0 |
|
|
1934 |
0B21: GOTO 324 |
|
|
1935 |
0B22: MOVLW 05 |
|
|
1936 |
0B23: ADDWF 39,F |
|
|
1937 |
.................... setup_vref(VREF_HIGH|treshold); //sets 3.6(vdd *value/32 +vdd/4) if vdd is 5.0V |
|
|
1938 |
0B24: MOVF 39,W |
|
|
1939 |
0B25: IORLW 80 |
|
|
1940 |
0B26: MOVWF 3A |
|
|
1941 |
0B27: BSF 03.5 |
|
|
1942 |
0B28: MOVWF 17 |
|
|
1943 |
.................... break; |
|
|
1944 |
0B29: BCF 03.5 |
|
|
1945 |
0B2A: GOTO 32B |
3020 |
jacho |
1946 |
.................... } |
|
|
1947 |
.................... } |
|
|
1948 |
.................... } |
|
|
1949 |
.................... |
|
|
1950 |
.................... if(!input(S3)) |
3021 |
kaklik |
1951 |
0B2B: BSF 03.5 |
|
|
1952 |
0B2C: BSF 08.0 |
|
|
1953 |
0B2D: BCF 03.5 |
|
|
1954 |
0B2E: BTFSC 08.0 |
|
|
1955 |
0B2F: GOTO 362 |
3020 |
jacho |
1956 |
.................... { |
|
|
1957 |
.................... delay_ms(20); |
3021 |
kaklik |
1958 |
0B30: MOVLW 14 |
|
|
1959 |
0B31: MOVWF 47 |
|
|
1960 |
0B32: BCF 0A.3 |
|
|
1961 |
0B33: CALL 0A4 |
|
|
1962 |
0B34: BSF 0A.3 |
3020 |
jacho |
1963 |
.................... if(!input(S3)) |
3021 |
kaklik |
1964 |
0B35: BSF 03.5 |
|
|
1965 |
0B36: BSF 08.0 |
|
|
1966 |
0B37: BCF 03.5 |
|
|
1967 |
0B38: BTFSC 08.0 |
|
|
1968 |
0B39: GOTO 362 |
3020 |
jacho |
1969 |
.................... { |
|
|
1970 |
.................... button_press=true; |
3021 |
kaklik |
1971 |
0B3A: BSF 36.0 |
|
|
1972 |
.................... sound_beep(100,500); |
|
|
1973 |
0B3B: MOVLW 64 |
|
|
1974 |
0B3C: MOVWF 3A |
|
|
1975 |
0B3D: MOVLW 01 |
|
|
1976 |
0B3E: MOVWF 3C |
|
|
1977 |
0B3F: MOVLW F4 |
|
|
1978 |
0B40: MOVWF 3B |
|
|
1979 |
0B41: BCF 0A.3 |
|
|
1980 |
0B42: CALL 654 |
|
|
1981 |
0B43: BSF 0A.3 |
|
|
1982 |
.................... switch (setup_mode) |
3020 |
jacho |
1983 |
.................... { |
3021 |
kaklik |
1984 |
0B44: MOVLW 00 |
|
|
1985 |
0B45: BTFSC 36.1 |
|
|
1986 |
0B46: MOVLW 01 |
|
|
1987 |
0B47: XORLW 00 |
|
|
1988 |
0B48: BTFSC 03.2 |
|
|
1989 |
0B49: GOTO 34E |
|
|
1990 |
0B4A: XORLW 01 |
|
|
1991 |
0B4B: BTFSC 03.2 |
|
|
1992 |
0B4C: GOTO 357 |
|
|
1993 |
0B4D: GOTO 362 |
|
|
1994 |
.................... case INTERVAL_setup: |
|
|
1995 |
.................... if(integration_time < 0xffff ) integration_time++; |
|
|
1996 |
0B4E: INCFSZ 30,W |
|
|
1997 |
0B4F: GOTO 353 |
|
|
1998 |
0B50: INCFSZ 31,W |
|
|
1999 |
0B51: GOTO 353 |
|
|
2000 |
0B52: GOTO 356 |
|
|
2001 |
0B53: INCF 30,F |
|
|
2002 |
0B54: BTFSC 03.2 |
|
|
2003 |
0B55: INCF 31,F |
|
|
2004 |
.................... break; |
|
|
2005 |
0B56: GOTO 362 |
|
|
2006 |
.................... |
|
|
2007 |
.................... case TRESHOLD_setup: |
|
|
2008 |
.................... if(treshold < 0x0F ) treshold ++; |
|
|
2009 |
0B57: MOVF 39,W |
|
|
2010 |
0B58: SUBLW 0E |
|
|
2011 |
0B59: BTFSC 03.0 |
|
|
2012 |
0B5A: INCF 39,F |
|
|
2013 |
.................... setup_vref(VREF_HIGH|treshold); //sets 3.6(vdd *value/32 +vdd/4) if vdd is 5.0V |
|
|
2014 |
0B5B: MOVF 39,W |
|
|
2015 |
0B5C: IORLW 80 |
|
|
2016 |
0B5D: MOVWF 3A |
|
|
2017 |
0B5E: BSF 03.5 |
|
|
2018 |
0B5F: MOVWF 17 |
|
|
2019 |
.................... break; |
|
|
2020 |
0B60: BCF 03.5 |
|
|
2021 |
0B61: GOTO 362 |
3020 |
jacho |
2022 |
.................... } |
|
|
2023 |
.................... } |
|
|
2024 |
.................... } |
|
|
2025 |
.................... |
|
|
2026 |
.................... if(!input(S4)) |
3021 |
kaklik |
2027 |
0B62: BSF 03.5 |
|
|
2028 |
0B63: BSF 08.1 |
|
|
2029 |
0B64: BCF 03.5 |
|
|
2030 |
0B65: BTFSC 08.1 |
|
|
2031 |
0B66: GOTO 3A3 |
3020 |
jacho |
2032 |
.................... { |
|
|
2033 |
.................... delay_ms(20); |
3021 |
kaklik |
2034 |
0B67: MOVLW 14 |
|
|
2035 |
0B68: MOVWF 47 |
|
|
2036 |
0B69: BCF 0A.3 |
|
|
2037 |
0B6A: CALL 0A4 |
|
|
2038 |
0B6B: BSF 0A.3 |
3020 |
jacho |
2039 |
.................... if(!input(S4)) |
3021 |
kaklik |
2040 |
0B6C: BSF 03.5 |
|
|
2041 |
0B6D: BSF 08.1 |
|
|
2042 |
0B6E: BCF 03.5 |
|
|
2043 |
0B6F: BTFSC 08.1 |
|
|
2044 |
0B70: GOTO 3A3 |
3020 |
jacho |
2045 |
.................... { |
|
|
2046 |
.................... button_press=true; |
3021 |
kaklik |
2047 |
0B71: BSF 36.0 |
|
|
2048 |
.................... sound_beep(100,400); |
|
|
2049 |
0B72: MOVLW 64 |
|
|
2050 |
0B73: MOVWF 3A |
|
|
2051 |
0B74: MOVLW 01 |
|
|
2052 |
0B75: MOVWF 3C |
|
|
2053 |
0B76: MOVLW 90 |
|
|
2054 |
0B77: MOVWF 3B |
|
|
2055 |
0B78: BCF 0A.3 |
|
|
2056 |
0B79: CALL 654 |
|
|
2057 |
0B7A: BSF 0A.3 |
|
|
2058 |
.................... switch (setup_mode) |
3020 |
jacho |
2059 |
.................... { |
3021 |
kaklik |
2060 |
0B7B: MOVLW 00 |
|
|
2061 |
0B7C: BTFSC 36.1 |
|
|
2062 |
0B7D: MOVLW 01 |
|
|
2063 |
0B7E: XORLW 00 |
|
|
2064 |
0B7F: BTFSC 03.2 |
|
|
2065 |
0B80: GOTO 385 |
|
|
2066 |
0B81: XORLW 01 |
|
|
2067 |
0B82: BTFSC 03.2 |
|
|
2068 |
0B83: GOTO 398 |
|
|
2069 |
0B84: GOTO 3A3 |
|
|
2070 |
.................... case INTERVAL_setup: |
|
|
2071 |
.................... |
|
|
2072 |
.................... if(integration_time > 0x0001 ) integration_time--; |
|
|
2073 |
0B85: MOVF 31,F |
|
|
2074 |
0B86: BTFSS 03.2 |
|
|
2075 |
0B87: GOTO 38C |
|
|
2076 |
0B88: MOVF 30,W |
|
|
2077 |
0B89: SUBLW 01 |
|
|
2078 |
0B8A: BTFSC 03.0 |
|
|
2079 |
0B8B: GOTO 390 |
|
|
2080 |
0B8C: MOVF 30,W |
|
|
2081 |
0B8D: BTFSC 03.2 |
|
|
2082 |
0B8E: DECF 31,F |
|
|
2083 |
0B8F: DECF 30,F |
3020 |
jacho |
2084 |
.................... |
3021 |
kaklik |
2085 |
.................... set_timer0(0); // vynulovani pocitadel, kdyz uzivatel sahne na tlacitka |
|
|
2086 |
0B90: CLRF 01 |
|
|
2087 |
.................... time_overflow_count=0; |
|
|
2088 |
0B91: CLRF 2E |
|
|
2089 |
0B92: CLRF 2D |
|
|
2090 |
.................... set_timer1(0); |
|
|
2091 |
0B93: CLRF 0F |
|
|
2092 |
0B94: CLRF 0E |
|
|
2093 |
.................... overflow_count=0; |
|
|
2094 |
0B95: CLRF 2C |
|
|
2095 |
0B96: CLRF 2B |
|
|
2096 |
.................... break; |
|
|
2097 |
0B97: GOTO 3A3 |
|
|
2098 |
.................... case TRESHOLD_setup: |
|
|
2099 |
.................... if(treshold > 0x01 ) treshold--; |
|
|
2100 |
0B98: MOVF 39,W |
|
|
2101 |
0B99: SUBLW 01 |
|
|
2102 |
0B9A: BTFSS 03.0 |
|
|
2103 |
0B9B: DECF 39,F |
|
|
2104 |
.................... setup_vref(VREF_HIGH|treshold); //sets 3.6(vdd *value/32 +vdd/4) if vdd is 5.0V |
|
|
2105 |
0B9C: MOVF 39,W |
|
|
2106 |
0B9D: IORLW 80 |
|
|
2107 |
0B9E: MOVWF 3A |
|
|
2108 |
0B9F: BSF 03.5 |
|
|
2109 |
0BA0: MOVWF 17 |
|
|
2110 |
.................... break; |
|
|
2111 |
0BA1: BCF 03.5 |
|
|
2112 |
0BA2: GOTO 3A3 |
3020 |
jacho |
2113 |
.................... } |
|
|
2114 |
.................... } |
|
|
2115 |
.................... } |
|
|
2116 |
.................... |
|
|
2117 |
.................... if(!input(S5)) // prepnuti na nastavovani casu |
3021 |
kaklik |
2118 |
0BA3: BSF 03.5 |
|
|
2119 |
0BA4: BSF 06.1 |
|
|
2120 |
0BA5: BCF 03.5 |
|
|
2121 |
0BA6: BTFSC 06.1 |
|
|
2122 |
0BA7: GOTO 3C9 |
3020 |
jacho |
2123 |
.................... { |
|
|
2124 |
.................... delay_ms(20); |
3021 |
kaklik |
2125 |
0BA8: MOVLW 14 |
|
|
2126 |
0BA9: MOVWF 47 |
|
|
2127 |
0BAA: BCF 0A.3 |
|
|
2128 |
0BAB: CALL 0A4 |
|
|
2129 |
0BAC: BSF 0A.3 |
3020 |
jacho |
2130 |
.................... if(!input(S5)) |
3021 |
kaklik |
2131 |
0BAD: BSF 03.5 |
|
|
2132 |
0BAE: BSF 06.1 |
|
|
2133 |
0BAF: BCF 03.5 |
|
|
2134 |
0BB0: BTFSC 06.1 |
|
|
2135 |
0BB1: GOTO 3C9 |
3020 |
jacho |
2136 |
.................... { |
3021 |
kaklik |
2137 |
.................... button_press=true; |
|
|
2138 |
0BB2: BSF 36.0 |
3020 |
jacho |
2139 |
.................... sound_beep(100,800); |
3021 |
kaklik |
2140 |
0BB3: MOVLW 64 |
|
|
2141 |
0BB4: MOVWF 3A |
|
|
2142 |
0BB5: MOVLW 03 |
|
|
2143 |
0BB6: MOVWF 3C |
|
|
2144 |
0BB7: MOVLW 20 |
|
|
2145 |
0BB8: MOVWF 3B |
|
|
2146 |
0BB9: BCF 0A.3 |
|
|
2147 |
0BBA: CALL 654 |
|
|
2148 |
0BBB: BSF 0A.3 |
|
|
2149 |
.................... setup_mode=INTERVAL_setup; |
|
|
2150 |
0BBC: BCF 36.1 |
|
|
2151 |
.................... lcd_gotoxy(16,1); // prepsani dat na displeje |
|
|
2152 |
0BBD: MOVLW 10 |
|
|
2153 |
0BBE: MOVWF 47 |
|
|
2154 |
0BBF: MOVLW 01 |
|
|
2155 |
0BC0: MOVWF 48 |
|
|
2156 |
0BC1: BCF 0A.3 |
|
|
2157 |
0BC2: CALL 1AB |
|
|
2158 |
0BC3: BSF 0A.3 |
|
|
2159 |
.................... printf(lcd_putc,"I"); |
|
|
2160 |
0BC4: MOVLW 49 |
|
|
2161 |
0BC5: MOVWF 46 |
|
|
2162 |
0BC6: BCF 0A.3 |
|
|
2163 |
0BC7: CALL 1BD |
|
|
2164 |
0BC8: BSF 0A.3 |
3020 |
jacho |
2165 |
.................... } |
|
|
2166 |
.................... } |
|
|
2167 |
.................... |
|
|
2168 |
.................... if(!input(S6)) // prepnuti na nastavovani napeti |
3021 |
kaklik |
2169 |
0BC9: BSF 03.5 |
|
|
2170 |
0BCA: BSF 06.2 |
|
|
2171 |
0BCB: BCF 03.5 |
|
|
2172 |
0BCC: BTFSC 06.2 |
|
|
2173 |
0BCD: GOTO 3EF |
3020 |
jacho |
2174 |
.................... { |
|
|
2175 |
.................... delay_ms(20); |
3021 |
kaklik |
2176 |
0BCE: MOVLW 14 |
|
|
2177 |
0BCF: MOVWF 47 |
|
|
2178 |
0BD0: BCF 0A.3 |
|
|
2179 |
0BD1: CALL 0A4 |
|
|
2180 |
0BD2: BSF 0A.3 |
3020 |
jacho |
2181 |
.................... if(!input(S6)) |
3021 |
kaklik |
2182 |
0BD3: BSF 03.5 |
|
|
2183 |
0BD4: BSF 06.2 |
|
|
2184 |
0BD5: BCF 03.5 |
|
|
2185 |
0BD6: BTFSC 06.2 |
|
|
2186 |
0BD7: GOTO 3EF |
3020 |
jacho |
2187 |
.................... { |
3021 |
kaklik |
2188 |
.................... button_press=true; |
|
|
2189 |
0BD8: BSF 36.0 |
3020 |
jacho |
2190 |
.................... sound_beep(100,800); |
3021 |
kaklik |
2191 |
0BD9: MOVLW 64 |
|
|
2192 |
0BDA: MOVWF 3A |
|
|
2193 |
0BDB: MOVLW 03 |
|
|
2194 |
0BDC: MOVWF 3C |
|
|
2195 |
0BDD: MOVLW 20 |
|
|
2196 |
0BDE: MOVWF 3B |
|
|
2197 |
0BDF: BCF 0A.3 |
|
|
2198 |
0BE0: CALL 654 |
|
|
2199 |
0BE1: BSF 0A.3 |
|
|
2200 |
.................... setup_mode=TRESHOLD_setup; |
|
|
2201 |
0BE2: BSF 36.1 |
|
|
2202 |
.................... lcd_gotoxy(16,1); // prepsani dat na displeje |
|
|
2203 |
0BE3: MOVLW 10 |
|
|
2204 |
0BE4: MOVWF 47 |
|
|
2205 |
0BE5: MOVLW 01 |
|
|
2206 |
0BE6: MOVWF 48 |
|
|
2207 |
0BE7: BCF 0A.3 |
|
|
2208 |
0BE8: CALL 1AB |
|
|
2209 |
0BE9: BSF 0A.3 |
|
|
2210 |
.................... printf(lcd_putc,"U"); |
|
|
2211 |
0BEA: MOVLW 55 |
|
|
2212 |
0BEB: MOVWF 46 |
|
|
2213 |
0BEC: BCF 0A.3 |
|
|
2214 |
0BED: CALL 1BD |
|
|
2215 |
0BEE: BSF 0A.3 |
3020 |
jacho |
2216 |
.................... } |
|
|
2217 |
.................... } |
|
|
2218 |
.................... } |
|
|
2219 |
.................... |
|
|
2220 |
.................... if ( input(S1) && input(S2) && input(S3) && input(S4) && input(S5) && input(S6)) // detekce pustenych tlacitek |
3021 |
kaklik |
2221 |
0BEF: BSF 2F.2 |
|
|
2222 |
0BF0: MOVF 2F,W |
|
|
2223 |
0BF1: BSF 03.5 |
|
|
2224 |
0BF2: MOVWF 07 |
|
|
2225 |
0BF3: BCF 03.5 |
|
|
2226 |
0BF4: BTFSS 07.2 |
|
|
2227 |
0BF5: GOTO 412 |
|
|
2228 |
0BF6: BSF 2F.3 |
|
|
2229 |
0BF7: MOVF 2F,W |
|
|
2230 |
0BF8: BSF 03.5 |
|
|
2231 |
0BF9: MOVWF 07 |
|
|
2232 |
0BFA: BCF 03.5 |
|
|
2233 |
0BFB: BTFSS 07.3 |
|
|
2234 |
0BFC: GOTO 412 |
|
|
2235 |
0BFD: BSF 03.5 |
|
|
2236 |
0BFE: BSF 08.0 |
|
|
2237 |
0BFF: BCF 03.5 |
|
|
2238 |
0C00: BTFSS 08.0 |
|
|
2239 |
0C01: GOTO 412 |
|
|
2240 |
0C02: BSF 03.5 |
|
|
2241 |
0C03: BSF 08.1 |
|
|
2242 |
0C04: BCF 03.5 |
|
|
2243 |
0C05: BTFSS 08.1 |
|
|
2244 |
0C06: GOTO 412 |
|
|
2245 |
0C07: BSF 03.5 |
|
|
2246 |
0C08: BSF 06.1 |
|
|
2247 |
0C09: BCF 03.5 |
|
|
2248 |
0C0A: BTFSS 06.1 |
|
|
2249 |
0C0B: GOTO 412 |
|
|
2250 |
0C0C: BSF 03.5 |
|
|
2251 |
0C0D: BSF 06.2 |
|
|
2252 |
0C0E: BCF 03.5 |
|
|
2253 |
0C0F: BTFSS 06.2 |
|
|
2254 |
0C10: GOTO 412 |
3020 |
jacho |
2255 |
.................... { |
|
|
2256 |
.................... button_press=false; |
3021 |
kaklik |
2257 |
0C11: BCF 36.0 |
3020 |
jacho |
2258 |
.................... } |
|
|
2259 |
.................... } |
3021 |
kaklik |
2260 |
0C12: GOTO 11F |
3020 |
jacho |
2261 |
.................... } |
3021 |
kaklik |
2262 |
0C13: SLEEP |
3020 |
jacho |
2263 |
|
|
|
2264 |
Configuration Fuses: |
|
|
2265 |
Word 1: 2CF5 INTRC NOWDT NOPUT MCLR NOPROTECT NOCPD NOBROWNOUT IESO FCMEN NOLVP NODEBUG |
|
|
2266 |
Word 2: 3FFF NOWRT BORV40 |