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