3020 |
jacho |
1 |
CCS PCM C Compiler, Version 4.106, 47914 22-5-13 12:34 |
|
|
2 |
|
|
|
3 |
Filename: D:\Honza\MLAB\Designs\Measuring_instruments\GM_counter\SW\counter\main.lst |
|
|
4 |
|
|
|
5 |
ROM used: 2825 words (34%) |
|
|
6 |
Largest free fragment is 2048 |
|
|
7 |
RAM used: 36 (10%) at main() level |
|
|
8 |
55 (15%) worst case |
|
|
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 |
* |
|
|
92 |
00A9: MOVLW 46 |
|
|
93 |
00AA: MOVWF 04 |
|
|
94 |
00AB: BCF 03.7 |
|
|
95 |
00AC: MOVF 00,W |
|
|
96 |
00AD: BTFSC 03.2 |
|
|
97 |
00AE: GOTO 0BC |
|
|
98 |
00AF: MOVLW 02 |
|
|
99 |
00B0: MOVWF 78 |
|
|
100 |
00B1: CLRF 77 |
|
|
101 |
00B2: DECFSZ 77,F |
|
|
102 |
00B3: GOTO 0B2 |
|
|
103 |
00B4: DECFSZ 78,F |
|
|
104 |
00B5: GOTO 0B1 |
|
|
105 |
00B6: MOVLW 97 |
|
|
106 |
00B7: MOVWF 77 |
|
|
107 |
00B8: DECFSZ 77,F |
|
|
108 |
00B9: GOTO 0B8 |
|
|
109 |
00BA: DECFSZ 00,F |
|
|
110 |
00BB: GOTO 0AF |
|
|
111 |
00BC: RETURN |
|
|
112 |
* |
|
|
113 |
05FC: MOVLW 08 |
|
|
114 |
05FD: SUBWF 40,F |
|
|
115 |
05FE: BTFSS 03.0 |
|
|
116 |
05FF: GOTO 60C |
|
|
117 |
0600: MOVLW 40 |
|
|
118 |
0601: MOVWF 04 |
|
|
119 |
0602: BCF 03.7 |
|
|
120 |
0603: BCF 03.0 |
|
|
121 |
0604: RRF 00,F |
|
|
122 |
0605: MOVF 00,W |
|
|
123 |
0606: BTFSC 03.2 |
|
|
124 |
0607: GOTO 60C |
|
|
125 |
0608: GOTO 60A |
|
|
126 |
0609: NOP |
|
|
127 |
060A: DECFSZ 00,F |
|
|
128 |
060B: GOTO 609 |
|
|
129 |
060C: RETURN |
|
|
130 |
.................... #use rs232(baud=9600,parity=N,xmit=PIN_B7,rcv=PIN_B6,bits=8) |
|
|
131 |
* |
|
|
132 |
0235: BSF 03.5 |
|
|
133 |
0236: BCF 06.7 |
|
|
134 |
0237: BCF 03.5 |
|
|
135 |
0238: BCF 06.7 |
|
|
136 |
0239: MOVLW 08 |
|
|
137 |
023A: MOVWF 78 |
|
|
138 |
023B: GOTO 23C |
|
|
139 |
023C: NOP |
|
|
140 |
023D: BSF 78.7 |
|
|
141 |
023E: GOTO 24D |
|
|
142 |
023F: BCF 78.7 |
|
|
143 |
0240: RRF 45,F |
|
|
144 |
0241: BTFSC 03.0 |
|
|
145 |
0242: BSF 06.7 |
|
|
146 |
0243: BTFSS 03.0 |
|
|
147 |
0244: BCF 06.7 |
|
|
148 |
0245: BSF 78.6 |
|
|
149 |
0246: GOTO 24D |
|
|
150 |
0247: BCF 78.6 |
|
|
151 |
0248: DECFSZ 78,F |
|
|
152 |
0249: GOTO 240 |
|
|
153 |
024A: GOTO 24B |
|
|
154 |
024B: NOP |
|
|
155 |
024C: BSF 06.7 |
|
|
156 |
024D: MOVLW 3F |
|
|
157 |
024E: MOVWF 04 |
|
|
158 |
024F: DECFSZ 04,F |
|
|
159 |
0250: GOTO 24F |
|
|
160 |
0251: NOP |
|
|
161 |
0252: BTFSC 78.7 |
|
|
162 |
0253: GOTO 23F |
|
|
163 |
0254: BTFSC 78.6 |
|
|
164 |
0255: GOTO 247 |
|
|
165 |
0256: RETURN |
|
|
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 |
* |
|
|
387 |
0122: BSF 08.4 |
|
|
388 |
.................... output_float(LCD_DATA5); |
|
|
389 |
0123: BSF 08.5 |
|
|
390 |
.................... output_float(LCD_DATA6); |
|
|
391 |
0124: BSF 08.6 |
|
|
392 |
.................... output_float(LCD_DATA7); |
|
|
393 |
0125: BSF 08.7 |
|
|
394 |
.................... #else |
|
|
395 |
.................... lcdtris.data = 0xF; |
|
|
396 |
.................... #endif |
|
|
397 |
.................... #endif |
|
|
398 |
.................... |
|
|
399 |
.................... lcd_output_rw(1); |
|
|
400 |
0126: BCF 03.5 |
|
|
401 |
0127: BSF 09.2 |
|
|
402 |
0128: BSF 03.5 |
|
|
403 |
0129: BCF 09.2 |
|
|
404 |
.................... delay_cycles(1); |
|
|
405 |
012A: NOP |
|
|
406 |
.................... lcd_output_enable(1); |
|
|
407 |
012B: BCF 03.5 |
|
|
408 |
012C: BSF 09.0 |
|
|
409 |
012D: BSF 03.5 |
|
|
410 |
012E: BCF 09.0 |
|
|
411 |
.................... delay_cycles(1); |
|
|
412 |
012F: NOP |
|
|
413 |
.................... high = lcd_read_nibble(); |
|
|
414 |
0130: BCF 03.5 |
|
|
415 |
0131: CALL 0E9 |
|
|
416 |
0132: MOVF 78,W |
|
|
417 |
0133: MOVWF 4D |
|
|
418 |
.................... |
|
|
419 |
.................... lcd_output_enable(0); |
|
|
420 |
0134: BCF 09.0 |
|
|
421 |
0135: BSF 03.5 |
|
|
422 |
0136: BCF 09.0 |
|
|
423 |
.................... delay_cycles(1); |
|
|
424 |
0137: NOP |
|
|
425 |
.................... lcd_output_enable(1); |
|
|
426 |
0138: BCF 03.5 |
|
|
427 |
0139: BSF 09.0 |
|
|
428 |
013A: BSF 03.5 |
|
|
429 |
013B: BCF 09.0 |
|
|
430 |
.................... delay_us(1); |
|
|
431 |
013C: GOTO 13D |
|
|
432 |
.................... low = lcd_read_nibble(); |
|
|
433 |
013D: BCF 03.5 |
|
|
434 |
013E: CALL 0E9 |
|
|
435 |
013F: MOVF 78,W |
|
|
436 |
0140: MOVWF 4C |
|
|
437 |
.................... |
|
|
438 |
.................... lcd_output_enable(0); |
|
|
439 |
0141: BCF 09.0 |
|
|
440 |
0142: BSF 03.5 |
|
|
441 |
0143: BCF 09.0 |
|
|
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); |
|
|
448 |
0144: BCF 08.4 |
|
|
449 |
.................... output_drive(LCD_DATA5); |
|
|
450 |
0145: BCF 08.5 |
|
|
451 |
.................... output_drive(LCD_DATA6); |
|
|
452 |
0146: BCF 08.6 |
|
|
453 |
.................... output_drive(LCD_DATA7); |
|
|
454 |
0147: BCF 08.7 |
|
|
455 |
.................... #else |
|
|
456 |
.................... lcdtris.data = 0x0; |
|
|
457 |
.................... #endif |
|
|
458 |
.................... #endif |
|
|
459 |
.................... |
|
|
460 |
.................... return( (high<<4) | low); |
|
|
461 |
0148: BCF 03.5 |
|
|
462 |
0149: SWAPF 4D,W |
|
|
463 |
014A: MOVWF 77 |
|
|
464 |
014B: MOVLW F0 |
|
|
465 |
014C: ANDWF 77,F |
|
|
466 |
014D: MOVF 77,W |
|
|
467 |
014E: IORWF 4C,W |
|
|
468 |
014F: MOVWF 78 |
|
|
469 |
.................... } |
|
|
470 |
.................... |
|
|
471 |
.................... BYTE lcd_read_nibble(void) |
|
|
472 |
.................... { |
|
|
473 |
.................... #if (defined(LCD_DATA4) && defined(LCD_DATA5) && defined(LCD_DATA6) && defined(LCD_DATA7)) |
|
|
474 |
* |
|
|
475 |
00E9: CLRF 4E |
|
|
476 |
.................... BYTE n = 0x00; |
|
|
477 |
.................... |
|
|
478 |
.................... /* Read the data port */ |
|
|
479 |
.................... n |= input(LCD_DATA4); |
|
|
480 |
00EA: BSF 03.5 |
|
|
481 |
00EB: BSF 08.4 |
|
|
482 |
00EC: MOVLW 00 |
|
|
483 |
00ED: BCF 03.5 |
|
|
484 |
00EE: BTFSC 08.4 |
|
|
485 |
00EF: MOVLW 01 |
|
|
486 |
00F0: IORWF 4E,F |
|
|
487 |
.................... n |= input(LCD_DATA5) << 1; |
|
|
488 |
00F1: BSF 03.5 |
|
|
489 |
00F2: BSF 08.5 |
|
|
490 |
00F3: MOVLW 00 |
|
|
491 |
00F4: BCF 03.5 |
|
|
492 |
00F5: BTFSC 08.5 |
|
|
493 |
00F6: MOVLW 01 |
|
|
494 |
00F7: MOVWF 77 |
|
|
495 |
00F8: BCF 03.0 |
|
|
496 |
00F9: RLF 77,F |
|
|
497 |
00FA: MOVF 77,W |
|
|
498 |
00FB: IORWF 4E,F |
|
|
499 |
.................... n |= input(LCD_DATA6) << 2; |
|
|
500 |
00FC: BSF 03.5 |
|
|
501 |
00FD: BSF 08.6 |
|
|
502 |
00FE: MOVLW 00 |
|
|
503 |
00FF: BCF 03.5 |
|
|
504 |
0100: BTFSC 08.6 |
|
|
505 |
0101: MOVLW 01 |
|
|
506 |
0102: MOVWF 77 |
|
|
507 |
0103: RLF 77,F |
|
|
508 |
0104: RLF 77,F |
|
|
509 |
0105: MOVLW FC |
|
|
510 |
0106: ANDWF 77,F |
|
|
511 |
0107: MOVF 77,W |
|
|
512 |
0108: IORWF 4E,F |
|
|
513 |
.................... n |= input(LCD_DATA7) << 3; |
|
|
514 |
0109: BSF 03.5 |
|
|
515 |
010A: BSF 08.7 |
|
|
516 |
010B: MOVLW 00 |
|
|
517 |
010C: BCF 03.5 |
|
|
518 |
010D: BTFSC 08.7 |
|
|
519 |
010E: MOVLW 01 |
|
|
520 |
010F: MOVWF 77 |
|
|
521 |
0110: RLF 77,F |
|
|
522 |
0111: RLF 77,F |
|
|
523 |
0112: RLF 77,F |
|
|
524 |
0113: MOVLW F8 |
|
|
525 |
0114: ANDWF 77,F |
|
|
526 |
0115: MOVF 77,W |
|
|
527 |
0116: IORWF 4E,F |
|
|
528 |
.................... |
|
|
529 |
.................... return(n); |
|
|
530 |
0117: MOVF 4E,W |
|
|
531 |
0118: MOVWF 78 |
|
|
532 |
.................... #else |
|
|
533 |
.................... return(lcd.data); |
|
|
534 |
.................... #endif |
|
|
535 |
.................... } |
|
|
536 |
0119: RETURN |
|
|
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 |
* |
|
|
544 |
00BD: BTFSC 4D.0 |
|
|
545 |
00BE: GOTO 0C1 |
|
|
546 |
00BF: BCF 08.4 |
|
|
547 |
00C0: GOTO 0C2 |
|
|
548 |
00C1: BSF 08.4 |
|
|
549 |
00C2: BSF 03.5 |
|
|
550 |
00C3: BCF 08.4 |
|
|
551 |
.................... output_bit(LCD_DATA5, bit_test(n, 1)); |
|
|
552 |
00C4: BCF 03.5 |
|
|
553 |
00C5: BTFSC 4D.1 |
|
|
554 |
00C6: GOTO 0C9 |
|
|
555 |
00C7: BCF 08.5 |
|
|
556 |
00C8: GOTO 0CA |
|
|
557 |
00C9: BSF 08.5 |
|
|
558 |
00CA: BSF 03.5 |
|
|
559 |
00CB: BCF 08.5 |
|
|
560 |
.................... output_bit(LCD_DATA6, bit_test(n, 2)); |
|
|
561 |
00CC: BCF 03.5 |
|
|
562 |
00CD: BTFSC 4D.2 |
|
|
563 |
00CE: GOTO 0D1 |
|
|
564 |
00CF: BCF 08.6 |
|
|
565 |
00D0: GOTO 0D2 |
|
|
566 |
00D1: BSF 08.6 |
|
|
567 |
00D2: BSF 03.5 |
|
|
568 |
00D3: BCF 08.6 |
|
|
569 |
.................... output_bit(LCD_DATA7, bit_test(n, 3)); |
|
|
570 |
00D4: BCF 03.5 |
|
|
571 |
00D5: BTFSC 4D.3 |
|
|
572 |
00D6: GOTO 0D9 |
|
|
573 |
00D7: BCF 08.7 |
|
|
574 |
00D8: GOTO 0DA |
|
|
575 |
00D9: BSF 08.7 |
|
|
576 |
00DA: BSF 03.5 |
|
|
577 |
00DB: BCF 08.7 |
|
|
578 |
.................... #else |
|
|
579 |
.................... lcdlat.data = n; |
|
|
580 |
.................... #endif |
|
|
581 |
.................... |
|
|
582 |
.................... delay_cycles(1); |
|
|
583 |
00DC: NOP |
|
|
584 |
.................... lcd_output_enable(1); |
|
|
585 |
00DD: BCF 03.5 |
|
|
586 |
00DE: BSF 09.0 |
|
|
587 |
00DF: BSF 03.5 |
|
|
588 |
00E0: BCF 09.0 |
|
|
589 |
.................... delay_us(2); |
|
|
590 |
00E1: GOTO 0E2 |
|
|
591 |
00E2: GOTO 0E3 |
|
|
592 |
.................... lcd_output_enable(0); |
|
|
593 |
00E3: BCF 03.5 |
|
|
594 |
00E4: BCF 09.0 |
|
|
595 |
00E5: BSF 03.5 |
|
|
596 |
00E6: BCF 09.0 |
|
|
597 |
.................... } |
|
|
598 |
00E7: BCF 03.5 |
|
|
599 |
00E8: RETURN |
|
|
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 |
* |
|
|
608 |
011A: BSF 03.5 |
|
|
609 |
011B: BCF 09.0 |
|
|
610 |
.................... lcd_rs_tris(); |
|
|
611 |
011C: BCF 09.1 |
|
|
612 |
.................... lcd_rw_tris(); |
|
|
613 |
011D: BCF 09.2 |
|
|
614 |
.................... #endif |
|
|
615 |
.................... |
|
|
616 |
.................... lcd_output_rs(0); |
|
|
617 |
011E: BCF 03.5 |
|
|
618 |
011F: BCF 09.1 |
|
|
619 |
0120: BSF 03.5 |
|
|
620 |
0121: BCF 09.1 |
|
|
621 |
.................... while ( bit_test(lcd_read_byte(),7) ) ; |
|
|
622 |
* |
|
|
623 |
0150: MOVF 78,W |
|
|
624 |
0151: MOVWF 4C |
|
|
625 |
0152: BTFSS 4C.7 |
|
|
626 |
0153: GOTO 156 |
|
|
627 |
0154: BSF 03.5 |
|
|
628 |
0155: GOTO 122 |
|
|
629 |
.................... lcd_output_rs(address); |
|
|
630 |
0156: MOVF 4A,F |
|
|
631 |
0157: BTFSS 03.2 |
|
|
632 |
0158: GOTO 15B |
|
|
633 |
0159: BCF 09.1 |
|
|
634 |
015A: GOTO 15C |
|
|
635 |
015B: BSF 09.1 |
|
|
636 |
015C: BSF 03.5 |
|
|
637 |
015D: BCF 09.1 |
|
|
638 |
.................... delay_cycles(1); |
|
|
639 |
015E: NOP |
|
|
640 |
.................... lcd_output_rw(0); |
|
|
641 |
015F: BCF 03.5 |
|
|
642 |
0160: BCF 09.2 |
|
|
643 |
0161: BSF 03.5 |
|
|
644 |
0162: BCF 09.2 |
|
|
645 |
.................... delay_cycles(1); |
|
|
646 |
0163: NOP |
|
|
647 |
.................... lcd_output_enable(0); |
|
|
648 |
0164: BCF 03.5 |
|
|
649 |
0165: BCF 09.0 |
|
|
650 |
0166: BSF 03.5 |
|
|
651 |
0167: BCF 09.0 |
|
|
652 |
.................... lcd_send_nibble(n >> 4); |
|
|
653 |
0168: BCF 03.5 |
|
|
654 |
0169: SWAPF 4B,W |
|
|
655 |
016A: MOVWF 4C |
|
|
656 |
016B: MOVLW 0F |
|
|
657 |
016C: ANDWF 4C,F |
|
|
658 |
016D: MOVF 4C,W |
|
|
659 |
016E: MOVWF 4D |
|
|
660 |
016F: CALL 0BD |
|
|
661 |
.................... lcd_send_nibble(n & 0xf); |
|
|
662 |
0170: MOVF 4B,W |
|
|
663 |
0171: ANDLW 0F |
|
|
664 |
0172: MOVWF 4C |
|
|
665 |
0173: MOVWF 4D |
|
|
666 |
0174: CALL 0BD |
|
|
667 |
.................... } |
|
|
668 |
0175: RETURN |
|
|
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); |
|
|
683 |
0176: BSF 03.5 |
|
|
684 |
0177: BCF 08.4 |
|
|
685 |
.................... output_drive(LCD_DATA5); |
|
|
686 |
0178: BCF 08.5 |
|
|
687 |
.................... output_drive(LCD_DATA6); |
|
|
688 |
0179: BCF 08.6 |
|
|
689 |
.................... output_drive(LCD_DATA7); |
|
|
690 |
017A: BCF 08.7 |
|
|
691 |
.................... #else |
|
|
692 |
.................... lcdtris.data = 0x0; |
|
|
693 |
.................... #endif |
|
|
694 |
.................... lcd_enable_tris(); |
|
|
695 |
017B: BCF 09.0 |
|
|
696 |
.................... lcd_rs_tris(); |
|
|
697 |
017C: BCF 09.1 |
|
|
698 |
.................... lcd_rw_tris(); |
|
|
699 |
017D: BCF 09.2 |
|
|
700 |
.................... #endif |
|
|
701 |
.................... |
|
|
702 |
.................... lcd_output_rs(0); |
|
|
703 |
017E: BCF 03.5 |
|
|
704 |
017F: BCF 09.1 |
|
|
705 |
0180: BSF 03.5 |
|
|
706 |
0181: BCF 09.1 |
|
|
707 |
.................... lcd_output_rw(0); |
|
|
708 |
0182: BCF 03.5 |
|
|
709 |
0183: BCF 09.2 |
|
|
710 |
0184: BSF 03.5 |
|
|
711 |
0185: BCF 09.2 |
|
|
712 |
.................... lcd_output_enable(0); |
|
|
713 |
0186: BCF 03.5 |
|
|
714 |
0187: BCF 09.0 |
|
|
715 |
0188: BSF 03.5 |
|
|
716 |
0189: BCF 09.0 |
|
|
717 |
.................... |
|
|
718 |
.................... delay_ms(15); |
|
|
719 |
018A: MOVLW 0F |
|
|
720 |
018B: BCF 03.5 |
|
|
721 |
018C: MOVWF 46 |
|
|
722 |
018D: CALL 0A9 |
|
|
723 |
.................... for(i=1;i<=3;++i) |
|
|
724 |
018E: MOVLW 01 |
|
|
725 |
018F: MOVWF 39 |
|
|
726 |
0190: MOVF 39,W |
|
|
727 |
0191: SUBLW 03 |
|
|
728 |
0192: BTFSS 03.0 |
|
|
729 |
0193: GOTO 19C |
|
|
730 |
.................... { |
|
|
731 |
.................... lcd_send_nibble(3); |
|
|
732 |
0194: MOVLW 03 |
|
|
733 |
0195: MOVWF 4D |
|
|
734 |
0196: CALL 0BD |
|
|
735 |
.................... delay_ms(5); |
|
|
736 |
0197: MOVLW 05 |
|
|
737 |
0198: MOVWF 46 |
|
|
738 |
0199: CALL 0A9 |
|
|
739 |
.................... } |
|
|
740 |
019A: INCF 39,F |
|
|
741 |
019B: GOTO 190 |
|
|
742 |
.................... |
|
|
743 |
.................... lcd_send_nibble(2); |
|
|
744 |
019C: MOVLW 02 |
|
|
745 |
019D: MOVWF 4D |
|
|
746 |
019E: CALL 0BD |
|
|
747 |
.................... for(i=0;i<=3;++i) |
|
|
748 |
019F: CLRF 39 |
|
|
749 |
01A0: MOVF 39,W |
|
|
750 |
01A1: SUBLW 03 |
|
|
751 |
01A2: BTFSS 03.0 |
|
|
752 |
01A3: GOTO 1AD |
|
|
753 |
.................... lcd_send_byte(0,LCD_INIT_STRING[i]); |
|
|
754 |
01A4: MOVF 39,W |
|
|
755 |
01A5: CALL 038 |
|
|
756 |
01A6: MOVWF 3A |
|
|
757 |
01A7: CLRF 4A |
|
|
758 |
01A8: MOVF 3A,W |
|
|
759 |
01A9: MOVWF 4B |
|
|
760 |
01AA: CALL 11A |
|
|
761 |
.................... |
|
|
762 |
.................... #if defined(LCD_EXTENDED_NEWLINE) |
|
|
763 |
01AB: INCF 39,F |
|
|
764 |
01AC: GOTO 1A0 |
|
|
765 |
.................... g_LcdX = 0; |
|
|
766 |
.................... g_LcdY = 0; |
|
|
767 |
.................... #endif |
|
|
768 |
.................... } |
|
|
769 |
01AD: BSF 0A.3 |
|
|
770 |
01AE: BCF 0A.4 |
|
|
771 |
01AF: GOTO 0B3 (RETURN) |
|
|
772 |
.................... |
|
|
773 |
.................... void lcd_gotoxy(BYTE x, BYTE y) |
|
|
774 |
.................... { |
|
|
775 |
.................... BYTE address; |
|
|
776 |
.................... |
|
|
777 |
.................... if(y!=1) |
|
|
778 |
01B0: DECFSZ 47,W |
|
|
779 |
01B1: GOTO 1B3 |
|
|
780 |
01B2: GOTO 1B6 |
|
|
781 |
.................... address=LCD_LINE_TWO; |
|
|
782 |
01B3: MOVLW 40 |
|
|
783 |
01B4: MOVWF 48 |
|
|
784 |
.................... else |
|
|
785 |
01B5: GOTO 1B7 |
|
|
786 |
.................... address=0; |
|
|
787 |
01B6: CLRF 48 |
|
|
788 |
.................... |
|
|
789 |
.................... address+=x-1; |
|
|
790 |
01B7: MOVLW 01 |
|
|
791 |
01B8: SUBWF 46,W |
|
|
792 |
01B9: ADDWF 48,F |
|
|
793 |
.................... lcd_send_byte(0,0x80|address); |
|
|
794 |
01BA: MOVF 48,W |
|
|
795 |
01BB: IORLW 80 |
|
|
796 |
01BC: MOVWF 49 |
|
|
797 |
01BD: CLRF 4A |
|
|
798 |
01BE: MOVF 49,W |
|
|
799 |
01BF: MOVWF 4B |
|
|
800 |
01C0: CALL 11A |
|
|
801 |
.................... |
|
|
802 |
.................... #if defined(LCD_EXTENDED_NEWLINE) |
|
|
803 |
.................... g_LcdX = x - 1; |
|
|
804 |
.................... g_LcdY = y - 1; |
|
|
805 |
.................... #endif |
|
|
806 |
.................... } |
|
|
807 |
01C1: RETURN |
|
|
808 |
.................... |
|
|
809 |
.................... void lcd_putc(char c) |
|
|
810 |
.................... { |
|
|
811 |
.................... switch (c) |
|
|
812 |
.................... { |
|
|
813 |
01C2: MOVF 45,W |
|
|
814 |
01C3: XORLW 07 |
|
|
815 |
01C4: BTFSC 03.2 |
|
|
816 |
01C5: GOTO 1D0 |
|
|
817 |
01C6: XORLW 0B |
|
|
818 |
01C7: BTFSC 03.2 |
|
|
819 |
01C8: GOTO 1D5 |
|
|
820 |
01C9: XORLW 06 |
|
|
821 |
01CA: BTFSC 03.2 |
|
|
822 |
01CB: GOTO 1DD |
|
|
823 |
01CC: XORLW 02 |
|
|
824 |
01CD: BTFSC 03.2 |
|
|
825 |
01CE: GOTO 1E3 |
|
|
826 |
01CF: GOTO 1E8 |
|
|
827 |
.................... case '\a' : lcd_gotoxy(1,1); break; |
|
|
828 |
01D0: MOVLW 01 |
|
|
829 |
01D1: MOVWF 46 |
|
|
830 |
01D2: MOVWF 47 |
|
|
831 |
01D3: CALL 1B0 |
|
|
832 |
01D4: GOTO 1EE |
|
|
833 |
.................... |
|
|
834 |
.................... case '\f' : lcd_send_byte(0,1); |
|
|
835 |
01D5: CLRF 4A |
|
|
836 |
01D6: MOVLW 01 |
|
|
837 |
01D7: MOVWF 4B |
|
|
838 |
01D8: CALL 11A |
|
|
839 |
.................... delay_ms(2); |
|
|
840 |
01D9: MOVLW 02 |
|
|
841 |
01DA: MOVWF 46 |
|
|
842 |
01DB: CALL 0A9 |
|
|
843 |
.................... #if defined(LCD_EXTENDED_NEWLINE) |
|
|
844 |
.................... g_LcdX = 0; |
|
|
845 |
.................... g_LcdY = 0; |
|
|
846 |
.................... #endif |
|
|
847 |
.................... break; |
|
|
848 |
01DC: GOTO 1EE |
|
|
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; |
|
|
861 |
01DD: MOVLW 01 |
|
|
862 |
01DE: MOVWF 46 |
|
|
863 |
01DF: MOVLW 02 |
|
|
864 |
01E0: MOVWF 47 |
|
|
865 |
01E1: CALL 1B0 |
|
|
866 |
01E2: GOTO 1EE |
|
|
867 |
.................... #endif |
|
|
868 |
.................... |
|
|
869 |
.................... case '\b' : lcd_send_byte(0,0x10); break; |
|
|
870 |
01E3: CLRF 4A |
|
|
871 |
01E4: MOVLW 10 |
|
|
872 |
01E5: MOVWF 4B |
|
|
873 |
01E6: CALL 11A |
|
|
874 |
01E7: GOTO 1EE |
|
|
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; |
|
|
886 |
01E8: MOVLW 01 |
|
|
887 |
01E9: MOVWF 4A |
|
|
888 |
01EA: MOVF 45,W |
|
|
889 |
01EB: MOVWF 4B |
|
|
890 |
01EC: CALL 11A |
|
|
891 |
01ED: GOTO 1EE |
|
|
892 |
.................... #endif |
|
|
893 |
.................... } |
|
|
894 |
.................... } |
|
|
895 |
01EE: RETURN |
|
|
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 |
* |
|
|
964 |
060D: CLRF 3C |
|
|
965 |
060E: MOVF 3C,W |
|
|
966 |
060F: SUBWF 39,W |
|
|
967 |
0610: BTFSS 03.0 |
|
|
968 |
0611: GOTO 655 |
|
|
969 |
.................... { |
|
|
970 |
.................... output_toggle(BEEP); |
|
|
971 |
0612: BSF 03.5 |
|
|
972 |
0613: BCF 08.2 |
|
|
973 |
0614: MOVLW 04 |
|
|
974 |
0615: BCF 03.5 |
|
|
975 |
0616: XORWF 08,F |
|
|
976 |
.................... delay_us(1/frequency); |
|
|
977 |
0617: CLRF 3E |
|
|
978 |
0618: MOVLW 01 |
|
|
979 |
0619: MOVWF 3D |
|
|
980 |
061A: MOVF 3B,W |
|
|
981 |
061B: MOVWF 40 |
|
|
982 |
061C: MOVF 3A,W |
|
|
983 |
061D: MOVWF 3F |
|
|
984 |
* |
|
|
985 |
0642: MOVF 79,W |
|
|
986 |
0643: MOVWF 3E |
|
|
987 |
0644: MOVF 78,W |
|
|
988 |
0645: MOVWF 3D |
|
|
989 |
0646: MOVF 3E,W |
|
|
990 |
0647: MOVWF 3F |
|
|
991 |
0648: INCF 3F,F |
|
|
992 |
0649: DECF 3F,F |
|
|
993 |
064A: BTFSC 03.2 |
|
|
994 |
064B: GOTO 650 |
|
|
995 |
064C: MOVLW FF |
|
|
996 |
064D: MOVWF 40 |
|
|
997 |
064E: CALL 5FC |
|
|
998 |
064F: GOTO 649 |
|
|
999 |
0650: MOVF 3D,W |
|
|
1000 |
0651: MOVWF 40 |
|
|
1001 |
0652: CALL 5FC |
|
|
1002 |
.................... } |
|
|
1003 |
0653: INCF 3C,F |
|
|
1004 |
0654: GOTO 60E |
|
|
1005 |
.................... } |
|
|
1006 |
0655: RETURN |
|
|
1007 |
.................... |
|
|
1008 |
.................... void main() |
|
|
1009 |
.................... { |
|
|
1010 |
* |
|
|
1011 |
0800: CLRF 04 |
|
|
1012 |
0801: BCF 03.7 |
|
|
1013 |
0802: MOVLW 1F |
|
|
1014 |
0803: ANDWF 03,F |
|
|
1015 |
0804: MOVLW 71 |
|
|
1016 |
0805: BSF 03.5 |
|
|
1017 |
0806: MOVWF 0F |
|
|
1018 |
0807: MOVF 0F,W |
|
|
1019 |
0808: BCF 06.7 |
|
|
1020 |
0809: BCF 03.5 |
|
|
1021 |
080A: BSF 06.7 |
|
|
1022 |
080B: CLRF 2A |
|
|
1023 |
080C: CLRF 29 |
|
|
1024 |
080D: CLRF 28 |
|
|
1025 |
080E: CLRF 27 |
|
|
1026 |
080F: CLRF 2C |
|
|
1027 |
0810: CLRF 2B |
|
|
1028 |
0811: CLRF 2E |
|
|
1029 |
0812: CLRF 2D |
|
|
1030 |
0813: BSF 03.5 |
|
|
1031 |
0814: BSF 03.6 |
|
|
1032 |
0815: MOVF 09,W |
|
|
1033 |
0816: ANDLW C0 |
|
|
1034 |
0817: MOVWF 09 |
|
|
1035 |
0818: BCF 03.6 |
|
|
1036 |
0819: BCF 1F.4 |
|
|
1037 |
081A: BCF 1F.5 |
|
|
1038 |
081B: MOVLW 00 |
|
|
1039 |
081C: BSF 03.6 |
|
|
1040 |
081D: MOVWF 08 |
|
|
1041 |
081E: BCF 03.5 |
|
|
1042 |
081F: CLRF 07 |
|
|
1043 |
0820: CLRF 08 |
|
|
1044 |
0821: CLRF 09 |
|
|
1045 |
* |
|
|
1046 |
0825: CLRF 31 |
|
|
1047 |
0826: MOVLW 3C |
|
|
1048 |
0827: MOVWF 30 |
|
|
1049 |
0828: CLRF 38 |
|
|
1050 |
0829: CLRF 37 |
|
|
1051 |
.................... unsigned int16 integration_time=60; |
|
|
1052 |
.................... unsigned int16 time; |
|
|
1053 |
.................... unsigned int16 last_timer; // promena pro praskani |
|
|
1054 |
.................... unsigned int1 button_press,voltage_setup,time_setup; // semafor pro cteni tlacitek |
|
|
1055 |
.................... unsigned int16 measurement_number=0; |
|
|
1056 |
.................... |
|
|
1057 |
.................... setup_adc_ports(sAN0|VSS_VDD); |
|
|
1058 |
082A: BSF 03.5 |
|
|
1059 |
082B: BSF 03.6 |
|
|
1060 |
082C: MOVF 09,W |
|
|
1061 |
082D: ANDLW C0 |
|
|
1062 |
082E: MOVWF 09 |
|
|
1063 |
082F: BCF 03.6 |
|
|
1064 |
0830: BCF 1F.4 |
|
|
1065 |
0831: BCF 1F.5 |
|
|
1066 |
0832: MOVLW 01 |
|
|
1067 |
0833: BSF 03.6 |
|
|
1068 |
0834: MOVWF 08 |
|
|
1069 |
.................... setup_adc(ADC_CLOCK_DIV_32); |
|
|
1070 |
0835: BCF 03.5 |
|
|
1071 |
0836: BCF 03.6 |
|
|
1072 |
0837: BCF 1F.6 |
|
|
1073 |
0838: BSF 1F.7 |
|
|
1074 |
0839: BSF 03.5 |
|
|
1075 |
083A: BSF 1F.7 |
|
|
1076 |
083B: BCF 03.5 |
|
|
1077 |
083C: BSF 1F.0 |
|
|
1078 |
.................... setup_spi(SPI_SS_DISABLED); |
|
|
1079 |
083D: BCF 14.5 |
|
|
1080 |
083E: BCF 2F.5 |
|
|
1081 |
083F: MOVF 2F,W |
|
|
1082 |
0840: BSF 03.5 |
|
|
1083 |
0841: MOVWF 07 |
|
|
1084 |
0842: BCF 03.5 |
|
|
1085 |
0843: BSF 2F.4 |
|
|
1086 |
0844: MOVF 2F,W |
|
|
1087 |
0845: BSF 03.5 |
|
|
1088 |
0846: MOVWF 07 |
|
|
1089 |
0847: BCF 03.5 |
|
|
1090 |
0848: BCF 2F.3 |
|
|
1091 |
0849: MOVF 2F,W |
|
|
1092 |
084A: BSF 03.5 |
|
|
1093 |
084B: MOVWF 07 |
|
|
1094 |
084C: MOVLW 01 |
|
|
1095 |
084D: BCF 03.5 |
|
|
1096 |
084E: MOVWF 14 |
|
|
1097 |
084F: MOVLW 00 |
|
|
1098 |
0850: BSF 03.5 |
|
|
1099 |
0851: MOVWF 14 |
|
|
1100 |
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_256); |
|
|
1101 |
0852: MOVF 01,W |
|
|
1102 |
0853: ANDLW C0 |
|
|
1103 |
0854: IORLW 07 |
|
|
1104 |
0855: MOVWF 01 |
|
|
1105 |
.................... setup_timer_1(T1_EXTERNAL|T1_DIV_BY_1); |
|
|
1106 |
0856: MOVLW 07 |
|
|
1107 |
0857: BCF 03.5 |
|
|
1108 |
0858: MOVWF 10 |
|
|
1109 |
.................... setup_timer_2(T2_DISABLED,0,1); |
|
|
1110 |
0859: MOVLW 00 |
|
|
1111 |
085A: MOVWF 78 |
|
|
1112 |
085B: MOVWF 12 |
|
|
1113 |
085C: MOVLW 00 |
|
|
1114 |
085D: BSF 03.5 |
|
|
1115 |
085E: MOVWF 12 |
|
|
1116 |
.................... setup_ccp1(CCP_PWM); |
|
|
1117 |
085F: BCF 03.5 |
|
|
1118 |
0860: BCF 2F.2 |
|
|
1119 |
0861: MOVF 2F,W |
|
|
1120 |
0862: BSF 03.5 |
|
|
1121 |
0863: MOVWF 07 |
|
|
1122 |
0864: BCF 03.5 |
|
|
1123 |
0865: BCF 07.2 |
|
|
1124 |
0866: BSF 03.5 |
|
|
1125 |
0867: BCF 09.6 |
|
|
1126 |
0868: MOVLW 0C |
|
|
1127 |
0869: BCF 03.5 |
|
|
1128 |
086A: MOVWF 17 |
|
|
1129 |
086B: BSF 03.5 |
|
|
1130 |
086C: CLRF 1B |
|
|
1131 |
086D: CLRF 1C |
|
|
1132 |
086E: MOVLW 01 |
|
|
1133 |
086F: MOVWF 1D |
|
|
1134 |
.................... setup_ccp2(CCP_PWM); |
|
|
1135 |
0870: BCF 03.5 |
|
|
1136 |
0871: BCF 2F.1 |
|
|
1137 |
0872: MOVF 2F,W |
|
|
1138 |
0873: BSF 03.5 |
|
|
1139 |
0874: MOVWF 07 |
|
|
1140 |
0875: BCF 03.5 |
|
|
1141 |
0876: BCF 07.1 |
|
|
1142 |
0877: MOVLW 0C |
|
|
1143 |
0878: MOVWF 1D |
|
|
1144 |
0879: MOVLW 01 |
|
|
1145 |
087A: MOVWF 00 |
|
|
1146 |
.................... setup_oscillator(OSC_8MHZ); |
|
|
1147 |
087B: MOVLW 71 |
|
|
1148 |
087C: BSF 03.5 |
|
|
1149 |
087D: MOVWF 0F |
|
|
1150 |
087E: MOVF 0F,W |
|
|
1151 |
.................... |
|
|
1152 |
.................... set_pwm1_duty(0); |
|
|
1153 |
087F: BCF 03.5 |
|
|
1154 |
0880: CLRF 15 |
|
|
1155 |
.................... set_pwm2_duty(0); |
|
|
1156 |
0881: CLRF 1B |
|
|
1157 |
.................... |
|
|
1158 |
.................... output_high(LED1); |
|
|
1159 |
0882: BCF 2F.6 |
|
|
1160 |
0883: MOVF 2F,W |
|
|
1161 |
0884: BSF 03.5 |
|
|
1162 |
0885: MOVWF 07 |
|
|
1163 |
0886: BCF 03.5 |
|
|
1164 |
0887: BSF 07.6 |
|
|
1165 |
.................... output_high(LED2); |
|
|
1166 |
0888: BCF 2F.5 |
|
|
1167 |
0889: MOVF 2F,W |
|
|
1168 |
088A: BSF 03.5 |
|
|
1169 |
088B: MOVWF 07 |
|
|
1170 |
088C: BCF 03.5 |
|
|
1171 |
088D: BSF 07.5 |
|
|
1172 |
.................... output_high(LED3); |
|
|
1173 |
088E: BCF 2F.4 |
|
|
1174 |
088F: MOVF 2F,W |
|
|
1175 |
0890: BSF 03.5 |
|
|
1176 |
0891: MOVWF 07 |
|
|
1177 |
0892: BCF 03.5 |
|
|
1178 |
0893: BSF 07.4 |
|
|
1179 |
.................... output_high(LED4); |
|
|
1180 |
0894: BSF 03.5 |
|
|
1181 |
0895: BCF 08.3 |
|
|
1182 |
0896: BCF 03.5 |
|
|
1183 |
0897: BSF 08.3 |
|
|
1184 |
.................... output_low(BEEP); |
|
|
1185 |
0898: BSF 03.5 |
|
|
1186 |
0899: BCF 08.2 |
|
|
1187 |
089A: BCF 03.5 |
|
|
1188 |
089B: BCF 08.2 |
|
|
1189 |
.................... |
|
|
1190 |
.................... setup_comparator(CP2_A0_VREF|CP2_OUT_ON_A5); // sets two comparators(A1 and VR and A2 as the output) |
|
|
1191 |
089C: BSF 03.6 |
|
|
1192 |
089D: CLRF 07 |
|
|
1193 |
089E: MOVLW A4 |
|
|
1194 |
089F: MOVWF 08 |
|
|
1195 |
08A0: MOVLW 10 |
|
|
1196 |
08A1: MOVWF 09 |
|
|
1197 |
08A2: BSF 03.5 |
|
|
1198 |
08A3: BCF 03.6 |
|
|
1199 |
08A4: BCF 05.5 |
|
|
1200 |
08A5: BSF 05.0 |
|
|
1201 |
.................... setup_vref(VREF_HIGH|6); //sets 3.6(vdd *value/32 +vdd/4) if vdd is 5.0V |
|
|
1202 |
08A6: MOVLW 86 |
|
|
1203 |
08A7: MOVWF 17 |
|
|
1204 |
.................... enable_interrupts(INT_COMP); //enables the comparator interrupt |
|
|
1205 |
08A8: BSF 0D.5 |
|
|
1206 |
.................... enable_interrupts(INT_RTCC); |
|
|
1207 |
08A9: BCF 03.5 |
|
|
1208 |
08AA: BSF 0B.5 |
|
|
1209 |
.................... enable_interrupts(INT_TIMER1); |
|
|
1210 |
08AB: BSF 03.5 |
|
|
1211 |
08AC: BSF 0C.0 |
|
|
1212 |
.................... enable_interrupts(INT_TIMER2); |
|
|
1213 |
08AD: BSF 0C.1 |
|
|
1214 |
.................... enable_interrupts(GLOBAL); |
|
|
1215 |
08AE: MOVLW C0 |
|
|
1216 |
08AF: BCF 03.5 |
|
|
1217 |
08B0: IORWF 0B,F |
|
|
1218 |
.................... lcd_init(); |
|
|
1219 |
08B1: BCF 0A.3 |
|
|
1220 |
08B2: GOTO 176 |
|
|
1221 |
08B3: BSF 0A.3 |
|
|
1222 |
.................... |
|
|
1223 |
.................... lcd_putc("\fGM counter V1.0 \n 2013 MLAB"); |
|
|
1224 |
08B4: MOVLW 5A |
|
|
1225 |
08B5: BSF 03.6 |
|
|
1226 |
08B6: MOVWF 0D |
|
|
1227 |
08B7: MOVLW 00 |
|
|
1228 |
08B8: MOVWF 0F |
|
|
1229 |
08B9: BCF 0A.3 |
|
|
1230 |
08BA: BCF 03.6 |
|
|
1231 |
08BB: CALL 1EF |
|
|
1232 |
08BC: BSF 0A.3 |
|
|
1233 |
.................... printf("Geiger-Muller Counter V1.0 \r\n"); |
|
|
1234 |
08BD: MOVLW 6A |
|
|
1235 |
08BE: BSF 03.6 |
|
|
1236 |
08BF: MOVWF 0D |
|
|
1237 |
08C0: MOVLW 00 |
|
|
1238 |
08C1: MOVWF 0F |
|
|
1239 |
08C2: BCF 0A.3 |
|
|
1240 |
08C3: BCF 03.6 |
|
|
1241 |
08C4: CALL 257 |
|
|
1242 |
08C5: BSF 0A.3 |
|
|
1243 |
.................... printf("(c) 2013 MLAB and UST.cz \r\n"); |
|
|
1244 |
08C6: MOVLW 79 |
|
|
1245 |
08C7: BSF 03.6 |
|
|
1246 |
08C8: MOVWF 0D |
|
|
1247 |
08C9: MOVLW 00 |
|
|
1248 |
08CA: MOVWF 0F |
|
|
1249 |
08CB: BCF 0A.3 |
|
|
1250 |
08CC: BCF 03.6 |
|
|
1251 |
08CD: CALL 257 |
|
|
1252 |
08CE: BSF 0A.3 |
|
|
1253 |
.................... Delay_ms(1000); |
|
|
1254 |
08CF: MOVLW 04 |
|
|
1255 |
08D0: MOVWF 39 |
|
|
1256 |
08D1: MOVLW FA |
|
|
1257 |
08D2: MOVWF 46 |
|
|
1258 |
08D3: BCF 0A.3 |
|
|
1259 |
08D4: CALL 0A9 |
|
|
1260 |
08D5: BSF 0A.3 |
|
|
1261 |
08D6: DECFSZ 39,F |
|
|
1262 |
08D7: GOTO 0D1 |
|
|
1263 |
.................... |
|
|
1264 |
.................... lcd_putc("\f"); |
|
|
1265 |
08D8: MOVLW 87 |
|
|
1266 |
08D9: BSF 03.6 |
|
|
1267 |
08DA: MOVWF 0D |
|
|
1268 |
08DB: MOVLW 00 |
|
|
1269 |
08DC: MOVWF 0F |
|
|
1270 |
08DD: BCF 0A.3 |
|
|
1271 |
08DE: BCF 03.6 |
|
|
1272 |
08DF: CALL 1EF |
|
|
1273 |
08E0: BSF 0A.3 |
|
|
1274 |
.................... printf("\r\n"); |
|
|
1275 |
08E1: MOVLW 0D |
|
|
1276 |
08E2: MOVWF 45 |
|
|
1277 |
08E3: BCF 0A.3 |
|
|
1278 |
08E4: CALL 235 |
|
|
1279 |
08E5: BSF 0A.3 |
|
|
1280 |
08E6: MOVLW 0A |
|
|
1281 |
08E7: MOVWF 45 |
|
|
1282 |
08E8: BCF 0A.3 |
|
|
1283 |
08E9: CALL 235 |
|
|
1284 |
08EA: BSF 0A.3 |
|
|
1285 |
.................... |
|
|
1286 |
.................... set_timer1(0); |
|
|
1287 |
08EB: CLRF 0F |
|
|
1288 |
08EC: CLRF 0E |
|
|
1289 |
.................... |
|
|
1290 |
.................... lcd_gotoxy(1,1); // vypsani hodnoty count, abz byla na LCD hned od zapnuti |
|
|
1291 |
08ED: MOVLW 01 |
|
|
1292 |
08EE: MOVWF 46 |
|
|
1293 |
08EF: MOVWF 47 |
|
|
1294 |
08F0: BCF 0A.3 |
|
|
1295 |
08F1: CALL 1B0 |
|
|
1296 |
08F2: BSF 0A.3 |
|
|
1297 |
.................... printf(lcd_putc,"Count:%lu ",pulse_count); |
|
|
1298 |
08F3: MOVLW 88 |
|
|
1299 |
08F4: BSF 03.6 |
|
|
1300 |
08F5: MOVWF 0D |
|
|
1301 |
08F6: MOVLW 00 |
|
|
1302 |
08F7: MOVWF 0F |
|
|
1303 |
08F8: BCF 03.0 |
|
|
1304 |
08F9: MOVLW 06 |
|
|
1305 |
08FA: BCF 03.6 |
|
|
1306 |
08FB: MOVWF 39 |
|
|
1307 |
08FC: BCF 0A.3 |
|
|
1308 |
08FD: CALL 29D |
|
|
1309 |
08FE: BSF 0A.3 |
|
|
1310 |
08FF: MOVLW 41 |
|
|
1311 |
0900: MOVWF 04 |
|
|
1312 |
0901: MOVF 2A,W |
|
|
1313 |
0902: MOVWF 3C |
|
|
1314 |
0903: MOVF 29,W |
|
|
1315 |
0904: MOVWF 3B |
|
|
1316 |
0905: MOVF 28,W |
|
|
1317 |
0906: MOVWF 3A |
|
|
1318 |
0907: MOVF 27,W |
|
|
1319 |
0908: MOVWF 39 |
|
|
1320 |
0909: BCF 0A.3 |
|
|
1321 |
090A: CALL 32E |
|
|
1322 |
090B: BSF 0A.3 |
|
|
1323 |
090C: MOVLW 8C |
|
|
1324 |
090D: BSF 03.6 |
|
|
1325 |
090E: MOVWF 0D |
|
|
1326 |
090F: MOVLW 00 |
|
|
1327 |
0910: MOVWF 0F |
|
|
1328 |
0911: BSF 03.0 |
|
|
1329 |
0912: MOVLW 05 |
|
|
1330 |
0913: BCF 03.6 |
|
|
1331 |
0914: MOVWF 39 |
|
|
1332 |
0915: BCF 0A.3 |
|
|
1333 |
0916: CALL 29D |
|
|
1334 |
0917: BSF 0A.3 |
|
|
1335 |
.................... |
|
|
1336 |
.................... while(true) |
|
|
1337 |
.................... { |
|
|
1338 |
.................... pulse_count = get_timer1() + (0xffff * overflow_count); // compute pulse count |
|
|
1339 |
0918: MOVF 0F,W |
|
|
1340 |
0919: MOVWF 7A |
|
|
1341 |
091A: MOVF 0E,W |
|
|
1342 |
091B: MOVWF 77 |
|
|
1343 |
091C: MOVF 0F,W |
|
|
1344 |
091D: SUBWF 7A,W |
|
|
1345 |
091E: BTFSS 03.2 |
|
|
1346 |
091F: GOTO 118 |
|
|
1347 |
0920: MOVF 77,W |
|
|
1348 |
0921: MOVWF 39 |
|
|
1349 |
0922: MOVF 7A,W |
|
|
1350 |
0923: MOVWF 3A |
|
|
1351 |
0924: MOVLW FF |
|
|
1352 |
0925: MOVWF 3C |
|
|
1353 |
0926: MOVWF 3B |
|
|
1354 |
0927: MOVF 2C,W |
|
|
1355 |
0928: MOVWF 3E |
|
|
1356 |
0929: MOVF 2B,W |
|
|
1357 |
092A: MOVWF 3D |
|
|
1358 |
092B: BCF 0A.3 |
|
|
1359 |
092C: GOTO 38A |
|
|
1360 |
092D: BSF 0A.3 |
|
|
1361 |
092E: MOVF 79,W |
|
|
1362 |
092F: MOVWF 7A |
|
|
1363 |
0930: MOVF 78,W |
|
|
1364 |
0931: ADDWF 39,W |
|
|
1365 |
0932: MOVWF 27 |
|
|
1366 |
0933: MOVF 3A,W |
|
|
1367 |
0934: MOVWF 28 |
|
|
1368 |
0935: MOVF 7A,W |
|
|
1369 |
0936: BTFSC 03.0 |
|
|
1370 |
0937: INCFSZ 7A,W |
|
|
1371 |
0938: ADDWF 28,F |
|
|
1372 |
0939: CLRF 29 |
|
|
1373 |
093A: CLRF 2A |
|
|
1374 |
.................... time = integration_time + 1 - (time_overflow_count * 0.0327); // compute time interval |
|
|
1375 |
093B: MOVLW 01 |
|
|
1376 |
093C: ADDWF 30,W |
|
|
1377 |
093D: MOVWF 39 |
|
|
1378 |
093E: MOVF 31,W |
|
|
1379 |
093F: MOVWF 3A |
|
|
1380 |
0940: BTFSC 03.0 |
|
|
1381 |
0941: INCF 3A,F |
|
|
1382 |
0942: MOVF 2E,W |
|
|
1383 |
0943: MOVWF 40 |
|
|
1384 |
0944: MOVF 2D,W |
|
|
1385 |
0945: MOVWF 3F |
|
|
1386 |
0946: BCF 0A.3 |
|
|
1387 |
0947: CALL 3A1 |
|
|
1388 |
0948: BSF 0A.3 |
|
|
1389 |
0949: MOVF 7A,W |
|
|
1390 |
094A: MOVWF 3E |
|
|
1391 |
094B: MOVF 79,W |
|
|
1392 |
094C: MOVWF 3D |
|
|
1393 |
094D: MOVF 78,W |
|
|
1394 |
094E: MOVWF 3C |
|
|
1395 |
094F: MOVF 77,W |
|
|
1396 |
0950: MOVWF 3B |
|
|
1397 |
0951: MOVLW 6F |
|
|
1398 |
0952: MOVWF 42 |
|
|
1399 |
0953: MOVLW F0 |
|
|
1400 |
0954: MOVWF 41 |
|
|
1401 |
0955: MOVLW 05 |
|
|
1402 |
0956: MOVWF 40 |
|
|
1403 |
0957: MOVLW 7A |
|
|
1404 |
0958: MOVWF 3F |
|
|
1405 |
0959: BCF 0A.3 |
|
|
1406 |
095A: GOTO 3BE |
|
|
1407 |
095B: BSF 0A.3 |
|
|
1408 |
095C: MOVF 77,W |
|
|
1409 |
095D: MOVWF 3B |
|
|
1410 |
095E: MOVF 78,W |
|
|
1411 |
095F: MOVWF 3C |
|
|
1412 |
0960: MOVF 79,W |
|
|
1413 |
0961: MOVWF 3D |
|
|
1414 |
0962: MOVF 7A,W |
|
|
1415 |
0963: MOVWF 3E |
|
|
1416 |
0964: MOVF 3A,W |
|
|
1417 |
0965: MOVWF 40 |
|
|
1418 |
0966: MOVF 39,W |
|
|
1419 |
0967: MOVWF 3F |
|
|
1420 |
0968: BCF 0A.3 |
|
|
1421 |
0969: CALL 3A1 |
|
|
1422 |
096A: BSF 0A.3 |
|
|
1423 |
096B: BSF 03.1 |
|
|
1424 |
096C: MOVF 7A,W |
|
|
1425 |
096D: MOVWF 42 |
|
|
1426 |
096E: MOVF 79,W |
|
|
1427 |
096F: MOVWF 41 |
|
|
1428 |
0970: MOVF 78,W |
|
|
1429 |
0971: MOVWF 40 |
|
|
1430 |
0972: MOVF 77,W |
|
|
1431 |
0973: MOVWF 3F |
|
|
1432 |
0974: MOVF 3E,W |
|
|
1433 |
0975: MOVWF 46 |
|
|
1434 |
0976: MOVF 3D,W |
|
|
1435 |
0977: MOVWF 45 |
|
|
1436 |
0978: MOVF 3C,W |
|
|
1437 |
0979: MOVWF 44 |
|
|
1438 |
097A: MOVF 3B,W |
|
|
1439 |
097B: MOVWF 43 |
|
|
1440 |
097C: BCF 0A.3 |
|
|
1441 |
097D: GOTO 435 |
|
|
1442 |
097E: BSF 0A.3 |
|
|
1443 |
097F: MOVF 7A,W |
|
|
1444 |
0980: MOVWF 42 |
|
|
1445 |
0981: MOVF 79,W |
|
|
1446 |
0982: MOVWF 41 |
|
|
1447 |
0983: MOVF 78,W |
|
|
1448 |
0984: MOVWF 40 |
|
|
1449 |
0985: MOVF 77,W |
|
|
1450 |
0986: MOVWF 3F |
|
|
1451 |
0987: BCF 0A.3 |
|
|
1452 |
0988: GOTO 578 |
|
|
1453 |
0989: BSF 0A.3 |
|
|
1454 |
098A: MOVF 79,W |
|
|
1455 |
098B: MOVWF 33 |
|
|
1456 |
098C: MOVF 78,W |
|
|
1457 |
098D: MOVWF 32 |
|
|
1458 |
.................... |
|
|
1459 |
.................... if(get_timer1() != last_timer) // timer count increment detection |
|
|
1460 |
098E: MOVF 0F,W |
|
|
1461 |
098F: MOVWF 7A |
|
|
1462 |
0990: MOVF 0E,W |
|
|
1463 |
0991: MOVWF 77 |
|
|
1464 |
0992: MOVF 0F,W |
|
|
1465 |
0993: SUBWF 7A,W |
|
|
1466 |
0994: BTFSS 03.2 |
|
|
1467 |
0995: GOTO 18E |
|
|
1468 |
0996: MOVF 77,W |
|
|
1469 |
0997: MOVWF 39 |
|
|
1470 |
0998: MOVF 7A,W |
|
|
1471 |
0999: MOVWF 3A |
|
|
1472 |
099A: MOVF 34,W |
|
|
1473 |
099B: SUBWF 39,W |
|
|
1474 |
099C: BTFSS 03.2 |
|
|
1475 |
099D: GOTO 1A2 |
|
|
1476 |
099E: MOVF 35,W |
|
|
1477 |
099F: SUBWF 3A,W |
|
|
1478 |
09A0: BTFSC 03.2 |
|
|
1479 |
09A1: GOTO 1EF |
|
|
1480 |
.................... { |
|
|
1481 |
.................... output_toggle(BEEP); |
|
|
1482 |
09A2: BSF 03.5 |
|
|
1483 |
09A3: BCF 08.2 |
|
|
1484 |
09A4: MOVLW 04 |
|
|
1485 |
09A5: BCF 03.5 |
|
|
1486 |
09A6: XORWF 08,F |
|
|
1487 |
.................... delay_ms(1); |
|
|
1488 |
09A7: MOVLW 01 |
|
|
1489 |
09A8: MOVWF 46 |
|
|
1490 |
09A9: BCF 0A.3 |
|
|
1491 |
09AA: CALL 0A9 |
|
|
1492 |
09AB: BSF 0A.3 |
|
|
1493 |
.................... output_toggle(BEEP); |
|
|
1494 |
09AC: BSF 03.5 |
|
|
1495 |
09AD: BCF 08.2 |
|
|
1496 |
09AE: MOVLW 04 |
|
|
1497 |
09AF: BCF 03.5 |
|
|
1498 |
09B0: XORWF 08,F |
|
|
1499 |
.................... output_toggle(LED3); |
|
|
1500 |
09B1: BCF 2F.4 |
|
|
1501 |
09B2: MOVF 2F,W |
|
|
1502 |
09B3: BSF 03.5 |
|
|
1503 |
09B4: MOVWF 07 |
|
|
1504 |
09B5: MOVLW 10 |
|
|
1505 |
09B6: BCF 03.5 |
|
|
1506 |
09B7: XORWF 07,F |
|
|
1507 |
.................... last_timer=get_timer1(); |
|
|
1508 |
09B8: MOVF 0F,W |
|
|
1509 |
09B9: MOVWF 7A |
|
|
1510 |
09BA: MOVF 0E,W |
|
|
1511 |
09BB: MOVWF 77 |
|
|
1512 |
09BC: MOVF 0F,W |
|
|
1513 |
09BD: SUBWF 7A,W |
|
|
1514 |
09BE: BTFSS 03.2 |
|
|
1515 |
09BF: GOTO 1B8 |
|
|
1516 |
09C0: MOVF 77,W |
|
|
1517 |
09C1: MOVWF 34 |
|
|
1518 |
09C2: MOVF 7A,W |
|
|
1519 |
09C3: MOVWF 35 |
|
|
1520 |
.................... lcd_gotoxy(1,1); // prepsani dat na displeje |
|
|
1521 |
09C4: MOVLW 01 |
|
|
1522 |
09C5: MOVWF 46 |
|
|
1523 |
09C6: MOVWF 47 |
|
|
1524 |
09C7: BCF 0A.3 |
|
|
1525 |
09C8: CALL 1B0 |
|
|
1526 |
09C9: BSF 0A.3 |
|
|
1527 |
.................... printf(lcd_putc,"Count:%lu ",pulse_count); |
|
|
1528 |
09CA: MOVLW 90 |
|
|
1529 |
09CB: BSF 03.6 |
|
|
1530 |
09CC: MOVWF 0D |
|
|
1531 |
09CD: MOVLW 00 |
|
|
1532 |
09CE: MOVWF 0F |
|
|
1533 |
09CF: BCF 03.0 |
|
|
1534 |
09D0: MOVLW 06 |
|
|
1535 |
09D1: BCF 03.6 |
|
|
1536 |
09D2: MOVWF 39 |
|
|
1537 |
09D3: BCF 0A.3 |
|
|
1538 |
09D4: CALL 29D |
|
|
1539 |
09D5: BSF 0A.3 |
|
|
1540 |
09D6: MOVLW 41 |
|
|
1541 |
09D7: MOVWF 04 |
|
|
1542 |
09D8: MOVF 2A,W |
|
|
1543 |
09D9: MOVWF 3C |
|
|
1544 |
09DA: MOVF 29,W |
|
|
1545 |
09DB: MOVWF 3B |
|
|
1546 |
09DC: MOVF 28,W |
|
|
1547 |
09DD: MOVWF 3A |
|
|
1548 |
09DE: MOVF 27,W |
|
|
1549 |
09DF: MOVWF 39 |
|
|
1550 |
09E0: BCF 0A.3 |
|
|
1551 |
09E1: CALL 32E |
|
|
1552 |
09E2: BSF 0A.3 |
|
|
1553 |
09E3: MOVLW 94 |
|
|
1554 |
09E4: BSF 03.6 |
|
|
1555 |
09E5: MOVWF 0D |
|
|
1556 |
09E6: MOVLW 00 |
|
|
1557 |
09E7: MOVWF 0F |
|
|
1558 |
09E8: BSF 03.0 |
|
|
1559 |
09E9: MOVLW 05 |
|
|
1560 |
09EA: BCF 03.6 |
|
|
1561 |
09EB: MOVWF 39 |
|
|
1562 |
09EC: BCF 0A.3 |
|
|
1563 |
09ED: CALL 29D |
|
|
1564 |
09EE: BSF 0A.3 |
|
|
1565 |
.................... } |
|
|
1566 |
.................... |
|
|
1567 |
.................... lcd_gotoxy(1,2); |
|
|
1568 |
09EF: MOVLW 01 |
|
|
1569 |
09F0: MOVWF 46 |
|
|
1570 |
09F1: MOVLW 02 |
|
|
1571 |
09F2: MOVWF 47 |
|
|
1572 |
09F3: BCF 0A.3 |
|
|
1573 |
09F4: CALL 1B0 |
|
|
1574 |
09F5: BSF 0A.3 |
|
|
1575 |
.................... printf(lcd_putc,"T:%lu ",time); |
|
|
1576 |
09F6: MOVLW 54 |
|
|
1577 |
09F7: MOVWF 45 |
|
|
1578 |
09F8: BCF 0A.3 |
|
|
1579 |
09F9: CALL 1C2 |
|
|
1580 |
09FA: BSF 0A.3 |
|
|
1581 |
09FB: MOVLW 3A |
|
|
1582 |
09FC: MOVWF 45 |
|
|
1583 |
09FD: BCF 0A.3 |
|
|
1584 |
09FE: CALL 1C2 |
|
|
1585 |
09FF: BSF 0A.3 |
|
|
1586 |
0A00: MOVLW 10 |
|
|
1587 |
0A01: MOVWF 04 |
|
|
1588 |
0A02: MOVF 33,W |
|
|
1589 |
0A03: MOVWF 3A |
|
|
1590 |
0A04: MOVF 32,W |
|
|
1591 |
0A05: MOVWF 39 |
|
|
1592 |
0A06: BCF 0A.3 |
|
|
1593 |
0A07: CALL 599 |
|
|
1594 |
0A08: BSF 0A.3 |
|
|
1595 |
0A09: MOVLW 20 |
|
|
1596 |
0A0A: MOVWF 45 |
|
|
1597 |
0A0B: BCF 0A.3 |
|
|
1598 |
0A0C: CALL 1C2 |
|
|
1599 |
0A0D: BSF 0A.3 |
|
|
1600 |
0A0E: MOVLW 20 |
|
|
1601 |
0A0F: MOVWF 45 |
|
|
1602 |
0A10: BCF 0A.3 |
|
|
1603 |
0A11: CALL 1C2 |
|
|
1604 |
0A12: BSF 0A.3 |
|
|
1605 |
0A13: MOVLW 20 |
|
|
1606 |
0A14: MOVWF 45 |
|
|
1607 |
0A15: BCF 0A.3 |
|
|
1608 |
0A16: CALL 1C2 |
|
|
1609 |
0A17: BSF 0A.3 |
|
|
1610 |
.................... lcd_gotoxy(9,2); |
|
|
1611 |
0A18: MOVLW 09 |
|
|
1612 |
0A19: MOVWF 46 |
|
|
1613 |
0A1A: MOVLW 02 |
|
|
1614 |
0A1B: MOVWF 47 |
|
|
1615 |
0A1C: BCF 0A.3 |
|
|
1616 |
0A1D: CALL 1B0 |
|
|
1617 |
0A1E: BSF 0A.3 |
|
|
1618 |
.................... printf(lcd_putc,"I:%lu ", integration_time); |
|
|
1619 |
0A1F: MOVLW 49 |
|
|
1620 |
0A20: MOVWF 45 |
|
|
1621 |
0A21: BCF 0A.3 |
|
|
1622 |
0A22: CALL 1C2 |
|
|
1623 |
0A23: BSF 0A.3 |
|
|
1624 |
0A24: MOVLW 3A |
|
|
1625 |
0A25: MOVWF 45 |
|
|
1626 |
0A26: BCF 0A.3 |
|
|
1627 |
0A27: CALL 1C2 |
|
|
1628 |
0A28: BSF 0A.3 |
|
|
1629 |
0A29: MOVLW 10 |
|
|
1630 |
0A2A: MOVWF 04 |
|
|
1631 |
0A2B: MOVF 31,W |
|
|
1632 |
0A2C: MOVWF 3A |
|
|
1633 |
0A2D: MOVF 30,W |
|
|
1634 |
0A2E: MOVWF 39 |
|
|
1635 |
0A2F: BCF 0A.3 |
|
|
1636 |
0A30: CALL 599 |
|
|
1637 |
0A31: BSF 0A.3 |
|
|
1638 |
0A32: MOVLW 9A |
|
|
1639 |
0A33: BSF 03.6 |
|
|
1640 |
0A34: MOVWF 0D |
|
|
1641 |
0A35: MOVLW 00 |
|
|
1642 |
0A36: MOVWF 0F |
|
|
1643 |
0A37: BSF 03.0 |
|
|
1644 |
0A38: MOVLW 04 |
|
|
1645 |
0A39: BCF 03.6 |
|
|
1646 |
0A3A: MOVWF 39 |
|
|
1647 |
0A3B: BCF 0A.3 |
|
|
1648 |
0A3C: CALL 29D |
|
|
1649 |
0A3D: BSF 0A.3 |
|
|
1650 |
.................... |
|
|
1651 |
.................... if(time == 0) // po uplynuti mereneho intervalu vypis na seriovku |
|
|
1652 |
0A3E: MOVF 32,F |
|
|
1653 |
0A3F: BTFSS 03.2 |
|
|
1654 |
0A40: GOTO 298 |
|
|
1655 |
0A41: MOVF 33,F |
|
|
1656 |
0A42: BTFSS 03.2 |
|
|
1657 |
0A43: GOTO 298 |
|
|
1658 |
.................... { |
|
|
1659 |
.................... set_timer0(0); |
|
|
1660 |
0A44: CLRF 01 |
|
|
1661 |
.................... time_overflow_count=0; |
|
|
1662 |
0A45: CLRF 2E |
|
|
1663 |
0A46: CLRF 2D |
|
|
1664 |
.................... sound_beep(1000,700); |
|
|
1665 |
0A47: MOVLW E8 |
|
|
1666 |
0A48: MOVWF 39 |
|
|
1667 |
0A49: MOVLW 02 |
|
|
1668 |
0A4A: MOVWF 3B |
|
|
1669 |
0A4B: MOVLW BC |
|
|
1670 |
0A4C: MOVWF 3A |
|
|
1671 |
0A4D: BCF 0A.3 |
|
|
1672 |
0A4E: CALL 60D |
|
|
1673 |
0A4F: BSF 0A.3 |
|
|
1674 |
.................... printf("$GMC1.0 %lu %lu %lu \r\n", measurement_number, integration_time, pulse_count); |
|
|
1675 |
0A50: MOVLW 9D |
|
|
1676 |
0A51: BSF 03.6 |
|
|
1677 |
0A52: MOVWF 0D |
|
|
1678 |
0A53: MOVLW 00 |
|
|
1679 |
0A54: MOVWF 0F |
|
|
1680 |
0A55: BCF 03.0 |
|
|
1681 |
0A56: MOVLW 08 |
|
|
1682 |
0A57: BCF 03.6 |
|
|
1683 |
0A58: MOVWF 39 |
|
|
1684 |
0A59: BCF 0A.3 |
|
|
1685 |
0A5A: CALL 656 |
|
|
1686 |
0A5B: BSF 0A.3 |
|
|
1687 |
0A5C: MOVLW 10 |
|
|
1688 |
0A5D: MOVWF 04 |
|
|
1689 |
0A5E: MOVF 38,W |
|
|
1690 |
0A5F: MOVWF 3A |
|
|
1691 |
0A60: MOVF 37,W |
|
|
1692 |
0A61: MOVWF 39 |
|
|
1693 |
0A62: BCF 0A.3 |
|
|
1694 |
0A63: CALL 6A5 |
|
|
1695 |
0A64: BSF 0A.3 |
|
|
1696 |
0A65: MOVLW 20 |
|
|
1697 |
0A66: MOVWF 45 |
|
|
1698 |
0A67: BCF 0A.3 |
|
|
1699 |
0A68: CALL 235 |
|
|
1700 |
0A69: BSF 0A.3 |
|
|
1701 |
0A6A: MOVLW 10 |
|
|
1702 |
0A6B: MOVWF 04 |
|
|
1703 |
0A6C: MOVF 31,W |
|
|
1704 |
0A6D: MOVWF 3A |
|
|
1705 |
0A6E: MOVF 30,W |
|
|
1706 |
0A6F: MOVWF 39 |
|
|
1707 |
0A70: BCF 0A.3 |
|
|
1708 |
0A71: CALL 6A5 |
|
|
1709 |
0A72: BSF 0A.3 |
|
|
1710 |
0A73: MOVLW 20 |
|
|
1711 |
0A74: MOVWF 45 |
|
|
1712 |
0A75: BCF 0A.3 |
|
|
1713 |
0A76: CALL 235 |
|
|
1714 |
0A77: BSF 0A.3 |
|
|
1715 |
0A78: MOVLW 41 |
|
|
1716 |
0A79: MOVWF 04 |
|
|
1717 |
0A7A: MOVF 2A,W |
|
|
1718 |
0A7B: MOVWF 3C |
|
|
1719 |
0A7C: MOVF 29,W |
|
|
1720 |
0A7D: MOVWF 3B |
|
|
1721 |
0A7E: MOVF 28,W |
|
|
1722 |
0A7F: MOVWF 3A |
|
|
1723 |
0A80: MOVF 27,W |
|
|
1724 |
0A81: MOVWF 39 |
|
|
1725 |
0A82: BCF 0A.3 |
|
|
1726 |
0A83: GOTO 708 |
|
|
1727 |
0A84: BSF 0A.3 |
|
|
1728 |
0A85: MOVLW A6 |
|
|
1729 |
0A86: BSF 03.6 |
|
|
1730 |
0A87: MOVWF 0D |
|
|
1731 |
0A88: MOVLW 00 |
|
|
1732 |
0A89: MOVWF 0F |
|
|
1733 |
0A8A: BSF 03.0 |
|
|
1734 |
0A8B: MOVLW 04 |
|
|
1735 |
0A8C: BCF 03.6 |
|
|
1736 |
0A8D: MOVWF 39 |
|
|
1737 |
0A8E: BCF 0A.3 |
|
|
1738 |
0A8F: CALL 656 |
|
|
1739 |
0A90: BSF 0A.3 |
|
|
1740 |
.................... set_timer1(0); |
|
|
1741 |
0A91: CLRF 0F |
|
|
1742 |
0A92: CLRF 0E |
|
|
1743 |
.................... overflow_count=0; |
|
|
1744 |
0A93: CLRF 2C |
|
|
1745 |
0A94: CLRF 2B |
|
|
1746 |
.................... measurement_number++; |
|
|
1747 |
0A95: INCF 37,F |
|
|
1748 |
0A96: BTFSC 03.2 |
|
|
1749 |
0A97: INCF 38,F |
|
|
1750 |
.................... } |
|
|
1751 |
.................... |
|
|
1752 |
.................... if(button_press==false ) // tlacitka se ctou znovu pouze pokud v redchozim cyklu nebyla zmacknuta. |
|
|
1753 |
0A98: BTFSC 36.0 |
|
|
1754 |
0A99: GOTO 37E |
|
|
1755 |
.................... { |
|
|
1756 |
.................... if(!input(S1)) |
|
|
1757 |
0A9A: BSF 2F.2 |
|
|
1758 |
0A9B: MOVF 2F,W |
|
|
1759 |
0A9C: BSF 03.5 |
|
|
1760 |
0A9D: MOVWF 07 |
|
|
1761 |
0A9E: BCF 03.5 |
|
|
1762 |
0A9F: BTFSC 07.2 |
|
|
1763 |
0AA0: GOTO 2C7 |
|
|
1764 |
.................... { |
|
|
1765 |
.................... delay_ms(20); |
|
|
1766 |
0AA1: MOVLW 14 |
|
|
1767 |
0AA2: MOVWF 46 |
|
|
1768 |
0AA3: BCF 0A.3 |
|
|
1769 |
0AA4: CALL 0A9 |
|
|
1770 |
0AA5: BSF 0A.3 |
|
|
1771 |
.................... if(!input(S1)) |
|
|
1772 |
0AA6: BSF 2F.2 |
|
|
1773 |
0AA7: MOVF 2F,W |
|
|
1774 |
0AA8: BSF 03.5 |
|
|
1775 |
0AA9: MOVWF 07 |
|
|
1776 |
0AAA: BCF 03.5 |
|
|
1777 |
0AAB: BTFSC 07.2 |
|
|
1778 |
0AAC: GOTO 2C7 |
|
|
1779 |
.................... { |
|
|
1780 |
.................... button_press=true; |
|
|
1781 |
0AAD: BSF 36.0 |
|
|
1782 |
.................... if(time_setup==TRUE) |
|
|
1783 |
0AAE: BTFSS 36.2 |
|
|
1784 |
0AAF: GOTO 2C7 |
|
|
1785 |
.................... { |
|
|
1786 |
.................... sound_beep(100,700); |
|
|
1787 |
0AB0: MOVLW 64 |
|
|
1788 |
0AB1: MOVWF 39 |
|
|
1789 |
0AB2: MOVLW 02 |
|
|
1790 |
0AB3: MOVWF 3B |
|
|
1791 |
0AB4: MOVLW BC |
|
|
1792 |
0AB5: MOVWF 3A |
|
|
1793 |
0AB6: BCF 0A.3 |
|
|
1794 |
0AB7: CALL 60D |
|
|
1795 |
0AB8: BSF 0A.3 |
|
|
1796 |
.................... if(integration_time < 0xfffa ) integration_time+=5; |
|
|
1797 |
0AB9: MOVF 31,W |
|
|
1798 |
0ABA: SUBLW FF |
|
|
1799 |
0ABB: BTFSS 03.0 |
|
|
1800 |
0ABC: GOTO 2C7 |
|
|
1801 |
0ABD: BTFSS 03.2 |
|
|
1802 |
0ABE: GOTO 2C3 |
|
|
1803 |
0ABF: MOVF 30,W |
|
|
1804 |
0AC0: SUBLW F9 |
|
|
1805 |
0AC1: BTFSS 03.0 |
|
|
1806 |
0AC2: GOTO 2C7 |
|
|
1807 |
0AC3: MOVLW 05 |
|
|
1808 |
0AC4: ADDWF 30,F |
|
|
1809 |
0AC5: BTFSC 03.0 |
|
|
1810 |
0AC6: INCF 31,F |
|
|
1811 |
.................... } |
|
|
1812 |
.................... } |
|
|
1813 |
.................... } |
|
|
1814 |
.................... |
|
|
1815 |
.................... if(!input(S2)) |
|
|
1816 |
0AC7: BSF 2F.3 |
|
|
1817 |
0AC8: MOVF 2F,W |
|
|
1818 |
0AC9: BSF 03.5 |
|
|
1819 |
0ACA: MOVWF 07 |
|
|
1820 |
0ACB: BCF 03.5 |
|
|
1821 |
0ACC: BTFSC 07.3 |
|
|
1822 |
0ACD: GOTO 2FA |
|
|
1823 |
.................... { |
|
|
1824 |
.................... delay_ms(20); |
|
|
1825 |
0ACE: MOVLW 14 |
|
|
1826 |
0ACF: MOVWF 46 |
|
|
1827 |
0AD0: BCF 0A.3 |
|
|
1828 |
0AD1: CALL 0A9 |
|
|
1829 |
0AD2: BSF 0A.3 |
|
|
1830 |
.................... if(!input(S2)) |
|
|
1831 |
0AD3: BSF 2F.3 |
|
|
1832 |
0AD4: MOVF 2F,W |
|
|
1833 |
0AD5: BSF 03.5 |
|
|
1834 |
0AD6: MOVWF 07 |
|
|
1835 |
0AD7: BCF 03.5 |
|
|
1836 |
0AD8: BTFSC 07.3 |
|
|
1837 |
0AD9: GOTO 2FA |
|
|
1838 |
.................... { |
|
|
1839 |
.................... button_press=true; |
|
|
1840 |
0ADA: BSF 36.0 |
|
|
1841 |
.................... if(time_setup==TRUE) |
|
|
1842 |
0ADB: BTFSS 36.2 |
|
|
1843 |
0ADC: GOTO 2FA |
|
|
1844 |
.................... { |
|
|
1845 |
.................... sound_beep(100,600); |
|
|
1846 |
0ADD: MOVLW 64 |
|
|
1847 |
0ADE: MOVWF 39 |
|
|
1848 |
0ADF: MOVLW 02 |
|
|
1849 |
0AE0: MOVWF 3B |
|
|
1850 |
0AE1: MOVLW 58 |
|
|
1851 |
0AE2: MOVWF 3A |
|
|
1852 |
0AE3: BCF 0A.3 |
|
|
1853 |
0AE4: CALL 60D |
|
|
1854 |
0AE5: BSF 0A.3 |
|
|
1855 |
.................... if(integration_time > 0x0005 ) integration_time-=5; |
|
|
1856 |
0AE6: MOVF 31,F |
|
|
1857 |
0AE7: BTFSS 03.2 |
|
|
1858 |
0AE8: GOTO 2ED |
|
|
1859 |
0AE9: MOVF 30,W |
|
|
1860 |
0AEA: SUBLW 05 |
|
|
1861 |
0AEB: BTFSC 03.0 |
|
|
1862 |
0AEC: GOTO 2F3 |
|
|
1863 |
0AED: MOVLW 05 |
|
|
1864 |
0AEE: SUBWF 30,F |
|
|
1865 |
0AEF: MOVLW 00 |
|
|
1866 |
0AF0: BTFSS 03.0 |
|
|
1867 |
0AF1: MOVLW 01 |
|
|
1868 |
0AF2: SUBWF 31,F |
|
|
1869 |
.................... |
|
|
1870 |
.................... set_timer0(0); // vynulovani pocitadel, kdyz uzivatel sahne na tlacitka |
|
|
1871 |
0AF3: CLRF 01 |
|
|
1872 |
.................... time_overflow_count=0; |
|
|
1873 |
0AF4: CLRF 2E |
|
|
1874 |
0AF5: CLRF 2D |
|
|
1875 |
.................... set_timer1(0); |
|
|
1876 |
0AF6: CLRF 0F |
|
|
1877 |
0AF7: CLRF 0E |
|
|
1878 |
.................... overflow_count=0; |
|
|
1879 |
0AF8: CLRF 2C |
|
|
1880 |
0AF9: CLRF 2B |
|
|
1881 |
.................... } |
|
|
1882 |
.................... } |
|
|
1883 |
.................... } |
|
|
1884 |
.................... |
|
|
1885 |
.................... if(!input(S3)) |
|
|
1886 |
0AFA: BSF 03.5 |
|
|
1887 |
0AFB: BSF 08.0 |
|
|
1888 |
0AFC: BCF 03.5 |
|
|
1889 |
0AFD: BTFSC 08.0 |
|
|
1890 |
0AFE: GOTO 31D |
|
|
1891 |
.................... { |
|
|
1892 |
.................... delay_ms(20); |
|
|
1893 |
0AFF: MOVLW 14 |
|
|
1894 |
0B00: MOVWF 46 |
|
|
1895 |
0B01: BCF 0A.3 |
|
|
1896 |
0B02: CALL 0A9 |
|
|
1897 |
0B03: BSF 0A.3 |
|
|
1898 |
.................... if(!input(S3)) |
|
|
1899 |
0B04: BSF 03.5 |
|
|
1900 |
0B05: BSF 08.0 |
|
|
1901 |
0B06: BCF 03.5 |
|
|
1902 |
0B07: BTFSC 08.0 |
|
|
1903 |
0B08: GOTO 31D |
|
|
1904 |
.................... { |
|
|
1905 |
.................... button_press=true; |
|
|
1906 |
0B09: BSF 36.0 |
|
|
1907 |
.................... if(time_setup==TRUE) |
|
|
1908 |
0B0A: BTFSS 36.2 |
|
|
1909 |
0B0B: GOTO 31D |
|
|
1910 |
.................... { |
|
|
1911 |
.................... sound_beep(100,500); |
|
|
1912 |
0B0C: MOVLW 64 |
|
|
1913 |
0B0D: MOVWF 39 |
|
|
1914 |
0B0E: MOVLW 01 |
|
|
1915 |
0B0F: MOVWF 3B |
|
|
1916 |
0B10: MOVLW F4 |
|
|
1917 |
0B11: MOVWF 3A |
|
|
1918 |
0B12: BCF 0A.3 |
|
|
1919 |
0B13: CALL 60D |
|
|
1920 |
0B14: BSF 0A.3 |
|
|
1921 |
.................... if(integration_time < 0xffff ) integration_time++; |
|
|
1922 |
0B15: INCFSZ 30,W |
|
|
1923 |
0B16: GOTO 31A |
|
|
1924 |
0B17: INCFSZ 31,W |
|
|
1925 |
0B18: GOTO 31A |
|
|
1926 |
0B19: GOTO 31D |
|
|
1927 |
0B1A: INCF 30,F |
|
|
1928 |
0B1B: BTFSC 03.2 |
|
|
1929 |
0B1C: INCF 31,F |
|
|
1930 |
.................... } |
|
|
1931 |
.................... } |
|
|
1932 |
.................... } |
|
|
1933 |
.................... |
|
|
1934 |
.................... if(!input(S4)) |
|
|
1935 |
0B1D: BSF 03.5 |
|
|
1936 |
0B1E: BSF 08.1 |
|
|
1937 |
0B1F: BCF 03.5 |
|
|
1938 |
0B20: BTFSC 08.1 |
|
|
1939 |
0B21: GOTO 34A |
|
|
1940 |
.................... { |
|
|
1941 |
.................... delay_ms(20); |
|
|
1942 |
0B22: MOVLW 14 |
|
|
1943 |
0B23: MOVWF 46 |
|
|
1944 |
0B24: BCF 0A.3 |
|
|
1945 |
0B25: CALL 0A9 |
|
|
1946 |
0B26: BSF 0A.3 |
|
|
1947 |
.................... if(!input(S4)) |
|
|
1948 |
0B27: BSF 03.5 |
|
|
1949 |
0B28: BSF 08.1 |
|
|
1950 |
0B29: BCF 03.5 |
|
|
1951 |
0B2A: BTFSC 08.1 |
|
|
1952 |
0B2B: GOTO 34A |
|
|
1953 |
.................... { |
|
|
1954 |
.................... button_press=true; |
|
|
1955 |
0B2C: BSF 36.0 |
|
|
1956 |
.................... if(time_setup==TRUE) |
|
|
1957 |
0B2D: BTFSS 36.2 |
|
|
1958 |
0B2E: GOTO 34A |
|
|
1959 |
.................... { |
|
|
1960 |
.................... sound_beep(100,400); |
|
|
1961 |
0B2F: MOVLW 64 |
|
|
1962 |
0B30: MOVWF 39 |
|
|
1963 |
0B31: MOVLW 01 |
|
|
1964 |
0B32: MOVWF 3B |
|
|
1965 |
0B33: MOVLW 90 |
|
|
1966 |
0B34: MOVWF 3A |
|
|
1967 |
0B35: BCF 0A.3 |
|
|
1968 |
0B36: CALL 60D |
|
|
1969 |
0B37: BSF 0A.3 |
|
|
1970 |
.................... if(integration_time > 0x0001 ) integration_time--; |
|
|
1971 |
0B38: MOVF 31,F |
|
|
1972 |
0B39: BTFSS 03.2 |
|
|
1973 |
0B3A: GOTO 33F |
|
|
1974 |
0B3B: MOVF 30,W |
|
|
1975 |
0B3C: SUBLW 01 |
|
|
1976 |
0B3D: BTFSC 03.0 |
|
|
1977 |
0B3E: GOTO 343 |
|
|
1978 |
0B3F: MOVF 30,W |
|
|
1979 |
0B40: BTFSC 03.2 |
|
|
1980 |
0B41: DECF 31,F |
|
|
1981 |
0B42: DECF 30,F |
|
|
1982 |
.................... |
|
|
1983 |
.................... set_timer0(0); // vynulovani pocitadel, kdyz uzivatel sahne na tlacitka |
|
|
1984 |
0B43: CLRF 01 |
|
|
1985 |
.................... time_overflow_count=0; |
|
|
1986 |
0B44: CLRF 2E |
|
|
1987 |
0B45: CLRF 2D |
|
|
1988 |
.................... set_timer1(0); |
|
|
1989 |
0B46: CLRF 0F |
|
|
1990 |
0B47: CLRF 0E |
|
|
1991 |
.................... overflow_count=0; |
|
|
1992 |
0B48: CLRF 2C |
|
|
1993 |
0B49: CLRF 2B |
|
|
1994 |
.................... } |
|
|
1995 |
.................... } |
|
|
1996 |
.................... } |
|
|
1997 |
.................... |
|
|
1998 |
.................... if(!input(S5)) // prepnuti na nastavovani casu |
|
|
1999 |
0B4A: BSF 03.5 |
|
|
2000 |
0B4B: BSF 06.1 |
|
|
2001 |
0B4C: BCF 03.5 |
|
|
2002 |
0B4D: BTFSC 06.1 |
|
|
2003 |
0B4E: GOTO 364 |
|
|
2004 |
.................... { |
|
|
2005 |
.................... delay_ms(20); |
|
|
2006 |
0B4F: MOVLW 14 |
|
|
2007 |
0B50: MOVWF 46 |
|
|
2008 |
0B51: BCF 0A.3 |
|
|
2009 |
0B52: CALL 0A9 |
|
|
2010 |
0B53: BSF 0A.3 |
|
|
2011 |
.................... if(!input(S5)) |
|
|
2012 |
0B54: BSF 03.5 |
|
|
2013 |
0B55: BSF 06.1 |
|
|
2014 |
0B56: BCF 03.5 |
|
|
2015 |
0B57: BTFSC 06.1 |
|
|
2016 |
0B58: GOTO 364 |
|
|
2017 |
.................... { |
|
|
2018 |
.................... sound_beep(100,800); |
|
|
2019 |
0B59: MOVLW 64 |
|
|
2020 |
0B5A: MOVWF 39 |
|
|
2021 |
0B5B: MOVLW 03 |
|
|
2022 |
0B5C: MOVWF 3B |
|
|
2023 |
0B5D: MOVLW 20 |
|
|
2024 |
0B5E: MOVWF 3A |
|
|
2025 |
0B5F: BCF 0A.3 |
|
|
2026 |
0B60: CALL 60D |
|
|
2027 |
0B61: BSF 0A.3 |
|
|
2028 |
.................... voltage_setup=FALSE; |
|
|
2029 |
0B62: BCF 36.1 |
|
|
2030 |
.................... time_setup=TRUE; |
|
|
2031 |
0B63: BSF 36.2 |
|
|
2032 |
.................... } |
|
|
2033 |
.................... } |
|
|
2034 |
.................... |
|
|
2035 |
.................... if(!input(S6)) // prepnuti na nastavovani napeti |
|
|
2036 |
0B64: BSF 03.5 |
|
|
2037 |
0B65: BSF 06.2 |
|
|
2038 |
0B66: BCF 03.5 |
|
|
2039 |
0B67: BTFSC 06.2 |
|
|
2040 |
0B68: GOTO 37E |
|
|
2041 |
.................... { |
|
|
2042 |
.................... delay_ms(20); |
|
|
2043 |
0B69: MOVLW 14 |
|
|
2044 |
0B6A: MOVWF 46 |
|
|
2045 |
0B6B: BCF 0A.3 |
|
|
2046 |
0B6C: CALL 0A9 |
|
|
2047 |
0B6D: BSF 0A.3 |
|
|
2048 |
.................... if(!input(S6)) |
|
|
2049 |
0B6E: BSF 03.5 |
|
|
2050 |
0B6F: BSF 06.2 |
|
|
2051 |
0B70: BCF 03.5 |
|
|
2052 |
0B71: BTFSC 06.2 |
|
|
2053 |
0B72: GOTO 37E |
|
|
2054 |
.................... { |
|
|
2055 |
.................... sound_beep(100,800); |
|
|
2056 |
0B73: MOVLW 64 |
|
|
2057 |
0B74: MOVWF 39 |
|
|
2058 |
0B75: MOVLW 03 |
|
|
2059 |
0B76: MOVWF 3B |
|
|
2060 |
0B77: MOVLW 20 |
|
|
2061 |
0B78: MOVWF 3A |
|
|
2062 |
0B79: BCF 0A.3 |
|
|
2063 |
0B7A: CALL 60D |
|
|
2064 |
0B7B: BSF 0A.3 |
|
|
2065 |
.................... voltage_setup=TRUE; |
|
|
2066 |
0B7C: BSF 36.1 |
|
|
2067 |
.................... time_setup=FALSE; |
|
|
2068 |
0B7D: BCF 36.2 |
|
|
2069 |
.................... } |
|
|
2070 |
.................... } |
|
|
2071 |
.................... } |
|
|
2072 |
.................... |
|
|
2073 |
.................... if ( input(S1) && input(S2) && input(S3) && input(S4) && input(S5) && input(S6)) // detekce pustenych tlacitek |
|
|
2074 |
0B7E: BSF 2F.2 |
|
|
2075 |
0B7F: MOVF 2F,W |
|
|
2076 |
0B80: BSF 03.5 |
|
|
2077 |
0B81: MOVWF 07 |
|
|
2078 |
0B82: BCF 03.5 |
|
|
2079 |
0B83: BTFSS 07.2 |
|
|
2080 |
0B84: GOTO 3A1 |
|
|
2081 |
0B85: BSF 2F.3 |
|
|
2082 |
0B86: MOVF 2F,W |
|
|
2083 |
0B87: BSF 03.5 |
|
|
2084 |
0B88: MOVWF 07 |
|
|
2085 |
0B89: BCF 03.5 |
|
|
2086 |
0B8A: BTFSS 07.3 |
|
|
2087 |
0B8B: GOTO 3A1 |
|
|
2088 |
0B8C: BSF 03.5 |
|
|
2089 |
0B8D: BSF 08.0 |
|
|
2090 |
0B8E: BCF 03.5 |
|
|
2091 |
0B8F: BTFSS 08.0 |
|
|
2092 |
0B90: GOTO 3A1 |
|
|
2093 |
0B91: BSF 03.5 |
|
|
2094 |
0B92: BSF 08.1 |
|
|
2095 |
0B93: BCF 03.5 |
|
|
2096 |
0B94: BTFSS 08.1 |
|
|
2097 |
0B95: GOTO 3A1 |
|
|
2098 |
0B96: BSF 03.5 |
|
|
2099 |
0B97: BSF 06.1 |
|
|
2100 |
0B98: BCF 03.5 |
|
|
2101 |
0B99: BTFSS 06.1 |
|
|
2102 |
0B9A: GOTO 3A1 |
|
|
2103 |
0B9B: BSF 03.5 |
|
|
2104 |
0B9C: BSF 06.2 |
|
|
2105 |
0B9D: BCF 03.5 |
|
|
2106 |
0B9E: BTFSS 06.2 |
|
|
2107 |
0B9F: GOTO 3A1 |
|
|
2108 |
.................... { |
|
|
2109 |
.................... button_press=false; |
|
|
2110 |
0BA0: BCF 36.0 |
|
|
2111 |
.................... } |
|
|
2112 |
.................... } |
|
|
2113 |
0BA1: GOTO 118 |
|
|
2114 |
.................... } |
|
|
2115 |
0BA2: SLEEP |
|
|
2116 |
|
|
|
2117 |
Configuration Fuses: |
|
|
2118 |
Word 1: 2CF5 INTRC NOWDT NOPUT MCLR NOPROTECT NOCPD NOBROWNOUT IESO FCMEN NOLVP NODEBUG |
|
|
2119 |
Word 2: 3FFF NOWRT BORV40 |