Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
66 | jan-hendri | 1 | 1 .file "analog.c" |
2 | 2 __SREG__ = 0x3f |
||
3 | 3 __SP_H__ = 0x3e |
||
4 | 4 __SP_L__ = 0x3d |
||
5 | 5 __tmp_reg__ = 0 |
||
6 | 6 __zero_reg__ = 1 |
||
7 | 7 .global __do_copy_data |
||
8 | 8 .global __do_clear_bss |
||
9 | 11 .text |
||
10 | 12 .Ltext0: |
||
11 | 100 .global ADC_Init |
||
12 | 102 ADC_Init: |
||
13 | 103 .stabd 46,0,0 |
||
14 | 1:src/analog.c **** /*############################################################################ |
||
15 | 2:src/analog.c **** |
||
16 | 3:src/analog.c **** ############################################################################*/ |
||
17 | 4:src/analog.c **** |
||
18 | 5:src/analog.c **** #include "main.h" |
||
19 | 6:src/analog.c **** |
||
20 | 7:src/analog.c **** //############################################################################ |
||
21 | 8:src/analog.c **** //Init ADC |
||
22 | 9:src/analog.c **** void ADC_Init(void) |
||
23 | 10:src/analog.c **** //############################################################################ |
||
24 | 11:src/analog.c **** { |
||
25 | 105 .LM0: |
||
26 | 106 .LFBB1: |
||
27 | 107 /* prologue: frame size=0 */ |
||
28 | 108 /* prologue end (size=0) */ |
||
29 | 12:src/analog.c **** ADCSRA = 0xA6; // Free Run & 1MHZ |
||
30 | 110 .LM1: |
||
31 | 111 0000 86EA ldi r24,lo8(-90) |
||
32 | 112 0002 86B9 out 38-0x20,r24 |
||
33 | 13:src/analog.c **** ADMUX = 7; // Kanal 7 |
||
34 | 114 .LM2: |
||
35 | 115 0004 87E0 ldi r24,lo8(7) |
||
36 | 116 0006 87B9 out 39-0x20,r24 |
||
37 | 14:src/analog.c **** ADCSRA |= 0x40; // Start |
||
38 | 118 .LM3: |
||
39 | 119 0008 369A sbi 38-0x20,6 |
||
40 | 120 /* epilogue: frame size=0 */ |
||
41 | 121 000a 0895 ret |
||
42 | 122 /* epilogue end (size=1) */ |
||
43 | 123 /* function ADC_Init size 6 (5) */ |
||
44 | 125 .Lscope1: |
||
45 | 127 .stabd 78,0,0 |
||
46 | 129 .global AdConvert |
||
47 | 131 AdConvert: |
||
48 | 132 .stabd 46,0,0 |
||
49 | 15:src/analog.c **** } |
||
50 | 16:src/analog.c **** |
||
51 | 17:src/analog.c **** //############################################################################ |
||
52 | 18:src/analog.c **** //Strom Analogwerte lesen |
||
53 | 19:src/analog.c **** void AdConvert(void) |
||
54 | 20:src/analog.c **** //############################################################################ |
||
55 | 21:src/analog.c **** { |
||
56 | 134 .LM4: |
||
57 | 135 .LFBB2: |
||
58 | 136 /* prologue: frame size=0 */ |
||
59 | 137 /* prologue end (size=0) */ |
||
60 | 22:src/analog.c **** unsigned int i=0; |
||
61 | 23:src/analog.c **** unsigned char sense; |
||
62 | 24:src/analog.c **** sense = ADMUX; // Sense-Kanal merken |
||
63 | 139 .LM5: |
||
64 | 140 000c 27B1 in r18,39-0x20 |
||
65 | 25:src/analog.c **** ADMUX = 0x06; // Kanal 6 |
||
66 | 142 .LM6: |
||
67 | 143 000e 96E0 ldi r25,lo8(6) |
||
68 | 144 0010 97B9 out 39-0x20,r25 |
||
69 | 26:src/analog.c **** SFIOR = 0x00; // Analog Comperator aus |
||
70 | 146 .LM7: |
||
71 | 147 0012 10BE out 80-0x20,__zero_reg__ |
||
72 | 27:src/analog.c **** ADCSRA = 0xD3; // Converter ein, single |
||
73 | 149 .LM8: |
||
74 | 150 0014 83ED ldi r24,lo8(-45) |
||
75 | 151 0016 86B9 out 38-0x20,r24 |
||
76 | 28:src/analog.c **** ADCSRA |= 0x10; // Ready löschen |
||
77 | 153 .LM9: |
||
78 | 154 0018 349A sbi 38-0x20,4 |
||
79 | 29:src/analog.c **** ADMUX = 0x06; // Kanal 6 |
||
80 | 156 .LM10: |
||
81 | 157 001a 97B9 out 39-0x20,r25 |
||
82 | 30:src/analog.c **** ADCSRA |= 0x40; // Start |
||
83 | 159 .LM11: |
||
84 | 160 001c 369A sbi 38-0x20,6 |
||
85 | 161 .L4: |
||
86 | 31:src/analog.c **** while (((ADCSRA & 0x10) == 0)); |
||
87 | 163 .LM12: |
||
88 | 164 001e 349B sbis 38-0x20,4 |
||
89 | 165 0020 00C0 rjmp .L4 |
||
90 | 32:src/analog.c **** ADMUX = sense; // zurück auf den Sense-Kanal |
||
91 | 167 .LM13: |
||
92 | 168 0022 27B9 out 39-0x20,r18 |
||
93 | 33:src/analog.c **** i = ADCW * 4; |
||
94 | 170 .LM14: |
||
95 | 171 0024 84B1 in r24,36-0x20 |
||
96 | 172 0026 95B1 in r25,(36)+1-0x20 |
||
97 | 34:src/analog.c **** // if(i > 300) i = 300; |
||
98 | 35:src/analog.c **** Strom = (i + Strom * 7) / 8; |
||
99 | 174 .LM15: |
||
100 | 175 0028 2091 0000 lds r18,Strom |
||
101 | 176 002c 3091 0000 lds r19,(Strom)+1 |
||
102 | 177 0030 A901 movw r20,r18 |
||
103 | 178 0032 63E0 ldi r22,3 |
||
104 | 179 0034 440F 1: lsl r20 |
||
105 | 180 0036 551F rol r21 |
||
106 | 181 0038 6A95 dec r22 |
||
107 | 182 003a 01F4 brne 1b |
||
108 | 183 003c 421B sub r20,r18 |
||
109 | 184 003e 530B sbc r21,r19 |
||
110 | 185 0040 880F lsl r24 |
||
111 | 186 0042 991F rol r25 |
||
112 | 187 0044 880F lsl r24 |
||
113 | 188 0046 991F rol r25 |
||
114 | 189 0048 480F add r20,r24 |
||
115 | 190 004a 591F adc r21,r25 |
||
116 | 191 004c 83E0 ldi r24,3 |
||
117 | 192 004e 5695 1: lsr r21 |
||
118 | 193 0050 4795 ror r20 |
||
119 | 194 0052 8A95 dec r24 |
||
120 | 195 0054 01F4 brne 1b |
||
121 | 196 0056 5093 0000 sts (Strom)+1,r21 |
||
122 | 197 005a 4093 0000 sts Strom,r20 |
||
123 | 36:src/analog.c **** if (Strom_max < Strom) Strom_max = Strom; |
||
124 | 199 .LM16: |
||
125 | 200 005e 8091 0000 lds r24,Strom_max |
||
126 | 201 0062 9927 clr r25 |
||
127 | 202 0064 8417 cp r24,r20 |
||
128 | 203 0066 9507 cpc r25,r21 |
||
129 | 204 0068 00F4 brsh .L6 |
||
130 | 205 006a 4093 0000 sts Strom_max,r20 |
||
131 | 206 .L6: |
||
132 | 37:src/analog.c **** ADCSRA = 0x00; |
||
133 | 208 .LM17: |
||
134 | 209 006e 16B8 out 38-0x20,__zero_reg__ |
||
135 | 38:src/analog.c **** SFIOR = 0x08; // Analog Comperator ein |
||
136 | 211 .LM18: |
||
137 | 212 0070 88E0 ldi r24,lo8(8) |
||
138 | 213 0072 80BF out 80-0x20,r24 |
||
139 | 214 /* epilogue: frame size=0 */ |
||
140 | 215 0074 0895 ret |
||
141 | 216 /* epilogue end (size=1) */ |
||
142 | 217 /* function AdConvert size 53 (52) */ |
||
143 | 222 .Lscope2: |
||
144 | 224 .stabd 78,0,0 |
||
145 | 227 .global MessAD |
||
146 | 229 MessAD: |
||
147 | 230 .stabd 46,0,0 |
||
148 | 39:src/analog.c **** } |
||
149 | 40:src/analog.c **** |
||
150 | 41:src/analog.c **** |
||
151 | 42:src/analog.c **** |
||
152 | 43:src/analog.c **** //############################################################################ |
||
153 | 44:src/analog.c **** //Strom Analogwerte lesen |
||
154 | 45:src/analog.c **** unsigned int MessAD(unsigned char channel) |
||
155 | 46:src/analog.c **** //############################################################################ |
||
156 | 47:src/analog.c **** { |
||
157 | 232 .LM19: |
||
158 | 233 .LFBB3: |
||
159 | 234 /* prologue: frame size=0 */ |
||
160 | 235 /* prologue end (size=0) */ |
||
161 | 48:src/analog.c **** unsigned char sense; |
||
162 | 49:src/analog.c **** sense = ADMUX; // Sense-Kanal merken |
||
163 | 237 .LM20: |
||
164 | 238 0076 27B1 in r18,39-0x20 |
||
165 | 50:src/analog.c **** ADMUX = channel; // Kanal 6 |
||
166 | 240 .LM21: |
||
167 | 241 0078 87B9 out 39-0x20,r24 |
||
168 | 51:src/analog.c **** SFIOR = 0x00; // Analog Comperator aus |
||
169 | 243 .LM22: |
||
170 | 244 007a 10BE out 80-0x20,__zero_reg__ |
||
171 | 52:src/analog.c **** ADCSRA = 0xD3; // Converter ein, single |
||
172 | 246 .LM23: |
||
173 | 247 007c 93ED ldi r25,lo8(-45) |
||
174 | 248 007e 96B9 out 38-0x20,r25 |
||
175 | 53:src/analog.c **** ADCSRA |= 0x10; // Ready löschen |
||
176 | 250 .LM24: |
||
177 | 251 0080 349A sbi 38-0x20,4 |
||
178 | 54:src/analog.c **** ADMUX = channel; // Kanal 6 |
||
179 | 253 .LM25: |
||
180 | 254 0082 87B9 out 39-0x20,r24 |
||
181 | 55:src/analog.c **** ADCSRA |= 0x40; // Start |
||
182 | 256 .LM26: |
||
183 | 257 0084 369A sbi 38-0x20,6 |
||
184 | 258 .L12: |
||
185 | 56:src/analog.c **** while (((ADCSRA & 0x10) == 0)); |
||
186 | 260 .LM27: |
||
187 | 261 0086 349B sbis 38-0x20,4 |
||
188 | 262 0088 00C0 rjmp .L12 |
||
189 | 57:src/analog.c **** ADMUX = sense; // zurück auf den Sense-Kanal |
||
190 | 264 .LM28: |
||
191 | 265 008a 27B9 out 39-0x20,r18 |
||
192 | 58:src/analog.c **** ADCSRA = 0x00; |
||
193 | 267 .LM29: |
||
194 | 268 008c 16B8 out 38-0x20,__zero_reg__ |
||
195 | 59:src/analog.c **** SFIOR = 0x08; // Analog Comperator ein |
||
196 | 270 .LM30: |
||
197 | 271 008e 88E0 ldi r24,lo8(8) |
||
198 | 272 0090 80BF out 80-0x20,r24 |
||
199 | 60:src/analog.c **** return(ADCW); |
||
200 | 274 .LM31: |
||
201 | 275 0092 84B1 in r24,36-0x20 |
||
202 | 276 0094 95B1 in r25,(36)+1-0x20 |
||
203 | 277 /* epilogue: frame size=0 */ |
||
204 | 278 0096 0895 ret |
||
205 | 279 /* epilogue end (size=1) */ |
||
206 | 280 /* function MessAD size 17 (16) */ |
||
207 | 285 .Lscope3: |
||
208 | 287 .stabd 78,0,0 |
||
209 | 289 .global FastADConvert |
||
210 | 291 FastADConvert: |
||
211 | 292 .stabd 46,0,0 |
||
212 | 61:src/analog.c **** } |
||
213 | 62:src/analog.c **** |
||
214 | 63:src/analog.c **** //############################################################################ |
||
215 | 64:src/analog.c **** //Strom Analogwerte lesen |
||
216 | 65:src/analog.c **** void FastADConvert(void) |
||
217 | 66:src/analog.c **** //############################################################################ |
||
218 | 67:src/analog.c **** { |
||
219 | 294 .LM32: |
||
220 | 295 .LFBB4: |
||
221 | 296 /* prologue: frame size=0 */ |
||
222 | 297 /* prologue end (size=0) */ |
||
223 | 68:src/analog.c **** unsigned int i=0; |
||
224 | 69:src/analog.c **** i = MessAD(6) * 4; |
||
225 | 299 .LM33: |
||
226 | 300 0098 86E0 ldi r24,lo8(6) |
||
227 | 301 009a 00D0 rcall MessAD |
||
228 | 302 009c 9C01 movw r18,r24 |
||
229 | 303 009e 220F lsl r18 |
||
230 | 304 00a0 331F rol r19 |
||
231 | 305 00a2 220F lsl r18 |
||
232 | 306 00a4 331F rol r19 |
||
233 | 307 00a6 293C cpi r18,201 |
||
234 | 308 00a8 3105 cpc r19,__zero_reg__ |
||
235 | 309 00aa 00F0 brlo .L18 |
||
236 | 311 .LM34: |
||
237 | 312 00ac 28EC ldi r18,lo8(200) |
||
238 | 313 00ae 30E0 ldi r19,hi8(200) |
||
239 | 314 .L18: |
||
240 | 70:src/analog.c **** // i = ADCW * 4; |
||
241 | 71:src/analog.c **** if(i > 200) i = 200; |
||
242 | 72:src/analog.c **** Strom = i;//(i + Strom * 1) / 2; |
||
243 | 316 .LM35: |
||
244 | 317 00b0 3093 0000 sts (Strom)+1,r19 |
||
245 | 318 00b4 2093 0000 sts Strom,r18 |
||
246 | 73:src/analog.c **** if (Strom_max < Strom) Strom_max = Strom; |
||
247 | 320 .LM36: |
||
248 | 321 00b8 8091 0000 lds r24,Strom_max |
||
249 | 322 00bc 9927 clr r25 |
||
250 | 323 00be 8217 cp r24,r18 |
||
251 | 324 00c0 9307 cpc r25,r19 |
||
252 | 325 00c2 00F4 brsh .L19 |
||
253 | 326 00c4 2093 0000 sts Strom_max,r18 |
||
254 | 327 .L19: |
||
255 | 74:src/analog.c **** ADCSRA = 0x00; |
||
256 | 329 .LM37: |
||
257 | 330 00c8 16B8 out 38-0x20,__zero_reg__ |
||
258 | 75:src/analog.c **** SFIOR = 0x08; // Analog Comperator ein |
||
259 | 332 .LM38: |
||
260 | 333 00ca 88E0 ldi r24,lo8(8) |
||
261 | 334 00cc 80BF out 80-0x20,r24 |
||
262 | 335 /* epilogue: frame size=0 */ |
||
263 | 336 00ce 0895 ret |
||
264 | 337 /* epilogue end (size=1) */ |
||
265 | 338 /* function FastADConvert size 28 (27) */ |
||
266 | 340 .Lscope4: |
||
267 | 342 .stabd 78,0,0 |
||
268 | 344 .Letext0: |
||
269 | 345 /* File "src/analog.c": code 104 = 0x0068 ( 100), prologues 0, epilogues 4 */ |
||
270 | DEFINED SYMBOLS |
||
271 | *ABS*:00000000 analog.c |
||
272 | /tmp/ccjrtWT0.s:2 *ABS*:0000003f __SREG__ |
||
273 | /tmp/ccjrtWT0.s:3 *ABS*:0000003e __SP_H__ |
||
274 | /tmp/ccjrtWT0.s:4 *ABS*:0000003d __SP_L__ |
||
275 | /tmp/ccjrtWT0.s:5 *ABS*:00000000 __tmp_reg__ |
||
276 | /tmp/ccjrtWT0.s:6 *ABS*:00000001 __zero_reg__ |
||
277 | /tmp/ccjrtWT0.s:102 .text:00000000 ADC_Init |
||
278 | /tmp/ccjrtWT0.s:131 .text:0000000c AdConvert |
||
279 | /tmp/ccjrtWT0.s:229 .text:00000076 MessAD |
||
280 | /tmp/ccjrtWT0.s:291 .text:00000098 FastADConvert |
||
281 | |||
282 | UNDEFINED SYMBOLS |
||
283 | __do_copy_data |
||
284 | __do_clear_bss |
||
285 | Strom |
||
286 | Strom_max |