Rev 3095 Rev 3180
1 CCS PCM C Compiler, Version 4.106, 47914 29-6-13 22:36 1 CCS PCM C Compiler, Version 4.106, 47914 19-7-13 17:14
2   2  
3 Filename: D:\Honza\MLAB\Modules\Sensors\LTS01A\SW\PIC16F887\main.lst 3 Filename: D:\Honza\MLAB\Modules\Sensors\LTS01A\SW\PIC16F887\main.lst
4   4  
5 ROM used: 1725 words (21%) 5 ROM used: 1725 words (21%)
6 Largest free fragment is 2048 6 Largest free fragment is 2048
7 RAM used: 10 (3%) at main() level 7 RAM used: 10 (3%) at main() level
8 38 (10%) worst case 8 38 (10%) worst case
9 Stack: 2 locations 9 Stack: 2 locations
10   10  
11 * 11 *
12 0000: MOVLW 05 12 0000: MOVLW 05
13 0001: MOVWF 0A 13 0001: MOVWF 0A
14 0002: GOTO 574 14 0002: GOTO 574
15 0003: NOP 15 0003: NOP
16 .................... #include "D:\Honza\MLAB\Modules\Sensors\LTS01A\SW\PIC16F887\main.h" 16 .................... #include "D:\Honza\MLAB\Modules\Sensors\LTS01A\SW\PIC16F887\main.h"
17 .................... #include <16F887.h> 17 .................... #include <16F887.h>
18 .................... //////// Standard Header file for the PIC16F887 device //////////////// 18 .................... //////// Standard Header file for the PIC16F887 device ////////////////
19 .................... #device PIC16F887 19 .................... #device PIC16F887
20 .................... #list 20 .................... #list
21 .................... 21 ....................
22 .................... #device adc=8 22 .................... #device adc=8
23 .................... 23 ....................
24 .................... #FUSES NOWDT //No Watch Dog Timer 24 .................... #FUSES NOWDT //No Watch Dog Timer
25 .................... #FUSES INTRC //Internal RC Osc 25 .................... #FUSES INTRC //Internal RC Osc
26 .................... #FUSES NOPUT //No Power Up Timer 26 .................... #FUSES NOPUT //No Power Up Timer
27 .................... #FUSES MCLR //Master Clear pin enabled 27 .................... #FUSES MCLR //Master Clear pin enabled
28 .................... #FUSES NOPROTECT //Code not protected from reading 28 .................... #FUSES NOPROTECT //Code not protected from reading
29 .................... #FUSES NOCPD //No EE protection 29 .................... #FUSES NOCPD //No EE protection
30 .................... #FUSES NOBROWNOUT //No brownout reset 30 .................... #FUSES NOBROWNOUT //No brownout reset
31 .................... #FUSES IESO //Internal External Switch Over mode enabled 31 .................... #FUSES IESO //Internal External Switch Over mode enabled
32 .................... #FUSES FCMEN //Fail-safe clock monitor enabled 32 .................... #FUSES FCMEN //Fail-safe clock monitor enabled
33 .................... #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O 33 .................... #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
34 .................... #FUSES NODEBUG //No Debug mode for ICD 34 .................... #FUSES NODEBUG //No Debug mode for ICD
35 .................... #FUSES NOWRT //Program memory not write protected 35 .................... #FUSES NOWRT //Program memory not write protected
36 .................... #FUSES BORV40 //Brownout reset at 4.0V 36 .................... #FUSES BORV40 //Brownout reset at 4.0V
37 .................... 37 ....................
38 .................... #use delay(clock=8000000) 38 .................... #use delay(clock=8000000)
39 * 39 *
40 055E: MOVLW 28 40 055E: MOVLW 28
41 055F: MOVWF 04 41 055F: MOVWF 04
42 0560: BCF 03.7 42 0560: BCF 03.7
43 0561: MOVF 00,W 43 0561: MOVF 00,W
44 0562: BTFSC 03.2 44 0562: BTFSC 03.2
45 0563: GOTO 571 45 0563: GOTO 571
46 0564: MOVLW 02 46 0564: MOVLW 02
47 0565: MOVWF 78 47 0565: MOVWF 78
48 0566: CLRF 77 48 0566: CLRF 77
49 0567: DECFSZ 77,F 49 0567: DECFSZ 77,F
50 0568: GOTO 567 50 0568: GOTO 567
51 0569: DECFSZ 78,F 51 0569: DECFSZ 78,F
52 056A: GOTO 566 52 056A: GOTO 566
53 056B: MOVLW 97 53 056B: MOVLW 97
54 056C: MOVWF 77 54 056C: MOVWF 77
55 056D: DECFSZ 77,F 55 056D: DECFSZ 77,F
56 056E: GOTO 56D 56 056E: GOTO 56D
57 056F: DECFSZ 00,F 57 056F: DECFSZ 00,F
58 0570: GOTO 564 58 0570: GOTO 564
59 0571: BCF 0A.3 59 0571: BCF 0A.3
60 0572: BCF 0A.4 60 0572: BCF 0A.4
61 0573: GOTO 6B9 (RETURN) 61 0573: GOTO 6B9 (RETURN)
62 .................... 62 ....................
63 .................... 63 ....................
64 .................... 64 ....................
65 .................... #define S_SDA PIN_C3 65 .................... #define S_SDA PIN_C3
66 .................... #define S_SCL PIN_C4 66 .................... #define S_SCL PIN_C4
67 .................... #use i2c(master, sda=S_SDA, scl=S_SCL) 67 .................... #use i2c(master, sda=S_SDA, scl=S_SCL)
68 * 68 *
69 008D: MOVLW 08 69 008D: MOVLW 08
70 008E: MOVWF 78 70 008E: MOVWF 78
71 008F: NOP 71 008F: NOP
72 0090: BCF 07.4 72 0090: BCF 07.4
73 0091: BCF 20.4 73 0091: BCF 20.4
74 0092: MOVF 20,W 74 0092: MOVF 20,W
75 0093: BSF 03.5 75 0093: BSF 03.5
76 0094: MOVWF 07 76 0094: MOVWF 07
77 0095: NOP 77 0095: NOP
78 0096: BCF 03.5 78 0096: BCF 03.5
79 0097: RLF 27,F 79 0097: RLF 27,F
80 0098: BCF 07.3 80 0098: BCF 07.3
81 0099: BTFSS 03.0 81 0099: BTFSS 03.0
82 009A: GOTO 0A1 82 009A: GOTO 0A1
83 009B: BSF 20.3 83 009B: BSF 20.3
84 009C: MOVF 20,W 84 009C: MOVF 20,W
85 009D: BSF 03.5 85 009D: BSF 03.5
86 009E: MOVWF 07 86 009E: MOVWF 07
87 009F: GOTO 0A5 87 009F: GOTO 0A5
88 00A0: BCF 03.5 88 00A0: BCF 03.5
89 00A1: BCF 20.3 89 00A1: BCF 20.3
90 00A2: MOVF 20,W 90 00A2: MOVF 20,W
91 00A3: BSF 03.5 91 00A3: BSF 03.5
92 00A4: MOVWF 07 92 00A4: MOVWF 07
93 00A5: NOP 93 00A5: NOP
94 00A6: BCF 03.5 94 00A6: BCF 03.5
95 00A7: BSF 20.4 95 00A7: BSF 20.4
96 00A8: MOVF 20,W 96 00A8: MOVF 20,W
97 00A9: BSF 03.5 97 00A9: BSF 03.5
98 00AA: MOVWF 07 98 00AA: MOVWF 07
99 00AB: BCF 03.5 99 00AB: BCF 03.5
100 00AC: BTFSS 07.4 100 00AC: BTFSS 07.4
101 00AD: GOTO 0AC 101 00AD: GOTO 0AC
102 00AE: DECFSZ 78,F 102 00AE: DECFSZ 78,F
103 00AF: GOTO 08F 103 00AF: GOTO 08F
104 00B0: NOP 104 00B0: NOP
105 00B1: BCF 07.4 105 00B1: BCF 07.4
106 00B2: BCF 20.4 106 00B2: BCF 20.4
107 00B3: MOVF 20,W 107 00B3: MOVF 20,W
108 00B4: BSF 03.5 108 00B4: BSF 03.5
109 00B5: MOVWF 07 109 00B5: MOVWF 07
110 00B6: NOP 110 00B6: NOP
111 00B7: BCF 03.5 111 00B7: BCF 03.5
112 00B8: BSF 20.3 112 00B8: BSF 20.3
113 00B9: MOVF 20,W 113 00B9: MOVF 20,W
114 00BA: BSF 03.5 114 00BA: BSF 03.5
115 00BB: MOVWF 07 115 00BB: MOVWF 07
116 00BC: NOP 116 00BC: NOP
117 00BD: NOP 117 00BD: NOP
118 00BE: BCF 03.5 118 00BE: BCF 03.5
119 00BF: BSF 20.4 119 00BF: BSF 20.4
120 00C0: MOVF 20,W 120 00C0: MOVF 20,W
121 00C1: BSF 03.5 121 00C1: BSF 03.5
122 00C2: MOVWF 07 122 00C2: MOVWF 07
123 00C3: BCF 03.5 123 00C3: BCF 03.5
124 00C4: BTFSS 07.4 124 00C4: BTFSS 07.4
125 00C5: GOTO 0C4 125 00C5: GOTO 0C4
126 00C6: CLRF 78 126 00C6: CLRF 78
127 00C7: NOP 127 00C7: NOP
128 00C8: BTFSC 07.3 128 00C8: BTFSC 07.3
129 00C9: BSF 78.0 129 00C9: BSF 78.0
130 00CA: BCF 07.4 130 00CA: BCF 07.4
131 00CB: BCF 20.4 131 00CB: BCF 20.4
132 00CC: MOVF 20,W 132 00CC: MOVF 20,W
133 00CD: BSF 03.5 133 00CD: BSF 03.5
134 00CE: MOVWF 07 134 00CE: MOVWF 07
135 00CF: BCF 03.5 135 00CF: BCF 03.5
136 00D0: BCF 07.3 136 00D0: BCF 07.3
137 00D1: BCF 20.3 137 00D1: BCF 20.3
138 00D2: MOVF 20,W 138 00D2: MOVF 20,W
139 00D3: BSF 03.5 139 00D3: BSF 03.5
140 00D4: MOVWF 07 140 00D4: MOVWF 07
141 00D5: BCF 03.5 141 00D5: BCF 03.5
142 00D6: RETURN 142 00D6: RETURN
143 00D7: MOVLW 08 143 00D7: MOVLW 08
144 00D8: MOVWF 28 144 00D8: MOVWF 28
145 00D9: MOVF 77,W 145 00D9: MOVF 77,W
146 00DA: MOVWF 29 146 00DA: MOVWF 29
147 00DB: BSF 20.3 147 00DB: BSF 20.3
148 00DC: MOVF 20,W 148 00DC: MOVF 20,W
149 00DD: BSF 03.5 149 00DD: BSF 03.5
150 00DE: MOVWF 07 150 00DE: MOVWF 07
151 00DF: NOP 151 00DF: NOP
152 00E0: BCF 03.5 152 00E0: BCF 03.5
153 00E1: BSF 20.4 153 00E1: BSF 20.4
154 00E2: MOVF 20,W 154 00E2: MOVF 20,W
155 00E3: BSF 03.5 155 00E3: BSF 03.5
156 00E4: MOVWF 07 156 00E4: MOVWF 07
157 00E5: BCF 03.5 157 00E5: BCF 03.5
158 00E6: BTFSS 07.4 158 00E6: BTFSS 07.4
159 00E7: GOTO 0E6 159 00E7: GOTO 0E6
160 00E8: BTFSC 07.3 160 00E8: BTFSC 07.3
161 00E9: BSF 03.0 161 00E9: BSF 03.0
162 00EA: BTFSS 07.3 162 00EA: BTFSS 07.3
163 00EB: BCF 03.0 163 00EB: BCF 03.0
164 00EC: RLF 78,F 164 00EC: RLF 78,F
165 00ED: NOP 165 00ED: NOP
166 00EE: BCF 20.4 166 00EE: BCF 20.4
167 00EF: MOVF 20,W 167 00EF: MOVF 20,W
168 00F0: BSF 03.5 168 00F0: BSF 03.5
169 00F1: MOVWF 07 169 00F1: MOVWF 07
170 00F2: BCF 03.5 170 00F2: BCF 03.5
171 00F3: BCF 07.4 171 00F3: BCF 07.4
172 00F4: DECFSZ 28,F 172 00F4: DECFSZ 28,F
173 00F5: GOTO 0DB 173 00F5: GOTO 0DB
174 00F6: BSF 20.3 174 00F6: BSF 20.3
175 00F7: MOVF 20,W 175 00F7: MOVF 20,W
176 00F8: BSF 03.5 176 00F8: BSF 03.5
177 00F9: MOVWF 07 177 00F9: MOVWF 07
178 00FA: NOP 178 00FA: NOP
179 00FB: BCF 03.5 179 00FB: BCF 03.5
180 00FC: BCF 07.3 180 00FC: BCF 07.3
181 00FD: MOVF 29,W 181 00FD: MOVF 29,W
182 00FE: BTFSC 03.2 182 00FE: BTFSC 03.2
183 00FF: GOTO 105 183 00FF: GOTO 105
184 0100: BCF 20.3 184 0100: BCF 20.3
185 0101: MOVF 20,W 185 0101: MOVF 20,W
186 0102: BSF 03.5 186 0102: BSF 03.5
187 0103: MOVWF 07 187 0103: MOVWF 07
188 0104: BCF 03.5 188 0104: BCF 03.5
189 0105: NOP 189 0105: NOP
190 0106: BSF 20.4 190 0106: BSF 20.4
191 0107: MOVF 20,W 191 0107: MOVF 20,W
192 0108: BSF 03.5 192 0108: BSF 03.5
193 0109: MOVWF 07 193 0109: MOVWF 07
194 010A: BCF 03.5 194 010A: BCF 03.5
195 010B: BTFSS 07.4 195 010B: BTFSS 07.4
196 010C: GOTO 10B 196 010C: GOTO 10B
197 010D: NOP 197 010D: NOP
198 010E: BCF 07.4 198 010E: BCF 07.4
199 010F: BCF 20.4 199 010F: BCF 20.4
200 0110: MOVF 20,W 200 0110: MOVF 20,W
201 0111: BSF 03.5 201 0111: BSF 03.5
202 0112: MOVWF 07 202 0112: MOVWF 07
203 0113: NOP 203 0113: NOP
204 0114: BCF 03.5 204 0114: BCF 03.5
205 0115: BCF 07.3 205 0115: BCF 07.3
206 0116: BCF 20.3 206 0116: BCF 20.3
207 0117: MOVF 20,W 207 0117: MOVF 20,W
208 0118: BSF 03.5 208 0118: BSF 03.5
209 0119: MOVWF 07 209 0119: MOVWF 07
210 011A: BCF 03.5 210 011A: BCF 03.5
211 011B: RETURN 211 011B: RETURN
212 .................... #use rs232(baud=9600,parity=N,xmit=PIN_B3,rcv=PIN_B2,bits=8) //rcv TXD xmit RXD 212 .................... #use rs232(baud=9600,parity=N,xmit=PIN_B3,rcv=PIN_B2,bits=8) //rcv TXD xmit RXD
213 * 213 *
214 0025: BSF 03.5 214 0025: BSF 03.5
215 0026: BCF 06.3 215 0026: BCF 06.3
216 0027: BCF 03.5 216 0027: BCF 03.5
217 0028: BCF 06.3 217 0028: BCF 06.3
218 0029: MOVLW 08 218 0029: MOVLW 08
219 002A: MOVWF 78 219 002A: MOVWF 78
220 002B: GOTO 02C 220 002B: GOTO 02C
221 002C: NOP 221 002C: NOP
222 002D: BSF 78.7 222 002D: BSF 78.7
223 002E: GOTO 03D 223 002E: GOTO 03D
224 002F: BCF 78.7 224 002F: BCF 78.7
225 0030: RRF 34,F 225 0030: RRF 34,F
226 0031: BTFSC 03.0 226 0031: BTFSC 03.0
227 0032: BSF 06.3 227 0032: BSF 06.3
228 0033: BTFSS 03.0 228 0033: BTFSS 03.0
229 0034: BCF 06.3 229 0034: BCF 06.3
230 0035: BSF 78.6 230 0035: BSF 78.6
231 0036: GOTO 03D 231 0036: GOTO 03D
232 0037: BCF 78.6 232 0037: BCF 78.6
233 0038: DECFSZ 78,F 233 0038: DECFSZ 78,F
234 0039: GOTO 030 234 0039: GOTO 030
235 003A: GOTO 03B 235 003A: GOTO 03B
236 003B: NOP 236 003B: NOP
237 003C: BSF 06.3 237 003C: BSF 06.3
238 003D: MOVLW 3F 238 003D: MOVLW 3F
239 003E: MOVWF 04 239 003E: MOVWF 04
240 003F: DECFSZ 04,F 240 003F: DECFSZ 04,F
241 0040: GOTO 03F 241 0040: GOTO 03F
242 0041: NOP 242 0041: NOP
243 0042: BTFSC 78.7 243 0042: BTFSC 78.7
244 0043: GOTO 02F 244 0043: GOTO 02F
245 0044: BTFSC 78.6 245 0044: BTFSC 78.6
246 0045: GOTO 037 246 0045: GOTO 037
247 0046: RETURN 247 0046: RETURN
248 .................... 248 ....................
-   249 .................... //Adresa pro VDD, VDD, VDD W 0x9E R 0x9F
-   250 .................... //Adresa pro GND GND GND W 0x90 R 0x91
249 .................... 251 ....................
250 .................... void main() 252 .................... void main()
251 .................... { 253 .................... {
252 * 254 *
253 0574: CLRF 04 255 0574: CLRF 04
254 0575: BCF 03.7 256 0575: BCF 03.7
255 0576: MOVLW 1F 257 0576: MOVLW 1F
256 0577: ANDWF 03,F 258 0577: ANDWF 03,F
257 0578: MOVLW 71 259 0578: MOVLW 71
258 0579: BSF 03.5 260 0579: BSF 03.5
259 057A: MOVWF 0F 261 057A: MOVWF 0F
260 057B: MOVF 0F,W 262 057B: MOVF 0F,W
261 057C: BCF 06.3 263 057C: BCF 06.3
262 057D: BCF 03.5 264 057D: BCF 03.5
263 057E: BSF 06.3 265 057E: BSF 06.3
264 057F: BSF 03.5 266 057F: BSF 03.5
265 0580: BSF 03.6 267 0580: BSF 03.6
266 0581: MOVF 09,W 268 0581: MOVF 09,W
267 0582: ANDLW C0 269 0582: ANDLW C0
268 0583: MOVWF 09 270 0583: MOVWF 09
269 0584: BCF 03.6 271 0584: BCF 03.6
270 0585: BCF 1F.4 272 0585: BCF 1F.4
271 0586: BCF 1F.5 273 0586: BCF 1F.5
272 0587: MOVLW 00 274 0587: MOVLW 00
273 0588: BSF 03.6 275 0588: BSF 03.6
274 0589: MOVWF 08 276 0589: MOVWF 08
275 058A: BCF 03.5 277 058A: BCF 03.5
276 058B: CLRF 07 278 058B: CLRF 07
277 058C: CLRF 08 279 058C: CLRF 08
278 058D: CLRF 09 280 058D: CLRF 09
279 .................... 281 ....................
280 .................... setup_adc_ports(NO_ANALOGS|VSS_VDD); 282 .................... setup_adc_ports(NO_ANALOGS|VSS_VDD);
281 * 283 *
282 0591: BSF 03.5 284 0591: BSF 03.5
283 0592: BSF 03.6 285 0592: BSF 03.6
284 0593: MOVF 09,W 286 0593: MOVF 09,W
285 0594: ANDLW C0 287 0594: ANDLW C0
286 0595: MOVWF 09 288 0595: MOVWF 09
287 0596: BCF 03.6 289 0596: BCF 03.6
288 0597: BCF 1F.4 290 0597: BCF 1F.4
289 0598: BCF 1F.5 291 0598: BCF 1F.5
290 0599: MOVLW 00 292 0599: MOVLW 00
291 059A: BSF 03.6 293 059A: BSF 03.6
292 059B: MOVWF 08 294 059B: MOVWF 08
293 .................... setup_adc(ADC_CLOCK_DIV_2); 295 .................... setup_adc(ADC_CLOCK_DIV_2);
294 059C: BCF 03.5 296 059C: BCF 03.5
295 059D: BCF 03.6 297 059D: BCF 03.6
296 059E: BCF 1F.6 298 059E: BCF 1F.6
297 059F: BCF 1F.7 299 059F: BCF 1F.7
298 05A0: BSF 03.5 300 05A0: BSF 03.5
299 05A1: BCF 1F.7 301 05A1: BCF 1F.7
300 05A2: BCF 03.5 302 05A2: BCF 03.5
301 05A3: BSF 1F.0 303 05A3: BSF 1F.0
302 .................... setup_spi(SPI_SS_DISABLED); 304 .................... setup_spi(SPI_SS_DISABLED);
303 05A4: BCF 14.5 305 05A4: BCF 14.5
304 05A5: BCF 20.5 306 05A5: BCF 20.5
305 05A6: MOVF 20,W 307 05A6: MOVF 20,W
306 05A7: BSF 03.5 308 05A7: BSF 03.5
307 05A8: MOVWF 07 309 05A8: MOVWF 07
308 05A9: BCF 03.5 310 05A9: BCF 03.5
309 05AA: BSF 20.4 311 05AA: BSF 20.4
310 05AB: MOVF 20,W 312 05AB: MOVF 20,W
311 05AC: BSF 03.5 313 05AC: BSF 03.5
312 05AD: MOVWF 07 314 05AD: MOVWF 07
313 05AE: BCF 03.5 315 05AE: BCF 03.5
314 05AF: BCF 20.3 316 05AF: BCF 20.3
315 05B0: MOVF 20,W 317 05B0: MOVF 20,W
316 05B1: BSF 03.5 318 05B1: BSF 03.5
317 05B2: MOVWF 07 319 05B2: MOVWF 07
318 05B3: MOVLW 01 320 05B3: MOVLW 01
319 05B4: BCF 03.5 321 05B4: BCF 03.5
320 05B5: MOVWF 14 322 05B5: MOVWF 14
321 05B6: MOVLW 00 323 05B6: MOVLW 00
322 05B7: BSF 03.5 324 05B7: BSF 03.5
323 05B8: MOVWF 14 325 05B8: MOVWF 14
324 .................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); 326 .................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
325 05B9: MOVF 01,W 327 05B9: MOVF 01,W
326 05BA: ANDLW C7 328 05BA: ANDLW C7
327 05BB: IORLW 08 329 05BB: IORLW 08
328 05BC: MOVWF 01 330 05BC: MOVWF 01
329 .................... setup_timer_1(T1_DISABLED); 331 .................... setup_timer_1(T1_DISABLED);
330 05BD: BCF 03.5 332 05BD: BCF 03.5
331 05BE: CLRF 10 333 05BE: CLRF 10
332 .................... setup_timer_2(T2_DISABLED,0,1); 334 .................... setup_timer_2(T2_DISABLED,0,1);
333 05BF: MOVLW 00 335 05BF: MOVLW 00
334 05C0: MOVWF 78 336 05C0: MOVWF 78
335 05C1: MOVWF 12 337 05C1: MOVWF 12
336 05C2: MOVLW 00 338 05C2: MOVLW 00
337 05C3: BSF 03.5 339 05C3: BSF 03.5
338 05C4: MOVWF 12 340 05C4: MOVWF 12
339 .................... setup_ccp1(CCP_OFF); 341 .................... setup_ccp1(CCP_OFF);
340 05C5: BCF 03.5 342 05C5: BCF 03.5
341 05C6: BSF 20.2 343 05C6: BSF 20.2
342 05C7: MOVF 20,W 344 05C7: MOVF 20,W
343 05C8: BSF 03.5 345 05C8: BSF 03.5
344 05C9: MOVWF 07 346 05C9: MOVWF 07
345 05CA: BCF 03.5 347 05CA: BCF 03.5
346 05CB: CLRF 17 348 05CB: CLRF 17
347 05CC: BSF 03.5 349 05CC: BSF 03.5
348 05CD: CLRF 1B 350 05CD: CLRF 1B
349 05CE: CLRF 1C 351 05CE: CLRF 1C
350 05CF: MOVLW 01 352 05CF: MOVLW 01
351 05D0: MOVWF 1D 353 05D0: MOVWF 1D
352 .................... setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard 354 .................... setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard
353 05D1: BCF 03.5 355 05D1: BCF 03.5
354 05D2: BSF 03.6 356 05D2: BSF 03.6
355 05D3: CLRF 07 357 05D3: CLRF 07
356 05D4: CLRF 08 358 05D4: CLRF 08
357 05D5: CLRF 09 359 05D5: CLRF 09
358 .................... 360 ....................
359 .................... printf("Simple Thermomether \r\n",); 361 .................... printf("Simple Thermomether \r\n",);
360 05D6: MOVLW 04 362 05D6: MOVLW 04
361 05D7: MOVWF 0D 363 05D7: MOVWF 0D
362 05D8: MOVLW 00 364 05D8: MOVLW 00
363 05D9: MOVWF 0F 365 05D9: MOVWF 0F
364 05DA: BCF 03.6 366 05DA: BCF 03.6
365 05DB: CALL 047 367 05DB: CALL 047
366 .................... printf("(c) MLAB 2013 JACHO \r\n",); 368 .................... printf("(c) MLAB 2013 JACHO \r\n",);
367 05DC: MOVLW 10 369 05DC: MOVLW 10
368 05DD: BSF 03.6 370 05DD: BSF 03.6
369 05DE: MOVWF 0D 371 05DE: MOVWF 0D
370 05DF: MOVLW 00 372 05DF: MOVLW 00
371 05E0: MOVWF 0F 373 05E0: MOVWF 0F
372 05E1: BCF 03.6 374 05E1: BCF 03.6
373 05E2: CALL 047 375 05E2: CALL 047
374 .................... 376 ....................
375 .................... signed int8 MSB; 377 .................... signed int8 MSB;
376 .................... byte LSB; 378 .................... byte LSB;
377 .................... float t; 379 .................... float t;
378 .................... 380 ....................
379 .................... while(TRUE) 381 .................... while(TRUE)
380 .................... { 382 .................... {
381 .................... 383 ....................
382 .................... 384 ....................
383 .................... 385 ....................
384 .................... i2c_start(); 386 .................... i2c_start();
385 05E3: BSF 20.3 387 05E3: BSF 20.3
386 05E4: MOVF 20,W 388 05E4: MOVF 20,W
387 05E5: BSF 03.5 389 05E5: BSF 03.5
388 05E6: MOVWF 07 390 05E6: MOVWF 07
389 05E7: NOP 391 05E7: NOP
390 05E8: BCF 03.5 392 05E8: BCF 03.5
391 05E9: BSF 20.4 393 05E9: BSF 20.4
392 05EA: MOVF 20,W 394 05EA: MOVF 20,W
393 05EB: BSF 03.5 395 05EB: BSF 03.5
394 05EC: MOVWF 07 396 05EC: MOVWF 07
395 05ED: NOP 397 05ED: NOP
396 05EE: BCF 03.5 398 05EE: BCF 03.5
397 05EF: BCF 07.3 399 05EF: BCF 07.3
398 05F0: BCF 20.3 400 05F0: BCF 20.3
399 05F1: MOVF 20,W 401 05F1: MOVF 20,W
400 05F2: BSF 03.5 402 05F2: BSF 03.5
401 05F3: MOVWF 07 403 05F3: MOVWF 07
402 05F4: NOP 404 05F4: NOP
403 05F5: BCF 03.5 405 05F5: BCF 03.5
404 05F6: BCF 07.4 406 05F6: BCF 07.4
405 05F7: BCF 20.4 407 05F7: BCF 20.4
406 05F8: MOVF 20,W 408 05F8: MOVF 20,W
407 05F9: BSF 03.5 409 05F9: BSF 03.5
408 05FA: MOVWF 07 410 05FA: MOVWF 07
409 .................... I2C_Write(0x9E); 411 .................... I2C_Write(0x90);
410 05FB: MOVLW 9E 412 05FB: MOVLW 90
411 05FC: BCF 03.5 413 05FC: BCF 03.5
412 05FD: MOVWF 27 414 05FD: MOVWF 27
413 05FE: CALL 08D 415 05FE: CALL 08D
414 .................... I2C_write(0x00); 416 .................... I2C_write(0x00);
415 05FF: CLRF 27 417 05FF: CLRF 27
416 0600: CALL 08D 418 0600: CALL 08D
417 .................... i2c_stop(); 419 .................... i2c_stop();
418 0601: BCF 20.3 420 0601: BCF 20.3
419 0602: MOVF 20,W 421 0602: MOVF 20,W
420 0603: BSF 03.5 422 0603: BSF 03.5
421 0604: MOVWF 07 423 0604: MOVWF 07
422 0605: NOP 424 0605: NOP
423 0606: BCF 03.5 425 0606: BCF 03.5
424 0607: BSF 20.4 426 0607: BSF 20.4
425 0608: MOVF 20,W 427 0608: MOVF 20,W
426 0609: BSF 03.5 428 0609: BSF 03.5
427 060A: MOVWF 07 429 060A: MOVWF 07
428 060B: BCF 03.5 430 060B: BCF 03.5
429 060C: BTFSS 07.4 431 060C: BTFSS 07.4
430 060D: GOTO 60C 432 060D: GOTO 60C
431 060E: NOP 433 060E: NOP
432 060F: GOTO 610 434 060F: GOTO 610
433 0610: NOP 435 0610: NOP
434 0611: BSF 20.3 436 0611: BSF 20.3
435 0612: MOVF 20,W 437 0612: MOVF 20,W
436 0613: BSF 03.5 438 0613: BSF 03.5
437 0614: MOVWF 07 439 0614: MOVWF 07
438 0615: NOP 440 0615: NOP
439 .................... i2c_start(); 441 .................... i2c_start();
440 0616: BCF 03.5 442 0616: BCF 03.5
441 0617: BSF 20.3 443 0617: BSF 20.3
442 0618: MOVF 20,W 444 0618: MOVF 20,W
443 0619: BSF 03.5 445 0619: BSF 03.5
444 061A: MOVWF 07 446 061A: MOVWF 07
445 061B: NOP 447 061B: NOP
446 061C: BCF 03.5 448 061C: BCF 03.5
447 061D: BSF 20.4 449 061D: BSF 20.4
448 061E: MOVF 20,W 450 061E: MOVF 20,W
449 061F: BSF 03.5 451 061F: BSF 03.5
450 0620: MOVWF 07 452 0620: MOVWF 07
451 0621: NOP 453 0621: NOP
452 0622: BCF 03.5 454 0622: BCF 03.5
453 0623: BCF 07.3 455 0623: BCF 07.3
454 0624: BCF 20.3 456 0624: BCF 20.3
455 0625: MOVF 20,W 457 0625: MOVF 20,W
456 0626: BSF 03.5 458 0626: BSF 03.5
457 0627: MOVWF 07 459 0627: MOVWF 07
458 0628: NOP 460 0628: NOP
459 0629: BCF 03.5 461 0629: BCF 03.5
460 062A: BCF 07.4 462 062A: BCF 07.4
461 062B: BCF 20.4 463 062B: BCF 20.4
462 062C: MOVF 20,W 464 062C: MOVF 20,W
463 062D: BSF 03.5 465 062D: BSF 03.5
464 062E: MOVWF 07 466 062E: MOVWF 07
465 .................... I2C_Write(0x9F); 467 .................... I2C_Write(0x91);
466 062F: MOVLW 9F 468 062F: MOVLW 91
467 0630: BCF 03.5 469 0630: BCF 03.5
468 0631: MOVWF 27 470 0631: MOVWF 27
469 0632: CALL 08D 471 0632: CALL 08D
470 .................... MSB=i2c_read(1); 472 .................... MSB=i2c_read(1);
471 0633: MOVLW 01 473 0633: MOVLW 01
472 0634: MOVWF 77 474 0634: MOVWF 77
473 0635: CALL 0D7 475 0635: CALL 0D7
474 0636: MOVF 78,W 476 0636: MOVF 78,W
475 0637: MOVWF 21 477 0637: MOVWF 21
476 .................... LSB=i2c_read(0); 478 .................... LSB=i2c_read(0);
477 0638: CLRF 77 479 0638: CLRF 77
478 0639: CALL 0D7 480 0639: CALL 0D7
479 063A: MOVF 78,W 481 063A: MOVF 78,W
480 063B: MOVWF 22 482 063B: MOVWF 22
481 .................... i2c_stop(); 483 .................... i2c_stop();
482 063C: BCF 20.3 484 063C: BCF 20.3
483 063D: MOVF 20,W 485 063D: MOVF 20,W
484 063E: BSF 03.5 486 063E: BSF 03.5
485 063F: MOVWF 07 487 063F: MOVWF 07
486 0640: NOP 488 0640: NOP
487 0641: BCF 03.5 489 0641: BCF 03.5
488 0642: BSF 20.4 490 0642: BSF 20.4
489 0643: MOVF 20,W 491 0643: MOVF 20,W
490 0644: BSF 03.5 492 0644: BSF 03.5
491 0645: MOVWF 07 493 0645: MOVWF 07
492 0646: BCF 03.5 494 0646: BCF 03.5
493 0647: BTFSS 07.4 495 0647: BTFSS 07.4
494 0648: GOTO 647 496 0648: GOTO 647
495 0649: NOP 497 0649: NOP
496 064A: GOTO 64B 498 064A: GOTO 64B
497 064B: NOP 499 064B: NOP
498 064C: BSF 20.3 500 064C: BSF 20.3
499 064D: MOVF 20,W 501 064D: MOVF 20,W
500 064E: BSF 03.5 502 064E: BSF 03.5
501 064F: MOVWF 07 503 064F: MOVWF 07
502 0650: NOP 504 0650: NOP
503 .................... 505 ....................
504 .................... t = (float)(LSB)/256.0; 506 .................... t = (float)(LSB)/256.0;
505 0651: BCF 03.5 507 0651: BCF 03.5
506 0652: CLRF 28 508 0652: CLRF 28
507 0653: MOVF 22,W 509 0653: MOVF 22,W
508 0654: MOVWF 27 510 0654: MOVWF 27
509 0655: GOTO 11C 511 0655: GOTO 11C
510 0656: MOVF 77,W 512 0656: MOVF 77,W
511 0657: MOVWF 27 513 0657: MOVWF 27
512 0658: MOVF 78,W 514 0658: MOVF 78,W
513 0659: MOVWF 28 515 0659: MOVWF 28
514 065A: MOVF 79,W 516 065A: MOVF 79,W
515 065B: MOVWF 29 517 065B: MOVWF 29
516 065C: MOVF 7A,W 518 065C: MOVF 7A,W
517 065D: MOVWF 2A 519 065D: MOVWF 2A
518 065E: MOVWF 2E 520 065E: MOVWF 2E
519 065F: MOVF 79,W 521 065F: MOVF 79,W
520 0660: MOVWF 2D 522 0660: MOVWF 2D
521 0661: MOVF 78,W 523 0661: MOVF 78,W
522 0662: MOVWF 2C 524 0662: MOVWF 2C
523 0663: MOVF 77,W 525 0663: MOVF 77,W
524 0664: MOVWF 2B 526 0664: MOVWF 2B
525 0665: CLRF 32 527 0665: CLRF 32
526 0666: CLRF 31 528 0666: CLRF 31
527 0667: CLRF 30 529 0667: CLRF 30
528 0668: MOVLW 87 530 0668: MOVLW 87
529 0669: MOVWF 2F 531 0669: MOVWF 2F
530 066A: GOTO 13B 532 066A: GOTO 13B
531 066B: MOVF 7A,W 533 066B: MOVF 7A,W
532 066C: MOVWF 26 534 066C: MOVWF 26
533 066D: MOVF 79,W 535 066D: MOVF 79,W
534 066E: MOVWF 25 536 066E: MOVWF 25
535 066F: MOVF 78,W 537 066F: MOVF 78,W
536 0670: MOVWF 24 538 0670: MOVWF 24
537 0671: MOVF 77,W 539 0671: MOVF 77,W
538 0672: MOVWF 23 540 0672: MOVWF 23
539 .................... t = (float)(MSB+t); 541 .................... t = (float)(MSB+t);
540 0673: CLRF 29 542 0673: CLRF 29
541 0674: MOVF 21,W 543 0674: MOVF 21,W
542 0675: MOVWF 28 544 0675: MOVWF 28
543 0676: BTFSC 28.7 545 0676: BTFSC 28.7
544 0677: DECF 29,F 546 0677: DECF 29,F
545 0678: GOTO 207 547 0678: GOTO 207
546 0679: BCF 03.1 548 0679: BCF 03.1
547 067A: MOVF 7A,W 549 067A: MOVF 7A,W
548 067B: MOVWF 2B 550 067B: MOVWF 2B
549 067C: MOVF 79,W 551 067C: MOVF 79,W
550 067D: MOVWF 2A 552 067D: MOVWF 2A
551 067E: MOVF 78,W 553 067E: MOVF 78,W
552 067F: MOVWF 29 554 067F: MOVWF 29
553 0680: MOVF 77,W 555 0680: MOVF 77,W
554 0681: MOVWF 28 556 0681: MOVWF 28
555 0682: MOVF 26,W 557 0682: MOVF 26,W
556 0683: MOVWF 2F 558 0683: MOVWF 2F
557 0684: MOVF 25,W 559 0684: MOVF 25,W
558 0685: MOVWF 2E 560 0685: MOVWF 2E
559 0686: MOVF 24,W 561 0686: MOVF 24,W
560 0687: MOVWF 2D 562 0687: MOVWF 2D
561 0688: MOVF 23,W 563 0688: MOVF 23,W
562 0689: MOVWF 2C 564 0689: MOVWF 2C
563 068A: GOTO 22E 565 068A: GOTO 22E
564 068B: MOVF 7A,W 566 068B: MOVF 7A,W
565 068C: MOVWF 26 567 068C: MOVWF 26
566 068D: MOVF 79,W 568 068D: MOVF 79,W
567 068E: MOVWF 25 569 068E: MOVWF 25
568 068F: MOVF 78,W 570 068F: MOVF 78,W
569 0690: MOVWF 24 571 0690: MOVWF 24
570 0691: MOVF 77,W 572 0691: MOVF 77,W
571 0692: MOVWF 23 573 0692: MOVWF 23
572 .................... 574 ....................
573 .................... printf("Teplota: %f (C)\r\n", t); 575 .................... printf("Teplota: %f (C)\r\n", t);
574 0693: MOVLW 1C 576 0693: MOVLW 1C
575 0694: BSF 03.6 577 0694: BSF 03.6
576 0695: MOVWF 0D 578 0695: MOVWF 0D
577 0696: MOVLW 00 579 0696: MOVLW 00
578 0697: MOVWF 0F 580 0697: MOVWF 0F
579 0698: BCF 03.0 581 0698: BCF 03.0
580 0699: MOVLW 09 582 0699: MOVLW 09
581 069A: BCF 03.6 583 069A: BCF 03.6
582 069B: MOVWF 27 584 069B: MOVWF 27
583 069C: CALL 371 585 069C: CALL 371
584 069D: MOVLW 89 586 069D: MOVLW 89
585 069E: MOVWF 04 587 069E: MOVWF 04
586 069F: MOVF 26,W 588 069F: MOVF 26,W
587 06A0: MOVWF 2A 589 06A0: MOVWF 2A
588 06A1: MOVF 25,W 590 06A1: MOVF 25,W
589 06A2: MOVWF 29 591 06A2: MOVWF 29
590 06A3: MOVF 24,W 592 06A3: MOVF 24,W
591 06A4: MOVWF 28 593 06A4: MOVWF 28
592 06A5: MOVF 23,W 594 06A5: MOVF 23,W
593 06A6: MOVWF 27 595 06A6: MOVWF 27
594 06A7: MOVLW 02 596 06A7: MOVLW 02
595 06A8: MOVWF 2B 597 06A8: MOVWF 2B
596 06A9: GOTO 402 598 06A9: GOTO 402
597 06AA: MOVLW 21 599 06AA: MOVLW 21
598 06AB: BSF 03.6 600 06AB: BSF 03.6
599 06AC: MOVWF 0D 601 06AC: MOVWF 0D
600 06AD: MOVLW 00 602 06AD: MOVLW 00
601 06AE: MOVWF 0F 603 06AE: MOVWF 0F
602 06AF: BSF 03.0 604 06AF: BSF 03.0
603 06B0: MOVLW 06 605 06B0: MOVLW 06
604 06B1: BCF 03.6 606 06B1: BCF 03.6
605 06B2: MOVWF 27 607 06B2: MOVWF 27
606 06B3: CALL 371 608 06B3: CALL 371
607 .................... delay_ms(500); 609 .................... delay_ms(500);
608 06B4: MOVLW 02 610 06B4: MOVLW 02
609 06B5: MOVWF 27 611 06B5: MOVWF 27
610 06B6: MOVLW FA 612 06B6: MOVLW FA
611 06B7: MOVWF 28 613 06B7: MOVWF 28
612 06B8: GOTO 55E 614 06B8: GOTO 55E
613 06B9: DECFSZ 27,F 615 06B9: DECFSZ 27,F
614 06BA: GOTO 6B6 616 06BA: GOTO 6B6
615 .................... } 617 .................... }
616 06BB: GOTO 5E3 618 06BB: GOTO 5E3
617 .................... } 619 .................... }
618 .................... 620 ....................
619 06BC: SLEEP 621 06BC: SLEEP
620   622  
621 Configuration Fuses: 623 Configuration Fuses:
622 Word 1: 2CF5 INTRC NOWDT NOPUT MCLR NOPROTECT NOCPD NOBROWNOUT IESO FCMEN NOLVP NODEBUG 624 Word 1: 2CF5 INTRC NOWDT NOPUT MCLR NOPROTECT NOCPD NOBROWNOUT IESO FCMEN NOLVP NODEBUG
623 Word 2: 3FFF NOWRT BORV40 625 Word 2: 3FFF NOWRT BORV40