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