Subversion Repositories svnkaklik

Rev

Rev 2 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2 Rev 66
1
CCS PCM C Compiler, Version 3.245, 27853               24-IV-06 23:56
1
CCS PCM C Compiler, Version 3.245, 27853               05-XI-06 20:45
2
 
2
 
3
               Filename: D:\KAKLIK\programy\PIC_C\roboti\istrobot\3Orbis\cidla\cidla.lst
3
               Filename: D:\KAKLIK\projekty\roboti\istrobot\3Orbis\cidla\cidla.lst
4
 
4
 
5
               ROM used: 548 words (13%)
5
               ROM used: 548 words (13%)
6
                         Largest free fragment is 2048
6
                         Largest free fragment is 2048
7
               RAM used: 12 (7%) at main() level
7
               RAM used: 12 (7%) at main() level
8
                         17 (10%) worst case
8
                         17 (10%) worst case
9
               Stack:    2 locations
9
               Stack:    2 locations
10
 
10
 
11
*
11
*
12
0000:  MOVLW  00
12
0000:  MOVLW  00
13
0001:  MOVWF  0A
13
0001:  MOVWF  0A
14
0002:  GOTO   0B1
14
0002:  GOTO   0B1
15
0003:  NOP
15
0003:  NOP
16
.................... #include ".\cidla.h" 
16
.................... #include ".\cidla.h" 
17
.................... #include <16F88.h> 
17
.................... #include <16F88.h> 
18
.................... //////// Standard Header file for the PIC16F88 device //////////////// 
18
.................... //////// Standard Header file for the PIC16F88 device //////////////// 
19
.................... #device PIC16F88 
19
.................... #device PIC16F88 
20
.................... #list 
20
.................... #list 
21
....................  
21
....................  
22
.................... #device adc=8 
22
.................... #device adc=8 
23
.................... #fuses NOWDT,INTRC_IO, NOPUT, MCLR, NOBROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG, NOPROTECT, NOFCMEN, NOIESO 
23
.................... #fuses NOWDT,INTRC_IO, NOPUT, MCLR, NOBROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG, NOPROTECT, NOFCMEN, NOIESO 
24
.................... #use delay(clock=4000000,RESTART_WDT) 
24
.................... #use delay(clock=4000000,RESTART_WDT) 
25
*
25
*
26
002A:  MOVLW  27
26
002A:  MOVLW  27
27
002B:  MOVWF  04
27
002B:  MOVWF  04
28
002C:  MOVF   00,W
28
002C:  MOVF   00,W
29
002D:  BTFSC  03.2
29
002D:  BTFSC  03.2
30
002E:  GOTO   040
30
002E:  GOTO   040
31
002F:  MOVLW  01
31
002F:  MOVLW  01
32
0030:  MOVWF  78
32
0030:  MOVWF  78
33
0031:  MOVLW  BF
33
0031:  MOVLW  BF
34
0032:  MOVWF  77
34
0032:  MOVWF  77
35
0033:  CLRWDT
35
0033:  CLRWDT
36
0034:  DECFSZ 77,F
36
0034:  DECFSZ 77,F
37
0035:  GOTO   033
37
0035:  GOTO   033
38
0036:  DECFSZ 78,F
38
0036:  DECFSZ 78,F
39
0037:  GOTO   031
39
0037:  GOTO   031
40
0038:  MOVLW  4A
40
0038:  MOVLW  4A
41
0039:  MOVWF  77
41
0039:  MOVWF  77
42
003A:  DECFSZ 77,F
42
003A:  DECFSZ 77,F
43
003B:  GOTO   03A
43
003B:  GOTO   03A
44
003C:  NOP
44
003C:  NOP
45
003D:  CLRWDT
45
003D:  CLRWDT
46
003E:  DECFSZ 00,F
46
003E:  DECFSZ 00,F
47
003F:  GOTO   02F
47
003F:  GOTO   02F
48
0040:  RETLW  00
48
0040:  RETLW  00
49
....................  
49
....................  
50
....................  
50
....................  
51
.................... //#include <stdlib.h> 
51
.................... //#include <stdlib.h> 
52
....................  
52
....................  
53
.................... #use rs232(baud=9600,parity=N,xmit=PIN_B3,bits=8,restart_wdt) 
53
.................... #use rs232(baud=9600,parity=N,xmit=PIN_B3,bits=8,restart_wdt) 
54
0041:  BSF    03.5
54
0041:  BSF    03.5
55
0042:  BCF    06.3
55
0042:  BCF    06.3
56
0043:  BCF    03.5
56
0043:  BCF    03.5
57
0044:  BCF    06.3
57
0044:  BCF    06.3
58
0045:  MOVLW  08
58
0045:  MOVLW  08
59
0046:  MOVWF  78
59
0046:  MOVWF  78
60
0047:  NOP
60
0047:  NOP
61
0048:  NOP
61
0048:  NOP
62
0049:  NOP
62
0049:  NOP
63
004A:  BSF    78.7
63
004A:  BSF    78.7
64
004B:  GOTO   05B
64
004B:  GOTO   05B
65
004C:  BCF    78.7
65
004C:  BCF    78.7
66
004D:  RRF    29,F
66
004D:  RRF    29,F
67
004E:  BTFSC  03.0
67
004E:  BTFSC  03.0
68
004F:  BSF    06.3
68
004F:  BSF    06.3
69
0050:  BTFSS  03.0
69
0050:  BTFSS  03.0
70
0051:  BCF    06.3
70
0051:  BCF    06.3
71
0052:  BSF    78.6
71
0052:  BSF    78.6
72
0053:  GOTO   05B
72
0053:  GOTO   05B
73
0054:  BCF    78.6
73
0054:  BCF    78.6
74
0055:  DECFSZ 78,F
74
0055:  DECFSZ 78,F
75
0056:  GOTO   04D
75
0056:  GOTO   04D
76
0057:  NOP
76
0057:  NOP
77
0058:  NOP
77
0058:  NOP
78
0059:  NOP
78
0059:  NOP
79
005A:  BSF    06.3
79
005A:  BSF    06.3
80
005B:  MOVLW  1C
80
005B:  MOVLW  1C
81
005C:  MOVWF  04
81
005C:  MOVWF  04
82
005D:  DECFSZ 04,F
82
005D:  DECFSZ 04,F
83
005E:  GOTO   05D
83
005E:  GOTO   05D
84
005F:  NOP
84
005F:  NOP
85
0060:  NOP
85
0060:  NOP
86
0061:  CLRWDT
86
0061:  CLRWDT
87
0062:  BTFSC  78.7
87
0062:  BTFSC  78.7
88
0063:  GOTO   04C
88
0063:  GOTO   04C
89
0064:  BTFSC  78.6
89
0064:  BTFSC  78.6
90
0065:  GOTO   054
90
0065:  GOTO   054
91
0066:  RETLW  00
91
0066:  RETLW  00
92
....................  
92
....................  
93
.................... #define IRRX      PIN_B0 
93
.................... #define IRRX      PIN_B0 
94
....................  
94
....................  
95
.................... #define  TRESHOLD_MAX   70    // rozhodovaci uroven  pro cidla cerna/bila 
95
.................... #define  TRESHOLD_MAX   70    // rozhodovaci uroven  pro cidla cerna/bila 
96
.................... #define  TRESHOLD_MIN   50 
96
.................... #define  TRESHOLD_MIN   50 
97
.................... #define  CIHLA          10    // doba, po kterou musi byt detekovana cihla 
97
.................... #define  CIHLA          10    // doba, po kterou musi byt detekovana cihla 
98
....................  
98
....................  
99
.................... unsigned int8 last_radius;    // rozsah 
99
.................... unsigned int8 last_radius;    // rozsah 
100
.................... unsigned int8 last_cidla;     // co cidla videla minule 
100
.................... unsigned int8 last_cidla;     // co cidla videla minule 
101
.................... unsigned int8 shure;          // citac doby, po kterou musi byt detekovana cihla 
101
.................... unsigned int8 shure;          // citac doby, po kterou musi byt detekovana cihla 
102
....................  
102
....................  
103
.................... //tuning 
103
.................... //tuning 
104
.................... /*#define  PULZACE  3  // urcuje rychlost pulzovani pomoci PWM 
104
.................... /*#define  PULZACE  3  // urcuje rychlost pulzovani pomoci PWM 
105
....................  
105
....................  
106
.................... //Vystup PWM je na PIN_B3 
106
.................... //Vystup PWM je na PIN_B3 
107
.................... //////////////////////////////////////////////////////////////////////////////// 
107
.................... //////////////////////////////////////////////////////////////////////////////// 
108
.................... void pulzovani()  // postupne rozsvecuje a zhasina podsvetleni 
108
.................... void pulzovani()  // postupne rozsvecuje a zhasina podsvetleni 
109
.................... { 
109
.................... { 
110
.................... unsigned int8 i,n; 
110
.................... unsigned int8 i,n; 
111
....................    for(n=0;n<=3;n++) 
111
....................    for(n=0;n<=3;n++) 
112
....................    { 
112
....................    { 
113
....................       for(i=0;i<255;i++) {set_pwm1_duty(i); Delay_ms(PULZACE);} // rozsvecovani 
113
....................       for(i=0;i<255;i++) {set_pwm1_duty(i); Delay_ms(PULZACE);} // rozsvecovani 
114
....................       for(i=255;i>0;i--) {set_pwm1_duty(i); Delay_ms(PULZACE);} // zhasinani 
114
....................       for(i=255;i>0;i--) {set_pwm1_duty(i); Delay_ms(PULZACE);} // zhasinani 
115
....................    } 
115
....................    } 
116
.................... } 
116
.................... } 
117
.................... */ 
117
.................... */ 
118
.................... //////////////////////////////////////////////////////////////////////////////// 
118
.................... //////////////////////////////////////////////////////////////////////////////// 
119
.................... void main() 
119
.................... void main() 
120
.................... { 
120
.................... { 
121
*
121
*
122
00B1:  CLRF   04
122
00B1:  CLRF   04
123
00B2:  MOVLW  1F
123
00B2:  MOVLW  1F
124
00B3:  ANDWF  03,F
124
00B3:  ANDWF  03,F
125
00B4:  MOVLW  60
125
00B4:  MOVLW  60
126
00B5:  BSF    03.5
126
00B5:  BSF    03.5
127
00B6:  MOVWF  0F
127
00B6:  MOVWF  0F
128
00B7:  BCF    06.3
128
00B7:  BCF    06.3
129
00B8:  BCF    03.5
129
00B8:  BCF    03.5
130
00B9:  BSF    06.3
130
00B9:  BSF    06.3
131
00BA:  BSF    03.5
131
00BA:  BSF    03.5
132
00BB:  BCF    1F.4
132
00BB:  BCF    1F.4
133
00BC:  BCF    1F.5
133
00BC:  BCF    1F.5
134
00BD:  MOVF   1B,W
134
00BD:  MOVF   1B,W
135
00BE:  ANDLW  80
135
00BE:  ANDLW  80
136
00BF:  MOVWF  1B
136
00BF:  MOVWF  1B
137
00C0:  MOVLW  07
137
00C0:  MOVLW  07
138
00C1:  MOVWF  1C
138
00C1:  MOVWF  1C
139
....................    int8 cidla; 
139
....................    int8 cidla; 
140
....................    unsigned int8 a; 
140
....................    unsigned int8 a; 
141
....................    unsigned int8 n; 
141
....................    unsigned int8 n; 
142
....................  
142
....................  
143
....................    setup_adc_ports(sAN0|sAN1|sAN2|sAN3|sAN4|sAN5|sAN6|VSS_VDD); 
143
....................    setup_adc_ports(sAN0|sAN1|sAN2|sAN3|sAN4|sAN5|sAN6|VSS_VDD); 
144
00C2:  BCF    1F.4
144
00C2:  BCF    1F.4
145
00C3:  BCF    1F.5
145
00C3:  BCF    1F.5
146
00C4:  MOVF   1B,W
146
00C4:  MOVF   1B,W
147
00C5:  ANDLW  80
147
00C5:  ANDLW  80
148
00C6:  IORLW  7F
148
00C6:  IORLW  7F
149
00C7:  MOVWF  1B
149
00C7:  MOVWF  1B
150
....................    setup_adc(ADC_CLOCK_INTERNAL); 
150
....................    setup_adc(ADC_CLOCK_INTERNAL); 
151
00C8:  BCF    1F.6
151
00C8:  BCF    1F.6
152
00C9:  BCF    03.5
152
00C9:  BCF    03.5
153
00CA:  BSF    1F.6
153
00CA:  BSF    1F.6
154
00CB:  BSF    1F.7
154
00CB:  BSF    1F.7
155
00CC:  BSF    03.5
155
00CC:  BSF    03.5
156
00CD:  BCF    1F.7
156
00CD:  BCF    1F.7
157
00CE:  BCF    03.5
157
00CE:  BCF    03.5
158
00CF:  BSF    1F.0
158
00CF:  BSF    1F.0
159
....................    setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); 
159
....................    setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); 
160
00D0:  BSF    03.5
160
00D0:  BSF    03.5
161
00D1:  MOVF   01,W
161
00D1:  MOVF   01,W
162
00D2:  ANDLW  C7
162
00D2:  ANDLW  C7
163
00D3:  IORLW  08
163
00D3:  IORLW  08
164
00D4:  MOVWF  01
164
00D4:  MOVWF  01
165
....................    setup_timer_1(T1_DISABLED); 
165
....................    setup_timer_1(T1_DISABLED); 
166
00D5:  BCF    03.5
166
00D5:  BCF    03.5
167
00D6:  CLRF   10
167
00D6:  CLRF   10
168
....................    setup_timer_2(T2_DISABLED,0,1); 
168
....................    setup_timer_2(T2_DISABLED,0,1); 
169
00D7:  MOVLW  00
169
00D7:  MOVLW  00
170
00D8:  MOVWF  78
170
00D8:  MOVWF  78
171
00D9:  MOVWF  12
171
00D9:  MOVWF  12
172
00DA:  MOVLW  00
172
00DA:  MOVLW  00
173
00DB:  BSF    03.5
173
00DB:  BSF    03.5
174
00DC:  MOVWF  12
174
00DC:  MOVWF  12
175
....................    setup_comparator(NC_NC_NC_NC); 
175
....................    setup_comparator(NC_NC_NC_NC); 
176
00DD:  MOVLW  07
176
00DD:  MOVLW  07
177
00DE:  MOVWF  1C
177
00DE:  MOVWF  1C
178
00DF:  MOVF   05,W
178
00DF:  MOVF   05,W
179
00E0:  CLRWDT
179
00E0:  CLRWDT
180
00E1:  MOVLW  02
180
00E1:  MOVLW  02
181
00E2:  MOVWF  77
181
00E2:  MOVWF  77
182
00E3:  DECFSZ 77,F
182
00E3:  DECFSZ 77,F
183
00E4:  GOTO   0E3
183
00E4:  GOTO   0E3
184
00E5:  NOP
184
00E5:  NOP
185
00E6:  NOP
185
00E6:  NOP
186
00E7:  MOVF   1C,W
186
00E7:  MOVF   1C,W
187
00E8:  BCF    03.5
187
00E8:  BCF    03.5
188
00E9:  BCF    0D.6
188
00E9:  BCF    0D.6
189
....................    setup_vref(FALSE); 
189
....................    setup_vref(FALSE); 
190
00EA:  BSF    03.5
190
00EA:  BSF    03.5
191
00EB:  CLRF   1D
191
00EB:  CLRF   1D
192
....................  
192
....................  
193
....................    Delay_ms(500); 
193
....................    Delay_ms(500); 
194
00EC:  MOVLW  02
194
00EC:  MOVLW  02
195
00ED:  BCF    03.5
195
00ED:  BCF    03.5
196
00EE:  MOVWF  26
196
00EE:  MOVWF  26
197
00EF:  MOVLW  FA
197
00EF:  MOVLW  FA
198
00F0:  MOVWF  27
198
00F0:  MOVWF  27
199
00F1:  CALL   02A
199
00F1:  CALL   02A
200
00F2:  DECFSZ 26,F
200
00F2:  DECFSZ 26,F
201
00F3:  GOTO   0EF
201
00F3:  GOTO   0EF
202
....................    setup_spi(SPI_SLAVE|SPI_H_TO_L|SPI_SS_DISABLED); 
202
....................    setup_spi(SPI_SLAVE|SPI_H_TO_L|SPI_SS_DISABLED); 
203
00F4:  BCF    14.5
203
00F4:  BCF    14.5
204
00F5:  BSF    03.5
204
00F5:  BSF    03.5
205
00F6:  BCF    06.2
205
00F6:  BCF    06.2
206
00F7:  BSF    06.1
206
00F7:  BSF    06.1
207
00F8:  BSF    06.4
207
00F8:  BSF    06.4
208
00F9:  MOVLW  35
208
00F9:  MOVLW  35
209
00FA:  BCF    03.5
209
00FA:  BCF    03.5
210
00FB:  MOVWF  14
210
00FB:  MOVWF  14
211
00FC:  MOVLW  40
211
00FC:  MOVLW  40
212
00FD:  BSF    03.5
212
00FD:  BSF    03.5
213
00FE:  MOVWF  14
213
00FE:  MOVWF  14
214
....................     
214
....................     
215
....................    // diagnostika 
215
....................    // diagnostika 
216
....................    printf("\n\r"); 
216
....................    printf("\n\r"); 
217
00FF:  BCF    03.5
217
00FF:  BCF    03.5
218
0100:  CLRF   26
218
0100:  CLRF   26
219
0101:  MOVF   26,W
219
0101:  MOVF   26,W
220
0102:  CALL   004
220
0102:  CALL   004
221
0103:  IORLW  00
221
0103:  IORLW  00
222
0104:  BTFSC  03.2
222
0104:  BTFSC  03.2
223
0105:  GOTO   10A
223
0105:  GOTO   10A
224
0106:  INCF   26,F
224
0106:  INCF   26,F
225
0107:  MOVWF  29
225
0107:  MOVWF  29
226
0108:  CALL   041
226
0108:  CALL   041
227
0109:  GOTO   101
227
0109:  GOTO   101
228
....................    Delay_ms(100); 
228
....................    Delay_ms(100); 
229
010A:  MOVLW  64
229
010A:  MOVLW  64
230
010B:  MOVWF  27
230
010B:  MOVWF  27
231
010C:  CALL   02A
231
010C:  CALL   02A
232
....................    printf("***\n\r"); 
232
....................    printf("***\n\r"); 
233
010D:  CLRF   26
233
010D:  CLRF   26
234
010E:  MOVF   26,W
234
010E:  MOVF   26,W
235
010F:  CALL   00B
235
010F:  CALL   00B
236
0110:  IORLW  00
236
0110:  IORLW  00
237
0111:  BTFSC  03.2
237
0111:  BTFSC  03.2
238
0112:  GOTO   117
238
0112:  GOTO   117
239
0113:  INCF   26,F
239
0113:  INCF   26,F
240
0114:  MOVWF  29
240
0114:  MOVWF  29
241
0115:  CALL   041
241
0115:  CALL   041
242
0116:  GOTO   10E
242
0116:  GOTO   10E
243
....................    Delay_ms(100); 
243
....................    Delay_ms(100); 
244
0117:  MOVLW  64
244
0117:  MOVLW  64
245
0118:  MOVWF  27
245
0118:  MOVWF  27
246
0119:  CALL   02A
246
0119:  CALL   02A
247
....................    for (n=0; n<=6; n++) 
247
....................    for (n=0; n<=6; n++) 
248
011A:  CLRF   25
248
011A:  CLRF   25
249
011B:  MOVF   25,W
249
011B:  MOVF   25,W
250
011C:  SUBLW  06
250
011C:  SUBLW  06
251
011D:  BTFSS  03.0
251
011D:  BTFSS  03.0
252
011E:  GOTO   157
252
011E:  GOTO   157
253
....................    { 
253
....................    { 
254
....................       set_adc_channel(n); 
254
....................       set_adc_channel(n); 
255
011F:  RLF    25,W
255
011F:  RLF    25,W
256
0120:  MOVWF  77
256
0120:  MOVWF  77
257
0121:  RLF    77,F
257
0121:  RLF    77,F
258
0122:  RLF    77,F
258
0122:  RLF    77,F
259
0123:  MOVLW  F8
259
0123:  MOVLW  F8
260
0124:  ANDWF  77,F
260
0124:  ANDWF  77,F
261
0125:  MOVF   1F,W
261
0125:  MOVF   1F,W
262
0126:  ANDLW  C7
262
0126:  ANDLW  C7
263
0127:  IORWF  77,W
263
0127:  IORWF  77,W
264
0128:  MOVWF  1F
264
0128:  MOVWF  1F
265
....................       Delay_ms(100); 
265
....................       Delay_ms(100); 
266
0129:  MOVLW  64
266
0129:  MOVLW  64
267
012A:  MOVWF  27
267
012A:  MOVWF  27
268
012B:  CALL   02A
268
012B:  CALL   02A
269
....................       a=read_adc(); 
269
....................       a=read_adc(); 
270
012C:  BSF    1F.2
270
012C:  BSF    1F.2
271
012D:  BTFSC  1F.2
271
012D:  BTFSC  1F.2
272
012E:  GOTO   12D
272
012E:  GOTO   12D
273
012F:  MOVF   1E,W
273
012F:  MOVF   1E,W
274
0130:  MOVWF  24
274
0130:  MOVWF  24
275
....................       printf("sensor %u - %u\n\r",n,a); 
275
....................       printf("sensor %u - %u\n\r",n,a); 
276
0131:  CLRF   26
276
0131:  CLRF   26
277
0132:  MOVF   26,W
277
0132:  MOVF   26,W
278
0133:  CALL   015
278
0133:  CALL   015
279
0134:  INCF   26,F
279
0134:  INCF   26,F
280
0135:  MOVWF  77
280
0135:  MOVWF  77
281
0136:  MOVWF  29
281
0136:  MOVWF  29
282
0137:  CALL   041
282
0137:  CALL   041
283
0138:  MOVLW  07
283
0138:  MOVLW  07
284
0139:  SUBWF  26,W
284
0139:  SUBWF  26,W
285
013A:  BTFSS  03.2
285
013A:  BTFSS  03.2
286
013B:  GOTO   132
286
013B:  GOTO   132
287
013C:  MOVF   25,W
287
013C:  MOVF   25,W
288
013D:  MOVWF  27
288
013D:  MOVWF  27
289
013E:  MOVLW  1B
289
013E:  MOVLW  1B
290
013F:  MOVWF  28
290
013F:  MOVWF  28
291
0140:  CALL   07C
291
0140:  CALL   07C
292
0141:  MOVLW  20
292
0141:  MOVLW  20
293
0142:  MOVWF  29
293
0142:  MOVWF  29
294
0143:  CALL   041
294
0143:  CALL   041
295
0144:  MOVLW  2D
295
0144:  MOVLW  2D
296
0145:  MOVWF  29
296
0145:  MOVWF  29
297
0146:  CALL   041
297
0146:  CALL   041
298
0147:  MOVLW  20
298
0147:  MOVLW  20
299
0148:  MOVWF  29
299
0148:  MOVWF  29
300
0149:  CALL   041
300
0149:  CALL   041
301
014A:  MOVF   24,W
301
014A:  MOVF   24,W
302
014B:  MOVWF  27
302
014B:  MOVWF  27
303
014C:  MOVLW  1B
303
014C:  MOVLW  1B
304
014D:  MOVWF  28
304
014D:  MOVWF  28
305
014E:  CALL   07C
305
014E:  CALL   07C
306
014F:  MOVLW  0A
306
014F:  MOVLW  0A
307
0150:  MOVWF  29
307
0150:  MOVWF  29
308
0151:  CALL   041
308
0151:  CALL   041
309
0152:  MOVLW  0D
309
0152:  MOVLW  0D
310
0153:  MOVWF  29
310
0153:  MOVWF  29
311
0154:  CALL   041
311
0154:  CALL   041
312
....................    } 
312
....................    } 
313
0155:  INCF   25,F
313
0155:  INCF   25,F
314
0156:  GOTO   11B
314
0156:  GOTO   11B
315
....................  
315
....................  
316
....................    shure=0; 
316
....................    shure=0; 
317
0157:  CLRF   22
317
0157:  CLRF   22
318
....................    while(true) 
318
....................    while(true) 
319
....................    { 
319
....................    { 
320
....................       set_adc_channel(0); 
320
....................       set_adc_channel(0); 
321
0158:  MOVLW  00
321
0158:  MOVLW  00
322
0159:  MOVWF  78
322
0159:  MOVWF  78
323
015A:  MOVF   1F,W
323
015A:  MOVF   1F,W
324
015B:  ANDLW  C7
324
015B:  ANDLW  C7
325
015C:  IORWF  78,W
325
015C:  IORWF  78,W
326
015D:  MOVWF  1F
326
015D:  MOVWF  1F
327
....................       cidla=0; 
327
....................       cidla=0; 
328
015E:  CLRF   23
328
015E:  CLRF   23
329
....................       Delay_us(10); 
329
....................       Delay_us(10); 
330
015F:  CLRWDT
330
015F:  CLRWDT
331
0160:  MOVLW  02
331
0160:  MOVLW  02
332
0161:  MOVWF  77
332
0161:  MOVWF  77
333
0162:  DECFSZ 77,F
333
0162:  DECFSZ 77,F
334
0163:  GOTO   162
334
0163:  GOTO   162
335
0164:  NOP
335
0164:  NOP
336
0165:  NOP
336
0165:  NOP
337
....................       a=read_adc(); 
337
....................       a=read_adc(); 
338
0166:  BSF    1F.2
338
0166:  BSF    1F.2
339
0167:  BTFSC  1F.2
339
0167:  BTFSC  1F.2
340
0168:  GOTO   167
340
0168:  GOTO   167
341
0169:  MOVF   1E,W
341
0169:  MOVF   1E,W
342
016A:  MOVWF  24
342
016A:  MOVWF  24
343
....................  
343
....................  
344
....................       set_adc_channel(1); 
344
....................       set_adc_channel(1); 
345
016B:  MOVLW  08
345
016B:  MOVLW  08
346
016C:  MOVWF  78
346
016C:  MOVWF  78
347
016D:  MOVF   1F,W
347
016D:  MOVF   1F,W
348
016E:  ANDLW  C7
348
016E:  ANDLW  C7
349
016F:  IORWF  78,W
349
016F:  IORWF  78,W
350
0170:  MOVWF  1F
350
0170:  MOVWF  1F
351
....................       if(a<TRESHOLD_MAX)         //hystereze cidel 
351
....................       if(a<TRESHOLD_MAX)         //hystereze cidel 
352
0171:  MOVF   24,W
352
0171:  MOVF   24,W
353
0172:  SUBLW  45
353
0172:  SUBLW  45
354
0173:  BTFSS  03.0
354
0173:  BTFSS  03.0
355
0174:  GOTO   17E
355
0174:  GOTO   17E
356
....................       { 
356
....................       { 
357
....................          if(a>TRESHOLD_MIN) 
357
....................          if(a>TRESHOLD_MIN) 
358
0175:  MOVF   24,W
358
0175:  MOVF   24,W
359
0176:  SUBLW  32
359
0176:  SUBLW  32
360
0177:  BTFSC  03.0
360
0177:  BTFSC  03.0
361
0178:  GOTO   17D
361
0178:  GOTO   17D
362
....................          { 
362
....................          { 
363
....................             cidla |= (last_cidla & 0b00000001); 
363
....................             cidla |= (last_cidla & 0b00000001); 
364
0179:  MOVF   21,W
364
0179:  MOVF   21,W
365
017A:  ANDLW  01
365
017A:  ANDLW  01
366
017B:  IORWF  23,F
366
017B:  IORWF  23,F
367
....................          } 
367
....................          } 
368
....................          else cidla |= 0b00000001; 
368
....................          else cidla |= 0b00000001; 
369
017C:  GOTO   17E
369
017C:  GOTO   17E
370
017D:  BSF    23.0
370
017D:  BSF    23.0
371
....................       } 
371
....................       } 
372
....................  
372
....................  
373
....................       a=read_adc(); 
373
....................       a=read_adc(); 
374
017E:  BSF    1F.2
374
017E:  BSF    1F.2
375
017F:  BTFSC  1F.2
375
017F:  BTFSC  1F.2
376
0180:  GOTO   17F
376
0180:  GOTO   17F
377
0181:  MOVF   1E,W
377
0181:  MOVF   1E,W
378
0182:  MOVWF  24
378
0182:  MOVWF  24
379
....................  
379
....................  
380
....................       set_adc_channel(2); 
380
....................       set_adc_channel(2); 
381
0183:  MOVLW  10
381
0183:  MOVLW  10
382
0184:  MOVWF  78
382
0184:  MOVWF  78
383
0185:  MOVF   1F,W
383
0185:  MOVF   1F,W
384
0186:  ANDLW  C7
384
0186:  ANDLW  C7
385
0187:  IORWF  78,W
385
0187:  IORWF  78,W
386
0188:  MOVWF  1F
386
0188:  MOVWF  1F
387
....................       if(a<TRESHOLD_MAX) 
387
....................       if(a<TRESHOLD_MAX) 
388
0189:  MOVF   24,W
388
0189:  MOVF   24,W
389
018A:  SUBLW  45
389
018A:  SUBLW  45
390
018B:  BTFSS  03.0
390
018B:  BTFSS  03.0
391
018C:  GOTO   196
391
018C:  GOTO   196
392
....................       { 
392
....................       { 
393
....................          if(a>TRESHOLD_MIN) 
393
....................          if(a>TRESHOLD_MIN) 
394
018D:  MOVF   24,W
394
018D:  MOVF   24,W
395
018E:  SUBLW  32
395
018E:  SUBLW  32
396
018F:  BTFSC  03.0
396
018F:  BTFSC  03.0
397
0190:  GOTO   195
397
0190:  GOTO   195
398
....................          { 
398
....................          { 
399
....................             cidla |= (last_cidla & 0b00000010); 
399
....................             cidla |= (last_cidla & 0b00000010); 
400
0191:  MOVF   21,W
400
0191:  MOVF   21,W
401
0192:  ANDLW  02
401
0192:  ANDLW  02
402
0193:  IORWF  23,F
402
0193:  IORWF  23,F
403
....................          } 
403
....................          } 
404
....................          else cidla |= 0b00000010; 
404
....................          else cidla |= 0b00000010; 
405
0194:  GOTO   196
405
0194:  GOTO   196
406
0195:  BSF    23.1
406
0195:  BSF    23.1
407
....................       } 
407
....................       } 
408
....................  
408
....................  
409
....................       a=read_adc(); 
409
....................       a=read_adc(); 
410
0196:  BSF    1F.2
410
0196:  BSF    1F.2
411
0197:  BTFSC  1F.2
411
0197:  BTFSC  1F.2
412
0198:  GOTO   197
412
0198:  GOTO   197
413
0199:  MOVF   1E,W
413
0199:  MOVF   1E,W
414
019A:  MOVWF  24
414
019A:  MOVWF  24
415
....................  
415
....................  
416
....................       set_adc_channel(3); 
416
....................       set_adc_channel(3); 
417
019B:  MOVLW  18
417
019B:  MOVLW  18
418
019C:  MOVWF  78
418
019C:  MOVWF  78
419
019D:  MOVF   1F,W
419
019D:  MOVF   1F,W
420
019E:  ANDLW  C7
420
019E:  ANDLW  C7
421
019F:  IORWF  78,W
421
019F:  IORWF  78,W
422
01A0:  MOVWF  1F
422
01A0:  MOVWF  1F
423
....................       if(a<TRESHOLD_MAX) 
423
....................       if(a<TRESHOLD_MAX) 
424
01A1:  MOVF   24,W
424
01A1:  MOVF   24,W
425
01A2:  SUBLW  45
425
01A2:  SUBLW  45
426
01A3:  BTFSS  03.0
426
01A3:  BTFSS  03.0
427
01A4:  GOTO   1AE
427
01A4:  GOTO   1AE
428
....................       { 
428
....................       { 
429
....................          if(a>TRESHOLD_MIN) 
429
....................          if(a>TRESHOLD_MIN) 
430
01A5:  MOVF   24,W
430
01A5:  MOVF   24,W
431
01A6:  SUBLW  32
431
01A6:  SUBLW  32
432
01A7:  BTFSC  03.0
432
01A7:  BTFSC  03.0
433
01A8:  GOTO   1AD
433
01A8:  GOTO   1AD
434
....................          { 
434
....................          { 
435
....................             cidla |= (last_cidla & 0b00000100); 
435
....................             cidla |= (last_cidla & 0b00000100); 
436
01A9:  MOVF   21,W
436
01A9:  MOVF   21,W
437
01AA:  ANDLW  04
437
01AA:  ANDLW  04
438
01AB:  IORWF  23,F
438
01AB:  IORWF  23,F
439
....................          } 
439
....................          } 
440
....................          else cidla |= 0b00000100; 
440
....................          else cidla |= 0b00000100; 
441
01AC:  GOTO   1AE
441
01AC:  GOTO   1AE
442
01AD:  BSF    23.2
442
01AD:  BSF    23.2
443
....................       } 
443
....................       } 
444
....................  
444
....................  
445
....................       a=read_adc(); 
445
....................       a=read_adc(); 
446
01AE:  BSF    1F.2
446
01AE:  BSF    1F.2
447
01AF:  BTFSC  1F.2
447
01AF:  BTFSC  1F.2
448
01B0:  GOTO   1AF
448
01B0:  GOTO   1AF
449
01B1:  MOVF   1E,W
449
01B1:  MOVF   1E,W
450
01B2:  MOVWF  24
450
01B2:  MOVWF  24
451
....................  
451
....................  
452
....................       set_adc_channel(4); 
452
....................       set_adc_channel(4); 
453
01B3:  MOVLW  20
453
01B3:  MOVLW  20
454
01B4:  MOVWF  78
454
01B4:  MOVWF  78
455
01B5:  MOVF   1F,W
455
01B5:  MOVF   1F,W
456
01B6:  ANDLW  C7
456
01B6:  ANDLW  C7
457
01B7:  IORWF  78,W
457
01B7:  IORWF  78,W
458
01B8:  MOVWF  1F
458
01B8:  MOVWF  1F
459
....................       if(a<TRESHOLD_MAX) 
459
....................       if(a<TRESHOLD_MAX) 
460
01B9:  MOVF   24,W
460
01B9:  MOVF   24,W
461
01BA:  SUBLW  45
461
01BA:  SUBLW  45
462
01BB:  BTFSS  03.0
462
01BB:  BTFSS  03.0
463
01BC:  GOTO   1C6
463
01BC:  GOTO   1C6
464
....................       { 
464
....................       { 
465
....................          if(a>TRESHOLD_MIN) 
465
....................          if(a>TRESHOLD_MIN) 
466
01BD:  MOVF   24,W
466
01BD:  MOVF   24,W
467
01BE:  SUBLW  32
467
01BE:  SUBLW  32
468
01BF:  BTFSC  03.0
468
01BF:  BTFSC  03.0
469
01C0:  GOTO   1C5
469
01C0:  GOTO   1C5
470
....................          { 
470
....................          { 
471
....................             cidla |= (last_cidla & 0b00001000); 
471
....................             cidla |= (last_cidla & 0b00001000); 
472
01C1:  MOVF   21,W
472
01C1:  MOVF   21,W
473
01C2:  ANDLW  08
473
01C2:  ANDLW  08
474
01C3:  IORWF  23,F
474
01C3:  IORWF  23,F
475
....................          } 
475
....................          } 
476
....................          else cidla |= 0b00001000; 
476
....................          else cidla |= 0b00001000; 
477
01C4:  GOTO   1C6
477
01C4:  GOTO   1C6
478
01C5:  BSF    23.3
478
01C5:  BSF    23.3
479
....................       } 
479
....................       } 
480
....................       a=read_adc(); 
480
....................       a=read_adc(); 
481
01C6:  BSF    1F.2
481
01C6:  BSF    1F.2
482
01C7:  BTFSC  1F.2
482
01C7:  BTFSC  1F.2
483
01C8:  GOTO   1C7
483
01C8:  GOTO   1C7
484
01C9:  MOVF   1E,W
484
01C9:  MOVF   1E,W
485
01CA:  MOVWF  24
485
01CA:  MOVWF  24
486
....................  
486
....................  
487
....................       set_adc_channel(5); 
487
....................       set_adc_channel(5); 
488
01CB:  MOVLW  28
488
01CB:  MOVLW  28
489
01CC:  MOVWF  78
489
01CC:  MOVWF  78
490
01CD:  MOVF   1F,W
490
01CD:  MOVF   1F,W
491
01CE:  ANDLW  C7
491
01CE:  ANDLW  C7
492
01CF:  IORWF  78,W
492
01CF:  IORWF  78,W
493
01D0:  MOVWF  1F
493
01D0:  MOVWF  1F
494
....................  
494
....................  
495
....................       if(a<TRESHOLD_MAX) 
495
....................       if(a<TRESHOLD_MAX) 
496
01D1:  MOVF   24,W
496
01D1:  MOVF   24,W
497
01D2:  SUBLW  45
497
01D2:  SUBLW  45
498
01D3:  BTFSS  03.0
498
01D3:  BTFSS  03.0
499
01D4:  GOTO   1DE
499
01D4:  GOTO   1DE
500
....................       { 
500
....................       { 
501
....................          if(a>TRESHOLD_MIN) 
501
....................          if(a>TRESHOLD_MIN) 
502
01D5:  MOVF   24,W
502
01D5:  MOVF   24,W
503
01D6:  SUBLW  32
503
01D6:  SUBLW  32
504
01D7:  BTFSC  03.0
504
01D7:  BTFSC  03.0
505
01D8:  GOTO   1DD
505
01D8:  GOTO   1DD
506
....................          { 
506
....................          { 
507
....................             cidla |= (last_cidla & 0b00010000); 
507
....................             cidla |= (last_cidla & 0b00010000); 
508
01D9:  MOVF   21,W
508
01D9:  MOVF   21,W
509
01DA:  ANDLW  10
509
01DA:  ANDLW  10
510
01DB:  IORWF  23,F
510
01DB:  IORWF  23,F
511
....................          } 
511
....................          } 
512
....................          else cidla |= 0b00010000; 
512
....................          else cidla |= 0b00010000; 
513
01DC:  GOTO   1DE
513
01DC:  GOTO   1DE
514
01DD:  BSF    23.4
514
01DD:  BSF    23.4
515
....................       } 
515
....................       } 
516
....................       a=read_adc(); 
516
....................       a=read_adc(); 
517
01DE:  BSF    1F.2
517
01DE:  BSF    1F.2
518
01DF:  BTFSC  1F.2
518
01DF:  BTFSC  1F.2
519
01E0:  GOTO   1DF
519
01E0:  GOTO   1DF
520
01E1:  MOVF   1E,W
520
01E1:  MOVF   1E,W
521
01E2:  MOVWF  24
521
01E2:  MOVWF  24
522
....................  
522
....................  
523
....................       set_adc_channel(6); 
523
....................       set_adc_channel(6); 
524
01E3:  MOVLW  30
524
01E3:  MOVLW  30
525
01E4:  MOVWF  78
525
01E4:  MOVWF  78
526
01E5:  MOVF   1F,W
526
01E5:  MOVF   1F,W
527
01E6:  ANDLW  C7
527
01E6:  ANDLW  C7
528
01E7:  IORWF  78,W
528
01E7:  IORWF  78,W
529
01E8:  MOVWF  1F
529
01E8:  MOVWF  1F
530
....................       if(a<TRESHOLD_MAX) 
530
....................       if(a<TRESHOLD_MAX) 
531
01E9:  MOVF   24,W
531
01E9:  MOVF   24,W
532
01EA:  SUBLW  45
532
01EA:  SUBLW  45
533
01EB:  BTFSS  03.0
533
01EB:  BTFSS  03.0
534
01EC:  GOTO   1F6
534
01EC:  GOTO   1F6
535
....................       { 
535
....................       { 
536
....................          if(a>TRESHOLD_MIN) 
536
....................          if(a>TRESHOLD_MIN) 
537
01ED:  MOVF   24,W
537
01ED:  MOVF   24,W
538
01EE:  SUBLW  32
538
01EE:  SUBLW  32
539
01EF:  BTFSC  03.0
539
01EF:  BTFSC  03.0
540
01F0:  GOTO   1F5
540
01F0:  GOTO   1F5
541
....................          { 
541
....................          { 
542
....................             cidla |= (last_cidla & 0b00100000); 
542
....................             cidla |= (last_cidla & 0b00100000); 
543
01F1:  MOVF   21,W
543
01F1:  MOVF   21,W
544
01F2:  ANDLW  20
544
01F2:  ANDLW  20
545
01F3:  IORWF  23,F
545
01F3:  IORWF  23,F
546
....................          } 
546
....................          } 
547
....................          else cidla |= 0b00100000; 
547
....................          else cidla |= 0b00100000; 
548
01F4:  GOTO   1F6
548
01F4:  GOTO   1F6
549
01F5:  BSF    23.5
549
01F5:  BSF    23.5
550
....................       } 
550
....................       } 
551
....................       a=read_adc(); 
551
....................       a=read_adc(); 
552
01F6:  BSF    1F.2
552
01F6:  BSF    1F.2
553
01F7:  BTFSC  1F.2
553
01F7:  BTFSC  1F.2
554
01F8:  GOTO   1F7
554
01F8:  GOTO   1F7
555
01F9:  MOVF   1E,W
555
01F9:  MOVF   1E,W
556
01FA:  MOVWF  24
556
01FA:  MOVWF  24
557
....................  
557
....................  
558
....................       if(a<TRESHOLD_MAX) 
558
....................       if(a<TRESHOLD_MAX) 
559
01FB:  MOVF   24,W
559
01FB:  MOVF   24,W
560
01FC:  SUBLW  45
560
01FC:  SUBLW  45
561
01FD:  BTFSS  03.0
561
01FD:  BTFSS  03.0
562
01FE:  GOTO   208
562
01FE:  GOTO   208
563
....................       { 
563
....................       { 
564
....................          if(a>TRESHOLD_MIN) 
564
....................          if(a>TRESHOLD_MIN) 
565
01FF:  MOVF   24,W
565
01FF:  MOVF   24,W
566
0200:  SUBLW  32
566
0200:  SUBLW  32
567
0201:  BTFSC  03.0
567
0201:  BTFSC  03.0
568
0202:  GOTO   207
568
0202:  GOTO   207
569
....................          { 
569
....................          { 
570
....................             cidla |=(last_cidla & 0b01000000); 
570
....................             cidla |=(last_cidla & 0b01000000); 
571
0203:  MOVF   21,W
571
0203:  MOVF   21,W
572
0204:  ANDLW  40
572
0204:  ANDLW  40
573
0205:  IORWF  23,F
573
0205:  IORWF  23,F
574
....................          } 
574
....................          } 
575
....................          else cidla |= 0b01000000; 
575
....................          else cidla |= 0b01000000; 
576
0206:  GOTO   208
576
0206:  GOTO   208
577
0207:  BSF    23.6
577
0207:  BSF    23.6
578
....................       } 
578
....................       } 
579
....................  
579
....................  
580
....................       last_cidla=cidla; 
580
....................       last_cidla=cidla; 
581
0208:  MOVF   23,W
581
0208:  MOVF   23,W
582
0209:  MOVWF  21
582
0209:  MOVWF  21
583
....................  
583
....................  
584
....................       if (!input(IRRX)) {if (shure<255) shure++;} else {shure=0;}; 
584
....................       if (!input(IRRX)) {if (shure<255) shure++;} else {shure=0;}; 
585
020A:  BSF    03.5
585
020A:  BSF    03.5
586
020B:  BSF    06.0
586
020B:  BSF    06.0
587
020C:  BCF    03.5
587
020C:  BCF    03.5
588
020D:  BTFSC  06.0
588
020D:  BTFSC  06.0
589
020E:  GOTO   214
589
020E:  GOTO   214
590
020F:  INCFSZ 22,W
590
020F:  INCFSZ 22,W
591
0210:  GOTO   212
591
0210:  GOTO   212
592
0211:  GOTO   213
592
0211:  GOTO   213
593
0212:  INCF   22,F
593
0212:  INCF   22,F
594
0213:  GOTO   215
594
0213:  GOTO   215
595
0214:  CLRF   22
595
0214:  CLRF   22
596
....................       if (shure>CIHLA) cidla|=0b10000000; 
596
....................       if (shure>CIHLA) cidla|=0b10000000; 
597
0215:  MOVF   22,W
597
0215:  MOVF   22,W
598
0216:  SUBLW  0A
598
0216:  SUBLW  0A
599
0217:  BTFSS  03.0
599
0217:  BTFSS  03.0
600
0218:  BSF    23.7
600
0218:  BSF    23.7
601
....................  
601
....................  
602
....................       cidla=~cidla; 
602
....................       cidla=~cidla; 
603
0219:  COMF   23,F
603
0219:  COMF   23,F
604
....................       spi_write(cidla); 
604
....................       spi_write(cidla); 
605
021A:  MOVF   23,W
605
021A:  MOVF   23,W
606
021B:  MOVWF  13
606
021B:  MOVWF  13
607
021C:  BSF    03.5
607
021C:  BSF    03.5
608
021D:  BTFSC  14.0
608
021D:  BTFSC  14.0
609
021E:  GOTO   221
609
021E:  GOTO   221
610
021F:  BCF    03.5
610
021F:  BCF    03.5
611
0220:  GOTO   21C
611
0220:  GOTO   21C
612
....................    } 
612
....................    } 
613
0221:  BCF    03.5
613
0221:  BCF    03.5
614
0222:  GOTO   158
614
0222:  GOTO   158
615
.................... } 
615
.................... } 
616
0223:  SLEEP
616
0223:  SLEEP
617
 
617
 
618
Configuration Fuses:
618
Configuration Fuses:
619
   Word  1: 3F38   NOWDT NOPUT MCLR NOBROWNOUT NOLVP NOCPD NOWRT NODEBUG CCPB0 NOPROTECT INTRC_IO
619
   Word  1: 3F38   NOWDT NOPUT MCLR NOBROWNOUT NOLVP NOCPD NOWRT NODEBUG CCPB0 NOPROTECT INTRC_IO
620
   Word  2: 3FFC   NOFCMEN NOIESO
620
   Word  2: 3FFC   NOFCMEN NOIESO