Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
116 | - | 1 | |
2 | BrushLess-Ctrl_V0_41_10A.elf: file format elf32-avr |
||
3 | |||
4 | Sections: |
||
5 | Idx Name Size VMA LMA File off Algn |
||
6 | |||
7 | CONTENTS, ALLOC, LOAD, READONLY, CODE |
||
8 | 1 .data 00000018 00800060 00001bca 00001c5e 2**0 |
||
9 | CONTENTS, ALLOC, LOAD, DATA |
||
10 | 2 .bss 00000328 00800078 00800078 00001c76 2**0 |
||
11 | ALLOC |
||
12 | 3 .debug_aranges 000000e0 00000000 00000000 00001c76 2**0 |
||
13 | CONTENTS, READONLY, DEBUGGING |
||
14 | 4 .debug_pubnames 000005da 00000000 00000000 00001d56 2**0 |
||
15 | CONTENTS, READONLY, DEBUGGING |
||
16 | 5 .debug_info 00001379 00000000 00000000 00002330 2**0 |
||
17 | CONTENTS, READONLY, DEBUGGING |
||
18 | 6 .debug_abbrev 0000077a 00000000 00000000 000036a9 2**0 |
||
19 | CONTENTS, READONLY, DEBUGGING |
||
20 | 7 .debug_line 00001739 00000000 00000000 00003e23 2**0 |
||
21 | CONTENTS, READONLY, DEBUGGING |
||
22 | 8 .debug_frame 000002e0 00000000 00000000 0000555c 2**2 |
||
23 | CONTENTS, READONLY, DEBUGGING |
||
24 | 9 .debug_str 000005bf 00000000 00000000 0000583c 2**0 |
||
25 | CONTENTS, READONLY, DEBUGGING |
||
26 | 10 .debug_loc 0000073a 00000000 00000000 00005dfb 2**0 |
||
27 | CONTENTS, READONLY, DEBUGGING |
||
28 | 11 .debug_ranges 00000018 00000000 00000000 00006535 2**0 |
||
29 | CONTENTS, READONLY, DEBUGGING |
||
30 | |||
31 | Disassembly of section .text: |
||
32 | |||
33 | 00000000 <__vectors>: |
||
34 | 0: 12 c0 rjmp .+36 ; 0x26 <__ctors_end> |
||
35 | 2: 50 ca rjmp .-2912 ; 0xfffff4a4 <__eeprom_end+0xff7ef4a4> |
||
36 | 4: 2b c0 rjmp .+86 ; 0x5c <__bad_interrupt> |
||
37 | 6: 2a c0 rjmp .+84 ; 0x5c <__bad_interrupt> |
||
38 | 8: b5 ca rjmp .-2710 ; 0xfffff574 <__eeprom_end+0xff7ef574> |
||
39 | a: b5 c9 rjmp .-3222 ; 0xfffff376 <__eeprom_end+0xff7ef376> |
||
40 | c: 27 c0 rjmp .+78 ; 0x5c <__bad_interrupt> |
||
41 | e: 26 c0 rjmp .+76 ; 0x5c <__bad_interrupt> |
||
42 | 10: a1 c9 rjmp .-3262 ; 0xfffff354 <__eeprom_end+0xff7ef354> |
||
43 | 12: a9 c8 rjmp .-3758 ; 0xfffff166 <__eeprom_end+0xff7ef166> |
||
44 | 14: 23 c0 rjmp .+70 ; 0x5c <__bad_interrupt> |
||
45 | 16: 65 c7 rjmp .+3786 ; 0xee2 <__vector_11> |
||
46 | 18: 21 c0 rjmp .+66 ; 0x5c <__bad_interrupt> |
||
47 | 1a: 3a c6 rjmp .+3188 ; 0xc90 <__vector_13> |
||
48 | 1c: 1f c0 rjmp .+62 ; 0x5c <__bad_interrupt> |
||
49 | 1e: 1e c0 rjmp .+60 ; 0x5c <__bad_interrupt> |
||
50 | 20: 22 cb rjmp .-2492 ; 0xfffff666 <__eeprom_end+0xff7ef666> |
||
51 | 22: 57 ca rjmp .-2898 ; 0xfffff4d2 <__eeprom_end+0xff7ef4d2> |
||
52 | 24: 1b c0 rjmp .+54 ; 0x5c <__bad_interrupt> |
||
53 | |||
54 | 00000026 <__ctors_end>: |
||
55 | 26: 11 24 eor r1, r1 |
||
56 | 28: 1f be out 0x3f, r1 ; 63 |
||
57 | 2a: cf e5 ldi r28, 0x5F ; 95 |
||
58 | 2c: d4 e0 ldi r29, 0x04 ; 4 |
||
59 | 2e: de bf out 0x3e, r29 ; 62 |
||
60 | 30: cd bf out 0x3d, r28 ; 61 |
||
61 | |||
62 | 00000032 <__do_copy_data>: |
||
63 | 32: 10 e0 ldi r17, 0x00 ; 0 |
||
64 | 34: a0 e6 ldi r26, 0x60 ; 96 |
||
65 | 36: b0 e0 ldi r27, 0x00 ; 0 |
||
66 | 38: ea ec ldi r30, 0xCA ; 202 |
||
67 | 3a: fb e1 ldi r31, 0x1B ; 27 |
||
68 | 3c: 02 c0 rjmp .+4 ; 0x42 <.do_copy_data_start> |
||
69 | |||
70 | 0000003e <.do_copy_data_loop>: |
||
71 | 3e: 05 90 lpm r0, Z+ |
||
72 | 40: 0d 92 st X+, r0 |
||
73 | |||
74 | 00000042 <.do_copy_data_start>: |
||
75 | 42: a8 37 cpi r26, 0x78 ; 120 |
||
76 | 44: b1 07 cpc r27, r17 |
||
77 | 46: d9 f7 brne .-10 ; 0x3e <.do_copy_data_loop> |
||
78 | |||
79 | 00000048 <__do_clear_bss>: |
||
80 | 48: 13 e0 ldi r17, 0x03 ; 3 |
||
81 | 4a: a8 e7 ldi r26, 0x78 ; 120 |
||
82 | 4c: b0 e0 ldi r27, 0x00 ; 0 |
||
83 | 4e: 01 c0 rjmp .+2 ; 0x52 <.do_clear_bss_start> |
||
84 | |||
85 | 00000050 <.do_clear_bss_loop>: |
||
86 | 50: 1d 92 st X+, r1 |
||
87 | |||
88 | 00000052 <.do_clear_bss_start>: |
||
89 | 52: a0 3a cpi r26, 0xA0 ; 160 |
||
90 | 54: b1 07 cpc r27, r17 |
||
91 | 56: e1 f7 brne .-8 ; 0x50 <.do_clear_bss_loop> |
||
92 | 58: 46 d4 rcall .+2188 ; 0x8e6 <main> |
||
93 | 5a: b5 cd rjmp .-1174 ; 0xfffffbc6 <__eeprom_end+0xff7efbc6> |
||
94 | |||
95 | 0000005c <__bad_interrupt>: |
||
96 | 5c: d1 cf rjmp .-94 ; 0x0 <__vectors> |
||
97 | |||
98 | 0000005e <SetPWM>: |
||
99 | // |
||
100 | void SetPWM(void) |
||
101 | //############################################################################ |
||
102 | { |
||
103 | unsigned char tmp_pwm; |
||
104 | tmp_pwm = PWM; |
||
105 | 5e: 40 91 78 00 lds r20, 0x0078 |
||
106 | if(tmp_pwm > MaxPWM) // Strombegrenzung |
||
107 | 62: 80 91 64 00 lds r24, 0x0064 |
||
108 | 66: 84 17 cp r24, r20 |
||
109 | 68: 10 f4 brcc .+4 ; 0x6e <SetPWM+0x10> |
||
110 | { |
||
111 | tmp_pwm = MaxPWM; |
||
112 | PORTC |= ROT; |
||
113 | 6a: ab 9a sbi 0x15, 3 ; 21 |
||
114 | 6c: 48 2f mov r20, r24 |
||
115 | } |
||
116 | if(Strom > MAX_STROM) // Strombegrenzung |
||
117 | 6e: 20 91 7a 00 lds r18, 0x007A |
||
118 | 72: 30 91 7b 00 lds r19, 0x007B |
||
119 | 76: 29 3c cpi r18, 0xC9 ; 201 |
||
120 | 78: 31 05 cpc r19, r1 |
||
121 | 7a: c8 f0 brcs .+50 ; 0xae <SetPWM+0x50> |
||
122 | { |
||
123 | OCR1A = 0; OCR1B = 0; OCR2 = 0; |
||
124 | 7c: 1b bc out 0x2b, r1 ; 43 |
||
125 | 7e: 1a bc out 0x2a, r1 ; 42 |
||
126 | 80: 19 bc out 0x29, r1 ; 41 |
||
127 | 82: 18 bc out 0x28, r1 ; 40 |
||
128 | 84: 13 bc out 0x23, r1 ; 35 |
||
129 | PORTD &= ~0x38; |
||
130 | 86: 82 b3 in r24, 0x12 ; 18 |
||
131 | 88: 87 7c andi r24, 0xC7 ; 199 |
||
132 | 8a: 82 bb out 0x12, r24 ; 18 |
||
133 | PORTC |= ROT; |
||
134 | 8c: ab 9a sbi 0x15, 3 ; 21 |
||
135 | DebugOut.Analog[6]++; |
||
136 | 8e: 80 91 90 03 lds r24, 0x0390 |
||
137 | 92: 90 91 91 03 lds r25, 0x0391 |
||
138 | 96: 01 96 adiw r24, 0x01 ; 1 |
||
139 | 98: 90 93 91 03 sts 0x0391, r25 |
||
140 | 9c: 80 93 90 03 sts 0x0390, r24 |
||
141 | Strom--; |
||
142 | a0: 21 50 subi r18, 0x01 ; 1 |
||
143 | a2: 30 40 sbci r19, 0x00 ; 0 |
||
144 | a4: 30 93 7b 00 sts 0x007B, r19 |
||
145 | a8: 20 93 7a 00 sts 0x007A, r18 |
||
146 | ac: 08 95 ret |
||
147 | OCR1A = tmp_pwm; OCR1B = tmp_pwm; OCR2 = tmp_pwm; |
||
148 | #endif |
||
149 | |||
150 | #ifdef _16KHZ |
||
151 | //OCR1A = 2 * (int)tmp_pwm; OCR1B = 2 * (int)tmp_pwm; OCR2 = tmp_pwm; |
||
152 | OCR1A = tmp_pwm; OCR1B = tmp_pwm; OCR2 = tmp_pwm; |
||
153 | ae: 84 2f mov r24, r20 |
||
154 | b0: 90 e0 ldi r25, 0x00 ; 0 |
||
155 | b2: 9b bd out 0x2b, r25 ; 43 |
||
156 | b4: 8a bd out 0x2a, r24 ; 42 |
||
157 | b6: 99 bd out 0x29, r25 ; 41 |
||
158 | b8: 88 bd out 0x28, r24 ; 40 |
||
159 | ba: 43 bd out 0x23, r20 ; 35 |
||
160 | bc: 08 95 ret |
||
161 | |||
162 | 000000be <DebugAusgaben>: |
||
163 | } |
||
164 | } |
||
165 | |||
166 | void DebugAusgaben(void) |
||
167 | { |
||
168 | DebugOut.Analog[0] = Strom; |
||
169 | be: e4 e8 ldi r30, 0x84 ; 132 |
||
170 | c0: f3 e0 ldi r31, 0x03 ; 3 |
||
171 | c2: 80 91 7a 00 lds r24, 0x007A |
||
172 | c6: 90 91 7b 00 lds r25, 0x007B |
||
173 | ca: 90 93 85 03 sts 0x0385, r25 |
||
174 | ce: 80 93 84 03 sts 0x0384, r24 |
||
175 | DebugOut.Analog[1] = Mittelstrom; |
||
176 | d2: 80 91 7d 00 lds r24, 0x007D |
||
177 | d6: 80 93 86 03 sts 0x0386, r24 |
||
178 | da: 13 82 std Z+3, r1 ; 0x03 |
||
179 | DebugOut.Analog[2] = SIO_Drehzahl; |
||
180 | dc: 80 91 8b 00 lds r24, 0x008B |
||
181 | e0: 90 91 8c 00 lds r25, 0x008C |
||
182 | e4: 90 93 89 03 sts 0x0389, r25 |
||
183 | e8: 80 93 88 03 sts 0x0388, r24 |
||
184 | DebugOut.Analog[3] = PPM_Signal; |
||
185 | ec: 80 91 a5 00 lds r24, 0x00A5 |
||
186 | f0: 90 91 a6 00 lds r25, 0x00A6 |
||
187 | f4: 90 93 8b 03 sts 0x038B, r25 |
||
188 | f8: 80 93 8a 03 sts 0x038A, r24 |
||
189 | DebugOut.Analog[4] = OCR2; |
||
190 | fc: 83 b5 in r24, 0x23 ; 35 |
||
191 | fe: 80 93 8c 03 sts 0x038C, r24 |
||
192 | 102: 11 86 std Z+9, r1 ; 0x09 |
||
193 | // DebugOut.Analog[5] = PWM; |
||
194 | } |
||
195 | 104: 08 95 ret |
||
196 | |||
197 | 00000106 <PWM_Init>: |
||
198 | //############################################################################ |
||
199 | // |
||
200 | void PWM_Init(void) |
||
201 | //############################################################################ |
||
202 | { |
||
203 | PWM_OFF; |
||
204 | 106: 1b bc out 0x2b, r1 ; 43 |
||
205 | 108: 1a bc out 0x2a, r1 ; 42 |
||
206 | 10a: 19 bc out 0x29, r1 ; 41 |
||
207 | 10c: 18 bc out 0x28, r1 ; 40 |
||
208 | 10e: 13 bc out 0x23, r1 ; 35 |
||
209 | 110: 91 e0 ldi r25, 0x01 ; 1 |
||
210 | 112: 9f bd out 0x2f, r25 ; 47 |
||
211 | 114: 81 e4 ldi r24, 0x41 ; 65 |
||
212 | 116: 85 bd out 0x25, r24 ; 37 |
||
213 | 118: 8e e0 ldi r24, 0x0E ; 14 |
||
214 | 11a: 87 bb out 0x17, r24 ; 23 |
||
215 | 11c: 88 b3 in r24, 0x18 ; 24 |
||
216 | 11e: 81 7f andi r24, 0xF1 ; 241 |
||
217 | 120: 88 bb out 0x18, r24 ; 24 |
||
218 | TCCR1B = (1 << CS10) | (0 << CS11) | (0 << CS12) | (0 << WGM12) | |
||
219 | 122: 9e bd out 0x2e, r25 ; 46 |
||
220 | (0 << WGM13) | (0<< ICES1) | (0 << ICNC1); |
||
221 | /* TCCR1B = (1 << CS10) | (0 << CS11) | (0 << CS12) | (1 << WGM12) | |
||
222 | (0 << WGM13) | (0<< ICES1) | (0 << ICNC1); |
||
223 | */ |
||
224 | } |
||
225 | 124: 08 95 ret |
||
226 | |||
227 | 00000126 <Wait>: |
||
228 | //############################################################################ |
||
229 | // |
||
230 | void Wait(unsigned char dauer) |
||
231 | //############################################################################ |
||
232 | { |
||
233 | dauer = (unsigned char)TCNT0 + dauer; |
||
234 | 126: 92 b7 in r25, 0x32 ; 50 |
||
235 | 128: 98 0f add r25, r24 |
||
236 | while((TCNT0 - dauer) & 0x80); |
||
237 | 12a: 82 b7 in r24, 0x32 ; 50 |
||
238 | 12c: 89 1b sub r24, r25 |
||
239 | 12e: 87 fd sbrc r24, 7 |
||
240 | 130: fc cf rjmp .-8 ; 0x12a <Wait+0x4> |
||
241 | } |
||
242 | 132: 08 95 ret |
||
243 | |||
244 | 00000134 <Delay>: |
||
245 | } |
||
246 | return(0); |
||
247 | } |
||
248 | |||
249 | unsigned char Delay(unsigned int timer) |
||
250 | { |
||
251 | 134: 01 c0 rjmp .+2 ; 0x138 <Delay+0x4> |
||
252 | while(timer--) |
||
253 | { |
||
254 | // if(SENSE_H) { PORTC |= ROT; } else { PORTC &= ~ROT;} |
||
255 | asm volatile(""); |
||
256 | 136: 01 97 sbiw r24, 0x01 ; 1 |
||
257 | return(0); |
||
258 | } |
||
259 | |||
260 | unsigned char Delay(unsigned int timer) |
||
261 | { |
||
262 | while(timer--) |
||
263 | 138: 00 97 sbiw r24, 0x00 ; 0 |
||
264 | 13a: e9 f7 brne .-6 ; 0x136 <Delay+0x2> |
||
265 | { |
||
266 | // if(SENSE_H) { PORTC |= ROT; } else { PORTC &= ~ROT;} |
||
267 | asm volatile(""); |
||
268 | } |
||
269 | return(0); |
||
270 | } |
||
271 | 13c: 80 e0 ldi r24, 0x00 ; 0 |
||
272 | 13e: 08 95 ret |
||
273 | |||
274 | 00000140 <SollwertErmittlung>: |
||
275 | unsigned char SollwertErmittlung(void) |
||
276 | //############################################################################ |
||
277 | { |
||
278 | static unsigned int sollwert = 0; |
||
279 | unsigned int ppm; |
||
280 | if(!I2C_Timeout) // bei Erreichen von 0 ist der Wert ungültig |
||
281 | 140: 80 91 80 00 lds r24, 0x0080 |
||
282 | 144: 90 91 81 00 lds r25, 0x0081 |
||
283 | 148: 89 2b or r24, r25 |
||
284 | 14a: 09 f0 breq .+2 ; 0x14e <SollwertErmittlung+0xe> |
||
285 | 14c: 59 c0 rjmp .+178 ; 0x200 <SollwertErmittlung+0xc0> |
||
286 | { |
||
287 | if(SIO_Timeout) // es gibt gültige SIO-Daten |
||
288 | 14e: 80 91 82 00 lds r24, 0x0082 |
||
289 | 152: 90 91 83 00 lds r25, 0x0083 |
||
290 | 156: 89 2b or r24, r25 |
||
291 | 158: 99 f0 breq .+38 ; 0x180 <SollwertErmittlung+0x40> |
||
292 | { |
||
293 | sollwert = (MAX_PWM * (unsigned int) SIO_Sollwert) / 200; // skalieren auf 0-200 = 0-255 |
||
294 | 15a: 90 91 90 00 lds r25, 0x0090 |
||
295 | 15e: 8f ef ldi r24, 0xFF ; 255 |
||
296 | 160: 98 9f mul r25, r24 |
||
297 | 162: c0 01 movw r24, r0 |
||
298 | 164: 11 24 eor r1, r1 |
||
299 | 166: 68 ec ldi r22, 0xC8 ; 200 |
||
300 | 168: 70 e0 ldi r23, 0x00 ; 0 |
||
301 | 16a: 86 db rcall .-2292 ; 0xfffff878 <__eeprom_end+0xff7ef878> |
||
302 | 16c: 70 93 8f 00 sts 0x008F, r23 |
||
303 | 170: 60 93 8e 00 sts 0x008E, r22 |
||
304 | PPM_Betrieb = 0; |
||
305 | 174: 10 92 67 00 sts 0x0067, r1 |
||
306 | ICP_INT_DISABLE; |
||
307 | 178: 89 b7 in r24, 0x39 ; 57 |
||
308 | 17a: 8f 7d andi r24, 0xDF ; 223 |
||
309 | 17c: 89 bf out 0x39, r24 ; 57 |
||
310 | 17e: 31 c0 rjmp .+98 ; 0x1e2 <SollwertErmittlung+0xa2> |
||
311 | PORTC &= ~ROT; |
||
312 | } |
||
313 | else |
||
314 | if(anz_ppm_werte > 20) // es gibt gültige PPM-Daten |
||
315 | 180: 80 91 a9 00 lds r24, 0x00A9 |
||
316 | 184: 85 31 cpi r24, 0x15 ; 21 |
||
317 | 186: 78 f1 brcs .+94 ; 0x1e6 <SollwertErmittlung+0xa6> |
||
318 | { |
||
319 | PPM_Betrieb = 1; |
||
320 | 188: 81 e0 ldi r24, 0x01 ; 1 |
||
321 | 18a: 80 93 67 00 sts 0x0067, r24 |
||
322 | ppm = PPM_Signal; |
||
323 | 18e: 20 91 a5 00 lds r18, 0x00A5 |
||
324 | 192: 30 91 a6 00 lds r19, 0x00A6 |
||
325 | if(ppm > 300) ppm = 0; // ungültiges Signal |
||
326 | 196: 41 e0 ldi r20, 0x01 ; 1 |
||
327 | 198: 2d 32 cpi r18, 0x2D ; 45 |
||
328 | 19a: 34 07 cpc r19, r20 |
||
329 | 19c: 30 f4 brcc .+12 ; 0x1aa <SollwertErmittlung+0x6a> |
||
330 | if(ppm > 200) ppm = 200; |
||
331 | 19e: 29 3c cpi r18, 0xC9 ; 201 |
||
332 | 1a0: 31 05 cpc r19, r1 |
||
333 | 1a2: 40 f4 brcc .+16 ; 0x1b4 <SollwertErmittlung+0x74> |
||
334 | if(ppm <= MIN_PPM) sollwert = 0; |
||
335 | 1a4: 2b 30 cpi r18, 0x0B ; 11 |
||
336 | 1a6: 31 05 cpc r19, r1 |
||
337 | 1a8: 38 f4 brcc .+14 ; 0x1b8 <SollwertErmittlung+0x78> |
||
338 | 1aa: 10 92 8f 00 sts 0x008F, r1 |
||
339 | 1ae: 10 92 8e 00 sts 0x008E, r1 |
||
340 | 1b2: 17 c0 rjmp .+46 ; 0x1e2 <SollwertErmittlung+0xa2> |
||
341 | 1b4: 28 ec ldi r18, 0xC8 ; 200 |
||
342 | 1b6: 30 e0 ldi r19, 0x00 ; 0 |
||
343 | else |
||
344 | { |
||
345 | sollwert = (int) MIN_PWM + ((MAX_PWM - MIN_PWM) * (ppm - MIN_PPM)) / (190 - MIN_PPM); |
||
346 | 1b8: 8c ef ldi r24, 0xFC ; 252 |
||
347 | 1ba: 90 e0 ldi r25, 0x00 ; 0 |
||
348 | 1bc: ac 01 movw r20, r24 |
||
349 | 1be: 24 9f mul r18, r20 |
||
350 | 1c0: c0 01 movw r24, r0 |
||
351 | 1c2: 25 9f mul r18, r21 |
||
352 | 1c4: 90 0d add r25, r0 |
||
353 | 1c6: 34 9f mul r19, r20 |
||
354 | 1c8: 90 0d add r25, r0 |
||
355 | 1ca: 11 24 eor r1, r1 |
||
356 | 1cc: 88 5d subi r24, 0xD8 ; 216 |
||
357 | 1ce: 99 40 sbci r25, 0x09 ; 9 |
||
358 | 1d0: 64 eb ldi r22, 0xB4 ; 180 |
||
359 | 1d2: 70 e0 ldi r23, 0x00 ; 0 |
||
360 | 1d4: 51 db rcall .-2398 ; 0xfffff878 <__eeprom_end+0xff7ef878> |
||
361 | 1d6: 6d 5f subi r22, 0xFD ; 253 |
||
362 | 1d8: 7f 4f sbci r23, 0xFF ; 255 |
||
363 | 1da: 70 93 8f 00 sts 0x008F, r23 |
||
364 | 1de: 60 93 8e 00 sts 0x008E, r22 |
||
365 | } |
||
366 | PORTC &= ~ROT; |
||
367 | 1e2: ab 98 cbi 0x15, 3 ; 21 |
||
368 | 1e4: 19 c0 rjmp .+50 ; 0x218 <SollwertErmittlung+0xd8> |
||
369 | } |
||
370 | else // Kein gültiger Sollwert |
||
371 | { |
||
372 | if(!TEST_SCHUB) { if(sollwert) sollwert--; } |
||
373 | 1e6: 80 91 8e 00 lds r24, 0x008E |
||
374 | 1ea: 90 91 8f 00 lds r25, 0x008F |
||
375 | 1ee: 00 97 sbiw r24, 0x00 ; 0 |
||
376 | 1f0: 29 f0 breq .+10 ; 0x1fc <SollwertErmittlung+0xbc> |
||
377 | 1f2: 01 97 sbiw r24, 0x01 ; 1 |
||
378 | 1f4: 90 93 8f 00 sts 0x008F, r25 |
||
379 | 1f8: 80 93 8e 00 sts 0x008E, r24 |
||
380 | PORTC |= ROT; |
||
381 | 1fc: ab 9a sbi 0x15, 3 ; 21 |
||
382 | 1fe: 0c c0 rjmp .+24 ; 0x218 <SollwertErmittlung+0xd8> |
||
383 | } |
||
384 | } |
||
385 | else // I2C-Daten sind gültig |
||
386 | { |
||
387 | sollwert = I2C_RXBuffer; |
||
388 | 200: 80 91 95 03 lds r24, 0x0395 |
||
389 | 204: 80 93 8e 00 sts 0x008E, r24 |
||
390 | 208: 10 92 8f 00 sts 0x008F, r1 |
||
391 | PPM_Betrieb = 0; |
||
392 | 20c: 10 92 67 00 sts 0x0067, r1 |
||
393 | PORTC &= ~ROT; |
||
394 | 210: ab 98 cbi 0x15, 3 ; 21 |
||
395 | ICP_INT_DISABLE; |
||
396 | 212: 89 b7 in r24, 0x39 ; 57 |
||
397 | 214: 8f 7d andi r24, 0xDF ; 223 |
||
398 | 216: 89 bf out 0x39, r24 ; 57 |
||
399 | } |
||
400 | if(sollwert > MAX_PWM) sollwert = MAX_PWM; |
||
401 | 218: 80 91 8e 00 lds r24, 0x008E |
||
402 | 21c: 90 91 8f 00 lds r25, 0x008F |
||
403 | 220: 8f 3f cpi r24, 0xFF ; 255 |
||
404 | 222: 91 05 cpc r25, r1 |
||
405 | 224: 39 f0 breq .+14 ; 0x234 <SollwertErmittlung+0xf4> |
||
406 | 226: 30 f0 brcs .+12 ; 0x234 <SollwertErmittlung+0xf4> |
||
407 | 228: 8f ef ldi r24, 0xFF ; 255 |
||
408 | 22a: 90 e0 ldi r25, 0x00 ; 0 |
||
409 | 22c: 90 93 8f 00 sts 0x008F, r25 |
||
410 | 230: 80 93 8e 00 sts 0x008E, r24 |
||
411 | return(sollwert); |
||
412 | } |
||
413 | 234: 80 91 8e 00 lds r24, 0x008E |
||
414 | 238: 08 95 ret |
||
415 | |||
416 | 0000023a <DelayM>: |
||
417 | */ |
||
418 | |||
419 | |||
420 | #define TEST_STROMGRENZE 120 |
||
421 | unsigned char DelayM(unsigned int timer) |
||
422 | { |
||
423 | 23a: cf 93 push r28 |
||
424 | 23c: df 93 push r29 |
||
425 | 23e: ec 01 movw r28, r24 |
||
426 | 240: 17 c0 rjmp .+46 ; 0x270 <DelayM+0x36> |
||
427 | while(timer--) |
||
428 | { |
||
429 | FastADConvert(); |
||
430 | 242: 5f d8 rcall .-3906 ; 0xfffff302 <__eeprom_end+0xff7ef302> |
||
431 | 244: 21 97 sbiw r28, 0x01 ; 1 |
||
432 | if(Strom > (TEST_STROMGRENZE + RuheStrom)) |
||
433 | 246: 80 91 b5 02 lds r24, 0x02B5 |
||
434 | 24a: 90 91 b6 02 lds r25, 0x02B6 |
||
435 | 24e: 88 58 subi r24, 0x88 ; 136 |
||
436 | 250: 9f 4f sbci r25, 0xFF ; 255 |
||
437 | 252: 20 91 7a 00 lds r18, 0x007A |
||
438 | 256: 30 91 7b 00 lds r19, 0x007B |
||
439 | 25a: 82 17 cp r24, r18 |
||
440 | 25c: 93 07 cpc r25, r19 |
||
441 | 25e: 40 f4 brcc .+16 ; 0x270 <DelayM+0x36> |
||
442 | { |
||
443 | FETS_OFF; |
||
444 | 260: 82 b3 in r24, 0x12 ; 18 |
||
445 | 262: 87 7c andi r24, 0xC7 ; 199 |
||
446 | 264: 82 bb out 0x12, r24 ; 18 |
||
447 | 266: 88 b3 in r24, 0x18 ; 24 |
||
448 | 268: 81 7f andi r24, 0xF1 ; 241 |
||
449 | 26a: 88 bb out 0x18, r24 ; 24 |
||
450 | 26c: 81 e0 ldi r24, 0x01 ; 1 |
||
451 | 26e: 03 c0 rjmp .+6 ; 0x276 <DelayM+0x3c> |
||
452 | |||
453 | |||
454 | #define TEST_STROMGRENZE 120 |
||
455 | unsigned char DelayM(unsigned int timer) |
||
456 | { |
||
457 | while(timer--) |
||
458 | 270: 20 97 sbiw r28, 0x00 ; 0 |
||
459 | 272: 39 f7 brne .-50 ; 0x242 <DelayM+0x8> |
||
460 | 274: 80 e0 ldi r24, 0x00 ; 0 |
||
461 | FETS_OFF; |
||
462 | return(1); |
||
463 | } |
||
464 | } |
||
465 | return(0); |
||
466 | } |
||
467 | 276: df 91 pop r29 |
||
468 | 278: cf 91 pop r28 |
||
469 | 27a: 08 95 ret |
||
470 | |||
471 | 0000027c <RotBlink>: |
||
472 | dauer = (unsigned char)TCNT0 + dauer; |
||
473 | while((TCNT0 - dauer) & 0x80); |
||
474 | } |
||
475 | |||
476 | void RotBlink(unsigned char anz) |
||
477 | { |
||
478 | 27c: 1f 93 push r17 |
||
479 | 27e: 18 2f mov r17, r24 |
||
480 | sei(); // Interrupts ein |
||
481 | 280: 78 94 sei |
||
482 | 282: 09 c0 rjmp .+18 ; 0x296 <RotBlink+0x1a> |
||
483 | while(anz--) |
||
484 | { |
||
485 | PORTC |= ROT; |
||
486 | 284: ab 9a sbi 0x15, 3 ; 21 |
||
487 | Delay_ms(300); |
||
488 | 286: 8c e2 ldi r24, 0x2C ; 44 |
||
489 | 288: 91 e0 ldi r25, 0x01 ; 1 |
||
490 | 28a: d2 d7 rcall .+4004 ; 0x1230 <Delay_ms> |
||
491 | PORTC &= ~ROT; |
||
492 | 28c: ab 98 cbi 0x15, 3 ; 21 |
||
493 | Delay_ms(300); |
||
494 | 28e: 8c e2 ldi r24, 0x2C ; 44 |
||
495 | 290: 91 e0 ldi r25, 0x01 ; 1 |
||
496 | 292: ce d7 rcall .+3996 ; 0x1230 <Delay_ms> |
||
497 | 294: 11 50 subi r17, 0x01 ; 1 |
||
498 | } |
||
499 | |||
500 | void RotBlink(unsigned char anz) |
||
501 | { |
||
502 | sei(); // Interrupts ein |
||
503 | while(anz--) |
||
504 | 296: 11 23 and r17, r17 |
||
505 | 298: a9 f7 brne .-22 ; 0x284 <RotBlink+0x8> |
||
506 | PORTC |= ROT; |
||
507 | Delay_ms(300); |
||
508 | PORTC &= ~ROT; |
||
509 | Delay_ms(300); |
||
510 | } |
||
511 | Delay_ms(1000); |
||
512 | 29a: 88 ee ldi r24, 0xE8 ; 232 |
||
513 | 29c: 93 e0 ldi r25, 0x03 ; 3 |
||
514 | 29e: c8 d7 rcall .+3984 ; 0x1230 <Delay_ms> |
||
515 | } |
||
516 | 2a0: 1f 91 pop r17 |
||
517 | 2a2: 08 95 ret |
||
518 | |||
519 | 000002a4 <MotorTon>: |
||
520 | #define LOW_B_EIN PORTD |= 0x10 |
||
521 | #define LOW_C_EIN PORTD |= 0x20 |
||
522 | |||
523 | void MotorTon(void) |
||
524 | //############################################################################ |
||
525 | { |
||
526 | 2a4: af 92 push r10 |
||
527 | 2a6: bf 92 push r11 |
||
528 | 2a8: df 92 push r13 |
||
529 | 2aa: ef 92 push r14 |
||
530 | 2ac: ff 92 push r15 |
||
531 | 2ae: 0f 93 push r16 |
||
532 | 2b0: 1f 93 push r17 |
||
533 | 2b2: df 93 push r29 |
||
534 | 2b4: cf 93 push r28 |
||
535 | 2b6: cd b7 in r28, 0x3d ; 61 |
||
536 | 2b8: de b7 in r29, 0x3e ; 62 |
||
537 | 2ba: 27 97 sbiw r28, 0x07 ; 7 |
||
538 | 2bc: 0f b6 in r0, 0x3f ; 63 |
||
539 | 2be: f8 94 cli |
||
540 | 2c0: de bf out 0x3e, r29 ; 62 |
||
541 | 2c2: 0f be out 0x3f, r0 ; 63 |
||
542 | 2c4: cd bf out 0x3d, r28 ; 61 |
||
543 | unsigned char ADR_TAB[7] = {0,0,0,1,1,2,2}; |
||
544 | 2c6: de 01 movw r26, r28 |
||
545 | 2c8: 11 96 adiw r26, 0x01 ; 1 |
||
546 | 2ca: e8 e6 ldi r30, 0x68 ; 104 |
||
547 | 2cc: f0 e0 ldi r31, 0x00 ; 0 |
||
548 | 2ce: 87 e0 ldi r24, 0x07 ; 7 |
||
549 | 2d0: 01 90 ld r0, Z+ |
||
550 | 2d2: 0d 92 st X+, r0 |
||
551 | 2d4: 81 50 subi r24, 0x01 ; 1 |
||
552 | 2d6: e1 f7 brne .-8 ; 0x2d0 <MotorTon+0x2c> |
||
553 | unsigned int timer = 300,i; |
||
554 | unsigned int t = 0; |
||
555 | unsigned char anz = 0,MosfetOkay = 0, grenze = 50; |
||
556 | |||
557 | PORTC &= ~ROT; |
||
558 | 2d8: ab 98 cbi 0x15, 3 ; 21 |
||
559 | Delay_ms(300 * ADR_TAB[MotorAdresse]); |
||
560 | 2da: 80 91 66 00 lds r24, 0x0066 |
||
561 | 2de: fe 01 movw r30, r28 |
||
562 | 2e0: e8 0f add r30, r24 |
||
563 | 2e2: f1 1d adc r31, r1 |
||
564 | 2e4: 81 81 ldd r24, Z+1 ; 0x01 |
||
565 | 2e6: 90 e0 ldi r25, 0x00 ; 0 |
||
566 | 2e8: 2c e2 ldi r18, 0x2C ; 44 |
||
567 | 2ea: 31 e0 ldi r19, 0x01 ; 1 |
||
568 | 2ec: ac 01 movw r20, r24 |
||
569 | 2ee: 42 9f mul r20, r18 |
||
570 | 2f0: c0 01 movw r24, r0 |
||
571 | 2f2: 43 9f mul r20, r19 |
||
572 | 2f4: 90 0d add r25, r0 |
||
573 | 2f6: 52 9f mul r21, r18 |
||
574 | 2f8: 90 0d add r25, r0 |
||
575 | 2fa: 11 24 eor r1, r1 |
||
576 | 2fc: 99 d7 rcall .+3890 ; 0x1230 <Delay_ms> |
||
577 | DISABLE_SENSE_INT; |
||
578 | 2fe: 10 92 b1 00 sts 0x00B1, r1 |
||
579 | 302: 43 98 cbi 0x08, 3 ; 8 |
||
580 | cli();//Globale Interrupts Ausschalten |
||
581 | 304: f8 94 cli |
||
582 | uart_putchar('\n'); |
||
583 | 306: 8a e0 ldi r24, 0x0A ; 10 |
||
584 | 308: df d5 rcall .+3006 ; 0xec8 <uart_putchar> |
||
585 | STEUER_OFF; |
||
586 | 30a: 82 b3 in r24, 0x12 ; 18 |
||
587 | 30c: 87 7c andi r24, 0xC7 ; 199 |
||
588 | 30e: 82 bb out 0x12, r24 ; 18 |
||
589 | 310: 1b bc out 0x2b, r1 ; 43 |
||
590 | 312: 1a bc out 0x2a, r1 ; 42 |
||
591 | 314: 19 bc out 0x29, r1 ; 41 |
||
592 | 316: 18 bc out 0x28, r1 ; 40 |
||
593 | 318: 13 bc out 0x23, r1 ; 35 |
||
594 | 31a: 81 e0 ldi r24, 0x01 ; 1 |
||
595 | 31c: 8f bd out 0x2f, r24 ; 47 |
||
596 | 31e: 81 e4 ldi r24, 0x41 ; 65 |
||
597 | 320: 85 bd out 0x25, r24 ; 37 |
||
598 | 322: 8e e0 ldi r24, 0x0E ; 14 |
||
599 | 324: 87 bb out 0x17, r24 ; 23 |
||
600 | 326: 88 b3 in r24, 0x18 ; 24 |
||
601 | 328: 81 7f andi r24, 0xF1 ; 241 |
||
602 | 32a: 88 bb out 0x18, r24 ; 24 |
||
603 | Strom_max = 0; |
||
604 | 32c: 10 92 7c 00 sts 0x007C, r1 |
||
605 | DelayM(50); |
||
606 | 330: 82 e3 ldi r24, 0x32 ; 50 |
||
607 | 332: 90 e0 ldi r25, 0x00 ; 0 |
||
608 | 334: 82 df rcall .-252 ; 0x23a <DelayM> |
||
609 | RuheStrom = Strom_max; |
||
610 | 336: 80 91 7c 00 lds r24, 0x007C |
||
611 | 33a: 80 93 b5 02 sts 0x02B5, r24 |
||
612 | 33e: 10 92 b6 02 sts 0x02B6, r1 |
||
613 | // uart_putchar(RuheStrom + 'A'); |
||
614 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
615 | //+ High-Mosfets auf Kurzschluss testen |
||
616 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
617 | Strom = 0; |
||
618 | 342: 10 92 7b 00 sts 0x007B, r1 |
||
619 | 346: 10 92 7a 00 sts 0x007A, r1 |
||
620 | if(anz) while(1) RotBlink(anz); // bei Kurzschluss nicht starten |
||
621 | */ |
||
622 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
623 | //+ LOW-Mosfets auf Schalten und Kurzschluss testen |
||
624 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
625 | if(UDR == ' ') {t = 65535; grenze = 40; uart_putchar('_');} else t = 1000; // Ausführlicher Test |
||
626 | 34a: 8c b1 in r24, 0x0c ; 12 |
||
627 | 34c: 80 32 cpi r24, 0x20 ; 32 |
||
628 | 34e: 31 f0 breq .+12 ; 0x35c <MotorTon+0xb8> |
||
629 | 350: 38 ee ldi r19, 0xE8 ; 232 |
||
630 | 352: e3 2e mov r14, r19 |
||
631 | 354: 33 e0 ldi r19, 0x03 ; 3 |
||
632 | 356: f3 2e mov r15, r19 |
||
633 | 358: 82 e3 ldi r24, 0x32 ; 50 |
||
634 | 35a: 06 c0 rjmp .+12 ; 0x368 <MotorTon+0xc4> |
||
635 | 35c: 8f e5 ldi r24, 0x5F ; 95 |
||
636 | 35e: b4 d5 rcall .+2920 ; 0xec8 <uart_putchar> |
||
637 | 360: ee 24 eor r14, r14 |
||
638 | 362: ea 94 dec r14 |
||
639 | 364: fe 2c mov r15, r14 |
||
640 | 366: 88 e2 ldi r24, 0x28 ; 40 |
||
641 | Strom = 0; |
||
642 | 368: 10 92 7b 00 sts 0x007B, r1 |
||
643 | 36c: 10 92 7a 00 sts 0x007A, r1 |
||
644 | 370: 00 e0 ldi r16, 0x00 ; 0 |
||
645 | 372: 10 e0 ldi r17, 0x00 ; 0 |
||
646 | FETS_OFF; |
||
647 | Delay(5); |
||
648 | HIGH_A_EIN; |
||
649 | DelayM(1); |
||
650 | FETS_OFF; |
||
651 | if(Strom > grenze + RuheStrom) {anz = 4; uart_putchar('4'); FETS_OFF; break;} |
||
652 | 374: a8 2e mov r10, r24 |
||
653 | 376: bb 24 eor r11, r11 |
||
654 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
655 | if(UDR == ' ') {t = 65535; grenze = 40; uart_putchar('_');} else t = 1000; // Ausführlicher Test |
||
656 | Strom = 0; |
||
657 | for(i=0;i<t;i++) |
||
658 | { |
||
659 | LOW_A_EIN; |
||
660 | 378: 93 9a sbi 0x12, 3 ; 18 |
||
661 | DelayM(1); |
||
662 | 37a: 81 e0 ldi r24, 0x01 ; 1 |
||
663 | 37c: 90 e0 ldi r25, 0x00 ; 0 |
||
664 | 37e: 5d df rcall .-326 ; 0x23a <DelayM> |
||
665 | FETS_OFF; |
||
666 | 380: 82 b3 in r24, 0x12 ; 18 |
||
667 | 382: 87 7c andi r24, 0xC7 ; 199 |
||
668 | 384: 82 bb out 0x12, r24 ; 18 |
||
669 | 386: 88 b3 in r24, 0x18 ; 24 |
||
670 | 388: 81 7f andi r24, 0xF1 ; 241 |
||
671 | 38a: 88 bb out 0x18, r24 ; 24 |
||
672 | Delay(5); |
||
673 | HIGH_A_EIN; |
||
674 | 38c: c3 9a sbi 0x18, 3 ; 24 |
||
675 | DelayM(1); |
||
676 | 38e: 81 e0 ldi r24, 0x01 ; 1 |
||
677 | 390: 90 e0 ldi r25, 0x00 ; 0 |
||
678 | 392: 53 df rcall .-346 ; 0x23a <DelayM> |
||
679 | FETS_OFF; |
||
680 | 394: 82 b3 in r24, 0x12 ; 18 |
||
681 | 396: 87 7c andi r24, 0xC7 ; 199 |
||
682 | 398: 82 bb out 0x12, r24 ; 18 |
||
683 | 39a: 88 b3 in r24, 0x18 ; 24 |
||
684 | 39c: 81 7f andi r24, 0xF1 ; 241 |
||
685 | 39e: 88 bb out 0x18, r24 ; 24 |
||
686 | if(Strom > grenze + RuheStrom) {anz = 4; uart_putchar('4'); FETS_OFF; break;} |
||
687 | 3a0: 80 91 b5 02 lds r24, 0x02B5 |
||
688 | 3a4: 90 91 b6 02 lds r25, 0x02B6 |
||
689 | 3a8: 8a 0d add r24, r10 |
||
690 | 3aa: 9b 1d adc r25, r11 |
||
691 | 3ac: 20 91 7a 00 lds r18, 0x007A |
||
692 | 3b0: 30 91 7b 00 lds r19, 0x007B |
||
693 | 3b4: 82 17 cp r24, r18 |
||
694 | 3b6: 93 07 cpc r25, r19 |
||
695 | 3b8: 38 f0 brcs .+14 ; 0x3c8 <MotorTon+0x124> |
||
696 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
697 | //+ LOW-Mosfets auf Schalten und Kurzschluss testen |
||
698 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
699 | if(UDR == ' ') {t = 65535; grenze = 40; uart_putchar('_');} else t = 1000; // Ausführlicher Test |
||
700 | Strom = 0; |
||
701 | for(i=0;i<t;i++) |
||
702 | 3ba: 0f 5f subi r16, 0xFF ; 255 |
||
703 | 3bc: 1f 4f sbci r17, 0xFF ; 255 |
||
704 | 3be: 0e 15 cp r16, r14 |
||
705 | 3c0: 1f 05 cpc r17, r15 |
||
706 | 3c2: d0 f2 brcs .-76 ; 0x378 <MotorTon+0xd4> |
||
707 | 3c4: dd 24 eor r13, r13 |
||
708 | 3c6: 0a c0 rjmp .+20 ; 0x3dc <MotorTon+0x138> |
||
709 | FETS_OFF; |
||
710 | Delay(5); |
||
711 | HIGH_A_EIN; |
||
712 | DelayM(1); |
||
713 | FETS_OFF; |
||
714 | if(Strom > grenze + RuheStrom) {anz = 4; uart_putchar('4'); FETS_OFF; break;} |
||
715 | 3c8: 84 e3 ldi r24, 0x34 ; 52 |
||
716 | 3ca: 7e d5 rcall .+2812 ; 0xec8 <uart_putchar> |
||
717 | 3cc: 82 b3 in r24, 0x12 ; 18 |
||
718 | 3ce: 87 7c andi r24, 0xC7 ; 199 |
||
719 | 3d0: 82 bb out 0x12, r24 ; 18 |
||
720 | 3d2: 88 b3 in r24, 0x18 ; 24 |
||
721 | 3d4: 81 7f andi r24, 0xF1 ; 241 |
||
722 | 3d6: 88 bb out 0x18, r24 ; 24 |
||
723 | 3d8: 24 e0 ldi r18, 0x04 ; 4 |
||
724 | 3da: d2 2e mov r13, r18 |
||
725 | 3dc: 80 e1 ldi r24, 0x10 ; 16 |
||
726 | 3de: 97 e2 ldi r25, 0x27 ; 39 |
||
727 | 3e0: 00 c0 rjmp .+0 ; 0x3e2 <MotorTon+0x13e> |
||
728 | return(0); |
||
729 | } |
||
730 | |||
731 | unsigned char Delay(unsigned int timer) |
||
732 | { |
||
733 | while(timer--) |
||
734 | 3e2: 01 97 sbiw r24, 0x01 ; 1 |
||
735 | 3e4: 5f ef ldi r21, 0xFF ; 255 |
||
736 | 3e6: 8f 3f cpi r24, 0xFF ; 255 |
||
737 | 3e8: 95 07 cpc r25, r21 |
||
738 | 3ea: d9 f7 brne .-10 ; 0x3e2 <MotorTon+0x13e> |
||
739 | if(Strom > grenze + RuheStrom) {anz = 4; uart_putchar('4'); FETS_OFF; break;} |
||
740 | Delay(5); |
||
741 | } |
||
742 | Delay(10000); |
||
743 | |||
744 | Strom = 0; |
||
745 | 3ec: 10 92 7b 00 sts 0x007B, r1 |
||
746 | 3f0: 10 92 7a 00 sts 0x007A, r1 |
||
747 | 3f4: 00 e0 ldi r16, 0x00 ; 0 |
||
748 | 3f6: 10 e0 ldi r17, 0x00 ; 0 |
||
749 | for(i=0;i<t;i++) |
||
750 | { |
||
751 | LOW_B_EIN; |
||
752 | 3f8: 94 9a sbi 0x12, 4 ; 18 |
||
753 | DelayM(1); |
||
754 | 3fa: 81 e0 ldi r24, 0x01 ; 1 |
||
755 | 3fc: 90 e0 ldi r25, 0x00 ; 0 |
||
756 | 3fe: 1d df rcall .-454 ; 0x23a <DelayM> |
||
757 | FETS_OFF; |
||
758 | 400: 82 b3 in r24, 0x12 ; 18 |
||
759 | 402: 87 7c andi r24, 0xC7 ; 199 |
||
760 | 404: 82 bb out 0x12, r24 ; 18 |
||
761 | 406: 88 b3 in r24, 0x18 ; 24 |
||
762 | 408: 81 7f andi r24, 0xF1 ; 241 |
||
763 | 40a: 88 bb out 0x18, r24 ; 24 |
||
764 | Delay(5); |
||
765 | HIGH_B_EIN; |
||
766 | 40c: c2 9a sbi 0x18, 2 ; 24 |
||
767 | DelayM(1); |
||
768 | 40e: 81 e0 ldi r24, 0x01 ; 1 |
||
769 | 410: 90 e0 ldi r25, 0x00 ; 0 |
||
770 | 412: 13 df rcall .-474 ; 0x23a <DelayM> |
||
771 | FETS_OFF; |
||
772 | 414: 82 b3 in r24, 0x12 ; 18 |
||
773 | 416: 87 7c andi r24, 0xC7 ; 199 |
||
774 | 418: 82 bb out 0x12, r24 ; 18 |
||
775 | 41a: 88 b3 in r24, 0x18 ; 24 |
||
776 | 41c: 81 7f andi r24, 0xF1 ; 241 |
||
777 | 41e: 88 bb out 0x18, r24 ; 24 |
||
778 | if(Strom > grenze + RuheStrom) {anz = 5; uart_putchar('5'); FETS_OFF;break;} |
||
779 | 420: 80 91 b5 02 lds r24, 0x02B5 |
||
780 | 424: 90 91 b6 02 lds r25, 0x02B6 |
||
781 | 428: 8a 0d add r24, r10 |
||
782 | 42a: 9b 1d adc r25, r11 |
||
783 | 42c: 20 91 7a 00 lds r18, 0x007A |
||
784 | 430: 30 91 7b 00 lds r19, 0x007B |
||
785 | 434: 82 17 cp r24, r18 |
||
786 | 436: 93 07 cpc r25, r19 |
||
787 | 438: 30 f0 brcs .+12 ; 0x446 <MotorTon+0x1a2> |
||
788 | Delay(5); |
||
789 | } |
||
790 | Delay(10000); |
||
791 | |||
792 | Strom = 0; |
||
793 | for(i=0;i<t;i++) |
||
794 | 43a: 0f 5f subi r16, 0xFF ; 255 |
||
795 | 43c: 1f 4f sbci r17, 0xFF ; 255 |
||
796 | 43e: 0e 15 cp r16, r14 |
||
797 | 440: 1f 05 cpc r17, r15 |
||
798 | 442: d0 f2 brcs .-76 ; 0x3f8 <MotorTon+0x154> |
||
799 | 444: 0a c0 rjmp .+20 ; 0x45a <MotorTon+0x1b6> |
||
800 | FETS_OFF; |
||
801 | Delay(5); |
||
802 | HIGH_B_EIN; |
||
803 | DelayM(1); |
||
804 | FETS_OFF; |
||
805 | if(Strom > grenze + RuheStrom) {anz = 5; uart_putchar('5'); FETS_OFF;break;} |
||
806 | 446: 85 e3 ldi r24, 0x35 ; 53 |
||
807 | 448: 3f d5 rcall .+2686 ; 0xec8 <uart_putchar> |
||
808 | 44a: 82 b3 in r24, 0x12 ; 18 |
||
809 | 44c: 87 7c andi r24, 0xC7 ; 199 |
||
810 | 44e: 82 bb out 0x12, r24 ; 18 |
||
811 | 450: 88 b3 in r24, 0x18 ; 24 |
||
812 | 452: 81 7f andi r24, 0xF1 ; 241 |
||
813 | 454: 88 bb out 0x18, r24 ; 24 |
||
814 | 456: 95 e0 ldi r25, 0x05 ; 5 |
||
815 | 458: d9 2e mov r13, r25 |
||
816 | Delay(5); |
||
817 | } |
||
818 | |||
819 | Strom = 0; |
||
820 | 45a: 10 92 7b 00 sts 0x007B, r1 |
||
821 | 45e: 10 92 7a 00 sts 0x007A, r1 |
||
822 | 462: 80 e1 ldi r24, 0x10 ; 16 |
||
823 | 464: 97 e2 ldi r25, 0x27 ; 39 |
||
824 | 466: 00 c0 rjmp .+0 ; 0x468 <__stack+0x9> |
||
825 | return(0); |
||
826 | } |
||
827 | |||
828 | unsigned char Delay(unsigned int timer) |
||
829 | { |
||
830 | while(timer--) |
||
831 | 468: 01 97 sbiw r24, 0x01 ; 1 |
||
832 | 46a: 2f ef ldi r18, 0xFF ; 255 |
||
833 | 46c: 8f 3f cpi r24, 0xFF ; 255 |
||
834 | 46e: 92 07 cpc r25, r18 |
||
835 | 470: d9 f7 brne .-10 ; 0x468 <__stack+0x9> |
||
836 | 472: 00 e0 ldi r16, 0x00 ; 0 |
||
837 | 474: 10 e0 ldi r17, 0x00 ; 0 |
||
838 | Strom = 0; |
||
839 | Delay(10000); |
||
840 | |||
841 | for(i=0;i<t;i++) |
||
842 | { |
||
843 | LOW_C_EIN; |
||
844 | 476: 95 9a sbi 0x12, 5 ; 18 |
||
845 | DelayM(1); |
||
846 | 478: 81 e0 ldi r24, 0x01 ; 1 |
||
847 | 47a: 90 e0 ldi r25, 0x00 ; 0 |
||
848 | 47c: de de rcall .-580 ; 0x23a <DelayM> |
||
849 | FETS_OFF; |
||
850 | 47e: 82 b3 in r24, 0x12 ; 18 |
||
851 | 480: 87 7c andi r24, 0xC7 ; 199 |
||
852 | 482: 82 bb out 0x12, r24 ; 18 |
||
853 | 484: 88 b3 in r24, 0x18 ; 24 |
||
854 | 486: 81 7f andi r24, 0xF1 ; 241 |
||
855 | 488: 88 bb out 0x18, r24 ; 24 |
||
856 | Delay(5); |
||
857 | HIGH_C_EIN; |
||
858 | 48a: c1 9a sbi 0x18, 1 ; 24 |
||
859 | DelayM(1); |
||
860 | 48c: 81 e0 ldi r24, 0x01 ; 1 |
||
861 | 48e: 90 e0 ldi r25, 0x00 ; 0 |
||
862 | 490: d4 de rcall .-600 ; 0x23a <DelayM> |
||
863 | FETS_OFF; |
||
864 | 492: 82 b3 in r24, 0x12 ; 18 |
||
865 | 494: 87 7c andi r24, 0xC7 ; 199 |
||
866 | 496: 82 bb out 0x12, r24 ; 18 |
||
867 | 498: 88 b3 in r24, 0x18 ; 24 |
||
868 | 49a: 81 7f andi r24, 0xF1 ; 241 |
||
869 | 49c: 88 bb out 0x18, r24 ; 24 |
||
870 | if(Strom > grenze + RuheStrom) {anz = 6; uart_putchar('6'); FETS_OFF; break;} |
||
871 | 49e: 80 91 b5 02 lds r24, 0x02B5 |
||
872 | 4a2: 90 91 b6 02 lds r25, 0x02B6 |
||
873 | 4a6: 8a 0d add r24, r10 |
||
874 | 4a8: 9b 1d adc r25, r11 |
||
875 | 4aa: 20 91 7a 00 lds r18, 0x007A |
||
876 | 4ae: 30 91 7b 00 lds r19, 0x007B |
||
877 | 4b2: 82 17 cp r24, r18 |
||
878 | 4b4: 93 07 cpc r25, r19 |
||
879 | 4b6: 30 f0 brcs .+12 ; 0x4c4 <__stack+0x65> |
||
880 | } |
||
881 | |||
882 | Strom = 0; |
||
883 | Delay(10000); |
||
884 | |||
885 | for(i=0;i<t;i++) |
||
886 | 4b8: 0f 5f subi r16, 0xFF ; 255 |
||
887 | 4ba: 1f 4f sbci r17, 0xFF ; 255 |
||
888 | 4bc: 0e 15 cp r16, r14 |
||
889 | 4be: 1f 05 cpc r17, r15 |
||
890 | 4c0: d0 f2 brcs .-76 ; 0x476 <__stack+0x17> |
||
891 | 4c2: 0b c0 rjmp .+22 ; 0x4da <__stack+0x7b> |
||
892 | FETS_OFF; |
||
893 | Delay(5); |
||
894 | HIGH_C_EIN; |
||
895 | DelayM(1); |
||
896 | FETS_OFF; |
||
897 | if(Strom > grenze + RuheStrom) {anz = 6; uart_putchar('6'); FETS_OFF; break;} |
||
898 | 4c4: 86 e3 ldi r24, 0x36 ; 54 |
||
899 | 4c6: 00 d5 rcall .+2560 ; 0xec8 <uart_putchar> |
||
900 | 4c8: 82 b3 in r24, 0x12 ; 18 |
||
901 | 4ca: 87 7c andi r24, 0xC7 ; 199 |
||
902 | 4cc: 82 bb out 0x12, r24 ; 18 |
||
903 | 4ce: 88 b3 in r24, 0x18 ; 24 |
||
904 | 4d0: 81 7f andi r24, 0xF1 ; 241 |
||
905 | 4d2: 88 bb out 0x18, r24 ; 24 |
||
906 | 4d4: 86 e0 ldi r24, 0x06 ; 6 |
||
907 | 4d6: d8 2e mov r13, r24 |
||
908 | 4d8: 02 c0 rjmp .+4 ; 0x4de <__stack+0x7f> |
||
909 | Delay(5); |
||
910 | } |
||
911 | |||
912 | if(anz) while(1) RotBlink(anz); // bei Kurzschluss nicht starten |
||
913 | 4da: dd 20 and r13, r13 |
||
914 | 4dc: 19 f0 breq .+6 ; 0x4e4 <__stack+0x85> |
||
915 | 4de: 8d 2d mov r24, r13 |
||
916 | 4e0: cd de rcall .-614 ; 0x27c <RotBlink> |
||
917 | 4e2: fd cf rjmp .-6 ; 0x4de <__stack+0x7f> |
||
918 | |||
919 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
920 | //+ High-Mosfets auf Schalten testen |
||
921 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
922 | SENSE_A; |
||
923 | 4e4: 80 91 8d 00 lds r24, 0x008D |
||
924 | 4e8: 87 b9 out 0x07, r24 ; 7 |
||
925 | FETS_OFF; |
||
926 | 4ea: 82 b3 in r24, 0x12 ; 18 |
||
927 | 4ec: 87 7c andi r24, 0xC7 ; 199 |
||
928 | 4ee: 82 bb out 0x12, r24 ; 18 |
||
929 | 4f0: 88 b3 in r24, 0x18 ; 24 |
||
930 | 4f2: 81 7f andi r24, 0xF1 ; 241 |
||
931 | 4f4: 88 bb out 0x18, r24 ; 24 |
||
932 | LOW_B_EIN; // Low B ein |
||
933 | 4f6: 94 9a sbi 0x12, 4 ; 18 |
||
934 | LOW_C_EIN; // Low C ein |
||
935 | 4f8: 95 9a sbi 0x12, 5 ; 18 |
||
936 | Strom = 0; |
||
937 | 4fa: 10 92 7b 00 sts 0x007B, r1 |
||
938 | 4fe: 10 92 7a 00 sts 0x007A, r1 |
||
939 | 502: 00 e0 ldi r16, 0x00 ; 0 |
||
940 | 504: 10 e0 ldi r17, 0x00 ; 0 |
||
941 | 506: ff 24 eor r15, r15 |
||
942 | #define SOUND2_A 330 |
||
943 | #define SOUND3_A 360 |
||
944 | |||
945 | for(i=0; i< (TONDAUER / SOUND2_A) ; i++) |
||
946 | { |
||
947 | HIGH_A_EIN; // Test A |
||
948 | 508: c3 9a sbi 0x18, 3 ; 24 |
||
949 | Delay(SOUND_E); |
||
950 | if(MessAD(0) > 50) { MosfetOkay |= 0x01; } else { MosfetOkay &= ~0x01;}; |
||
951 | 50a: 80 e0 ldi r24, 0x00 ; 0 |
||
952 | 50c: e5 d6 rcall .+3530 ; 0x12d8 <MessAD> |
||
953 | 50e: c3 97 sbiw r24, 0x33 ; 51 |
||
954 | 510: 18 f0 brcs .+6 ; 0x518 <__stack+0xb9> |
||
955 | 512: 41 e0 ldi r20, 0x01 ; 1 |
||
956 | 514: f4 2a or r15, r20 |
||
957 | 516: 02 c0 rjmp .+4 ; 0x51c <__stack+0xbd> |
||
958 | 518: 5e ef ldi r21, 0xFE ; 254 |
||
959 | 51a: f5 22 and r15, r21 |
||
960 | PORTB = 0; |
||
961 | 51c: 18 ba out 0x18, r1 ; 24 |
||
962 | 51e: 8c e2 ldi r24, 0x2C ; 44 |
||
963 | 520: 91 e0 ldi r25, 0x01 ; 1 |
||
964 | 522: 00 c0 rjmp .+0 ; 0x524 <__stack+0xc5> |
||
965 | return(0); |
||
966 | } |
||
967 | |||
968 | unsigned char Delay(unsigned int timer) |
||
969 | { |
||
970 | while(timer--) |
||
971 | 524: 01 97 sbiw r24, 0x01 ; 1 |
||
972 | 526: 2f ef ldi r18, 0xFF ; 255 |
||
973 | 528: 8f 3f cpi r24, 0xFF ; 255 |
||
974 | 52a: 92 07 cpc r25, r18 |
||
975 | 52c: d9 f7 brne .-10 ; 0x524 <__stack+0xc5> |
||
976 | #define SOUND_E 1 // 1 |
||
977 | #define SOUND1_A 300 |
||
978 | #define SOUND2_A 330 |
||
979 | #define SOUND3_A 360 |
||
980 | |||
981 | for(i=0; i< (TONDAUER / SOUND2_A) ; i++) |
||
982 | 52e: 0f 5f subi r16, 0xFF ; 255 |
||
983 | 530: 1f 4f sbci r17, 0xFF ; 255 |
||
984 | 532: 09 37 cpi r16, 0x79 ; 121 |
||
985 | 534: 11 05 cpc r17, r1 |
||
986 | 536: 41 f7 brne .-48 ; 0x508 <__stack+0xa9> |
||
987 | Delay(SOUND_E); |
||
988 | if(MessAD(0) > 50) { MosfetOkay |= 0x01; } else { MosfetOkay &= ~0x01;}; |
||
989 | PORTB = 0; |
||
990 | Delay(SOUND1_A); |
||
991 | } |
||
992 | FETS_OFF; |
||
993 | 538: 82 b3 in r24, 0x12 ; 18 |
||
994 | 53a: 87 7c andi r24, 0xC7 ; 199 |
||
995 | 53c: 82 bb out 0x12, r24 ; 18 |
||
996 | 53e: 88 b3 in r24, 0x18 ; 24 |
||
997 | 540: 81 7f andi r24, 0xF1 ; 241 |
||
998 | 542: 88 bb out 0x18, r24 ; 24 |
||
999 | |||
1000 | LOW_A_EIN; // Low A ein |
||
1001 | 544: 93 9a sbi 0x12, 3 ; 18 |
||
1002 | LOW_C_EIN; // Low C ein |
||
1003 | 546: 95 9a sbi 0x12, 5 ; 18 |
||
1004 | 548: 00 e0 ldi r16, 0x00 ; 0 |
||
1005 | 54a: 10 e0 ldi r17, 0x00 ; 0 |
||
1006 | for(i=0; i<(TONDAUER / SOUND1_A); i++) |
||
1007 | { |
||
1008 | HIGH_B_EIN; // Test B |
||
1009 | 54c: c2 9a sbi 0x18, 2 ; 24 |
||
1010 | Delay(SOUND_E); |
||
1011 | if(MessAD(1) > 50) { MosfetOkay |= 0x02; } else { MosfetOkay &= ~0x02;}; |
||
1012 | 54e: 81 e0 ldi r24, 0x01 ; 1 |
||
1013 | 550: c3 d6 rcall .+3462 ; 0x12d8 <MessAD> |
||
1014 | 552: c3 97 sbiw r24, 0x33 ; 51 |
||
1015 | 554: 18 f0 brcs .+6 ; 0x55c <__stack+0xfd> |
||
1016 | 556: 42 e0 ldi r20, 0x02 ; 2 |
||
1017 | 558: f4 2a or r15, r20 |
||
1018 | 55a: 02 c0 rjmp .+4 ; 0x560 <__stack+0x101> |
||
1019 | 55c: 5d ef ldi r21, 0xFD ; 253 |
||
1020 | 55e: f5 22 and r15, r21 |
||
1021 | PORTB = 0; |
||
1022 | 560: 18 ba out 0x18, r1 ; 24 |
||
1023 | 562: 8c e2 ldi r24, 0x2C ; 44 |
||
1024 | 564: 91 e0 ldi r25, 0x01 ; 1 |
||
1025 | 566: 00 c0 rjmp .+0 ; 0x568 <__stack+0x109> |
||
1026 | return(0); |
||
1027 | } |
||
1028 | |||
1029 | unsigned char Delay(unsigned int timer) |
||
1030 | { |
||
1031 | while(timer--) |
||
1032 | 568: 01 97 sbiw r24, 0x01 ; 1 |
||
1033 | 56a: 2f ef ldi r18, 0xFF ; 255 |
||
1034 | 56c: 8f 3f cpi r24, 0xFF ; 255 |
||
1035 | 56e: 92 07 cpc r25, r18 |
||
1036 | 570: d9 f7 brne .-10 ; 0x568 <__stack+0x109> |
||
1037 | } |
||
1038 | FETS_OFF; |
||
1039 | |||
1040 | LOW_A_EIN; // Low A ein |
||
1041 | LOW_C_EIN; // Low C ein |
||
1042 | for(i=0; i<(TONDAUER / SOUND1_A); i++) |
||
1043 | 572: 0f 5f subi r16, 0xFF ; 255 |
||
1044 | 574: 1f 4f sbci r17, 0xFF ; 255 |
||
1045 | 576: 05 38 cpi r16, 0x85 ; 133 |
||
1046 | 578: 11 05 cpc r17, r1 |
||
1047 | 57a: 41 f7 brne .-48 ; 0x54c <__stack+0xed> |
||
1048 | if(MessAD(1) > 50) { MosfetOkay |= 0x02; } else { MosfetOkay &= ~0x02;}; |
||
1049 | PORTB = 0; |
||
1050 | Delay(SOUND1_A); |
||
1051 | } |
||
1052 | |||
1053 | FETS_OFF; |
||
1054 | 57c: 82 b3 in r24, 0x12 ; 18 |
||
1055 | 57e: 87 7c andi r24, 0xC7 ; 199 |
||
1056 | 580: 82 bb out 0x12, r24 ; 18 |
||
1057 | 582: 88 b3 in r24, 0x18 ; 24 |
||
1058 | 584: 81 7f andi r24, 0xF1 ; 241 |
||
1059 | 586: 88 bb out 0x18, r24 ; 24 |
||
1060 | LOW_A_EIN; // Low A ein |
||
1061 | 588: 93 9a sbi 0x12, 3 ; 18 |
||
1062 | LOW_B_EIN; // Low B ein |
||
1063 | 58a: 94 9a sbi 0x12, 4 ; 18 |
||
1064 | 58c: 00 e0 ldi r16, 0x00 ; 0 |
||
1065 | 58e: 10 e0 ldi r17, 0x00 ; 0 |
||
1066 | for(i=0; i<(TONDAUER / SOUND3_A); i++) |
||
1067 | { |
||
1068 | HIGH_C_EIN; // Test C |
||
1069 | 590: c1 9a sbi 0x18, 1 ; 24 |
||
1070 | Delay(SOUND_E); |
||
1071 | if(MessAD(2) > 50) { MosfetOkay |= 0x04; } else { MosfetOkay &= ~0x04;}; |
||
1072 | 592: 82 e0 ldi r24, 0x02 ; 2 |
||
1073 | 594: a1 d6 rcall .+3394 ; 0x12d8 <MessAD> |
||
1074 | 596: c3 97 sbiw r24, 0x33 ; 51 |
||
1075 | 598: 18 f0 brcs .+6 ; 0x5a0 <__stack+0x141> |
||
1076 | 59a: 44 e0 ldi r20, 0x04 ; 4 |
||
1077 | 59c: f4 2a or r15, r20 |
||
1078 | 59e: 02 c0 rjmp .+4 ; 0x5a4 <__stack+0x145> |
||
1079 | 5a0: 5b ef ldi r21, 0xFB ; 251 |
||
1080 | 5a2: f5 22 and r15, r21 |
||
1081 | PORTB = 0; |
||
1082 | 5a4: 18 ba out 0x18, r1 ; 24 |
||
1083 | 5a6: 8a e4 ldi r24, 0x4A ; 74 |
||
1084 | 5a8: 91 e0 ldi r25, 0x01 ; 1 |
||
1085 | 5aa: 00 c0 rjmp .+0 ; 0x5ac <__stack+0x14d> |
||
1086 | return(0); |
||
1087 | } |
||
1088 | |||
1089 | unsigned char Delay(unsigned int timer) |
||
1090 | { |
||
1091 | while(timer--) |
||
1092 | 5ac: 01 97 sbiw r24, 0x01 ; 1 |
||
1093 | 5ae: 2f ef ldi r18, 0xFF ; 255 |
||
1094 | 5b0: 8f 3f cpi r24, 0xFF ; 255 |
||
1095 | 5b2: 92 07 cpc r25, r18 |
||
1096 | 5b4: d9 f7 brne .-10 ; 0x5ac <__stack+0x14d> |
||
1097 | } |
||
1098 | |||
1099 | FETS_OFF; |
||
1100 | LOW_A_EIN; // Low A ein |
||
1101 | LOW_B_EIN; // Low B ein |
||
1102 | for(i=0; i<(TONDAUER / SOUND3_A); i++) |
||
1103 | 5b6: 0f 5f subi r16, 0xFF ; 255 |
||
1104 | 5b8: 1f 4f sbci r17, 0xFF ; 255 |
||
1105 | 5ba: 0f 36 cpi r16, 0x6F ; 111 |
||
1106 | 5bc: 11 05 cpc r17, r1 |
||
1107 | 5be: 41 f7 brne .-48 ; 0x590 <__stack+0x131> |
||
1108 | Delay(SOUND_E); |
||
1109 | if(MessAD(2) > 50) { MosfetOkay |= 0x04; } else { MosfetOkay &= ~0x04;}; |
||
1110 | PORTB = 0; |
||
1111 | Delay(SOUND2_A); |
||
1112 | } |
||
1113 | FETS_OFF; |
||
1114 | 5c0: 82 b3 in r24, 0x12 ; 18 |
||
1115 | 5c2: 87 7c andi r24, 0xC7 ; 199 |
||
1116 | 5c4: 82 bb out 0x12, r24 ; 18 |
||
1117 | 5c6: 88 b3 in r24, 0x18 ; 24 |
||
1118 | 5c8: 81 7f andi r24, 0xF1 ; 241 |
||
1119 | 5ca: 88 bb out 0x18, r24 ; 24 |
||
1120 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
1121 | //+ Low-Mosfets auf Schalten testen |
||
1122 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
1123 | // SENSE_B; |
||
1124 | LOW_A_EIN; // Low A ein |
||
1125 | 5cc: 93 9a sbi 0x12, 3 ; 18 |
||
1126 | 5ce: 00 e0 ldi r16, 0x00 ; 0 |
||
1127 | 5d0: 10 e0 ldi r17, 0x00 ; 0 |
||
1128 | for(i=0; i< (TONDAUER / SOUND2_A) ; i++) |
||
1129 | { |
||
1130 | HIGH_B_EIN; // Test B |
||
1131 | 5d2: c2 9a sbi 0x18, 2 ; 24 |
||
1132 | Delay(SOUND_E); |
||
1133 | if(MessAD(0) > 128) { MosfetOkay &= ~0x08;} else { MosfetOkay |= 0x08;}; |
||
1134 | 5d4: 80 e0 ldi r24, 0x00 ; 0 |
||
1135 | 5d6: 80 d6 rcall .+3328 ; 0x12d8 <MessAD> |
||
1136 | 5d8: 81 38 cpi r24, 0x81 ; 129 |
||
1137 | 5da: 91 05 cpc r25, r1 |
||
1138 | 5dc: 18 f0 brcs .+6 ; 0x5e4 <__stack+0x185> |
||
1139 | 5de: 47 ef ldi r20, 0xF7 ; 247 |
||
1140 | 5e0: f4 22 and r15, r20 |
||
1141 | 5e2: 02 c0 rjmp .+4 ; 0x5e8 <__stack+0x189> |
||
1142 | 5e4: 58 e0 ldi r21, 0x08 ; 8 |
||
1143 | 5e6: f5 2a or r15, r21 |
||
1144 | PORTB = 0; |
||
1145 | 5e8: 18 ba out 0x18, r1 ; 24 |
||
1146 | 5ea: 8a e4 ldi r24, 0x4A ; 74 |
||
1147 | 5ec: 91 e0 ldi r25, 0x01 ; 1 |
||
1148 | 5ee: 00 c0 rjmp .+0 ; 0x5f0 <__stack+0x191> |
||
1149 | return(0); |
||
1150 | } |
||
1151 | |||
1152 | unsigned char Delay(unsigned int timer) |
||
1153 | { |
||
1154 | while(timer--) |
||
1155 | 5f0: 01 97 sbiw r24, 0x01 ; 1 |
||
1156 | 5f2: 2f ef ldi r18, 0xFF ; 255 |
||
1157 | 5f4: 8f 3f cpi r24, 0xFF ; 255 |
||
1158 | 5f6: 92 07 cpc r25, r18 |
||
1159 | 5f8: d9 f7 brne .-10 ; 0x5f0 <__stack+0x191> |
||
1160 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
1161 | //+ Low-Mosfets auf Schalten testen |
||
1162 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
1163 | // SENSE_B; |
||
1164 | LOW_A_EIN; // Low A ein |
||
1165 | for(i=0; i< (TONDAUER / SOUND2_A) ; i++) |
||
1166 | 5fa: 0f 5f subi r16, 0xFF ; 255 |
||
1167 | 5fc: 1f 4f sbci r17, 0xFF ; 255 |
||
1168 | 5fe: 09 37 cpi r16, 0x79 ; 121 |
||
1169 | 600: 11 05 cpc r17, r1 |
||
1170 | 602: 39 f7 brne .-50 ; 0x5d2 <__stack+0x173> |
||
1171 | PORTB = 0; |
||
1172 | Delay(SOUND2_A); |
||
1173 | } |
||
1174 | |||
1175 | //++++++++++++++++++++++++++++++++++++ |
||
1176 | LOW_C_EIN; // Low C ein |
||
1177 | 604: 95 9a sbi 0x12, 5 ; 18 |
||
1178 | 606: 00 e0 ldi r16, 0x00 ; 0 |
||
1179 | 608: 10 e0 ldi r17, 0x00 ; 0 |
||
1180 | for(i=0; i<(TONDAUER / SOUND1_A); i++) |
||
1181 | { |
||
1182 | HIGH_B_EIN; // Test B |
||
1183 | 60a: c2 9a sbi 0x18, 2 ; 24 |
||
1184 | Delay(SOUND_E); |
||
1185 | if(MessAD(2) > 128) { MosfetOkay &= ~0x20;} else { MosfetOkay |= 0x20;}; |
||
1186 | 60c: 82 e0 ldi r24, 0x02 ; 2 |
||
1187 | 60e: 64 d6 rcall .+3272 ; 0x12d8 <MessAD> |
||
1188 | 610: 81 38 cpi r24, 0x81 ; 129 |
||
1189 | 612: 91 05 cpc r25, r1 |
||
1190 | 614: 18 f0 brcs .+6 ; 0x61c <__stack+0x1bd> |
||
1191 | 616: 4f ed ldi r20, 0xDF ; 223 |
||
1192 | 618: f4 22 and r15, r20 |
||
1193 | 61a: 02 c0 rjmp .+4 ; 0x620 <__stack+0x1c1> |
||
1194 | 61c: 50 e2 ldi r21, 0x20 ; 32 |
||
1195 | 61e: f5 2a or r15, r21 |
||
1196 | PORTB = 0; |
||
1197 | 620: 18 ba out 0x18, r1 ; 24 |
||
1198 | 622: 88 e6 ldi r24, 0x68 ; 104 |
||
1199 | 624: 91 e0 ldi r25, 0x01 ; 1 |
||
1200 | 626: 00 c0 rjmp .+0 ; 0x628 <__stack+0x1c9> |
||
1201 | return(0); |
||
1202 | } |
||
1203 | |||
1204 | unsigned char Delay(unsigned int timer) |
||
1205 | { |
||
1206 | while(timer--) |
||
1207 | 628: 01 97 sbiw r24, 0x01 ; 1 |
||
1208 | 62a: 2f ef ldi r18, 0xFF ; 255 |
||
1209 | 62c: 8f 3f cpi r24, 0xFF ; 255 |
||
1210 | 62e: 92 07 cpc r25, r18 |
||
1211 | 630: d9 f7 brne .-10 ; 0x628 <__stack+0x1c9> |
||
1212 | Delay(SOUND2_A); |
||
1213 | } |
||
1214 | |||
1215 | //++++++++++++++++++++++++++++++++++++ |
||
1216 | LOW_C_EIN; // Low C ein |
||
1217 | for(i=0; i<(TONDAUER / SOUND1_A); i++) |
||
1218 | 632: 0f 5f subi r16, 0xFF ; 255 |
||
1219 | 634: 1f 4f sbci r17, 0xFF ; 255 |
||
1220 | 636: 05 38 cpi r16, 0x85 ; 133 |
||
1221 | 638: 11 05 cpc r17, r1 |
||
1222 | 63a: 39 f7 brne .-50 ; 0x60a <__stack+0x1ab> |
||
1223 | Delay(SOUND_E); |
||
1224 | if(MessAD(2) > 128) { MosfetOkay &= ~0x20;} else { MosfetOkay |= 0x20;}; |
||
1225 | PORTB = 0; |
||
1226 | Delay(SOUND3_A); |
||
1227 | } |
||
1228 | FETS_OFF; |
||
1229 | 63c: 82 b3 in r24, 0x12 ; 18 |
||
1230 | 63e: 87 7c andi r24, 0xC7 ; 199 |
||
1231 | 640: 82 bb out 0x12, r24 ; 18 |
||
1232 | 642: 88 b3 in r24, 0x18 ; 24 |
||
1233 | 644: 81 7f andi r24, 0xF1 ; 241 |
||
1234 | 646: 88 bb out 0x18, r24 ; 24 |
||
1235 | //++++++++++++++++++++++++++++++++++++ |
||
1236 | FETS_OFF; |
||
1237 | 648: 82 b3 in r24, 0x12 ; 18 |
||
1238 | 64a: 87 7c andi r24, 0xC7 ; 199 |
||
1239 | 64c: 82 bb out 0x12, r24 ; 18 |
||
1240 | 64e: 88 b3 in r24, 0x18 ; 24 |
||
1241 | 650: 81 7f andi r24, 0xF1 ; 241 |
||
1242 | 652: 88 bb out 0x18, r24 ; 24 |
||
1243 | LOW_B_EIN; // Low B ein |
||
1244 | 654: 94 9a sbi 0x12, 4 ; 18 |
||
1245 | 656: 00 e0 ldi r16, 0x00 ; 0 |
||
1246 | 658: 10 e0 ldi r17, 0x00 ; 0 |
||
1247 | for(i=0; i<(TONDAUER / SOUND3_A); i++) |
||
1248 | { |
||
1249 | HIGH_C_EIN; // Test C |
||
1250 | 65a: c1 9a sbi 0x18, 1 ; 24 |
||
1251 | Delay(SOUND_E); |
||
1252 | if(MessAD(1) > 128) { MosfetOkay &= ~0x10;} else { MosfetOkay |= 0x10;}; |
||
1253 | 65c: 81 e0 ldi r24, 0x01 ; 1 |
||
1254 | 65e: 3c d6 rcall .+3192 ; 0x12d8 <MessAD> |
||
1255 | 660: 81 38 cpi r24, 0x81 ; 129 |
||
1256 | 662: 91 05 cpc r25, r1 |
||
1257 | 664: 18 f0 brcs .+6 ; 0x66c <__stack+0x20d> |
||
1258 | 666: 4f ee ldi r20, 0xEF ; 239 |
||
1259 | 668: f4 22 and r15, r20 |
||
1260 | 66a: 02 c0 rjmp .+4 ; 0x670 <__stack+0x211> |
||
1261 | 66c: 50 e1 ldi r21, 0x10 ; 16 |
||
1262 | 66e: f5 2a or r15, r21 |
||
1263 | PORTB = 0; |
||
1264 | 670: 18 ba out 0x18, r1 ; 24 |
||
1265 | 672: 88 e6 ldi r24, 0x68 ; 104 |
||
1266 | 674: 91 e0 ldi r25, 0x01 ; 1 |
||
1267 | 676: 00 c0 rjmp .+0 ; 0x678 <__stack+0x219> |
||
1268 | return(0); |
||
1269 | } |
||
1270 | |||
1271 | unsigned char Delay(unsigned int timer) |
||
1272 | { |
||
1273 | while(timer--) |
||
1274 | 678: 01 97 sbiw r24, 0x01 ; 1 |
||
1275 | 67a: 2f ef ldi r18, 0xFF ; 255 |
||
1276 | 67c: 8f 3f cpi r24, 0xFF ; 255 |
||
1277 | 67e: 92 07 cpc r25, r18 |
||
1278 | 680: d9 f7 brne .-10 ; 0x678 <__stack+0x219> |
||
1279 | } |
||
1280 | FETS_OFF; |
||
1281 | //++++++++++++++++++++++++++++++++++++ |
||
1282 | FETS_OFF; |
||
1283 | LOW_B_EIN; // Low B ein |
||
1284 | for(i=0; i<(TONDAUER / SOUND3_A); i++) |
||
1285 | 682: 0f 5f subi r16, 0xFF ; 255 |
||
1286 | 684: 1f 4f sbci r17, 0xFF ; 255 |
||
1287 | 686: 0f 36 cpi r16, 0x6F ; 111 |
||
1288 | 688: 11 05 cpc r17, r1 |
||
1289 | 68a: 39 f7 brne .-50 ; 0x65a <__stack+0x1fb> |
||
1290 | Delay(SOUND_E); |
||
1291 | if(MessAD(1) > 128) { MosfetOkay &= ~0x10;} else { MosfetOkay |= 0x10;}; |
||
1292 | PORTB = 0; |
||
1293 | Delay(SOUND3_A); |
||
1294 | } |
||
1295 | FETS_OFF; |
||
1296 | 68c: 82 b3 in r24, 0x12 ; 18 |
||
1297 | 68e: 87 7c andi r24, 0xC7 ; 199 |
||
1298 | 690: 82 bb out 0x12, r24 ; 18 |
||
1299 | 692: 88 b3 in r24, 0x18 ; 24 |
||
1300 | 694: 81 7f andi r24, 0xF1 ; 241 |
||
1301 | 696: 88 bb out 0x18, r24 ; 24 |
||
1302 | //++++++++++++++++++++++++++++++++++++ |
||
1303 | |||
1304 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
1305 | sei();//Globale Interrupts Einschalten |
||
1306 | 698: 78 94 sei |
||
1307 | Delay(SOUND_E); |
||
1308 | PORTB = 0; |
||
1309 | Delay(SOUND8_A); |
||
1310 | } |
||
1311 | */ |
||
1312 | Delay_ms(300 * (3-ADR_TAB[MotorAdresse])); |
||
1313 | 69a: 80 91 66 00 lds r24, 0x0066 |
||
1314 | 69e: fe 01 movw r30, r28 |
||
1315 | 6a0: e8 0f add r30, r24 |
||
1316 | 6a2: f1 1d adc r31, r1 |
||
1317 | 6a4: 21 81 ldd r18, Z+1 ; 0x01 |
||
1318 | 6a6: 83 e0 ldi r24, 0x03 ; 3 |
||
1319 | 6a8: 90 e0 ldi r25, 0x00 ; 0 |
||
1320 | 6aa: 82 1b sub r24, r18 |
||
1321 | 6ac: 91 09 sbc r25, r1 |
||
1322 | 6ae: 2c e2 ldi r18, 0x2C ; 44 |
||
1323 | 6b0: 31 e0 ldi r19, 0x01 ; 1 |
||
1324 | 6b2: ac 01 movw r20, r24 |
||
1325 | 6b4: 42 9f mul r20, r18 |
||
1326 | 6b6: c0 01 movw r24, r0 |
||
1327 | 6b8: 43 9f mul r20, r19 |
||
1328 | 6ba: 90 0d add r25, r0 |
||
1329 | 6bc: 52 9f mul r21, r18 |
||
1330 | 6be: 90 0d add r25, r0 |
||
1331 | 6c0: 11 24 eor r1, r1 |
||
1332 | 6c2: b6 d5 rcall .+2924 ; 0x1230 <Delay_ms> |
||
1333 | if(!(MosfetOkay & 0x01)) { anz = 1; UDR='A'; } else |
||
1334 | 6c4: f0 fc sbrc r15, 0 |
||
1335 | 6c6: 04 c0 rjmp .+8 ; 0x6d0 <__stack+0x271> |
||
1336 | 6c8: 81 e4 ldi r24, 0x41 ; 65 |
||
1337 | 6ca: 8c b9 out 0x0c, r24 ; 12 |
||
1338 | 6cc: 11 e0 ldi r17, 0x01 ; 1 |
||
1339 | 6ce: 1d c0 rjmp .+58 ; 0x70a <__stack+0x2ab> |
||
1340 | if(!(MosfetOkay & 0x02)) { anz = 2; UDR='B'; } else |
||
1341 | 6d0: f1 fc sbrc r15, 1 |
||
1342 | 6d2: 04 c0 rjmp .+8 ; 0x6dc <__stack+0x27d> |
||
1343 | 6d4: 82 e4 ldi r24, 0x42 ; 66 |
||
1344 | 6d6: 8c b9 out 0x0c, r24 ; 12 |
||
1345 | 6d8: 12 e0 ldi r17, 0x02 ; 2 |
||
1346 | 6da: 17 c0 rjmp .+46 ; 0x70a <__stack+0x2ab> |
||
1347 | if(!(MosfetOkay & 0x04)) { anz = 3; UDR='C'; } else |
||
1348 | 6dc: f2 fc sbrc r15, 2 |
||
1349 | 6de: 04 c0 rjmp .+8 ; 0x6e8 <__stack+0x289> |
||
1350 | 6e0: 83 e4 ldi r24, 0x43 ; 67 |
||
1351 | 6e2: 8c b9 out 0x0c, r24 ; 12 |
||
1352 | 6e4: 13 e0 ldi r17, 0x03 ; 3 |
||
1353 | 6e6: 11 c0 rjmp .+34 ; 0x70a <__stack+0x2ab> |
||
1354 | if(!(MosfetOkay & 0x08)) { anz = 4; UDR='a'; } else |
||
1355 | 6e8: f3 fc sbrc r15, 3 |
||
1356 | 6ea: 04 c0 rjmp .+8 ; 0x6f4 <__stack+0x295> |
||
1357 | 6ec: 81 e6 ldi r24, 0x61 ; 97 |
||
1358 | 6ee: 8c b9 out 0x0c, r24 ; 12 |
||
1359 | 6f0: 14 e0 ldi r17, 0x04 ; 4 |
||
1360 | 6f2: 0b c0 rjmp .+22 ; 0x70a <__stack+0x2ab> |
||
1361 | if(!(MosfetOkay & 0x10)) { anz = 5; UDR='b'; } else |
||
1362 | 6f4: f4 fc sbrc r15, 4 |
||
1363 | 6f6: 04 c0 rjmp .+8 ; 0x700 <__stack+0x2a1> |
||
1364 | 6f8: 82 e6 ldi r24, 0x62 ; 98 |
||
1365 | 6fa: 8c b9 out 0x0c, r24 ; 12 |
||
1366 | 6fc: 15 e0 ldi r17, 0x05 ; 5 |
||
1367 | 6fe: 05 c0 rjmp .+10 ; 0x70a <__stack+0x2ab> |
||
1368 | if(!(MosfetOkay & 0x20)) { anz = 6; UDR='c'; } |
||
1369 | 700: f5 fc sbrc r15, 5 |
||
1370 | 702: 06 c0 rjmp .+12 ; 0x710 <__stack+0x2b1> |
||
1371 | 704: 83 e6 ldi r24, 0x63 ; 99 |
||
1372 | 706: 8c b9 out 0x0c, r24 ; 12 |
||
1373 | 708: 16 e0 ldi r17, 0x06 ; 6 |
||
1374 | |||
1375 | // if(anz) Delay_ms(1000); |
||
1376 | if(anz) while(1) RotBlink(anz); // bei Kurzschluss nicht starten |
||
1377 | 70a: 81 2f mov r24, r17 |
||
1378 | 70c: b7 dd rcall .-1170 ; 0x27c <RotBlink> |
||
1379 | 70e: fd cf rjmp .-6 ; 0x70a <__stack+0x2ab> |
||
1380 | RotBlink(anz); |
||
1381 | 710: 80 e0 ldi r24, 0x00 ; 0 |
||
1382 | 712: b4 dd rcall .-1176 ; 0x27c <RotBlink> |
||
1383 | uart_putchar('.'); |
||
1384 | 714: 8e e2 ldi r24, 0x2E ; 46 |
||
1385 | 716: d8 d3 rcall .+1968 ; 0xec8 <uart_putchar> |
||
1386 | } |
||
1387 | 718: 27 96 adiw r28, 0x07 ; 7 |
||
1388 | 71a: 0f b6 in r0, 0x3f ; 63 |
||
1389 | 71c: f8 94 cli |
||
1390 | 71e: de bf out 0x3e, r29 ; 62 |
||
1391 | 720: 0f be out 0x3f, r0 ; 63 |
||
1392 | 722: cd bf out 0x3d, r28 ; 61 |
||
1393 | 724: cf 91 pop r28 |
||
1394 | 726: df 91 pop r29 |
||
1395 | 728: 1f 91 pop r17 |
||
1396 | 72a: 0f 91 pop r16 |
||
1397 | 72c: ff 90 pop r15 |
||
1398 | 72e: ef 90 pop r14 |
||
1399 | 730: df 90 pop r13 |
||
1400 | 732: bf 90 pop r11 |
||
1401 | 734: af 90 pop r10 |
||
1402 | 736: 08 95 ret |
||
1403 | |||
1404 | 00000738 <Anwerfen>: |
||
1405 | |||
1406 | //############################################################################ |
||
1407 | // |
||
1408 | char Anwerfen(unsigned char pwm) |
||
1409 | //############################################################################ |
||
1410 | { |
||
1411 | 738: 6f 92 push r6 |
||
1412 | 73a: 7f 92 push r7 |
||
1413 | 73c: 9f 92 push r9 |
||
1414 | 73e: af 92 push r10 |
||
1415 | 740: bf 92 push r11 |
||
1416 | 742: cf 92 push r12 |
||
1417 | 744: df 92 push r13 |
||
1418 | 746: ef 92 push r14 |
||
1419 | 748: ff 92 push r15 |
||
1420 | 74a: 0f 93 push r16 |
||
1421 | 74c: 1f 93 push r17 |
||
1422 | 74e: cf 93 push r28 |
||
1423 | 750: df 93 push r29 |
||
1424 | 752: 98 2e mov r9, r24 |
||
1425 | unsigned long timer = 300,i; |
||
1426 | DISABLE_SENSE_INT; |
||
1427 | 754: 10 92 b1 00 sts 0x00B1, r1 |
||
1428 | 758: 43 98 cbi 0x08, 3 ; 8 |
||
1429 | PWM = 5; |
||
1430 | 75a: 85 e0 ldi r24, 0x05 ; 5 |
||
1431 | 75c: 90 e0 ldi r25, 0x00 ; 0 |
||
1432 | 75e: 90 93 79 00 sts 0x0079, r25 |
||
1433 | 762: 80 93 78 00 sts 0x0078, r24 |
||
1434 | SetPWM(); |
||
1435 | 766: 7b dc rcall .-1802 ; 0x5e <SetPWM> |
||
1436 | Manuell(); |
||
1437 | 768: 0f d7 rcall .+3614 ; 0x1588 <Manuell> |
||
1438 | // Delay_ms(200); |
||
1439 | MinUpmPulse = SetDelay(300); |
||
1440 | 76a: 8c e2 ldi r24, 0x2C ; 44 |
||
1441 | 76c: 91 e0 ldi r25, 0x01 ; 1 |
||
1442 | 76e: 4c d5 rcall .+2712 ; 0x1208 <SetDelay> |
||
1443 | 770: 90 93 b4 02 sts 0x02B4, r25 |
||
1444 | 774: 80 93 b3 02 sts 0x02B3, r24 |
||
1445 | 778: 09 c0 rjmp .+18 ; 0x78c <Anwerfen+0x54> |
||
1446 | while(!CheckDelay(MinUpmPulse)) |
||
1447 | { |
||
1448 | FastADConvert(); |
||
1449 | 77a: c3 d5 rcall .+2950 ; 0x1302 <FastADConvert> |
||
1450 | if(Strom > 120) |
||
1451 | 77c: 80 91 7a 00 lds r24, 0x007A |
||
1452 | 780: 90 91 7b 00 lds r25, 0x007B |
||
1453 | 784: 89 37 cpi r24, 0x79 ; 121 |
||
1454 | 786: 91 05 cpc r25, r1 |
||
1455 | 788: 08 f0 brcs .+2 ; 0x78c <Anwerfen+0x54> |
||
1456 | 78a: 5c c0 rjmp .+184 ; 0x844 <Anwerfen+0x10c> |
||
1457 | PWM = 5; |
||
1458 | SetPWM(); |
||
1459 | Manuell(); |
||
1460 | // Delay_ms(200); |
||
1461 | MinUpmPulse = SetDelay(300); |
||
1462 | while(!CheckDelay(MinUpmPulse)) |
||
1463 | 78c: 80 91 b3 02 lds r24, 0x02B3 |
||
1464 | 790: 90 91 b4 02 lds r25, 0x02B4 |
||
1465 | 794: 43 d5 rcall .+2694 ; 0x121c <CheckDelay> |
||
1466 | 796: 88 23 and r24, r24 |
||
1467 | 798: 81 f3 breq .-32 ; 0x77a <Anwerfen+0x42> |
||
1468 | STEUER_OFF; // Abschalten wegen Kurzschluss |
||
1469 | RotBlink(10); |
||
1470 | return(0); |
||
1471 | } |
||
1472 | } |
||
1473 | PWM = pwm; |
||
1474 | 79a: 90 92 78 00 sts 0x0078, r9 |
||
1475 | 79e: 10 92 79 00 sts 0x0079, r1 |
||
1476 | 7a2: 5c e2 ldi r21, 0x2C ; 44 |
||
1477 | 7a4: a5 2e mov r10, r21 |
||
1478 | 7a6: 51 e0 ldi r21, 0x01 ; 1 |
||
1479 | 7a8: b5 2e mov r11, r21 |
||
1480 | 7aa: c1 2c mov r12, r1 |
||
1481 | 7ac: d1 2c mov r13, r1 |
||
1482 | } |
||
1483 | |||
1484 | void DebugAusgaben(void) |
||
1485 | { |
||
1486 | DebugOut.Analog[0] = Strom; |
||
1487 | DebugOut.Analog[1] = Mittelstrom; |
||
1488 | 7ae: c6 e8 ldi r28, 0x86 ; 134 |
||
1489 | 7b0: d3 e0 ldi r29, 0x03 ; 3 |
||
1490 | DebugOut.Analog[2] = SIO_Drehzahl; |
||
1491 | DebugOut.Analog[3] = PPM_Signal; |
||
1492 | DebugOut.Analog[4] = OCR2; |
||
1493 | 7b2: 46 e0 ldi r20, 0x06 ; 6 |
||
1494 | 7b4: 64 2e mov r6, r20 |
||
1495 | 7b6: 71 2c mov r7, r1 |
||
1496 | 7b8: 6c 0e add r6, r28 |
||
1497 | 7ba: 7d 1e adc r7, r29 |
||
1498 | STEUER_OFF; // Abschalten wegen Kurzschluss |
||
1499 | RotBlink(10); |
||
1500 | return(0); |
||
1501 | } |
||
1502 | } |
||
1503 | PWM = pwm; |
||
1504 | 7bc: ee 24 eor r14, r14 |
||
1505 | 7be: ff 24 eor r15, r15 |
||
1506 | 7c0: 87 01 movw r16, r14 |
||
1507 | while(1) |
||
1508 | { |
||
1509 | for(i=0;i<timer; i++) |
||
1510 | { |
||
1511 | if(!UebertragungAbgeschlossen) SendUart(); |
||
1512 | 7c2: 80 91 6f 00 lds r24, 0x006F |
||
1513 | 7c6: 88 23 and r24, r24 |
||
1514 | 7c8: 11 f4 brne .+4 ; 0x7ce <Anwerfen+0x96> |
||
1515 | 7ca: 6c d2 rcall .+1240 ; 0xca4 <SendUart> |
||
1516 | 7cc: 01 c0 rjmp .+2 ; 0x7d0 <Anwerfen+0x98> |
||
1517 | else DatenUebertragung(); |
||
1518 | 7ce: 6e d4 rcall .+2268 ; 0x10ac <DatenUebertragung> |
||
1519 | //############################################################################ |
||
1520 | // |
||
1521 | void Wait(unsigned char dauer) |
||
1522 | //############################################################################ |
||
1523 | { |
||
1524 | dauer = (unsigned char)TCNT0 + dauer; |
||
1525 | 7d0: 82 b7 in r24, 0x32 ; 50 |
||
1526 | 7d2: 8c 59 subi r24, 0x9C ; 156 |
||
1527 | while((TCNT0 - dauer) & 0x80); |
||
1528 | 7d4: 98 2f mov r25, r24 |
||
1529 | 7d6: 82 b7 in r24, 0x32 ; 50 |
||
1530 | 7d8: 89 1b sub r24, r25 |
||
1531 | 7da: 87 fd sbrc r24, 7 |
||
1532 | 7dc: fc cf rjmp .-8 ; 0x7d6 <Anwerfen+0x9e> |
||
1533 | } |
||
1534 | } |
||
1535 | PWM = pwm; |
||
1536 | while(1) |
||
1537 | { |
||
1538 | for(i=0;i<timer; i++) |
||
1539 | 7de: 08 94 sec |
||
1540 | 7e0: e1 1c adc r14, r1 |
||
1541 | 7e2: f1 1c adc r15, r1 |
||
1542 | 7e4: 01 1d adc r16, r1 |
||
1543 | 7e6: 11 1d adc r17, r1 |
||
1544 | 7e8: ea 14 cp r14, r10 |
||
1545 | 7ea: fb 04 cpc r15, r11 |
||
1546 | 7ec: 0c 05 cpc r16, r12 |
||
1547 | 7ee: 1d 05 cpc r17, r13 |
||
1548 | 7f0: 40 f3 brcs .-48 ; 0x7c2 <Anwerfen+0x8a> |
||
1549 | } |
||
1550 | } |
||
1551 | |||
1552 | void DebugAusgaben(void) |
||
1553 | { |
||
1554 | DebugOut.Analog[0] = Strom; |
||
1555 | 7f2: 80 91 7a 00 lds r24, 0x007A |
||
1556 | 7f6: 90 91 7b 00 lds r25, 0x007B |
||
1557 | 7fa: 90 93 85 03 sts 0x0385, r25 |
||
1558 | 7fe: 80 93 84 03 sts 0x0384, r24 |
||
1559 | DebugOut.Analog[1] = Mittelstrom; |
||
1560 | 802: 80 91 7d 00 lds r24, 0x007D |
||
1561 | 806: 80 93 86 03 sts 0x0386, r24 |
||
1562 | 80a: 19 82 std Y+1, r1 ; 0x01 |
||
1563 | DebugOut.Analog[2] = SIO_Drehzahl; |
||
1564 | 80c: 80 91 8b 00 lds r24, 0x008B |
||
1565 | 810: 90 91 8c 00 lds r25, 0x008C |
||
1566 | 814: 90 93 89 03 sts 0x0389, r25 |
||
1567 | 818: 80 93 88 03 sts 0x0388, r24 |
||
1568 | DebugOut.Analog[3] = PPM_Signal; |
||
1569 | 81c: 80 91 a5 00 lds r24, 0x00A5 |
||
1570 | 820: 90 91 a6 00 lds r25, 0x00A6 |
||
1571 | 824: 90 93 8b 03 sts 0x038B, r25 |
||
1572 | 828: 80 93 8a 03 sts 0x038A, r24 |
||
1573 | DebugOut.Analog[4] = OCR2; |
||
1574 | 82c: 83 b5 in r24, 0x23 ; 35 |
||
1575 | 82e: 80 93 8c 03 sts 0x038C, r24 |
||
1576 | 832: f3 01 movw r30, r6 |
||
1577 | 834: 11 82 std Z+1, r1 ; 0x01 |
||
1578 | if(!UebertragungAbgeschlossen) SendUart(); |
||
1579 | else DatenUebertragung(); |
||
1580 | Wait(100); // warten |
||
1581 | } |
||
1582 | DebugAusgaben(); |
||
1583 | FastADConvert(); |
||
1584 | 836: 65 d5 rcall .+2762 ; 0x1302 <FastADConvert> |
||
1585 | if(Strom > 60) |
||
1586 | 838: 80 91 7a 00 lds r24, 0x007A |
||
1587 | 83c: 90 91 7b 00 lds r25, 0x007B |
||
1588 | 840: cd 97 sbiw r24, 0x3d ; 61 |
||
1589 | 842: a8 f0 brcs .+42 ; 0x86e <Anwerfen+0x136> |
||
1590 | { |
||
1591 | STEUER_OFF; // Abschalten wegen Kurzschluss |
||
1592 | 844: 82 b3 in r24, 0x12 ; 18 |
||
1593 | 846: 87 7c andi r24, 0xC7 ; 199 |
||
1594 | 848: 82 bb out 0x12, r24 ; 18 |
||
1595 | 84a: 1b bc out 0x2b, r1 ; 43 |
||
1596 | 84c: 1a bc out 0x2a, r1 ; 42 |
||
1597 | 84e: 19 bc out 0x29, r1 ; 41 |
||
1598 | 850: 18 bc out 0x28, r1 ; 40 |
||
1599 | 852: 13 bc out 0x23, r1 ; 35 |
||
1600 | 854: 81 e0 ldi r24, 0x01 ; 1 |
||
1601 | 856: 8f bd out 0x2f, r24 ; 47 |
||
1602 | 858: 81 e4 ldi r24, 0x41 ; 65 |
||
1603 | 85a: 85 bd out 0x25, r24 ; 37 |
||
1604 | 85c: 8e e0 ldi r24, 0x0E ; 14 |
||
1605 | 85e: 87 bb out 0x17, r24 ; 23 |
||
1606 | 860: 88 b3 in r24, 0x18 ; 24 |
||
1607 | 862: 81 7f andi r24, 0xF1 ; 241 |
||
1608 | 864: 88 bb out 0x18, r24 ; 24 |
||
1609 | RotBlink(10); |
||
1610 | 866: 8a e0 ldi r24, 0x0A ; 10 |
||
1611 | 868: 09 dd rcall .-1518 ; 0x27c <RotBlink> |
||
1612 | 86a: 80 e0 ldi r24, 0x00 ; 0 |
||
1613 | 86c: 2e c0 rjmp .+92 ; 0x8ca <Anwerfen+0x192> |
||
1614 | return(0); |
||
1615 | } |
||
1616 | |||
1617 | timer-= timer/15+1; |
||
1618 | 86e: c6 01 movw r24, r12 |
||
1619 | 870: b5 01 movw r22, r10 |
||
1620 | 872: 2f e0 ldi r18, 0x0F ; 15 |
||
1621 | 874: 30 e0 ldi r19, 0x00 ; 0 |
||
1622 | 876: 40 e0 ldi r20, 0x00 ; 0 |
||
1623 | 878: 50 e0 ldi r21, 0x00 ; 0 |
||
1624 | 87a: 12 d8 rcall .-4060 ; 0xfffff8a0 <__eeprom_end+0xff7ef8a0> |
||
1625 | 87c: 20 95 com r18 |
||
1626 | 87e: 30 95 com r19 |
||
1627 | 880: 40 95 com r20 |
||
1628 | 882: 50 95 com r21 |
||
1629 | 884: a2 0e add r10, r18 |
||
1630 | 886: b3 1e adc r11, r19 |
||
1631 | 888: c4 1e adc r12, r20 |
||
1632 | 88a: d5 1e adc r13, r21 |
||
1633 | if(timer < 25) { if(TEST_MANUELL) timer = 25; else return(1); } |
||
1634 | 88c: f9 e1 ldi r31, 0x19 ; 25 |
||
1635 | 88e: af 16 cp r10, r31 |
||
1636 | 890: b1 04 cpc r11, r1 |
||
1637 | 892: c1 04 cpc r12, r1 |
||
1638 | 894: d1 04 cpc r13, r1 |
||
1639 | 896: c0 f0 brcs .+48 ; 0x8c8 <Anwerfen+0x190> |
||
1640 | Manuell(); |
||
1641 | 898: 77 d6 rcall .+3310 ; 0x1588 <Manuell> |
||
1642 | Phase++; |
||
1643 | 89a: 80 91 af 00 lds r24, 0x00AF |
||
1644 | 89e: 8f 5f subi r24, 0xFF ; 255 |
||
1645 | 8a0: 80 93 af 00 sts 0x00AF, r24 |
||
1646 | Phase %= 6; |
||
1647 | 8a4: 80 91 af 00 lds r24, 0x00AF |
||
1648 | 8a8: 66 e0 ldi r22, 0x06 ; 6 |
||
1649 | 8aa: da d7 rcall .+4020 ; 0x1860 <__udivmodqi4> |
||
1650 | 8ac: 90 93 af 00 sts 0x00AF, r25 |
||
1651 | AdConvert(); |
||
1652 | 8b0: dc d4 rcall .+2488 ; 0x126a <AdConvert> |
||
1653 | PWM = pwm; |
||
1654 | 8b2: 90 92 78 00 sts 0x0078, r9 |
||
1655 | 8b6: 10 92 79 00 sts 0x0079, r1 |
||
1656 | SetPWM(); |
||
1657 | 8ba: d1 db rcall .-2142 ; 0x5e <SetPWM> |
||
1658 | if(SENSE) |
||
1659 | 8bc: 44 9b sbis 0x08, 4 ; 8 |
||
1660 | 8be: 7e cf rjmp .-260 ; 0x7bc <Anwerfen+0x84> |
||
1661 | { |
||
1662 | PORTD ^= GRUEN; |
||
1663 | 8c0: 82 b3 in r24, 0x12 ; 18 |
||
1664 | 8c2: 80 58 subi r24, 0x80 ; 128 |
||
1665 | 8c4: 82 bb out 0x12, r24 ; 18 |
||
1666 | 8c6: 7a cf rjmp .-268 ; 0x7bc <Anwerfen+0x84> |
||
1667 | 8c8: 81 e0 ldi r24, 0x01 ; 1 |
||
1668 | } |
||
1669 | } |
||
1670 | } |
||
1671 | 8ca: df 91 pop r29 |
||
1672 | 8cc: cf 91 pop r28 |
||
1673 | 8ce: 1f 91 pop r17 |
||
1674 | 8d0: 0f 91 pop r16 |
||
1675 | 8d2: ff 90 pop r15 |
||
1676 | 8d4: ef 90 pop r14 |
||
1677 | 8d6: df 90 pop r13 |
||
1678 | 8d8: cf 90 pop r12 |
||
1679 | 8da: bf 90 pop r11 |
||
1680 | 8dc: af 90 pop r10 |
||
1681 | 8de: 9f 90 pop r9 |
||
1682 | 8e0: 7f 90 pop r7 |
||
1683 | 8e2: 6f 90 pop r6 |
||
1684 | 8e4: 08 95 ret |
||
1685 | |||
1686 | 000008e6 <main>: |
||
1687 | |||
1688 | //############################################################################ |
||
1689 | //Hauptprogramm |
||
1690 | int main (void) |
||
1691 | //############################################################################ |
||
1692 | { |
||
1693 | 8e6: 5f 92 push r5 |
||
1694 | 8e8: 6f 92 push r6 |
||
1695 | 8ea: 7f 92 push r7 |
||
1696 | 8ec: 8f 92 push r8 |
||
1697 | 8ee: 9f 92 push r9 |
||
1698 | 8f0: af 92 push r10 |
||
1699 | 8f2: bf 92 push r11 |
||
1700 | 8f4: cf 92 push r12 |
||
1701 | 8f6: df 92 push r13 |
||
1702 | 8f8: ef 92 push r14 |
||
1703 | 8fa: ff 92 push r15 |
||
1704 | 8fc: 0f 93 push r16 |
||
1705 | 8fe: 1f 93 push r17 |
||
1706 | 900: cf 93 push r28 |
||
1707 | 902: df 93 push r29 |
||
1708 | char altPhase = 0; |
||
1709 | int test = 0; |
||
1710 | unsigned int Blink,TestschubTimer; |
||
1711 | unsigned int Blink2,MittelstromTimer,DrehzahlMessTimer,MotorGestopptTimer; |
||
1712 | |||
1713 | DDRC = 0x08; |
||
1714 | 904: 88 e0 ldi r24, 0x08 ; 8 |
||
1715 | 906: 84 bb out 0x14, r24 ; 20 |
||
1716 | PORTC = 0x08; |
||
1717 | 908: 85 bb out 0x15, r24 ; 21 |
||
1718 | DDRD = 0x3A; |
||
1719 | 90a: 8a e3 ldi r24, 0x3A ; 58 |
||
1720 | 90c: 81 bb out 0x11, r24 ; 17 |
||
1721 | PORTD = 0x00; |
||
1722 | 90e: 12 ba out 0x12, r1 ; 18 |
||
1723 | DDRB = 0x0E; |
||
1724 | 910: 8e e0 ldi r24, 0x0E ; 14 |
||
1725 | 912: 87 bb out 0x17, r24 ; 23 |
||
1726 | PORTB = 0x31; |
||
1727 | 914: 81 e3 ldi r24, 0x31 ; 49 |
||
1728 | 916: 88 bb out 0x18, r24 ; 24 |
||
1729 | |||
1730 | #if (MOTORADRESSE == 0) |
||
1731 | PORTB |= (ADR1 + ADR2); // Pullups für Adresswahl |
||
1732 | 918: 88 b3 in r24, 0x18 ; 24 |
||
1733 | 91a: 80 6c ori r24, 0xC0 ; 192 |
||
1734 | 91c: 88 bb out 0x18, r24 ; 24 |
||
1735 | for(test=0;test<500;test++); |
||
1736 | if(PINB & ADR1) |
||
1737 | 91e: b6 9b sbis 0x16, 6 ; 22 |
||
1738 | 920: 06 c0 rjmp .+12 ; 0x92e <main+0x48> |
||
1739 | { |
||
1740 | if (PINB & ADR2) MotorAdresse = 1; |
||
1741 | 922: b7 9b sbis 0x16, 7 ; 22 |
||
1742 | 924: 02 c0 rjmp .+4 ; 0x92a <main+0x44> |
||
1743 | 926: 81 e0 ldi r24, 0x01 ; 1 |
||
1744 | 928: 07 c0 rjmp .+14 ; 0x938 <main+0x52> |
||
1745 | else MotorAdresse = 2; |
||
1746 | 92a: 82 e0 ldi r24, 0x02 ; 2 |
||
1747 | 92c: 05 c0 rjmp .+10 ; 0x938 <main+0x52> |
||
1748 | } |
||
1749 | else |
||
1750 | { |
||
1751 | if (PINB & ADR2) MotorAdresse = 3; |
||
1752 | 92e: b7 9b sbis 0x16, 7 ; 22 |
||
1753 | 930: 02 c0 rjmp .+4 ; 0x936 <main+0x50> |
||
1754 | 932: 83 e0 ldi r24, 0x03 ; 3 |
||
1755 | 934: 01 c0 rjmp .+2 ; 0x938 <main+0x52> |
||
1756 | else MotorAdresse = 4; |
||
1757 | 936: 84 e0 ldi r24, 0x04 ; 4 |
||
1758 | 938: 80 93 66 00 sts 0x0066, r24 |
||
1759 | } |
||
1760 | HwVersion = 11; |
||
1761 | 93c: 8b e0 ldi r24, 0x0B ; 11 |
||
1762 | 93e: 80 93 b2 00 sts 0x00B2, r24 |
||
1763 | #else |
||
1764 | MotorAdresse = MOTORADRESSE; |
||
1765 | HwVersion = 10; |
||
1766 | #endif |
||
1767 | if(PIND & 0x80) {HwVersion = 12; IntRef = 0xc0;} |
||
1768 | 942: 87 9b sbis 0x10, 7 ; 16 |
||
1769 | 944: 06 c0 rjmp .+12 ; 0x952 <main+0x6c> |
||
1770 | 946: 8c e0 ldi r24, 0x0C ; 12 |
||
1771 | 948: 80 93 b2 00 sts 0x00B2, r24 |
||
1772 | 94c: 80 ec ldi r24, 0xC0 ; 192 |
||
1773 | 94e: 80 93 8d 00 sts 0x008D, r24 |
||
1774 | DDRD = 0xBA; |
||
1775 | 952: 8a eb ldi r24, 0xBA ; 186 |
||
1776 | 954: 81 bb out 0x11, r24 ; 17 |
||
1777 | UART_Init(); |
||
1778 | 956: c4 d3 rcall .+1928 ; 0x10e0 <UART_Init> |
||
1779 | Timer0_Init(); |
||
1780 | 958: 4e d4 rcall .+2204 ; 0x11f6 <Timer0_Init> |
||
1781 | sei();//Globale Interrupts Einschalten |
||
1782 | 95a: 78 94 sei |
||
1783 | } |
||
1784 | |||
1785 | Delay_ms(500); |
||
1786 | */ |
||
1787 | // UART_Init(); // war doppelt |
||
1788 | PWM_Init(); |
||
1789 | 95c: d4 db rcall .-2136 ; 0x106 <PWM_Init> |
||
1790 | |||
1791 | InitIC2_Slave(0x50); |
||
1792 | 95e: 80 e5 ldi r24, 0x50 ; 80 |
||
1793 | 960: b0 d5 rcall .+2912 ; 0x14c2 <InitIC2_Slave> |
||
1794 | InitPPM(); |
||
1795 | 962: eb d4 rcall .+2518 ; 0x133a <InitPPM> |
||
1796 | |||
1797 | Blink = SetDelay(101); |
||
1798 | 964: 85 e6 ldi r24, 0x65 ; 101 |
||
1799 | 966: 90 e0 ldi r25, 0x00 ; 0 |
||
1800 | 968: 4f d4 rcall .+2206 ; 0x1208 <SetDelay> |
||
1801 | Blink2 = SetDelay(102); |
||
1802 | 96a: 86 e6 ldi r24, 0x66 ; 102 |
||
1803 | 96c: 90 e0 ldi r25, 0x00 ; 0 |
||
1804 | 96e: 4c d4 rcall .+2200 ; 0x1208 <SetDelay> |
||
1805 | MinUpmPulse = SetDelay(103); |
||
1806 | 970: 87 e6 ldi r24, 0x67 ; 103 |
||
1807 | 972: 90 e0 ldi r25, 0x00 ; 0 |
||
1808 | 974: 49 d4 rcall .+2194 ; 0x1208 <SetDelay> |
||
1809 | 976: 90 93 b4 02 sts 0x02B4, r25 |
||
1810 | 97a: 80 93 b3 02 sts 0x02B3, r24 |
||
1811 | MittelstromTimer = SetDelay(254); |
||
1812 | 97e: 8e ef ldi r24, 0xFE ; 254 |
||
1813 | 980: 90 e0 ldi r25, 0x00 ; 0 |
||
1814 | 982: 42 d4 rcall .+2180 ; 0x1208 <SetDelay> |
||
1815 | 984: 6c 01 movw r12, r24 |
||
1816 | DrehzahlMessTimer = SetDelay(1005); |
||
1817 | 986: 8d ee ldi r24, 0xED ; 237 |
||
1818 | 988: 93 e0 ldi r25, 0x03 ; 3 |
||
1819 | 98a: 3e d4 rcall .+2172 ; 0x1208 <SetDelay> |
||
1820 | 98c: ec 01 movw r28, r24 |
||
1821 | TestschubTimer = SetDelay(1006); |
||
1822 | 98e: 8e ee ldi r24, 0xEE ; 238 |
||
1823 | 990: 93 e0 ldi r25, 0x03 ; 3 |
||
1824 | 992: 3a d4 rcall .+2164 ; 0x1208 <SetDelay> |
||
1825 | 994: 03 c0 rjmp .+6 ; 0x99c <main+0xb6> |
||
1826 | while(!CheckDelay(MinUpmPulse)) |
||
1827 | { |
||
1828 | if(SollwertErmittlung()) break; |
||
1829 | 996: d4 db rcall .-2136 ; 0x140 <SollwertErmittlung> |
||
1830 | 998: 88 23 and r24, r24 |
||
1831 | 99a: 39 f4 brne .+14 ; 0x9aa <main+0xc4> |
||
1832 | Blink2 = SetDelay(102); |
||
1833 | MinUpmPulse = SetDelay(103); |
||
1834 | MittelstromTimer = SetDelay(254); |
||
1835 | DrehzahlMessTimer = SetDelay(1005); |
||
1836 | TestschubTimer = SetDelay(1006); |
||
1837 | while(!CheckDelay(MinUpmPulse)) |
||
1838 | 99c: 80 91 b3 02 lds r24, 0x02B3 |
||
1839 | 9a0: 90 91 b4 02 lds r25, 0x02B4 |
||
1840 | 9a4: 3b d4 rcall .+2166 ; 0x121c <CheckDelay> |
||
1841 | 9a6: 88 23 and r24, r24 |
||
1842 | 9a8: b1 f3 breq .-20 ; 0x996 <main+0xb0> |
||
1843 | { |
||
1844 | if(SollwertErmittlung()) break; |
||
1845 | } |
||
1846 | |||
1847 | GRN_ON; |
||
1848 | 9aa: 80 91 b2 00 lds r24, 0x00B2 |
||
1849 | 9ae: 8c 30 cpi r24, 0x0C ; 12 |
||
1850 | 9b0: 10 f4 brcc .+4 ; 0x9b6 <main+0xd0> |
||
1851 | 9b2: 97 9a sbi 0x12, 7 ; 18 |
||
1852 | 9b4: 01 c0 rjmp .+2 ; 0x9b8 <main+0xd2> |
||
1853 | 9b6: 97 98 cbi 0x12, 7 ; 18 |
||
1854 | PWM = 0; |
||
1855 | 9b8: 10 92 79 00 sts 0x0079, r1 |
||
1856 | 9bc: 10 92 78 00 sts 0x0078, r1 |
||
1857 | |||
1858 | SetPWM(); |
||
1859 | 9c0: 4e db rcall .-2404 ; 0x5e <SetPWM> |
||
1860 | |||
1861 | SFIOR = 0x08; // Analog Comperator ein |
||
1862 | 9c2: 88 e0 ldi r24, 0x08 ; 8 |
||
1863 | 9c4: 80 bf out 0x30, r24 ; 48 |
||
1864 | ADMUX = 1; |
||
1865 | 9c6: 81 e0 ldi r24, 0x01 ; 1 |
||
1866 | 9c8: 87 b9 out 0x07, r24 ; 7 |
||
1867 | |||
1868 | MinUpmPulse = SetDelay(10); |
||
1869 | 9ca: 8a e0 ldi r24, 0x0A ; 10 |
||
1870 | 9cc: 90 e0 ldi r25, 0x00 ; 0 |
||
1871 | 9ce: 1c d4 rcall .+2104 ; 0x1208 <SetDelay> |
||
1872 | 9d0: 90 93 b4 02 sts 0x02B4, r25 |
||
1873 | 9d4: 80 93 b3 02 sts 0x02B3, r24 |
||
1874 | DebugOut.Analog[1] = 1; |
||
1875 | 9d8: 81 e0 ldi r24, 0x01 ; 1 |
||
1876 | 9da: 90 e0 ldi r25, 0x00 ; 0 |
||
1877 | 9dc: 90 93 87 03 sts 0x0387, r25 |
||
1878 | 9e0: 80 93 86 03 sts 0x0386, r24 |
||
1879 | PPM_Signal = 0; |
||
1880 | 9e4: 10 92 a6 00 sts 0x00A6, r1 |
||
1881 | 9e8: 10 92 a5 00 sts 0x00A5, r1 |
||
1882 | |||
1883 | if(!SollwertErmittlung()) MotorTon(); |
||
1884 | 9ec: a9 db rcall .-2222 ; 0x140 <SollwertErmittlung> |
||
1885 | 9ee: 88 23 and r24, r24 |
||
1886 | 9f0: 09 f4 brne .+2 ; 0x9f4 <main+0x10e> |
||
1887 | 9f2: 58 dc rcall .-1872 ; 0x2a4 <MotorTon> |
||
1888 | //MotorTon(); |
||
1889 | PORTB = 0x31; // Pullups wieder einschalten |
||
1890 | 9f4: 81 e3 ldi r24, 0x31 ; 49 |
||
1891 | 9f6: 88 bb out 0x18, r24 ; 24 |
||
1892 | 9f8: 10 e0 ldi r17, 0x00 ; 0 |
||
1893 | STEUER_OFF; |
||
1894 | } |
||
1895 | } |
||
1896 | else |
||
1897 | { |
||
1898 | if(MotorGestoppt) MotorAnwerfen = 1; // Startversuch |
||
1899 | 9fa: ff 24 eor r15, r15 |
||
1900 | 9fc: f3 94 inc r15 |
||
1901 | // nach 1,5 Sekunden den Motor als gestoppt betrachten |
||
1902 | if(CheckDelay(MotorGestopptTimer)) |
||
1903 | { |
||
1904 | DISABLE_SENSE_INT; |
||
1905 | MotorGestoppt = 1; |
||
1906 | STEUER_OFF; |
||
1907 | 9fe: f1 e4 ldi r31, 0x41 ; 65 |
||
1908 | a00: ef 2e mov r14, r31 |
||
1909 | a02: ee e0 ldi r30, 0x0E ; 14 |
||
1910 | a04: 5e 2e mov r5, r30 |
||
1911 | if(Anwerfen(10)) |
||
1912 | { |
||
1913 | GRN_ON; |
||
1914 | MotorGestoppt = 0; |
||
1915 | Phase--; |
||
1916 | PWM = 1; |
||
1917 | a06: 71 e0 ldi r23, 0x01 ; 1 |
||
1918 | a08: 67 2e mov r6, r23 |
||
1919 | a0a: 71 2c mov r7, r1 |
||
1920 | SetPWM(); |
||
1921 | SENSE_TOGGLE_INT; |
||
1922 | ENABLE_SENSE_INT; |
||
1923 | MinUpmPulse = SetDelay(20); |
||
1924 | while(!CheckDelay(MinUpmPulse)); // kurz Synchronisieren |
||
1925 | PWM = 15; |
||
1926 | a0c: 6f e0 ldi r22, 0x0F ; 15 |
||
1927 | a0e: 86 2e mov r8, r22 |
||
1928 | a10: 91 2c mov r9, r1 |
||
1929 | a12: 01 c0 rjmp .+2 ; 0xa16 <main+0x130> |
||
1930 | DebugOut.Analog[1] = 1; |
||
1931 | PPM_Signal = 0; |
||
1932 | |||
1933 | if(!SollwertErmittlung()) MotorTon(); |
||
1934 | //MotorTon(); |
||
1935 | PORTB = 0x31; // Pullups wieder einschalten |
||
1936 | a14: 10 2f mov r17, r16 |
||
1937 | |||
1938 | while (1) |
||
1939 | { |
||
1940 | //ShowSense(); |
||
1941 | |||
1942 | if(!TEST_SCHUB) PWM = SollwertErmittlung(); |
||
1943 | a16: 94 db rcall .-2264 ; 0x140 <SollwertErmittlung> |
||
1944 | a18: 80 93 78 00 sts 0x0078, r24 |
||
1945 | a1c: 10 92 79 00 sts 0x0079, r1 |
||
1946 | //I2C_TXBuffer = PWM; // Antwort über I2C-Bus |
||
1947 | if(MANUELL_PWM) PWM = MANUELL_PWM; |
||
1948 | |||
1949 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
1950 | if(Phase != altPhase) // es gab eine Kommutierung im Interrupt |
||
1951 | a20: 00 91 af 00 lds r16, 0x00AF |
||
1952 | a24: 01 17 cp r16, r17 |
||
1953 | a26: 69 f0 breq .+26 ; 0xa42 <main+0x15c> |
||
1954 | { |
||
1955 | MotorGestoppt = 0; |
||
1956 | a28: 10 92 63 00 sts 0x0063, r1 |
||
1957 | ZeitFuerBerechnungen = 0; // direkt nach einer Kommutierung ist Zeit |
||
1958 | a2c: 10 92 62 00 sts 0x0062, r1 |
||
1959 | MinUpmPulse = SetDelay(250); // Timeout, falls ein Motor stehen bleibt |
||
1960 | a30: 8a ef ldi r24, 0xFA ; 250 |
||
1961 | a32: 90 e0 ldi r25, 0x00 ; 0 |
||
1962 | a34: e9 d3 rcall .+2002 ; 0x1208 <SetDelay> |
||
1963 | a36: 90 93 b4 02 sts 0x02B4, r25 |
||
1964 | a3a: 80 93 b3 02 sts 0x02B3, r24 |
||
1965 | altPhase = Phase; |
||
1966 | a3e: 00 91 af 00 lds r16, 0x00AF |
||
1967 | } |
||
1968 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
1969 | if(!PWM) // Sollwert == 0 |
||
1970 | a42: 80 91 78 00 lds r24, 0x0078 |
||
1971 | a46: 90 91 79 00 lds r25, 0x0079 |
||
1972 | a4a: 89 2b or r24, r25 |
||
1973 | a4c: e1 f4 brne .+56 ; 0xa86 <main+0x1a0> |
||
1974 | { |
||
1975 | MotorAnwerfen = 0; // kein Startversuch |
||
1976 | a4e: 10 92 88 00 sts 0x0088, r1 |
||
1977 | ZeitFuerBerechnungen = 0; |
||
1978 | a52: 10 92 62 00 sts 0x0062, r1 |
||
1979 | // nach 1,5 Sekunden den Motor als gestoppt betrachten |
||
1980 | if(CheckDelay(MotorGestopptTimer)) |
||
1981 | a56: c5 01 movw r24, r10 |
||
1982 | a58: e1 d3 rcall .+1986 ; 0x121c <CheckDelay> |
||
1983 | a5a: 88 23 and r24, r24 |
||
1984 | a5c: f1 f0 breq .+60 ; 0xa9a <main+0x1b4> |
||
1985 | { |
||
1986 | DISABLE_SENSE_INT; |
||
1987 | a5e: 10 92 b1 00 sts 0x00B1, r1 |
||
1988 | a62: 43 98 cbi 0x08, 3 ; 8 |
||
1989 | MotorGestoppt = 1; |
||
1990 | a64: f0 92 63 00 sts 0x0063, r15 |
||
1991 | STEUER_OFF; |
||
1992 | a68: 82 b3 in r24, 0x12 ; 18 |
||
1993 | a6a: 87 7c andi r24, 0xC7 ; 199 |
||
1994 | a6c: 82 bb out 0x12, r24 ; 18 |
||
1995 | a6e: 1b bc out 0x2b, r1 ; 43 |
||
1996 | a70: 1a bc out 0x2a, r1 ; 42 |
||
1997 | a72: 19 bc out 0x29, r1 ; 41 |
||
1998 | a74: 18 bc out 0x28, r1 ; 40 |
||
1999 | a76: 13 bc out 0x23, r1 ; 35 |
||
2000 | a78: ff bc out 0x2f, r15 ; 47 |
||
2001 | a7a: e5 bc out 0x25, r14 ; 37 |
||
2002 | a7c: 57 ba out 0x17, r5 ; 23 |
||
2003 | a7e: 88 b3 in r24, 0x18 ; 24 |
||
2004 | a80: 81 7f andi r24, 0xF1 ; 241 |
||
2005 | a82: 88 bb out 0x18, r24 ; 24 |
||
2006 | a84: 0a c0 rjmp .+20 ; 0xa9a <main+0x1b4> |
||
2007 | } |
||
2008 | } |
||
2009 | else |
||
2010 | { |
||
2011 | if(MotorGestoppt) MotorAnwerfen = 1; // Startversuch |
||
2012 | a86: 80 91 63 00 lds r24, 0x0063 |
||
2013 | a8a: 88 23 and r24, r24 |
||
2014 | a8c: 11 f0 breq .+4 ; 0xa92 <main+0x1ac> |
||
2015 | a8e: f0 92 88 00 sts 0x0088, r15 |
||
2016 | MotorGestopptTimer = SetDelay(1500); |
||
2017 | a92: 8c ed ldi r24, 0xDC ; 220 |
||
2018 | a94: 95 e0 ldi r25, 0x05 ; 5 |
||
2019 | a96: b8 d3 rcall .+1904 ; 0x1208 <SetDelay> |
||
2020 | a98: 5c 01 movw r10, r24 |
||
2021 | } |
||
2022 | |||
2023 | if(MotorGestoppt && !TEST_SCHUB) PWM = 0; |
||
2024 | a9a: 80 91 63 00 lds r24, 0x0063 |
||
2025 | a9e: 88 23 and r24, r24 |
||
2026 | aa0: 21 f0 breq .+8 ; 0xaaa <main+0x1c4> |
||
2027 | aa2: 10 92 79 00 sts 0x0079, r1 |
||
2028 | aa6: 10 92 78 00 sts 0x0078, r1 |
||
2029 | SetPWM(); |
||
2030 | aaa: d9 da rcall .-2638 ; 0x5e <SetPWM> |
||
2031 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
2032 | if(!ZeitFuerBerechnungen++) |
||
2033 | aac: 80 91 62 00 lds r24, 0x0062 |
||
2034 | ab0: 8f 5f subi r24, 0xFF ; 255 |
||
2035 | ab2: 80 93 62 00 sts 0x0062, r24 |
||
2036 | ab6: 81 50 subi r24, 0x01 ; 1 |
||
2037 | ab8: 09 f0 breq .+2 ; 0xabc <main+0x1d6> |
||
2038 | aba: ac cf rjmp .-168 ; 0xa14 <main+0x12e> |
||
2039 | { |
||
2040 | if(MotorGestoppt) |
||
2041 | abc: 80 91 63 00 lds r24, 0x0063 |
||
2042 | ac0: 88 23 and r24, r24 |
||
2043 | ac2: 41 f0 breq .+16 ; 0xad4 <main+0x1ee> |
||
2044 | { |
||
2045 | GRN_ON; |
||
2046 | ac4: 80 91 b2 00 lds r24, 0x00B2 |
||
2047 | ac8: 8c 30 cpi r24, 0x0C ; 12 |
||
2048 | aca: 10 f4 brcc .+4 ; 0xad0 <main+0x1ea> |
||
2049 | acc: 97 9a sbi 0x12, 7 ; 18 |
||
2050 | ace: 01 c0 rjmp .+2 ; 0xad2 <main+0x1ec> |
||
2051 | ad0: 97 98 cbi 0x12, 7 ; 18 |
||
2052 | FastADConvert(); |
||
2053 | ad2: 17 d4 rcall .+2094 ; 0x1302 <FastADConvert> |
||
2054 | DebugAusgaben(); // welche Werte sollen angezeigt werden? |
||
2055 | if(!UebertragungAbgeschlossen) SendUart(); |
||
2056 | else DatenUebertragung(); |
||
2057 | } |
||
2058 | // Berechnen des Mittleren Stroms zur (langsamen) Strombegrenzung |
||
2059 | if(CheckDelay(MittelstromTimer)) |
||
2060 | ad4: c6 01 movw r24, r12 |
||
2061 | ad6: a2 d3 rcall .+1860 ; 0x121c <CheckDelay> |
||
2062 | ad8: 88 23 and r24, r24 |
||
2063 | ada: a9 f1 breq .+106 ; 0xb46 <main+0x260> |
||
2064 | { |
||
2065 | MittelstromTimer = SetDelay(50); // alle 50ms |
||
2066 | adc: 82 e3 ldi r24, 0x32 ; 50 |
||
2067 | ade: 90 e0 ldi r25, 0x00 ; 0 |
||
2068 | ae0: 93 d3 rcall .+1830 ; 0x1208 <SetDelay> |
||
2069 | ae2: 6c 01 movw r12, r24 |
||
2070 | if(Mittelstrom < Strom) Mittelstrom++;// Mittelwert des Stroms bilden |
||
2071 | ae4: 80 91 7d 00 lds r24, 0x007D |
||
2072 | ae8: 48 2f mov r20, r24 |
||
2073 | aea: 50 e0 ldi r21, 0x00 ; 0 |
||
2074 | aec: 20 91 7a 00 lds r18, 0x007A |
||
2075 | af0: 30 91 7b 00 lds r19, 0x007B |
||
2076 | af4: 42 17 cp r20, r18 |
||
2077 | af6: 53 07 cpc r21, r19 |
||
2078 | af8: 10 f4 brcc .+4 ; 0xafe <main+0x218> |
||
2079 | afa: 8f 5f subi r24, 0xFF ; 255 |
||
2080 | afc: 04 c0 rjmp .+8 ; 0xb06 <main+0x220> |
||
2081 | else if(Mittelstrom > Strom) Mittelstrom--; |
||
2082 | afe: 24 17 cp r18, r20 |
||
2083 | b00: 35 07 cpc r19, r21 |
||
2084 | b02: 18 f4 brcc .+6 ; 0xb0a <main+0x224> |
||
2085 | b04: 81 50 subi r24, 0x01 ; 1 |
||
2086 | b06: 80 93 7d 00 sts 0x007D, r24 |
||
2087 | if(Strom > MAX_STROM) MaxPWM -= MaxPWM / 32; |
||
2088 | b0a: 29 3c cpi r18, 0xC9 ; 201 |
||
2089 | b0c: 31 05 cpc r19, r1 |
||
2090 | b0e: 48 f0 brcs .+18 ; 0xb22 <main+0x23c> |
||
2091 | b10: 80 91 64 00 lds r24, 0x0064 |
||
2092 | b14: 98 2f mov r25, r24 |
||
2093 | b16: 92 95 swap r25 |
||
2094 | b18: 96 95 lsr r25 |
||
2095 | b1a: 97 70 andi r25, 0x07 ; 7 |
||
2096 | b1c: 89 1b sub r24, r25 |
||
2097 | b1e: 80 93 64 00 sts 0x0064, r24 |
||
2098 | if((Mittelstrom > LIMIT_STROM))// Strom am Limit? |
||
2099 | b22: 80 91 7d 00 lds r24, 0x007D |
||
2100 | b26: 90 91 64 00 lds r25, 0x0064 |
||
2101 | b2a: 89 37 cpi r24, 0x79 ; 121 |
||
2102 | b2c: 38 f0 brcs .+14 ; 0xb3c <main+0x256> |
||
2103 | { |
||
2104 | if(MaxPWM) MaxPWM--;// dann die Maximale PWM herunterfahren |
||
2105 | b2e: 99 23 and r25, r25 |
||
2106 | b30: 19 f0 breq .+6 ; 0xb38 <main+0x252> |
||
2107 | b32: 91 50 subi r25, 0x01 ; 1 |
||
2108 | b34: 90 93 64 00 sts 0x0064, r25 |
||
2109 | PORTC |= ROT; |
||
2110 | b38: ab 9a sbi 0x15, 3 ; 21 |
||
2111 | b3a: 05 c0 rjmp .+10 ; 0xb46 <main+0x260> |
||
2112 | } |
||
2113 | else |
||
2114 | { |
||
2115 | if(MaxPWM < MAX_PWM) MaxPWM++; |
||
2116 | b3c: 9f 3f cpi r25, 0xFF ; 255 |
||
2117 | b3e: 19 f0 breq .+6 ; 0xb46 <main+0x260> |
||
2118 | b40: 9f 5f subi r25, 0xFF ; 255 |
||
2119 | b42: 90 93 64 00 sts 0x0064, r25 |
||
2120 | } |
||
2121 | } |
||
2122 | |||
2123 | if(CheckDelay(DrehzahlMessTimer)) // Ist-Drehzahl bestimmen |
||
2124 | b46: ce 01 movw r24, r28 |
||
2125 | b48: 69 d3 rcall .+1746 ; 0x121c <CheckDelay> |
||
2126 | b4a: 88 23 and r24, r24 |
||
2127 | b4c: 91 f0 breq .+36 ; 0xb72 <main+0x28c> |
||
2128 | { |
||
2129 | DrehzahlMessTimer = SetDelay(10); |
||
2130 | b4e: 8a e0 ldi r24, 0x0A ; 10 |
||
2131 | b50: 90 e0 ldi r25, 0x00 ; 0 |
||
2132 | b52: 5a d3 rcall .+1716 ; 0x1208 <SetDelay> |
||
2133 | b54: ec 01 movw r28, r24 |
||
2134 | SIO_Drehzahl = CntKommutierungen;//(6 * CntKommutierungen) / (POLANZAHL / 2); |
||
2135 | b56: 80 91 89 00 lds r24, 0x0089 |
||
2136 | b5a: 90 91 8a 00 lds r25, 0x008A |
||
2137 | b5e: 90 93 8c 00 sts 0x008C, r25 |
||
2138 | b62: 80 93 8b 00 sts 0x008B, r24 |
||
2139 | CntKommutierungen = 0; |
||
2140 | b66: 10 92 8a 00 sts 0x008A, r1 |
||
2141 | b6a: 10 92 89 00 sts 0x0089, r1 |
||
2142 | // if(PPM_Timeout == 0) // keine PPM-Signale |
||
2143 | ZeitZumAdWandeln = 1; |
||
2144 | b6e: f0 92 65 00 sts 0x0065, r15 |
||
2145 | } |
||
2146 | } |
||
2147 | } |
||
2148 | #endif |
||
2149 | // Motor Stehen geblieben |
||
2150 | if((CheckDelay(MinUpmPulse) && SIO_Drehzahl == 0) || MotorAnwerfen) |
||
2151 | b72: 80 91 b3 02 lds r24, 0x02B3 |
||
2152 | b76: 90 91 b4 02 lds r25, 0x02B4 |
||
2153 | b7a: 50 d3 rcall .+1696 ; 0x121c <CheckDelay> |
||
2154 | b7c: 88 23 and r24, r24 |
||
2155 | b7e: 31 f0 breq .+12 ; 0xb8c <main+0x2a6> |
||
2156 | b80: 80 91 8b 00 lds r24, 0x008B |
||
2157 | b84: 90 91 8c 00 lds r25, 0x008C |
||
2158 | b88: 89 2b or r24, r25 |
||
2159 | b8a: 29 f0 breq .+10 ; 0xb96 <main+0x2b0> |
||
2160 | b8c: 80 91 88 00 lds r24, 0x0088 |
||
2161 | b90: 88 23 and r24, r24 |
||
2162 | b92: 09 f4 brne .+2 ; 0xb96 <main+0x2b0> |
||
2163 | b94: 3f cf rjmp .-386 ; 0xa14 <main+0x12e> |
||
2164 | { |
||
2165 | MotorGestoppt = 1; |
||
2166 | b96: f0 92 63 00 sts 0x0063, r15 |
||
2167 | DISABLE_SENSE_INT; |
||
2168 | b9a: 10 92 b1 00 sts 0x00B1, r1 |
||
2169 | b9e: 43 98 cbi 0x08, 3 ; 8 |
||
2170 | MinUpmPulse = SetDelay(100); |
||
2171 | ba0: 84 e6 ldi r24, 0x64 ; 100 |
||
2172 | ba2: 90 e0 ldi r25, 0x00 ; 0 |
||
2173 | ba4: 31 d3 rcall .+1634 ; 0x1208 <SetDelay> |
||
2174 | ba6: 90 93 b4 02 sts 0x02B4, r25 |
||
2175 | baa: 80 93 b3 02 sts 0x02B3, r24 |
||
2176 | if(MotorAnwerfen) |
||
2177 | bae: 80 91 88 00 lds r24, 0x0088 |
||
2178 | bb2: 88 23 and r24, r24 |
||
2179 | bb4: 09 f4 brne .+2 ; 0xbb8 <main+0x2d2> |
||
2180 | bb6: 2e cf rjmp .-420 ; 0xa14 <main+0x12e> |
||
2181 | { |
||
2182 | PORTC &= ~ROT; |
||
2183 | bb8: ab 98 cbi 0x15, 3 ; 21 |
||
2184 | Strom_max = 0; |
||
2185 | bba: 10 92 7c 00 sts 0x007C, r1 |
||
2186 | MotorAnwerfen = 0; |
||
2187 | bbe: 10 92 88 00 sts 0x0088, r1 |
||
2188 | if(Anwerfen(10)) |
||
2189 | bc2: 8a e0 ldi r24, 0x0A ; 10 |
||
2190 | bc4: b9 dd rcall .-1166 ; 0x738 <Anwerfen> |
||
2191 | bc6: 88 23 and r24, r24 |
||
2192 | bc8: 09 f4 brne .+2 ; 0xbcc <main+0x2e6> |
||
2193 | bca: 5b c0 rjmp .+182 ; 0xc82 <main+0x39c> |
||
2194 | { |
||
2195 | GRN_ON; |
||
2196 | bcc: 80 91 b2 00 lds r24, 0x00B2 |
||
2197 | bd0: 8c 30 cpi r24, 0x0C ; 12 |
||
2198 | bd2: 10 f4 brcc .+4 ; 0xbd8 <main+0x2f2> |
||
2199 | bd4: 97 9a sbi 0x12, 7 ; 18 |
||
2200 | bd6: 01 c0 rjmp .+2 ; 0xbda <main+0x2f4> |
||
2201 | bd8: 97 98 cbi 0x12, 7 ; 18 |
||
2202 | MotorGestoppt = 0; |
||
2203 | bda: 10 92 63 00 sts 0x0063, r1 |
||
2204 | Phase--; |
||
2205 | bde: 80 91 af 00 lds r24, 0x00AF |
||
2206 | be2: 81 50 subi r24, 0x01 ; 1 |
||
2207 | be4: 80 93 af 00 sts 0x00AF, r24 |
||
2208 | PWM = 1; |
||
2209 | be8: 70 92 79 00 sts 0x0079, r7 |
||
2210 | bec: 60 92 78 00 sts 0x0078, r6 |
||
2211 | SetPWM(); |
||
2212 | bf0: 36 da rcall .-2964 ; 0x5e <SetPWM> |
||
2213 | SENSE_TOGGLE_INT; |
||
2214 | bf2: 88 b1 in r24, 0x08 ; 8 |
||
2215 | bf4: 8c 7f andi r24, 0xFC ; 252 |
||
2216 | bf6: 88 b9 out 0x08, r24 ; 8 |
||
2217 | ENABLE_SENSE_INT; |
||
2218 | bf8: f0 92 b1 00 sts 0x00B1, r15 |
||
2219 | bfc: 88 b1 in r24, 0x08 ; 8 |
||
2220 | bfe: 8a 60 ori r24, 0x0A ; 10 |
||
2221 | c00: 88 b9 out 0x08, r24 ; 8 |
||
2222 | MinUpmPulse = SetDelay(20); |
||
2223 | c02: 84 e1 ldi r24, 0x14 ; 20 |
||
2224 | c04: 90 e0 ldi r25, 0x00 ; 0 |
||
2225 | c06: 00 d3 rcall .+1536 ; 0x1208 <SetDelay> |
||
2226 | c08: 90 93 b4 02 sts 0x02B4, r25 |
||
2227 | c0c: 80 93 b3 02 sts 0x02B3, r24 |
||
2228 | while(!CheckDelay(MinUpmPulse)); // kurz Synchronisieren |
||
2229 | c10: 80 91 b3 02 lds r24, 0x02B3 |
||
2230 | c14: 90 91 b4 02 lds r25, 0x02B4 |
||
2231 | c18: 01 d3 rcall .+1538 ; 0x121c <CheckDelay> |
||
2232 | c1a: 88 23 and r24, r24 |
||
2233 | c1c: c9 f3 breq .-14 ; 0xc10 <main+0x32a> |
||
2234 | PWM = 15; |
||
2235 | c1e: 90 92 79 00 sts 0x0079, r9 |
||
2236 | c22: 80 92 78 00 sts 0x0078, r8 |
||
2237 | SetPWM(); |
||
2238 | c26: 1b da rcall .-3018 ; 0x5e <SetPWM> |
||
2239 | MinUpmPulse = SetDelay(300); |
||
2240 | c28: 8c e2 ldi r24, 0x2C ; 44 |
||
2241 | c2a: 91 e0 ldi r25, 0x01 ; 1 |
||
2242 | c2c: ed d2 rcall .+1498 ; 0x1208 <SetDelay> |
||
2243 | c2e: 90 93 b4 02 sts 0x02B4, r25 |
||
2244 | c32: 80 93 b3 02 sts 0x02B3, r24 |
||
2245 | c36: 18 c0 rjmp .+48 ; 0xc68 <main+0x382> |
||
2246 | while(!CheckDelay(MinUpmPulse)) // kurz Durchstarten |
||
2247 | { |
||
2248 | if(Strom > LIMIT_STROM/2) |
||
2249 | c38: 80 91 7a 00 lds r24, 0x007A |
||
2250 | c3c: 90 91 7b 00 lds r25, 0x007B |
||
2251 | c40: cd 97 sbiw r24, 0x3d ; 61 |
||
2252 | c42: 90 f0 brcs .+36 ; 0xc68 <main+0x382> |
||
2253 | { |
||
2254 | STEUER_OFF; // Abschalten wegen Kurzschluss |
||
2255 | c44: 82 b3 in r24, 0x12 ; 18 |
||
2256 | c46: 87 7c andi r24, 0xC7 ; 199 |
||
2257 | c48: 82 bb out 0x12, r24 ; 18 |
||
2258 | c4a: 1b bc out 0x2b, r1 ; 43 |
||
2259 | c4c: 1a bc out 0x2a, r1 ; 42 |
||
2260 | c4e: 19 bc out 0x29, r1 ; 41 |
||
2261 | c50: 18 bc out 0x28, r1 ; 40 |
||
2262 | c52: 13 bc out 0x23, r1 ; 35 |
||
2263 | c54: ff bc out 0x2f, r15 ; 47 |
||
2264 | c56: e5 bc out 0x25, r14 ; 37 |
||
2265 | c58: 57 ba out 0x17, r5 ; 23 |
||
2266 | c5a: 88 b3 in r24, 0x18 ; 24 |
||
2267 | c5c: 81 7f andi r24, 0xF1 ; 241 |
||
2268 | c5e: 88 bb out 0x18, r24 ; 24 |
||
2269 | RotBlink(10); |
||
2270 | c60: 8a e0 ldi r24, 0x0A ; 10 |
||
2271 | c62: 0c db rcall .-2536 ; 0x27c <RotBlink> |
||
2272 | MotorAnwerfen = 1; |
||
2273 | c64: f0 92 88 00 sts 0x0088, r15 |
||
2274 | MinUpmPulse = SetDelay(20); |
||
2275 | while(!CheckDelay(MinUpmPulse)); // kurz Synchronisieren |
||
2276 | PWM = 15; |
||
2277 | SetPWM(); |
||
2278 | MinUpmPulse = SetDelay(300); |
||
2279 | while(!CheckDelay(MinUpmPulse)) // kurz Durchstarten |
||
2280 | c68: 80 91 b3 02 lds r24, 0x02B3 |
||
2281 | c6c: 90 91 b4 02 lds r25, 0x02B4 |
||
2282 | c70: d5 d2 rcall .+1450 ; 0x121c <CheckDelay> |
||
2283 | c72: 88 23 and r24, r24 |
||
2284 | c74: 09 f3 breq .-62 ; 0xc38 <main+0x352> |
||
2285 | RotBlink(10); |
||
2286 | MotorAnwerfen = 1; |
||
2287 | } |
||
2288 | } |
||
2289 | // Drehzahlmessung wieder aufsetzen |
||
2290 | DrehzahlMessTimer = SetDelay(50); |
||
2291 | c76: 82 e3 ldi r24, 0x32 ; 50 |
||
2292 | c78: 90 e0 ldi r25, 0x00 ; 0 |
||
2293 | c7a: c6 d2 rcall .+1420 ; 0x1208 <SetDelay> |
||
2294 | c7c: ec 01 movw r28, r24 |
||
2295 | c7e: 07 e0 ldi r16, 0x07 ; 7 |
||
2296 | c80: c9 ce rjmp .-622 ; 0xa14 <main+0x12e> |
||
2297 | altPhase = 7; |
||
2298 | } |
||
2299 | else if(SollwertErmittlung()) MotorAnwerfen = 1; |
||
2300 | c82: 5e da rcall .-2884 ; 0x140 <SollwertErmittlung> |
||
2301 | c84: 88 23 and r24, r24 |
||
2302 | c86: 09 f4 brne .+2 ; 0xc8a <main+0x3a4> |
||
2303 | c88: c5 ce rjmp .-630 ; 0xa14 <main+0x12e> |
||
2304 | c8a: f0 92 88 00 sts 0x0088, r15 |
||
2305 | c8e: c2 ce rjmp .-636 ; 0xa14 <main+0x12e> |
||
2306 | |||
2307 | 00000c90 <__vector_13>: |
||
2308 | |||
2309 | int Debug_Timer; |
||
2310 | |||
2311 | |||
2312 | SIGNAL(INT_VEC_TX) |
||
2313 | { |
||
2314 | c90: 1f 92 push r1 |
||
2315 | c92: 0f 92 push r0 |
||
2316 | c94: 0f b6 in r0, 0x3f ; 63 |
||
2317 | c96: 0f 92 push r0 |
||
2318 | c98: 11 24 eor r1, r1 |
||
2319 | } |
||
2320 | c9a: 0f 90 pop r0 |
||
2321 | c9c: 0f be out 0x3f, r0 ; 63 |
||
2322 | c9e: 0f 90 pop r0 |
||
2323 | ca0: 1f 90 pop r1 |
||
2324 | ca2: 18 95 reti |
||
2325 | |||
2326 | 00000ca4 <SendUart>: |
||
2327 | |||
2328 | void SendUart(void) |
||
2329 | { |
||
2330 | static unsigned int ptr = 0; |
||
2331 | unsigned char tmp_tx; |
||
2332 | if(!(UCSRA & 0x40)) return; |
||
2333 | ca4: 5e 9b sbis 0x0b, 6 ; 11 |
||
2334 | ca6: 24 c0 rjmp .+72 ; 0xcf0 <SendUart+0x4c> |
||
2335 | if(!UebertragungAbgeschlossen) |
||
2336 | ca8: 80 91 6f 00 lds r24, 0x006F |
||
2337 | cac: 88 23 and r24, r24 |
||
2338 | cae: e1 f4 brne .+56 ; 0xce8 <SendUart+0x44> |
||
2339 | { |
||
2340 | ptr++; // die [0] wurde schon gesendet |
||
2341 | cb0: 80 91 a0 00 lds r24, 0x00A0 |
||
2342 | cb4: 90 91 a1 00 lds r25, 0x00A1 |
||
2343 | cb8: 01 96 adiw r24, 0x01 ; 1 |
||
2344 | cba: 90 93 a1 00 sts 0x00A1, r25 |
||
2345 | cbe: 80 93 a0 00 sts 0x00A0, r24 |
||
2346 | tmp_tx = SendeBuffer[ptr]; |
||
2347 | cc2: fc 01 movw r30, r24 |
||
2348 | cc4: e8 54 subi r30, 0x48 ; 72 |
||
2349 | cc6: fd 4f sbci r31, 0xFD ; 253 |
||
2350 | cc8: e0 81 ld r30, Z |
||
2351 | if((tmp_tx == '\r') || (ptr == MAX_SENDE_BUFF)) |
||
2352 | cca: ed 30 cpi r30, 0x0D ; 13 |
||
2353 | ccc: 19 f0 breq .+6 ; 0xcd4 <SendUart+0x30> |
||
2354 | cce: 84 36 cpi r24, 0x64 ; 100 |
||
2355 | cd0: 91 05 cpc r25, r1 |
||
2356 | cd2: 39 f4 brne .+14 ; 0xce2 <SendUart+0x3e> |
||
2357 | { |
||
2358 | ptr = 0; |
||
2359 | cd4: 10 92 a1 00 sts 0x00A1, r1 |
||
2360 | cd8: 10 92 a0 00 sts 0x00A0, r1 |
||
2361 | UebertragungAbgeschlossen = 1; |
||
2362 | cdc: 81 e0 ldi r24, 0x01 ; 1 |
||
2363 | cde: 80 93 6f 00 sts 0x006F, r24 |
||
2364 | } |
||
2365 | USR |= (1<TXC); |
||
2366 | ce2: 58 9a sbi 0x0b, 0 ; 11 |
||
2367 | UDR = tmp_tx; |
||
2368 | ce4: ec b9 out 0x0c, r30 ; 12 |
||
2369 | ce6: 08 95 ret |
||
2370 | } |
||
2371 | else ptr = 0; |
||
2372 | ce8: 10 92 a1 00 sts 0x00A1, r1 |
||
2373 | cec: 10 92 a0 00 sts 0x00A0, r1 |
||
2374 | cf0: 08 95 ret |
||
2375 | |||
2376 | 00000cf2 <Decode64>: |
||
2377 | } |
||
2378 | |||
2379 | // -------------------------------------------------------------------------- |
||
2380 | void Decode64(unsigned char *ptrOut, unsigned char len, unsigned char ptrIn,unsigned char max) // Wohin mit den Daten; Wie lang; Wo im RxdBuffer |
||
2381 | { |
||
2382 | cf2: 1f 93 push r17 |
||
2383 | cf4: cf 93 push r28 |
||
2384 | cf6: df 93 push r29 |
||
2385 | cf8: ec 01 movw r28, r24 |
||
2386 | cfa: 70 e0 ldi r23, 0x00 ; 0 |
||
2387 | { |
||
2388 | a = RxdBuffer[ptrIn++] - '='; |
||
2389 | b = RxdBuffer[ptrIn++] - '='; |
||
2390 | c = RxdBuffer[ptrIn++] - '='; |
||
2391 | d = RxdBuffer[ptrIn++] - '='; |
||
2392 | if(ptrIn > max - 2) break; // nicht mehr Daten verarbeiten, als empfangen wurden |
||
2393 | cfc: a2 2f mov r26, r18 |
||
2394 | cfe: b0 e0 ldi r27, 0x00 ; 0 |
||
2395 | d00: 11 97 sbiw r26, 0x01 ; 1 |
||
2396 | d02: 48 c0 rjmp .+144 ; 0xd94 <Decode64+0xa2> |
||
2397 | unsigned char a,b,c,d; |
||
2398 | unsigned char ptr = 0; |
||
2399 | unsigned char x,y,z; |
||
2400 | while(len) |
||
2401 | { |
||
2402 | a = RxdBuffer[ptrIn++] - '='; |
||
2403 | d04: e4 2f mov r30, r20 |
||
2404 | d06: f0 e0 ldi r31, 0x00 ; 0 |
||
2405 | d08: e2 5e subi r30, 0xE2 ; 226 |
||
2406 | d0a: fc 4f sbci r31, 0xFC ; 252 |
||
2407 | d0c: 30 81 ld r19, Z |
||
2408 | b = RxdBuffer[ptrIn++] - '='; |
||
2409 | d0e: 4f 5f subi r20, 0xFF ; 255 |
||
2410 | d10: e4 2f mov r30, r20 |
||
2411 | d12: f0 e0 ldi r31, 0x00 ; 0 |
||
2412 | d14: e2 5e subi r30, 0xE2 ; 226 |
||
2413 | d16: fc 4f sbci r31, 0xFC ; 252 |
||
2414 | d18: 50 81 ld r21, Z |
||
2415 | c = RxdBuffer[ptrIn++] - '='; |
||
2416 | d1a: 4f 5f subi r20, 0xFF ; 255 |
||
2417 | d1c: e4 2f mov r30, r20 |
||
2418 | d1e: f0 e0 ldi r31, 0x00 ; 0 |
||
2419 | d20: e2 5e subi r30, 0xE2 ; 226 |
||
2420 | d22: fc 4f sbci r31, 0xFC ; 252 |
||
2421 | d24: 10 81 ld r17, Z |
||
2422 | d = RxdBuffer[ptrIn++] - '='; |
||
2423 | d26: 4f 5f subi r20, 0xFF ; 255 |
||
2424 | d28: e4 2f mov r30, r20 |
||
2425 | d2a: f0 e0 ldi r31, 0x00 ; 0 |
||
2426 | d2c: e2 5e subi r30, 0xE2 ; 226 |
||
2427 | d2e: fc 4f sbci r31, 0xFC ; 252 |
||
2428 | d30: 20 81 ld r18, Z |
||
2429 | d32: 4f 5f subi r20, 0xFF ; 255 |
||
2430 | if(ptrIn > max - 2) break; // nicht mehr Daten verarbeiten, als empfangen wurden |
||
2431 | d34: 84 2f mov r24, r20 |
||
2432 | d36: 90 e0 ldi r25, 0x00 ; 0 |
||
2433 | d38: 8a 17 cp r24, r26 |
||
2434 | d3a: 9b 07 cpc r25, r27 |
||
2435 | d3c: 74 f5 brge .+92 ; 0xd9a <Decode64+0xa8> |
||
2436 | unsigned char ptr = 0; |
||
2437 | unsigned char x,y,z; |
||
2438 | while(len) |
||
2439 | { |
||
2440 | a = RxdBuffer[ptrIn++] - '='; |
||
2441 | b = RxdBuffer[ptrIn++] - '='; |
||
2442 | d3e: 5d 53 subi r21, 0x3D ; 61 |
||
2443 | |||
2444 | x = (a << 2) | (b >> 4); |
||
2445 | y = ((b & 0x0f) << 4) | (c >> 2); |
||
2446 | z = ((c & 0x03) << 6) | d; |
||
2447 | |||
2448 | if(len--) ptrOut[ptr++] = x; else break; |
||
2449 | d40: fe 01 movw r30, r28 |
||
2450 | d42: e7 0f add r30, r23 |
||
2451 | d44: f1 1d adc r31, r1 |
||
2452 | d46: 85 2f mov r24, r21 |
||
2453 | d48: 82 95 swap r24 |
||
2454 | d4a: 8f 70 andi r24, 0x0F ; 15 |
||
2455 | d4c: 3d 53 subi r19, 0x3D ; 61 |
||
2456 | d4e: 33 0f add r19, r19 |
||
2457 | d50: 33 0f add r19, r19 |
||
2458 | d52: 38 2b or r19, r24 |
||
2459 | d54: 30 83 st Z, r19 |
||
2460 | if(len--) ptrOut[ptr++] = y; else break; |
||
2461 | d56: 61 30 cpi r22, 0x01 ; 1 |
||
2462 | d58: 01 f1 breq .+64 ; 0xd9a <Decode64+0xa8> |
||
2463 | unsigned char x,y,z; |
||
2464 | while(len) |
||
2465 | { |
||
2466 | a = RxdBuffer[ptrIn++] - '='; |
||
2467 | b = RxdBuffer[ptrIn++] - '='; |
||
2468 | c = RxdBuffer[ptrIn++] - '='; |
||
2469 | d5a: 91 2f mov r25, r17 |
||
2470 | d5c: 9d 53 subi r25, 0x3D ; 61 |
||
2471 | x = (a << 2) | (b >> 4); |
||
2472 | y = ((b & 0x0f) << 4) | (c >> 2); |
||
2473 | z = ((c & 0x03) << 6) | d; |
||
2474 | |||
2475 | if(len--) ptrOut[ptr++] = x; else break; |
||
2476 | if(len--) ptrOut[ptr++] = y; else break; |
||
2477 | d5e: 7f 5f subi r23, 0xFF ; 255 |
||
2478 | d60: fe 01 movw r30, r28 |
||
2479 | d62: e7 0f add r30, r23 |
||
2480 | d64: f1 1d adc r31, r1 |
||
2481 | d66: 71 50 subi r23, 0x01 ; 1 |
||
2482 | d68: 52 95 swap r21 |
||
2483 | d6a: 50 7f andi r21, 0xF0 ; 240 |
||
2484 | d6c: 89 2f mov r24, r25 |
||
2485 | d6e: 86 95 lsr r24 |
||
2486 | d70: 86 95 lsr r24 |
||
2487 | d72: 58 2b or r21, r24 |
||
2488 | d74: 50 83 st Z, r21 |
||
2489 | if(len--) ptrOut[ptr++] = z; else break; |
||
2490 | d76: 62 30 cpi r22, 0x02 ; 2 |
||
2491 | d78: 81 f0 breq .+32 ; 0xd9a <Decode64+0xa8> |
||
2492 | d7a: 63 50 subi r22, 0x03 ; 3 |
||
2493 | d7c: 7e 5f subi r23, 0xFE ; 254 |
||
2494 | d7e: fe 01 movw r30, r28 |
||
2495 | d80: e7 0f add r30, r23 |
||
2496 | d82: f1 1d adc r31, r1 |
||
2497 | d84: 92 95 swap r25 |
||
2498 | d86: 99 0f add r25, r25 |
||
2499 | d88: 99 0f add r25, r25 |
||
2500 | d8a: 90 7c andi r25, 0xC0 ; 192 |
||
2501 | d8c: 2d 53 subi r18, 0x3D ; 61 |
||
2502 | d8e: 92 2b or r25, r18 |
||
2503 | d90: 90 83 st Z, r25 |
||
2504 | d92: 7f 5f subi r23, 0xFF ; 255 |
||
2505 | void Decode64(unsigned char *ptrOut, unsigned char len, unsigned char ptrIn,unsigned char max) // Wohin mit den Daten; Wie lang; Wo im RxdBuffer |
||
2506 | { |
||
2507 | unsigned char a,b,c,d; |
||
2508 | unsigned char ptr = 0; |
||
2509 | unsigned char x,y,z; |
||
2510 | while(len) |
||
2511 | d94: 66 23 and r22, r22 |
||
2512 | d96: 09 f0 breq .+2 ; 0xd9a <Decode64+0xa8> |
||
2513 | d98: b5 cf rjmp .-150 ; 0xd04 <Decode64+0x12> |
||
2514 | if(len--) ptrOut[ptr++] = x; else break; |
||
2515 | if(len--) ptrOut[ptr++] = y; else break; |
||
2516 | if(len--) ptrOut[ptr++] = z; else break; |
||
2517 | } |
||
2518 | |||
2519 | } |
||
2520 | d9a: df 91 pop r29 |
||
2521 | d9c: cf 91 pop r28 |
||
2522 | d9e: 1f 91 pop r17 |
||
2523 | da0: 08 95 ret |
||
2524 | |||
2525 | 00000da2 <AddCRC>: |
||
2526 | }; |
||
2527 | |||
2528 | |||
2529 | // -------------------------------------------------------------------------- |
||
2530 | void AddCRC(unsigned int wieviele) |
||
2531 | { |
||
2532 | da2: dc 01 movw r26, r24 |
||
2533 | da4: 20 e0 ldi r18, 0x00 ; 0 |
||
2534 | da6: 30 e0 ldi r19, 0x00 ; 0 |
||
2535 | da8: 40 e0 ldi r20, 0x00 ; 0 |
||
2536 | daa: 50 e0 ldi r21, 0x00 ; 0 |
||
2537 | dac: 08 c0 rjmp .+16 ; 0xdbe <AddCRC+0x1c> |
||
2538 | unsigned int tmpCRC = 0,i; |
||
2539 | for(i = 0; i < wieviele;i++) |
||
2540 | { |
||
2541 | tmpCRC += SendeBuffer[i]; |
||
2542 | dae: fa 01 movw r30, r20 |
||
2543 | db0: e8 54 subi r30, 0x48 ; 72 |
||
2544 | db2: fd 4f sbci r31, 0xFD ; 253 |
||
2545 | db4: 80 81 ld r24, Z |
||
2546 | db6: 28 0f add r18, r24 |
||
2547 | db8: 31 1d adc r19, r1 |
||
2548 | |||
2549 | // -------------------------------------------------------------------------- |
||
2550 | void AddCRC(unsigned int wieviele) |
||
2551 | { |
||
2552 | unsigned int tmpCRC = 0,i; |
||
2553 | for(i = 0; i < wieviele;i++) |
||
2554 | dba: 4f 5f subi r20, 0xFF ; 255 |
||
2555 | dbc: 5f 4f sbci r21, 0xFF ; 255 |
||
2556 | dbe: 4a 17 cp r20, r26 |
||
2557 | dc0: 5b 07 cpc r21, r27 |
||
2558 | dc2: a8 f3 brcs .-22 ; 0xdae <AddCRC+0xc> |
||
2559 | { |
||
2560 | tmpCRC += SendeBuffer[i]; |
||
2561 | } |
||
2562 | tmpCRC %= 4096; |
||
2563 | dc4: 3f 70 andi r19, 0x0F ; 15 |
||
2564 | SendeBuffer[i++] = '=' + tmpCRC / 64; |
||
2565 | dc6: c9 01 movw r24, r18 |
||
2566 | dc8: 36 e0 ldi r19, 0x06 ; 6 |
||
2567 | dca: 96 95 lsr r25 |
||
2568 | dcc: 87 95 ror r24 |
||
2569 | dce: 3a 95 dec r19 |
||
2570 | dd0: e1 f7 brne .-8 ; 0xdca <AddCRC+0x28> |
||
2571 | dd2: 83 5c subi r24, 0xC3 ; 195 |
||
2572 | dd4: fd 01 movw r30, r26 |
||
2573 | dd6: e8 54 subi r30, 0x48 ; 72 |
||
2574 | dd8: fd 4f sbci r31, 0xFD ; 253 |
||
2575 | dda: 80 83 st Z, r24 |
||
2576 | ddc: 11 96 adiw r26, 0x01 ; 1 |
||
2577 | SendeBuffer[i++] = '=' + tmpCRC % 64; |
||
2578 | dde: 2f 73 andi r18, 0x3F ; 63 |
||
2579 | de0: 23 5c subi r18, 0xC3 ; 195 |
||
2580 | de2: fd 01 movw r30, r26 |
||
2581 | de4: e8 54 subi r30, 0x48 ; 72 |
||
2582 | de6: fd 4f sbci r31, 0xFD ; 253 |
||
2583 | de8: 20 83 st Z, r18 |
||
2584 | SendeBuffer[i++] = '\r'; |
||
2585 | dea: a7 54 subi r26, 0x47 ; 71 |
||
2586 | dec: bd 4f sbci r27, 0xFD ; 253 |
||
2587 | dee: 8d e0 ldi r24, 0x0D ; 13 |
||
2588 | df0: 8c 93 st X, r24 |
||
2589 | UebertragungAbgeschlossen = 0; |
||
2590 | df2: 10 92 6f 00 sts 0x006F, r1 |
||
2591 | UDR = SendeBuffer[0]; |
||
2592 | df6: 80 91 b8 02 lds r24, 0x02B8 |
||
2593 | dfa: 8c b9 out 0x0c, r24 ; 12 |
||
2594 | } |
||
2595 | dfc: 08 95 ret |
||
2596 | |||
2597 | 00000dfe <SendOutData>: |
||
2598 | |||
2599 | |||
2600 | // -------------------------------------------------------------------------- |
||
2601 | void SendOutData(unsigned char cmd,unsigned char modul, unsigned char *snd, unsigned char len) |
||
2602 | { |
||
2603 | dfe: cf 93 push r28 |
||
2604 | e00: df 93 push r29 |
||
2605 | e02: ea 01 movw r28, r20 |
||
2606 | e04: b2 2f mov r27, r18 |
||
2607 | unsigned int pt = 0; |
||
2608 | unsigned char a,b,c; |
||
2609 | unsigned char ptr = 0; |
||
2610 | |||
2611 | |||
2612 | SendeBuffer[pt++] = '#'; // Startzeichen |
||
2613 | e06: 93 e2 ldi r25, 0x23 ; 35 |
||
2614 | e08: 90 93 b8 02 sts 0x02B8, r25 |
||
2615 | SendeBuffer[pt++] = modul; // Adresse (a=0; b=1,...) |
||
2616 | e0c: 60 93 b9 02 sts 0x02B9, r22 |
||
2617 | SendeBuffer[pt++] = cmd; // Commando |
||
2618 | e10: 80 93 ba 02 sts 0x02BA, r24 |
||
2619 | e14: 63 e0 ldi r22, 0x03 ; 3 |
||
2620 | e16: 70 e0 ldi r23, 0x00 ; 0 |
||
2621 | e18: a0 e0 ldi r26, 0x00 ; 0 |
||
2622 | e1a: 4e c0 rjmp .+156 ; 0xeb8 <SendOutData+0xba> |
||
2623 | |||
2624 | while(len) |
||
2625 | { |
||
2626 | if(len) { a = snd[ptr++]; len--;} else a = 0; |
||
2627 | e1c: fe 01 movw r30, r28 |
||
2628 | e1e: ea 0f add r30, r26 |
||
2629 | e20: f1 1d adc r31, r1 |
||
2630 | e22: 90 81 ld r25, Z |
||
2631 | e24: af 5f subi r26, 0xFF ; 255 |
||
2632 | e26: b1 50 subi r27, 0x01 ; 1 |
||
2633 | if(len) { b = snd[ptr++]; len--;} else b = 0; |
||
2634 | e28: 19 f4 brne .+6 ; 0xe30 <SendOutData+0x32> |
||
2635 | e2a: 30 e0 ldi r19, 0x00 ; 0 |
||
2636 | e2c: 40 e0 ldi r20, 0x00 ; 0 |
||
2637 | e2e: 0f c0 rjmp .+30 ; 0xe4e <SendOutData+0x50> |
||
2638 | e30: fe 01 movw r30, r28 |
||
2639 | e32: ea 0f add r30, r26 |
||
2640 | e34: f1 1d adc r31, r1 |
||
2641 | e36: 40 81 ld r20, Z |
||
2642 | e38: af 5f subi r26, 0xFF ; 255 |
||
2643 | e3a: b1 50 subi r27, 0x01 ; 1 |
||
2644 | if(len) { c = snd[ptr++]; len--;} else c = 0; |
||
2645 | e3c: 11 f4 brne .+4 ; 0xe42 <SendOutData+0x44> |
||
2646 | e3e: 30 e0 ldi r19, 0x00 ; 0 |
||
2647 | e40: 06 c0 rjmp .+12 ; 0xe4e <SendOutData+0x50> |
||
2648 | e42: fe 01 movw r30, r28 |
||
2649 | e44: ea 0f add r30, r26 |
||
2650 | e46: f1 1d adc r31, r1 |
||
2651 | e48: 30 81 ld r19, Z |
||
2652 | e4a: af 5f subi r26, 0xFF ; 255 |
||
2653 | e4c: b1 50 subi r27, 0x01 ; 1 |
||
2654 | SendeBuffer[pt++] = '=' + (a >> 2); |
||
2655 | e4e: 89 2f mov r24, r25 |
||
2656 | e50: 86 95 lsr r24 |
||
2657 | e52: 86 95 lsr r24 |
||
2658 | e54: 83 5c subi r24, 0xC3 ; 195 |
||
2659 | e56: fb 01 movw r30, r22 |
||
2660 | e58: e8 54 subi r30, 0x48 ; 72 |
||
2661 | e5a: fd 4f sbci r31, 0xFD ; 253 |
||
2662 | e5c: 80 83 st Z, r24 |
||
2663 | SendeBuffer[pt++] = '=' + (((a & 0x03) << 4) | ((b & 0xf0) >> 4)); |
||
2664 | e5e: 24 2f mov r18, r20 |
||
2665 | e60: 22 95 swap r18 |
||
2666 | e62: 2f 70 andi r18, 0x0F ; 15 |
||
2667 | e64: 89 2f mov r24, r25 |
||
2668 | e66: 90 e0 ldi r25, 0x00 ; 0 |
||
2669 | e68: 83 70 andi r24, 0x03 ; 3 |
||
2670 | e6a: 90 70 andi r25, 0x00 ; 0 |
||
2671 | e6c: 54 e0 ldi r21, 0x04 ; 4 |
||
2672 | e6e: 88 0f add r24, r24 |
||
2673 | e70: 99 1f adc r25, r25 |
||
2674 | e72: 5a 95 dec r21 |
||
2675 | e74: e1 f7 brne .-8 ; 0xe6e <SendOutData+0x70> |
||
2676 | e76: 28 2b or r18, r24 |
||
2677 | e78: 23 5c subi r18, 0xC3 ; 195 |
||
2678 | e7a: fb 01 movw r30, r22 |
||
2679 | e7c: e7 54 subi r30, 0x47 ; 71 |
||
2680 | e7e: fd 4f sbci r31, 0xFD ; 253 |
||
2681 | e80: 20 83 st Z, r18 |
||
2682 | SendeBuffer[pt++] = '=' + (((b & 0x0f) << 2) | ((c & 0xc0) >> 6)); |
||
2683 | e82: 84 2f mov r24, r20 |
||
2684 | e84: 90 e0 ldi r25, 0x00 ; 0 |
||
2685 | e86: 8f 70 andi r24, 0x0F ; 15 |
||
2686 | e88: 90 70 andi r25, 0x00 ; 0 |
||
2687 | e8a: 88 0f add r24, r24 |
||
2688 | e8c: 99 1f adc r25, r25 |
||
2689 | e8e: 88 0f add r24, r24 |
||
2690 | e90: 99 1f adc r25, r25 |
||
2691 | e92: 23 2f mov r18, r19 |
||
2692 | e94: 22 95 swap r18 |
||
2693 | e96: 26 95 lsr r18 |
||
2694 | e98: 26 95 lsr r18 |
||
2695 | e9a: 23 70 andi r18, 0x03 ; 3 |
||
2696 | e9c: 28 2b or r18, r24 |
||
2697 | e9e: 23 5c subi r18, 0xC3 ; 195 |
||
2698 | ea0: fb 01 movw r30, r22 |
||
2699 | ea2: e6 54 subi r30, 0x46 ; 70 |
||
2700 | ea4: fd 4f sbci r31, 0xFD ; 253 |
||
2701 | ea6: 20 83 st Z, r18 |
||
2702 | SendeBuffer[pt++] = '=' + ( c & 0x3f); |
||
2703 | ea8: 3f 73 andi r19, 0x3F ; 63 |
||
2704 | eaa: 33 5c subi r19, 0xC3 ; 195 |
||
2705 | eac: fb 01 movw r30, r22 |
||
2706 | eae: e5 54 subi r30, 0x45 ; 69 |
||
2707 | eb0: fd 4f sbci r31, 0xFD ; 253 |
||
2708 | eb2: 30 83 st Z, r19 |
||
2709 | eb4: 6c 5f subi r22, 0xFC ; 252 |
||
2710 | eb6: 7f 4f sbci r23, 0xFF ; 255 |
||
2711 | |||
2712 | SendeBuffer[pt++] = '#'; // Startzeichen |
||
2713 | SendeBuffer[pt++] = modul; // Adresse (a=0; b=1,...) |
||
2714 | SendeBuffer[pt++] = cmd; // Commando |
||
2715 | |||
2716 | while(len) |
||
2717 | eb8: bb 23 and r27, r27 |
||
2718 | eba: 09 f0 breq .+2 ; 0xebe <SendOutData+0xc0> |
||
2719 | ebc: af cf rjmp .-162 ; 0xe1c <SendOutData+0x1e> |
||
2720 | SendeBuffer[pt++] = '=' + (a >> 2); |
||
2721 | SendeBuffer[pt++] = '=' + (((a & 0x03) << 4) | ((b & 0xf0) >> 4)); |
||
2722 | SendeBuffer[pt++] = '=' + (((b & 0x0f) << 2) | ((c & 0xc0) >> 6)); |
||
2723 | SendeBuffer[pt++] = '=' + ( c & 0x3f); |
||
2724 | } |
||
2725 | AddCRC(pt); |
||
2726 | ebe: cb 01 movw r24, r22 |
||
2727 | ec0: 70 df rcall .-288 ; 0xda2 <AddCRC> |
||
2728 | } |
||
2729 | ec2: df 91 pop r29 |
||
2730 | ec4: cf 91 pop r28 |
||
2731 | ec6: 08 95 ret |
||
2732 | |||
2733 | 00000ec8 <uart_putchar>: |
||
2734 | |||
2735 | //############################################################################ |
||
2736 | //Routine für die Serielle Ausgabe |
||
2737 | int uart_putchar (char c) |
||
2738 | //############################################################################ |
||
2739 | { |
||
2740 | ec8: 1f 93 push r17 |
||
2741 | eca: 18 2f mov r17, r24 |
||
2742 | if (c == '\n') |
||
2743 | ecc: 8a 30 cpi r24, 0x0A ; 10 |
||
2744 | ece: 11 f4 brne .+4 ; 0xed4 <uart_putchar+0xc> |
||
2745 | uart_putchar('\r'); |
||
2746 | ed0: 8d e0 ldi r24, 0x0D ; 13 |
||
2747 | ed2: fa df rcall .-12 ; 0xec8 <uart_putchar> |
||
2748 | //Warten solange bis Zeichen gesendet wurde |
||
2749 | loop_until_bit_is_set(USR, UDRE); |
||
2750 | ed4: 5d 9b sbis 0x0b, 5 ; 11 |
||
2751 | ed6: fe cf rjmp .-4 ; 0xed4 <uart_putchar+0xc> |
||
2752 | //Ausgabe des Zeichens |
||
2753 | UDR = c; |
||
2754 | ed8: 1c b9 out 0x0c, r17 ; 12 |
||
2755 | |||
2756 | return (0); |
||
2757 | } |
||
2758 | eda: 80 e0 ldi r24, 0x00 ; 0 |
||
2759 | edc: 90 e0 ldi r25, 0x00 ; 0 |
||
2760 | ede: 1f 91 pop r17 |
||
2761 | ee0: 08 95 ret |
||
2762 | |||
2763 | 00000ee2 <__vector_11>: |
||
2764 | |||
2765 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
2766 | //++ Empfangs-Part der Datenübertragung |
||
2767 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
2768 | SIGNAL(INT_VEC_RX) |
||
2769 | { |
||
2770 | ee2: 1f 92 push r1 |
||
2771 | ee4: 0f 92 push r0 |
||
2772 | ee6: 0f b6 in r0, 0x3f ; 63 |
||
2773 | ee8: 0f 92 push r0 |
||
2774 | eea: 11 24 eor r1, r1 |
||
2775 | eec: 2f 93 push r18 |
||
2776 | eee: 3f 93 push r19 |
||
2777 | ef0: 4f 93 push r20 |
||
2778 | ef2: 5f 93 push r21 |
||
2779 | ef4: 6f 93 push r22 |
||
2780 | ef6: 7f 93 push r23 |
||
2781 | ef8: 8f 93 push r24 |
||
2782 | efa: 9f 93 push r25 |
||
2783 | efc: af 93 push r26 |
||
2784 | efe: bf 93 push r27 |
||
2785 | f00: cf 93 push r28 |
||
2786 | f02: df 93 push r29 |
||
2787 | f04: ef 93 push r30 |
||
2788 | f06: ff 93 push r31 |
||
2789 | static unsigned int crc; |
||
2790 | static unsigned char crc1,crc2,buf_ptr; |
||
2791 | static unsigned char UartState = 0; |
||
2792 | unsigned char CrcOkay = 0; |
||
2793 | |||
2794 | SioTmp = UDR; |
||
2795 | f08: 8c b1 in r24, 0x0c ; 12 |
||
2796 | f0a: 80 93 91 00 sts 0x0091, r24 |
||
2797 | if(buf_ptr >= MAX_EMPFANGS_BUFF) UartState = 0; |
||
2798 | f0e: 40 91 9b 00 lds r20, 0x009B |
||
2799 | f12: 44 36 cpi r20, 0x64 ; 100 |
||
2800 | f14: 10 f0 brcs .+4 ; 0xf1a <__vector_11+0x38> |
||
2801 | f16: 10 92 9a 00 sts 0x009A, r1 |
||
2802 | if(SioTmp == '\r' && UartState == 2) |
||
2803 | f1a: 50 91 91 00 lds r21, 0x0091 |
||
2804 | f1e: 5d 30 cpi r21, 0x0D ; 13 |
||
2805 | f20: 09 f0 breq .+2 ; 0xf24 <__vector_11+0x42> |
||
2806 | f22: 64 c0 rjmp .+200 ; 0xfec <__vector_11+0x10a> |
||
2807 | f24: 80 91 9a 00 lds r24, 0x009A |
||
2808 | f28: 82 30 cpi r24, 0x02 ; 2 |
||
2809 | f2a: 09 f0 breq .+2 ; 0xf2e <__vector_11+0x4c> |
||
2810 | f2c: 5f c0 rjmp .+190 ; 0xfec <__vector_11+0x10a> |
||
2811 | { |
||
2812 | UartState = 0; |
||
2813 | f2e: 10 92 9a 00 sts 0x009A, r1 |
||
2814 | crc -= RxdBuffer[buf_ptr-2]; |
||
2815 | f32: a4 2f mov r26, r20 |
||
2816 | f34: b0 e0 ldi r27, 0x00 ; 0 |
||
2817 | f36: fd 01 movw r30, r26 |
||
2818 | f38: e4 5e subi r30, 0xE4 ; 228 |
||
2819 | f3a: fc 4f sbci r31, 0xFC ; 252 |
||
2820 | f3c: 30 81 ld r19, Z |
||
2821 | crc -= RxdBuffer[buf_ptr-1]; |
||
2822 | f3e: ed 01 movw r28, r26 |
||
2823 | f40: c3 5e subi r28, 0xE3 ; 227 |
||
2824 | f42: dc 4f sbci r29, 0xFC ; 252 |
||
2825 | f44: 28 81 ld r18, Y |
||
2826 | crc %= 4096; |
||
2827 | f46: 80 91 9e 00 lds r24, 0x009E |
||
2828 | f4a: 90 91 9f 00 lds r25, 0x009F |
||
2829 | f4e: 83 1b sub r24, r19 |
||
2830 | f50: 91 09 sbc r25, r1 |
||
2831 | f52: 82 1b sub r24, r18 |
||
2832 | f54: 91 09 sbc r25, r1 |
||
2833 | f56: 9f 70 andi r25, 0x0F ; 15 |
||
2834 | f58: 90 93 9f 00 sts 0x009F, r25 |
||
2835 | f5c: 80 93 9e 00 sts 0x009E, r24 |
||
2836 | crc1 = '=' + crc / 64; |
||
2837 | f60: 9c 01 movw r18, r24 |
||
2838 | f62: 66 e0 ldi r22, 0x06 ; 6 |
||
2839 | f64: 36 95 lsr r19 |
||
2840 | f66: 27 95 ror r18 |
||
2841 | f68: 6a 95 dec r22 |
||
2842 | f6a: e1 f7 brne .-8 ; 0xf64 <__vector_11+0x82> |
||
2843 | f6c: 23 5c subi r18, 0xC3 ; 195 |
||
2844 | f6e: 20 93 9d 00 sts 0x009D, r18 |
||
2845 | crc2 = '=' + crc % 64; |
||
2846 | f72: 98 2f mov r25, r24 |
||
2847 | f74: 9f 73 andi r25, 0x3F ; 63 |
||
2848 | f76: 93 5c subi r25, 0xC3 ; 195 |
||
2849 | f78: 90 93 9c 00 sts 0x009C, r25 |
||
2850 | CrcOkay = 0; |
||
2851 | if((crc1 == RxdBuffer[buf_ptr-2]) && (crc2 == RxdBuffer[buf_ptr-1])) CrcOkay = 1; else { CrcOkay = 0; }; |
||
2852 | f7c: 80 81 ld r24, Z |
||
2853 | f7e: 28 17 cp r18, r24 |
||
2854 | f80: 09 f0 breq .+2 ; 0xf84 <__vector_11+0xa2> |
||
2855 | f82: 80 c0 rjmp .+256 ; 0x1084 <__vector_11+0x1a2> |
||
2856 | f84: 88 81 ld r24, Y |
||
2857 | f86: 98 17 cp r25, r24 |
||
2858 | f88: 09 f0 breq .+2 ; 0xf8c <__vector_11+0xaa> |
||
2859 | f8a: 7c c0 rjmp .+248 ; 0x1084 <__vector_11+0x1a2> |
||
2860 | if(CrcOkay) // Datensatz schon verarbeitet |
||
2861 | { |
||
2862 | //NeuerDatensatzEmpfangen = 1; |
||
2863 | AnzahlEmpfangsBytes = buf_ptr; |
||
2864 | f8c: 40 93 99 00 sts 0x0099, r20 |
||
2865 | |||
2866 | RxdBuffer[buf_ptr] = '\r'; |
||
2867 | f90: a2 5e subi r26, 0xE2 ; 226 |
||
2868 | f92: bc 4f sbci r27, 0xFC ; 252 |
||
2869 | f94: 5c 93 st X, r21 |
||
2870 | if(/*(RxdBuffer[1] == MeineSlaveAdresse || (RxdBuffer[1] == 'a')) && */(RxdBuffer[2] == 'R')) wdt_enable(WDTO_250MS); // Reset-Commando |
||
2871 | f96: 80 91 20 03 lds r24, 0x0320 |
||
2872 | f9a: 82 35 cpi r24, 0x52 ; 82 |
||
2873 | f9c: 49 f4 brne .+18 ; 0xfb0 <__vector_11+0xce> |
||
2874 | f9e: 2c e0 ldi r18, 0x0C ; 12 |
||
2875 | fa0: 88 e1 ldi r24, 0x18 ; 24 |
||
2876 | fa2: 90 e0 ldi r25, 0x00 ; 0 |
||
2877 | fa4: 0f b6 in r0, 0x3f ; 63 |
||
2878 | fa6: f8 94 cli |
||
2879 | fa8: a8 95 wdr |
||
2880 | faa: 81 bd out 0x21, r24 ; 33 |
||
2881 | fac: 0f be out 0x3f, r0 ; 63 |
||
2882 | fae: 21 bd out 0x21, r18 ; 33 |
||
2883 | uart_putchar(RxdBuffer[2]); |
||
2884 | fb0: 80 91 20 03 lds r24, 0x0320 |
||
2885 | fb4: 89 df rcall .-238 ; 0xec8 <uart_putchar> |
||
2886 | if (RxdBuffer[2] == 't') // Motortest |
||
2887 | fb6: 80 91 20 03 lds r24, 0x0320 |
||
2888 | fba: 84 37 cpi r24, 0x74 ; 116 |
||
2889 | fbc: 09 f0 breq .+2 ; 0xfc0 <__vector_11+0xde> |
||
2890 | fbe: 62 c0 rjmp .+196 ; 0x1084 <__vector_11+0x1a2> |
||
2891 | { Decode64((unsigned char *) &MotorTest[0],sizeof(MotorTest),3,AnzahlEmpfangsBytes); |
||
2892 | fc0: 20 91 99 00 lds r18, 0x0099 |
||
2893 | fc4: 83 e9 ldi r24, 0x93 ; 147 |
||
2894 | fc6: 90 e0 ldi r25, 0x00 ; 0 |
||
2895 | fc8: 66 e0 ldi r22, 0x06 ; 6 |
||
2896 | fca: 43 e0 ldi r20, 0x03 ; 3 |
||
2897 | fcc: 92 de rcall .-732 ; 0xcf2 <Decode64> |
||
2898 | SIO_Sollwert = MotorTest[MotorAdresse - 1]; |
||
2899 | fce: e0 91 66 00 lds r30, 0x0066 |
||
2900 | fd2: f0 e0 ldi r31, 0x00 ; 0 |
||
2901 | fd4: ee 56 subi r30, 0x6E ; 110 |
||
2902 | fd6: ff 4f sbci r31, 0xFF ; 255 |
||
2903 | fd8: 80 81 ld r24, Z |
||
2904 | fda: 80 93 90 00 sts 0x0090, r24 |
||
2905 | SIO_Timeout = 500; // werte für 500ms gültig |
||
2906 | fde: 84 ef ldi r24, 0xF4 ; 244 |
||
2907 | fe0: 91 e0 ldi r25, 0x01 ; 1 |
||
2908 | fe2: 90 93 83 00 sts 0x0083, r25 |
||
2909 | fe6: 80 93 82 00 sts 0x0082, r24 |
||
2910 | fea: 4c c0 rjmp .+152 ; 0x1084 <__vector_11+0x1a2> |
||
2911 | |||
2912 | } |
||
2913 | } |
||
2914 | } |
||
2915 | else |
||
2916 | switch(UartState) |
||
2917 | fec: 80 91 9a 00 lds r24, 0x009A |
||
2918 | ff0: 81 30 cpi r24, 0x01 ; 1 |
||
2919 | ff2: f9 f0 breq .+62 ; 0x1032 <__vector_11+0x150> |
||
2920 | ff4: 81 30 cpi r24, 0x01 ; 1 |
||
2921 | ff6: 20 f0 brcs .+8 ; 0x1000 <__vector_11+0x11e> |
||
2922 | ff8: 82 30 cpi r24, 0x02 ; 2 |
||
2923 | ffa: 09 f0 breq .+2 ; 0xffe <__vector_11+0x11c> |
||
2924 | ffc: 41 c0 rjmp .+130 ; 0x1080 <__vector_11+0x19e> |
||
2925 | ffe: 24 c0 rjmp .+72 ; 0x1048 <__vector_11+0x166> |
||
2926 | { |
||
2927 | case 0: |
||
2928 | if(SioTmp == '#' && !NeuerDatensatzEmpfangen) UartState = 1; // Startzeichen und Daten schon verarbeitet |
||
2929 | 1000: 80 91 91 00 lds r24, 0x0091 |
||
2930 | 1004: 83 32 cpi r24, 0x23 ; 35 |
||
2931 | 1006: 39 f4 brne .+14 ; 0x1016 <__vector_11+0x134> |
||
2932 | 1008: 80 91 92 00 lds r24, 0x0092 |
||
2933 | 100c: 88 23 and r24, r24 |
||
2934 | 100e: 19 f4 brne .+6 ; 0x1016 <__vector_11+0x134> |
||
2935 | 1010: 81 e0 ldi r24, 0x01 ; 1 |
||
2936 | 1012: 80 93 9a 00 sts 0x009A, r24 |
||
2937 | buf_ptr = 0; |
||
2938 | RxdBuffer[buf_ptr++] = SioTmp; |
||
2939 | 1016: 80 91 91 00 lds r24, 0x0091 |
||
2940 | 101a: 80 93 1e 03 sts 0x031E, r24 |
||
2941 | 101e: 81 e0 ldi r24, 0x01 ; 1 |
||
2942 | 1020: 80 93 9b 00 sts 0x009B, r24 |
||
2943 | crc = SioTmp; |
||
2944 | 1024: 80 91 91 00 lds r24, 0x0091 |
||
2945 | 1028: 80 93 9e 00 sts 0x009E, r24 |
||
2946 | 102c: 10 92 9f 00 sts 0x009F, r1 |
||
2947 | 1030: 29 c0 rjmp .+82 ; 0x1084 <__vector_11+0x1a2> |
||
2948 | break; |
||
2949 | case 1: // Adresse auswerten |
||
2950 | UartState++; |
||
2951 | 1032: 82 e0 ldi r24, 0x02 ; 2 |
||
2952 | 1034: 80 93 9a 00 sts 0x009A, r24 |
||
2953 | RxdBuffer[buf_ptr++] = SioTmp; |
||
2954 | 1038: e4 2f mov r30, r20 |
||
2955 | 103a: f0 e0 ldi r31, 0x00 ; 0 |
||
2956 | 103c: 80 91 91 00 lds r24, 0x0091 |
||
2957 | 1040: e2 5e subi r30, 0xE2 ; 226 |
||
2958 | 1042: fc 4f sbci r31, 0xFC ; 252 |
||
2959 | 1044: 80 83 st Z, r24 |
||
2960 | 1046: 09 c0 rjmp .+18 ; 0x105a <__vector_11+0x178> |
||
2961 | crc += SioTmp; |
||
2962 | break; |
||
2963 | case 2: // Eingangsdaten sammeln |
||
2964 | RxdBuffer[buf_ptr] = SioTmp; |
||
2965 | 1048: e4 2f mov r30, r20 |
||
2966 | 104a: f0 e0 ldi r31, 0x00 ; 0 |
||
2967 | 104c: 80 91 91 00 lds r24, 0x0091 |
||
2968 | 1050: e2 5e subi r30, 0xE2 ; 226 |
||
2969 | 1052: fc 4f sbci r31, 0xFC ; 252 |
||
2970 | 1054: 80 83 st Z, r24 |
||
2971 | if(buf_ptr < MAX_EMPFANGS_BUFF) buf_ptr++; |
||
2972 | 1056: 44 36 cpi r20, 0x64 ; 100 |
||
2973 | 1058: 20 f4 brcc .+8 ; 0x1062 <__vector_11+0x180> |
||
2974 | 105a: 4f 5f subi r20, 0xFF ; 255 |
||
2975 | 105c: 40 93 9b 00 sts 0x009B, r20 |
||
2976 | 1060: 02 c0 rjmp .+4 ; 0x1066 <__vector_11+0x184> |
||
2977 | else UartState = 0; |
||
2978 | 1062: 10 92 9a 00 sts 0x009A, r1 |
||
2979 | crc += SioTmp; |
||
2980 | 1066: 20 91 91 00 lds r18, 0x0091 |
||
2981 | 106a: 80 91 9e 00 lds r24, 0x009E |
||
2982 | 106e: 90 91 9f 00 lds r25, 0x009F |
||
2983 | 1072: 82 0f add r24, r18 |
||
2984 | 1074: 91 1d adc r25, r1 |
||
2985 | 1076: 90 93 9f 00 sts 0x009F, r25 |
||
2986 | 107a: 80 93 9e 00 sts 0x009E, r24 |
||
2987 | 107e: 02 c0 rjmp .+4 ; 0x1084 <__vector_11+0x1a2> |
||
2988 | break; |
||
2989 | default: |
||
2990 | UartState = 0; |
||
2991 | 1080: 10 92 9a 00 sts 0x009A, r1 |
||
2992 | break; |
||
2993 | } |
||
2994 | |||
2995 | |||
2996 | #endif |
||
2997 | }; |
||
2998 | 1084: ff 91 pop r31 |
||
2999 | 1086: ef 91 pop r30 |
||
3000 | 1088: df 91 pop r29 |
||
3001 | 108a: cf 91 pop r28 |
||
3002 | 108c: bf 91 pop r27 |
||
3003 | 108e: af 91 pop r26 |
||
3004 | 1090: 9f 91 pop r25 |
||
3005 | 1092: 8f 91 pop r24 |
||
3006 | 1094: 7f 91 pop r23 |
||
3007 | 1096: 6f 91 pop r22 |
||
3008 | 1098: 5f 91 pop r21 |
||
3009 | 109a: 4f 91 pop r20 |
||
3010 | 109c: 3f 91 pop r19 |
||
3011 | 109e: 2f 91 pop r18 |
||
3012 | 10a0: 0f 90 pop r0 |
||
3013 | 10a2: 0f be out 0x3f, r0 ; 63 |
||
3014 | 10a4: 0f 90 pop r0 |
||
3015 | 10a6: 1f 90 pop r1 |
||
3016 | 10a8: 18 95 reti |
||
3017 | |||
3018 | 000010aa <WriteProgramData>: |
||
3019 | } |
||
3020 | |||
3021 | // -------------------------------------------------------------------------- |
||
3022 | void WriteProgramData(unsigned int pos, unsigned char wert) |
||
3023 | { |
||
3024 | } |
||
3025 | 10aa: 08 95 ret |
||
3026 | |||
3027 | 000010ac <DatenUebertragung>: |
||
3028 | |||
3029 | |||
3030 | //--------------------------------------------------------------------------------------------- |
||
3031 | void DatenUebertragung(void) |
||
3032 | { |
||
3033 | if((CheckDelay(Debug_Timer) && UebertragungAbgeschlossen)) // im Singlestep-Betrieb in jedem Schtitt senden |
||
3034 | 10ac: 80 91 1c 03 lds r24, 0x031C |
||
3035 | 10b0: 90 91 1d 03 lds r25, 0x031D |
||
3036 | 10b4: b3 d0 rcall .+358 ; 0x121c <CheckDelay> |
||
3037 | 10b6: 88 23 and r24, r24 |
||
3038 | 10b8: 91 f0 breq .+36 ; 0x10de <DatenUebertragung+0x32> |
||
3039 | 10ba: 80 91 6f 00 lds r24, 0x006F |
||
3040 | 10be: 88 23 and r24, r24 |
||
3041 | 10c0: 71 f0 breq .+28 ; 0x10de <DatenUebertragung+0x32> |
||
3042 | { |
||
3043 | SendOutData('D',MeineSlaveAdresse,(unsigned char *) &DebugOut,sizeof(DebugOut)); |
||
3044 | 10c2: 84 e4 ldi r24, 0x44 ; 68 |
||
3045 | 10c4: 60 91 b7 02 lds r22, 0x02B7 |
||
3046 | 10c8: 42 e8 ldi r20, 0x82 ; 130 |
||
3047 | 10ca: 53 e0 ldi r21, 0x03 ; 3 |
||
3048 | 10cc: 22 e1 ldi r18, 0x12 ; 18 |
||
3049 | 10ce: 97 de rcall .-722 ; 0xdfe <SendOutData> |
||
3050 | Debug_Timer = SetDelay(50); // Sendeintervall |
||
3051 | 10d0: 82 e3 ldi r24, 0x32 ; 50 |
||
3052 | 10d2: 90 e0 ldi r25, 0x00 ; 0 |
||
3053 | 10d4: 99 d0 rcall .+306 ; 0x1208 <SetDelay> |
||
3054 | 10d6: 90 93 1d 03 sts 0x031D, r25 |
||
3055 | 10da: 80 93 1c 03 sts 0x031C, r24 |
||
3056 | 10de: 08 95 ret |
||
3057 | |||
3058 | 000010e0 <UART_Init>: |
||
3059 | void UART_Init (void) |
||
3060 | //############################################################################ |
||
3061 | { |
||
3062 | //Enable TXEN im Register UCR TX-Data Enable & RX Enable |
||
3063 | |||
3064 | UCR=(1 << TXEN) | (1 << RXEN); |
||
3065 | 10e0: 88 e1 ldi r24, 0x18 ; 24 |
||
3066 | 10e2: 8a b9 out 0x0a, r24 ; 10 |
||
3067 | // UART Double Speed (U2X) |
||
3068 | USR |= (1<<U2X); |
||
3069 | 10e4: 59 9a sbi 0x0b, 1 ; 11 |
||
3070 | // RX-Interrupt Freigabe |
||
3071 | |||
3072 | UCSRB |= (1<<RXCIE); // serieller Empfangsinterrupt |
||
3073 | 10e6: 57 9a sbi 0x0a, 7 ; 10 |
||
3074 | |||
3075 | // TX-Interrupt Freigabe |
||
3076 | // UCSRB |= (1<<TXCIE); |
||
3077 | |||
3078 | //Teiler wird gesetzt |
||
3079 | UBRR= (SYSCLK / (BAUD_RATE * 8L) -1 ); |
||
3080 | 10e8: 80 e1 ldi r24, 0x10 ; 16 |
||
3081 | 10ea: 89 b9 out 0x09, r24 ; 9 |
||
3082 | //öffnet einen Kanal für printf (STDOUT) |
||
3083 | fdevopen (uart_putchar, NULL); |
||
3084 | 10ec: 84 e6 ldi r24, 0x64 ; 100 |
||
3085 | 10ee: 97 e0 ldi r25, 0x07 ; 7 |
||
3086 | 10f0: 60 e0 ldi r22, 0x00 ; 0 |
||
3087 | 10f2: 70 e0 ldi r23, 0x00 ; 0 |
||
3088 | 10f4: f7 d3 rcall .+2030 ; 0x18e4 <fdevopen> |
||
3089 | Debug_Timer = SetDelay(200); |
||
3090 | 10f6: 88 ec ldi r24, 0xC8 ; 200 |
||
3091 | 10f8: 90 e0 ldi r25, 0x00 ; 0 |
||
3092 | 10fa: 86 d0 rcall .+268 ; 0x1208 <SetDelay> |
||
3093 | 10fc: 90 93 1d 03 sts 0x031D, r25 |
||
3094 | 1100: 80 93 1c 03 sts 0x031C, r24 |
||
3095 | // Version beim Start ausgeben (nicht schön, aber geht... ) |
||
3096 | uart_putchar ('\n');uart_putchar ('B');uart_putchar ('L');uart_putchar (':'); |
||
3097 | 1104: 8a e0 ldi r24, 0x0A ; 10 |
||
3098 | 1106: e0 de rcall .-576 ; 0xec8 <uart_putchar> |
||
3099 | 1108: 82 e4 ldi r24, 0x42 ; 66 |
||
3100 | 110a: de de rcall .-580 ; 0xec8 <uart_putchar> |
||
3101 | 110c: 8c e4 ldi r24, 0x4C ; 76 |
||
3102 | 110e: dc de rcall .-584 ; 0xec8 <uart_putchar> |
||
3103 | 1110: 8a e3 ldi r24, 0x3A ; 58 |
||
3104 | 1112: da de rcall .-588 ; 0xec8 <uart_putchar> |
||
3105 | uart_putchar ('V');uart_putchar (0x30 + VERSION_HAUPTVERSION);uart_putchar ('.');uart_putchar (0x30 + VERSION_NEBENVERSION/10); uart_putchar (0x30 + VERSION_NEBENVERSION%10); |
||
3106 | 1114: 86 e5 ldi r24, 0x56 ; 86 |
||
3107 | 1116: d8 de rcall .-592 ; 0xec8 <uart_putchar> |
||
3108 | 1118: 80 e3 ldi r24, 0x30 ; 48 |
||
3109 | 111a: d6 de rcall .-596 ; 0xec8 <uart_putchar> |
||
3110 | 111c: 8e e2 ldi r24, 0x2E ; 46 |
||
3111 | 111e: d4 de rcall .-600 ; 0xec8 <uart_putchar> |
||
3112 | 1120: 84 e3 ldi r24, 0x34 ; 52 |
||
3113 | 1122: d2 de rcall .-604 ; 0xec8 <uart_putchar> |
||
3114 | 1124: 81 e3 ldi r24, 0x31 ; 49 |
||
3115 | 1126: d0 de rcall .-608 ; 0xec8 <uart_putchar> |
||
3116 | uart_putchar ('\n');uart_putchar('H');uart_putchar('W');uart_putchar (':');uart_putchar('1');uart_putchar('.');uart_putchar ((0x30-10) + HwVersion); |
||
3117 | 1128: 8a e0 ldi r24, 0x0A ; 10 |
||
3118 | 112a: ce de rcall .-612 ; 0xec8 <uart_putchar> |
||
3119 | 112c: 88 e4 ldi r24, 0x48 ; 72 |
||
3120 | 112e: cc de rcall .-616 ; 0xec8 <uart_putchar> |
||
3121 | 1130: 87 e5 ldi r24, 0x57 ; 87 |
||
3122 | 1132: ca de rcall .-620 ; 0xec8 <uart_putchar> |
||
3123 | 1134: 8a e3 ldi r24, 0x3A ; 58 |
||
3124 | 1136: c8 de rcall .-624 ; 0xec8 <uart_putchar> |
||
3125 | 1138: 81 e3 ldi r24, 0x31 ; 49 |
||
3126 | 113a: c6 de rcall .-628 ; 0xec8 <uart_putchar> |
||
3127 | 113c: 8e e2 ldi r24, 0x2E ; 46 |
||
3128 | 113e: c4 de rcall .-632 ; 0xec8 <uart_putchar> |
||
3129 | 1140: 80 91 b2 00 lds r24, 0x00B2 |
||
3130 | 1144: 8a 5d subi r24, 0xDA ; 218 |
||
3131 | 1146: c0 de rcall .-640 ; 0xec8 <uart_putchar> |
||
3132 | uart_putchar ('\n');uart_putchar ('A');uart_putchar ('D');uart_putchar ('R'); uart_putchar (':'); uart_putchar (0x30 + MotorAdresse); |
||
3133 | 1148: 8a e0 ldi r24, 0x0A ; 10 |
||
3134 | 114a: be de rcall .-644 ; 0xec8 <uart_putchar> |
||
3135 | 114c: 81 e4 ldi r24, 0x41 ; 65 |
||
3136 | 114e: bc de rcall .-648 ; 0xec8 <uart_putchar> |
||
3137 | 1150: 84 e4 ldi r24, 0x44 ; 68 |
||
3138 | 1152: ba de rcall .-652 ; 0xec8 <uart_putchar> |
||
3139 | 1154: 82 e5 ldi r24, 0x52 ; 82 |
||
3140 | 1156: b8 de rcall .-656 ; 0xec8 <uart_putchar> |
||
3141 | 1158: 8a e3 ldi r24, 0x3A ; 58 |
||
3142 | 115a: b6 de rcall .-660 ; 0xec8 <uart_putchar> |
||
3143 | 115c: 80 91 66 00 lds r24, 0x0066 |
||
3144 | 1160: 80 5d subi r24, 0xD0 ; 208 |
||
3145 | 1162: b2 de rcall .-668 ; 0xec8 <uart_putchar> |
||
3146 | |||
3147 | } |
||
3148 | 1164: 08 95 ret |
||
3149 | |||
3150 | 00001166 <__vector_9>: |
||
3151 | T0_RISING_EDGE = 7 |
||
3152 | }; |
||
3153 | |||
3154 | |||
3155 | SIGNAL(SIG_OVERFLOW0) |
||
3156 | { |
||
3157 | 1166: 1f 92 push r1 |
||
3158 | 1168: 0f 92 push r0 |
||
3159 | 116a: 0f b6 in r0, 0x3f ; 63 |
||
3160 | 116c: 0f 92 push r0 |
||
3161 | 116e: 11 24 eor r1, r1 |
||
3162 | 1170: 8f 93 push r24 |
||
3163 | 1172: 9f 93 push r25 |
||
3164 | static unsigned char cnt; |
||
3165 | Timer0Overflow++; |
||
3166 | 1174: 80 91 94 03 lds r24, 0x0394 |
||
3167 | 1178: 8f 5f subi r24, 0xFF ; 255 |
||
3168 | 117a: 80 93 94 03 sts 0x0394, r24 |
||
3169 | if(!cnt--) |
||
3170 | 117e: 80 91 a4 00 lds r24, 0x00A4 |
||
3171 | 1182: 81 50 subi r24, 0x01 ; 1 |
||
3172 | 1184: 80 93 a4 00 sts 0x00A4, r24 |
||
3173 | 1188: 8f 5f subi r24, 0xFF ; 255 |
||
3174 | 118a: 71 f5 brne .+92 ; 0x11e8 <__vector_9+0x82> |
||
3175 | { |
||
3176 | cnt = 3; |
||
3177 | 118c: 83 e0 ldi r24, 0x03 ; 3 |
||
3178 | 118e: 80 93 a4 00 sts 0x00A4, r24 |
||
3179 | CountMilliseconds += 1; |
||
3180 | 1192: 80 91 a2 00 lds r24, 0x00A2 |
||
3181 | 1196: 90 91 a3 00 lds r25, 0x00A3 |
||
3182 | 119a: 01 96 adiw r24, 0x01 ; 1 |
||
3183 | 119c: 90 93 a3 00 sts 0x00A3, r25 |
||
3184 | 11a0: 80 93 a2 00 sts 0x00A2, r24 |
||
3185 | if(I2C_Timeout) I2C_Timeout--; |
||
3186 | 11a4: 80 91 80 00 lds r24, 0x0080 |
||
3187 | 11a8: 90 91 81 00 lds r25, 0x0081 |
||
3188 | 11ac: 00 97 sbiw r24, 0x00 ; 0 |
||
3189 | 11ae: 29 f0 breq .+10 ; 0x11ba <__vector_9+0x54> |
||
3190 | 11b0: 01 97 sbiw r24, 0x01 ; 1 |
||
3191 | 11b2: 90 93 81 00 sts 0x0081, r25 |
||
3192 | 11b6: 80 93 80 00 sts 0x0080, r24 |
||
3193 | if(PPM_Timeout) PPM_Timeout--; else anz_ppm_werte = 0; |
||
3194 | 11ba: 80 91 a8 00 lds r24, 0x00A8 |
||
3195 | 11be: 88 23 and r24, r24 |
||
3196 | 11c0: 31 f0 breq .+12 ; 0x11ce <__vector_9+0x68> |
||
3197 | 11c2: 80 91 a8 00 lds r24, 0x00A8 |
||
3198 | 11c6: 81 50 subi r24, 0x01 ; 1 |
||
3199 | 11c8: 80 93 a8 00 sts 0x00A8, r24 |
||
3200 | 11cc: 02 c0 rjmp .+4 ; 0x11d2 <__vector_9+0x6c> |
||
3201 | 11ce: 10 92 a9 00 sts 0x00A9, r1 |
||
3202 | if(SIO_Timeout) SIO_Timeout--; |
||
3203 | 11d2: 80 91 82 00 lds r24, 0x0082 |
||
3204 | 11d6: 90 91 83 00 lds r25, 0x0083 |
||
3205 | 11da: 00 97 sbiw r24, 0x00 ; 0 |
||
3206 | 11dc: 29 f0 breq .+10 ; 0x11e8 <__vector_9+0x82> |
||
3207 | 11de: 01 97 sbiw r24, 0x01 ; 1 |
||
3208 | 11e0: 90 93 83 00 sts 0x0083, r25 |
||
3209 | 11e4: 80 93 82 00 sts 0x0082, r24 |
||
3210 | } |
||
3211 | } |
||
3212 | 11e8: 9f 91 pop r25 |
||
3213 | 11ea: 8f 91 pop r24 |
||
3214 | 11ec: 0f 90 pop r0 |
||
3215 | 11ee: 0f be out 0x3f, r0 ; 63 |
||
3216 | 11f0: 0f 90 pop r0 |
||
3217 | 11f2: 1f 90 pop r1 |
||
3218 | 11f4: 18 95 reti |
||
3219 | |||
3220 | 000011f6 <Timer0_Init>: |
||
3221 | |||
3222 | |||
3223 | void Timer0_Init(void) |
||
3224 | { |
||
3225 | TCCR0 = TIMER_TEILER; |
||
3226 | 11f6: 82 e0 ldi r24, 0x02 ; 2 |
||
3227 | 11f8: 83 bf out 0x33, r24 ; 51 |
||
3228 | // TCNT0 = -TIMER_RELOAD_VALUE; // reload |
||
3229 | TIM0_START; |
||
3230 | 11fa: 89 b7 in r24, 0x39 ; 57 |
||
3231 | 11fc: 81 60 ori r24, 0x01 ; 1 |
||
3232 | 11fe: 89 bf out 0x39, r24 ; 57 |
||
3233 | TIMER2_INT_ENABLE; |
||
3234 | 1200: 89 b7 in r24, 0x39 ; 57 |
||
3235 | 1202: 80 64 ori r24, 0x40 ; 64 |
||
3236 | 1204: 89 bf out 0x39, r24 ; 57 |
||
3237 | } |
||
3238 | 1206: 08 95 ret |
||
3239 | |||
3240 | 00001208 <SetDelay>: |
||
3241 | |||
3242 | |||
3243 | unsigned int SetDelay(unsigned int t) |
||
3244 | { |
||
3245 | return(CountMilliseconds + t - 1); |
||
3246 | 1208: 20 91 a2 00 lds r18, 0x00A2 |
||
3247 | 120c: 30 91 a3 00 lds r19, 0x00A3 |
||
3248 | 1210: 21 50 subi r18, 0x01 ; 1 |
||
3249 | 1212: 30 40 sbci r19, 0x00 ; 0 |
||
3250 | 1214: 28 0f add r18, r24 |
||
3251 | 1216: 39 1f adc r19, r25 |
||
3252 | } |
||
3253 | 1218: c9 01 movw r24, r18 |
||
3254 | 121a: 08 95 ret |
||
3255 | |||
3256 | 0000121c <CheckDelay>: |
||
3257 | |||
3258 | char CheckDelay (unsigned int t) |
||
3259 | { |
||
3260 | return(((t - CountMilliseconds) & 0x8000) >> 8); |
||
3261 | 121c: 20 91 a2 00 lds r18, 0x00A2 |
||
3262 | 1220: 30 91 a3 00 lds r19, 0x00A3 |
||
3263 | 1224: 82 1b sub r24, r18 |
||
3264 | 1226: 93 0b sbc r25, r19 |
||
3265 | 1228: 80 70 andi r24, 0x00 ; 0 |
||
3266 | 122a: 90 78 andi r25, 0x80 ; 128 |
||
3267 | } |
||
3268 | 122c: 89 2f mov r24, r25 |
||
3269 | 122e: 08 95 ret |
||
3270 | |||
3271 | 00001230 <Delay_ms>: |
||
3272 | } |
||
3273 | |||
3274 | |||
3275 | unsigned int SetDelay(unsigned int t) |
||
3276 | { |
||
3277 | return(CountMilliseconds + t - 1); |
||
3278 | 1230: 20 91 a2 00 lds r18, 0x00A2 |
||
3279 | 1234: 30 91 a3 00 lds r19, 0x00A3 |
||
3280 | 1238: 21 50 subi r18, 0x01 ; 1 |
||
3281 | 123a: 30 40 sbci r19, 0x00 ; 0 |
||
3282 | 123c: 28 0f add r18, r24 |
||
3283 | 123e: 39 1f adc r19, r25 |
||
3284 | } |
||
3285 | |||
3286 | char CheckDelay (unsigned int t) |
||
3287 | { |
||
3288 | return(((t - CountMilliseconds) & 0x8000) >> 8); |
||
3289 | 1240: 80 91 a2 00 lds r24, 0x00A2 |
||
3290 | 1244: 90 91 a3 00 lds r25, 0x00A3 |
||
3291 | |||
3292 | void Delay_ms(unsigned int w) |
||
3293 | { |
||
3294 | unsigned int akt; |
||
3295 | akt = SetDelay(w); |
||
3296 | while (!CheckDelay(akt)); |
||
3297 | 1248: a9 01 movw r20, r18 |
||
3298 | 124a: 48 1b sub r20, r24 |
||
3299 | 124c: 59 0b sbc r21, r25 |
||
3300 | 124e: ca 01 movw r24, r20 |
||
3301 | 1250: 80 70 andi r24, 0x00 ; 0 |
||
3302 | 1252: 90 78 andi r25, 0x80 ; 128 |
||
3303 | 1254: 99 23 and r25, r25 |
||
3304 | 1256: a1 f3 breq .-24 ; 0x1240 <Delay_ms+0x10> |
||
3305 | } |
||
3306 | 1258: 08 95 ret |
||
3307 | |||
3308 | 0000125a <ADC_Init>: |
||
3309 | //############################################################################ |
||
3310 | //Init ADC |
||
3311 | void ADC_Init(void) |
||
3312 | //############################################################################ |
||
3313 | { |
||
3314 | ADCSRA = 0xA6; // Free Run & 1MHZ |
||
3315 | 125a: 86 ea ldi r24, 0xA6 ; 166 |
||
3316 | 125c: 86 b9 out 0x06, r24 ; 6 |
||
3317 | ADMUX = 7 | IntRef; // Kanal 7 |
||
3318 | 125e: 80 91 8d 00 lds r24, 0x008D |
||
3319 | 1262: 87 60 ori r24, 0x07 ; 7 |
||
3320 | 1264: 87 b9 out 0x07, r24 ; 7 |
||
3321 | ADCSRA |= 0x40; // Start |
||
3322 | 1266: 36 9a sbi 0x06, 6 ; 6 |
||
3323 | } |
||
3324 | 1268: 08 95 ret |
||
3325 | |||
3326 | 0000126a <AdConvert>: |
||
3327 | void AdConvert(void) |
||
3328 | //############################################################################ |
||
3329 | { |
||
3330 | unsigned int i=0; |
||
3331 | unsigned char sense; |
||
3332 | sense = ADMUX; // Sense-Kanal merken |
||
3333 | 126a: 27 b1 in r18, 0x07 ; 7 |
||
3334 | ADMUX = 0x06 | IntRef; // Kanal 6 |
||
3335 | 126c: 90 91 8d 00 lds r25, 0x008D |
||
3336 | 1270: 96 60 ori r25, 0x06 ; 6 |
||
3337 | 1272: 97 b9 out 0x07, r25 ; 7 |
||
3338 | SFIOR = 0x00; // Analog Comperator aus |
||
3339 | 1274: 10 be out 0x30, r1 ; 48 |
||
3340 | ADCSRA = 0xD3; // Converter ein, single |
||
3341 | 1276: 83 ed ldi r24, 0xD3 ; 211 |
||
3342 | 1278: 86 b9 out 0x06, r24 ; 6 |
||
3343 | ADCSRA |= 0x10; // Ready löschen |
||
3344 | 127a: 34 9a sbi 0x06, 4 ; 6 |
||
3345 | ADMUX = 0x06 | IntRef; // Kanal 6 |
||
3346 | 127c: 97 b9 out 0x07, r25 ; 7 |
||
3347 | ADCSRA |= 0x40; // Start |
||
3348 | 127e: 36 9a sbi 0x06, 6 ; 6 |
||
3349 | while (((ADCSRA & 0x10) == 0)); |
||
3350 | 1280: 34 9b sbis 0x06, 4 ; 6 |
||
3351 | 1282: fe cf rjmp .-4 ; 0x1280 <AdConvert+0x16> |
||
3352 | ADMUX = sense; // zurück auf den Sense-Kanal |
||
3353 | 1284: 27 b9 out 0x07, r18 ; 7 |
||
3354 | i = ADCW * 4; |
||
3355 | 1286: 84 b1 in r24, 0x04 ; 4 |
||
3356 | 1288: 95 b1 in r25, 0x05 ; 5 |
||
3357 | // if(i > 300) i = 300; |
||
3358 | Strom = (i + Strom * 7) / 8; |
||
3359 | 128a: 20 91 7a 00 lds r18, 0x007A |
||
3360 | 128e: 30 91 7b 00 lds r19, 0x007B |
||
3361 | 1292: a9 01 movw r20, r18 |
||
3362 | 1294: 63 e0 ldi r22, 0x03 ; 3 |
||
3363 | 1296: 44 0f add r20, r20 |
||
3364 | 1298: 55 1f adc r21, r21 |
||
3365 | 129a: 6a 95 dec r22 |
||
3366 | 129c: e1 f7 brne .-8 ; 0x1296 <AdConvert+0x2c> |
||
3367 | 129e: 42 1b sub r20, r18 |
||
3368 | 12a0: 53 0b sbc r21, r19 |
||
3369 | 12a2: 88 0f add r24, r24 |
||
3370 | 12a4: 99 1f adc r25, r25 |
||
3371 | 12a6: 88 0f add r24, r24 |
||
3372 | 12a8: 99 1f adc r25, r25 |
||
3373 | 12aa: 48 0f add r20, r24 |
||
3374 | 12ac: 59 1f adc r21, r25 |
||
3375 | 12ae: 83 e0 ldi r24, 0x03 ; 3 |
||
3376 | 12b0: 56 95 lsr r21 |
||
3377 | 12b2: 47 95 ror r20 |
||
3378 | 12b4: 8a 95 dec r24 |
||
3379 | 12b6: e1 f7 brne .-8 ; 0x12b0 <AdConvert+0x46> |
||
3380 | 12b8: 50 93 7b 00 sts 0x007B, r21 |
||
3381 | 12bc: 40 93 7a 00 sts 0x007A, r20 |
||
3382 | if (Strom_max < Strom) Strom_max = Strom; |
||
3383 | 12c0: 80 91 7c 00 lds r24, 0x007C |
||
3384 | 12c4: 90 e0 ldi r25, 0x00 ; 0 |
||
3385 | 12c6: 84 17 cp r24, r20 |
||
3386 | 12c8: 95 07 cpc r25, r21 |
||
3387 | 12ca: 10 f4 brcc .+4 ; 0x12d0 <AdConvert+0x66> |
||
3388 | 12cc: 40 93 7c 00 sts 0x007C, r20 |
||
3389 | ADCSRA = 0x00; |
||
3390 | 12d0: 16 b8 out 0x06, r1 ; 6 |
||
3391 | SFIOR = 0x08; // Analog Comperator ein |
||
3392 | 12d2: 88 e0 ldi r24, 0x08 ; 8 |
||
3393 | 12d4: 80 bf out 0x30, r24 ; 48 |
||
3394 | } |
||
3395 | 12d6: 08 95 ret |
||
3396 | |||
3397 | 000012d8 <MessAD>: |
||
3398 | //Strom Analogwerte lesen |
||
3399 | unsigned int MessAD(unsigned char channel) |
||
3400 | //############################################################################ |
||
3401 | { |
||
3402 | unsigned char sense; |
||
3403 | sense = ADMUX; // Sense-Kanal merken |
||
3404 | 12d8: 27 b1 in r18, 0x07 ; 7 |
||
3405 | channel |= IntRef; |
||
3406 | 12da: 90 91 8d 00 lds r25, 0x008D |
||
3407 | 12de: 98 2b or r25, r24 |
||
3408 | ADMUX = channel; // Kanal 6 |
||
3409 | 12e0: 97 b9 out 0x07, r25 ; 7 |
||
3410 | SFIOR = 0x00; // Analog Comperator aus |
||
3411 | 12e2: 10 be out 0x30, r1 ; 48 |
||
3412 | ADCSRA = 0xD3; // Converter ein, single |
||
3413 | 12e4: 83 ed ldi r24, 0xD3 ; 211 |
||
3414 | 12e6: 86 b9 out 0x06, r24 ; 6 |
||
3415 | ADCSRA |= 0x10; // Ready löschen |
||
3416 | 12e8: 34 9a sbi 0x06, 4 ; 6 |
||
3417 | ADMUX = channel; // Kanal 6 |
||
3418 | 12ea: 97 b9 out 0x07, r25 ; 7 |
||
3419 | ADCSRA |= 0x40; // Start |
||
3420 | 12ec: 36 9a sbi 0x06, 6 ; 6 |
||
3421 | while (((ADCSRA & 0x10) == 0)); |
||
3422 | 12ee: 34 9b sbis 0x06, 4 ; 6 |
||
3423 | 12f0: fe cf rjmp .-4 ; 0x12ee <MessAD+0x16> |
||
3424 | ADMUX = sense; // zurück auf den Sense-Kanal |
||
3425 | 12f2: 27 b9 out 0x07, r18 ; 7 |
||
3426 | ADCSRA = 0x00; |
||
3427 | 12f4: 16 b8 out 0x06, r1 ; 6 |
||
3428 | SFIOR = 0x08; // Analog Comperator ein |
||
3429 | 12f6: 88 e0 ldi r24, 0x08 ; 8 |
||
3430 | 12f8: 80 bf out 0x30, r24 ; 48 |
||
3431 | return(ADCW); |
||
3432 | 12fa: 24 b1 in r18, 0x04 ; 4 |
||
3433 | 12fc: 35 b1 in r19, 0x05 ; 5 |
||
3434 | } |
||
3435 | 12fe: c9 01 movw r24, r18 |
||
3436 | 1300: 08 95 ret |
||
3437 | |||
3438 | 00001302 <FastADConvert>: |
||
3439 | //Strom Analogwerte lesen |
||
3440 | void FastADConvert(void) |
||
3441 | //############################################################################ |
||
3442 | { |
||
3443 | unsigned int i=0; |
||
3444 | i = MessAD(6) * 4; |
||
3445 | 1302: 86 e0 ldi r24, 0x06 ; 6 |
||
3446 | 1304: e9 df rcall .-46 ; 0x12d8 <MessAD> |
||
3447 | 1306: 9c 01 movw r18, r24 |
||
3448 | 1308: 22 0f add r18, r18 |
||
3449 | 130a: 33 1f adc r19, r19 |
||
3450 | 130c: 22 0f add r18, r18 |
||
3451 | 130e: 33 1f adc r19, r19 |
||
3452 | 1310: 29 3c cpi r18, 0xC9 ; 201 |
||
3453 | 1312: 31 05 cpc r19, r1 |
||
3454 | 1314: 10 f0 brcs .+4 ; 0x131a <FastADConvert+0x18> |
||
3455 | 1316: 28 ec ldi r18, 0xC8 ; 200 |
||
3456 | 1318: 30 e0 ldi r19, 0x00 ; 0 |
||
3457 | // i = ADCW * 4; |
||
3458 | if(i > 200) i = 200; |
||
3459 | Strom = i;//(i + Strom * 1) / 2; |
||
3460 | 131a: 30 93 7b 00 sts 0x007B, r19 |
||
3461 | 131e: 20 93 7a 00 sts 0x007A, r18 |
||
3462 | if (Strom_max < Strom) Strom_max = Strom; |
||
3463 | 1322: 80 91 7c 00 lds r24, 0x007C |
||
3464 | 1326: 90 e0 ldi r25, 0x00 ; 0 |
||
3465 | 1328: 82 17 cp r24, r18 |
||
3466 | 132a: 93 07 cpc r25, r19 |
||
3467 | 132c: 10 f4 brcc .+4 ; 0x1332 <FastADConvert+0x30> |
||
3468 | 132e: 20 93 7c 00 sts 0x007C, r18 |
||
3469 | ADCSRA = 0x00; |
||
3470 | 1332: 16 b8 out 0x06, r1 ; 6 |
||
3471 | SFIOR = 0x08; // Analog Comperator ein |
||
3472 | 1334: 88 e0 ldi r24, 0x08 ; 8 |
||
3473 | 1336: 80 bf out 0x30, r24 ; 48 |
||
3474 | } |
||
3475 | 1338: 08 95 ret |
||
3476 | |||
3477 | 0000133a <InitPPM>: |
||
3478 | //############################################################################ |
||
3479 | // |
||
3480 | void InitPPM(void) |
||
3481 | //############################################################################ |
||
3482 | { |
||
3483 | TCCR1B |= (1<<ICES1)|(1<<ICNC1); |
||
3484 | 133a: 8e b5 in r24, 0x2e ; 46 |
||
3485 | 133c: 80 6c ori r24, 0xC0 ; 192 |
||
3486 | 133e: 8e bd out 0x2e, r24 ; 46 |
||
3487 | ICP_POS_FLANKE; |
||
3488 | 1340: 8e b5 in r24, 0x2e ; 46 |
||
3489 | 1342: 80 64 ori r24, 0x40 ; 64 |
||
3490 | 1344: 8e bd out 0x2e, r24 ; 46 |
||
3491 | ICP_INT_ENABLE; |
||
3492 | 1346: 89 b7 in r24, 0x39 ; 57 |
||
3493 | 1348: 80 62 ori r24, 0x20 ; 32 |
||
3494 | 134a: 89 bf out 0x39, r24 ; 57 |
||
3495 | TIMER1_INT_ENABLE; |
||
3496 | 134c: 89 b7 in r24, 0x39 ; 57 |
||
3497 | 134e: 84 60 ori r24, 0x04 ; 4 |
||
3498 | 1350: 89 bf out 0x39, r24 ; 57 |
||
3499 | } |
||
3500 | 1352: 08 95 ret |
||
3501 | |||
3502 | 00001354 <__vector_8>: |
||
3503 | |||
3504 | //############################################################################ |
||
3505 | // |
||
3506 | SIGNAL(SIG_OVERFLOW1) |
||
3507 | //############################################################################ |
||
3508 | { |
||
3509 | 1354: 1f 92 push r1 |
||
3510 | 1356: 0f 92 push r0 |
||
3511 | 1358: 0f b6 in r0, 0x3f ; 63 |
||
3512 | 135a: 0f 92 push r0 |
||
3513 | 135c: 11 24 eor r1, r1 |
||
3514 | 135e: 8f 93 push r24 |
||
3515 | Timer1Overflow++; |
||
3516 | 1360: 80 91 a7 00 lds r24, 0x00A7 |
||
3517 | 1364: 8f 5f subi r24, 0xFF ; 255 |
||
3518 | 1366: 80 93 a7 00 sts 0x00A7, r24 |
||
3519 | } |
||
3520 | 136a: 8f 91 pop r24 |
||
3521 | 136c: 0f 90 pop r0 |
||
3522 | 136e: 0f be out 0x3f, r0 ; 63 |
||
3523 | 1370: 0f 90 pop r0 |
||
3524 | 1372: 1f 90 pop r1 |
||
3525 | 1374: 18 95 reti |
||
3526 | |||
3527 | 00001376 <__vector_5>: |
||
3528 | |||
3529 | //############################################################################ |
||
3530 | // |
||
3531 | SIGNAL(SIG_INPUT_CAPTURE1) |
||
3532 | //############################################################################ |
||
3533 | { |
||
3534 | 1376: 1f 92 push r1 |
||
3535 | 1378: 0f 92 push r0 |
||
3536 | 137a: 0f b6 in r0, 0x3f ; 63 |
||
3537 | 137c: 0f 92 push r0 |
||
3538 | 137e: 11 24 eor r1, r1 |
||
3539 | 1380: 2f 93 push r18 |
||
3540 | 1382: 3f 93 push r19 |
||
3541 | 1384: 4f 93 push r20 |
||
3542 | 1386: 5f 93 push r21 |
||
3543 | 1388: 8f 93 push r24 |
||
3544 | 138a: 9f 93 push r25 |
||
3545 | static unsigned int tim_alt; |
||
3546 | static unsigned int ppm; |
||
3547 | if(TCCR1B & (1<<ICES1)) // Positive Flanke |
||
3548 | 138c: 0e b4 in r0, 0x2e ; 46 |
||
3549 | 138e: 06 fe sbrs r0, 6 |
||
3550 | 1390: 0f c0 rjmp .+30 ; 0x13b0 <__vector_5+0x3a> |
||
3551 | { |
||
3552 | Timer1Overflow = 0; |
||
3553 | 1392: 10 92 a7 00 sts 0x00A7, r1 |
||
3554 | tim_alt = ICR1; |
||
3555 | 1396: 86 b5 in r24, 0x26 ; 38 |
||
3556 | 1398: 97 b5 in r25, 0x27 ; 39 |
||
3557 | 139a: 90 93 ad 00 sts 0x00AD, r25 |
||
3558 | 139e: 80 93 ac 00 sts 0x00AC, r24 |
||
3559 | ICP_NEG_FLANKE; |
||
3560 | 13a2: 8e b5 in r24, 0x2e ; 46 |
||
3561 | 13a4: 8f 7b andi r24, 0xBF ; 191 |
||
3562 | 13a6: 8e bd out 0x2e, r24 ; 46 |
||
3563 | PPM_Timeout = 100; |
||
3564 | 13a8: 84 e6 ldi r24, 0x64 ; 100 |
||
3565 | 13aa: 80 93 a8 00 sts 0x00A8, r24 |
||
3566 | 13ae: 6f c0 rjmp .+222 ; 0x148e <__vector_5+0x118> |
||
3567 | } |
||
3568 | else // Negative Flanke |
||
3569 | { |
||
3570 | ICP_POS_FLANKE; |
||
3571 | 13b0: 8e b5 in r24, 0x2e ; 46 |
||
3572 | 13b2: 80 64 ori r24, 0x40 ; 64 |
||
3573 | 13b4: 8e bd out 0x2e, r24 ; 46 |
||
3574 | #ifdef _32KHZ |
||
3575 | ppm = (ICR1 - tim_alt + (int) Timer1Overflow * 256) / 32; |
||
3576 | #endif |
||
3577 | #ifdef _16KHZ |
||
3578 | ppm = (ICR1 - tim_alt + (int) Timer1Overflow * 512) / 32; |
||
3579 | 13b6: 26 b5 in r18, 0x26 ; 38 |
||
3580 | 13b8: 37 b5 in r19, 0x27 ; 39 |
||
3581 | 13ba: 40 91 a7 00 lds r20, 0x00A7 |
||
3582 | 13be: 80 91 ac 00 lds r24, 0x00AC |
||
3583 | 13c2: 90 91 ad 00 lds r25, 0x00AD |
||
3584 | 13c6: 28 1b sub r18, r24 |
||
3585 | 13c8: 39 0b sbc r19, r25 |
||
3586 | 13ca: 94 2f mov r25, r20 |
||
3587 | 13cc: 99 0f add r25, r25 |
||
3588 | 13ce: 80 e0 ldi r24, 0x00 ; 0 |
||
3589 | 13d0: 28 0f add r18, r24 |
||
3590 | 13d2: 39 1f adc r19, r25 |
||
3591 | 13d4: 85 e0 ldi r24, 0x05 ; 5 |
||
3592 | 13d6: 36 95 lsr r19 |
||
3593 | 13d8: 27 95 ror r18 |
||
3594 | 13da: 8a 95 dec r24 |
||
3595 | 13dc: e1 f7 brne .-8 ; 0x13d6 <__vector_5+0x60> |
||
3596 | 13de: 30 93 ab 00 sts 0x00AB, r19 |
||
3597 | 13e2: 20 93 aa 00 sts 0x00AA, r18 |
||
3598 | #endif |
||
3599 | if(ppm < 280) ppm = 280; |
||
3600 | 13e6: 28 51 subi r18, 0x18 ; 24 |
||
3601 | 13e8: 31 40 sbci r19, 0x01 ; 1 |
||
3602 | 13ea: 30 f4 brcc .+12 ; 0x13f8 <__vector_5+0x82> |
||
3603 | 13ec: 88 e1 ldi r24, 0x18 ; 24 |
||
3604 | 13ee: 91 e0 ldi r25, 0x01 ; 1 |
||
3605 | 13f0: 90 93 ab 00 sts 0x00AB, r25 |
||
3606 | 13f4: 80 93 aa 00 sts 0x00AA, r24 |
||
3607 | ppm -= 280; |
||
3608 | 13f8: 40 91 aa 00 lds r20, 0x00AA |
||
3609 | 13fc: 50 91 ab 00 lds r21, 0x00AB |
||
3610 | 1400: 48 51 subi r20, 0x18 ; 24 |
||
3611 | 1402: 51 40 sbci r21, 0x01 ; 1 |
||
3612 | if(PPM_Signal < ppm) PPM_Signal++; |
||
3613 | 1404: 80 91 a5 00 lds r24, 0x00A5 |
||
3614 | 1408: 90 91 a6 00 lds r25, 0x00A6 |
||
3615 | 140c: 84 17 cp r24, r20 |
||
3616 | 140e: 95 07 cpc r25, r21 |
||
3617 | 1410: 30 f4 brcc .+12 ; 0x141e <__vector_5+0xa8> |
||
3618 | 1412: 80 91 a5 00 lds r24, 0x00A5 |
||
3619 | 1416: 90 91 a6 00 lds r25, 0x00A6 |
||
3620 | 141a: 01 96 adiw r24, 0x01 ; 1 |
||
3621 | 141c: 0c c0 rjmp .+24 ; 0x1436 <__vector_5+0xc0> |
||
3622 | else if(PPM_Signal > ppm) PPM_Signal--; |
||
3623 | 141e: 80 91 a5 00 lds r24, 0x00A5 |
||
3624 | 1422: 90 91 a6 00 lds r25, 0x00A6 |
||
3625 | 1426: 48 17 cp r20, r24 |
||
3626 | 1428: 59 07 cpc r21, r25 |
||
3627 | 142a: 48 f4 brcc .+18 ; 0x143e <__vector_5+0xc8> |
||
3628 | 142c: 80 91 a5 00 lds r24, 0x00A5 |
||
3629 | 1430: 90 91 a6 00 lds r25, 0x00A6 |
||
3630 | 1434: 01 97 sbiw r24, 0x01 ; 1 |
||
3631 | 1436: 90 93 a6 00 sts 0x00A6, r25 |
||
3632 | 143a: 80 93 a5 00 sts 0x00A5, r24 |
||
3633 | if(FILTER_PPM) ppm = (PPM_Signal * FILTER_PPM + ppm) / (FILTER_PPM + 1); // Filtern |
||
3634 | 143e: 80 91 a5 00 lds r24, 0x00A5 |
||
3635 | 1442: 90 91 a6 00 lds r25, 0x00A6 |
||
3636 | 1446: 9c 01 movw r18, r24 |
||
3637 | 1448: 22 0f add r18, r18 |
||
3638 | 144a: 33 1f adc r19, r19 |
||
3639 | 144c: 22 0f add r18, r18 |
||
3640 | 144e: 33 1f adc r19, r19 |
||
3641 | 1450: 22 0f add r18, r18 |
||
3642 | 1452: 33 1f adc r19, r19 |
||
3643 | 1454: 28 1b sub r18, r24 |
||
3644 | 1456: 39 0b sbc r19, r25 |
||
3645 | 1458: 24 0f add r18, r20 |
||
3646 | 145a: 35 1f adc r19, r21 |
||
3647 | 145c: 83 e0 ldi r24, 0x03 ; 3 |
||
3648 | 145e: 36 95 lsr r19 |
||
3649 | 1460: 27 95 ror r18 |
||
3650 | 1462: 8a 95 dec r24 |
||
3651 | 1464: e1 f7 brne .-8 ; 0x145e <__vector_5+0xe8> |
||
3652 | 1466: 30 93 ab 00 sts 0x00AB, r19 |
||
3653 | 146a: 20 93 aa 00 sts 0x00AA, r18 |
||
3654 | PPM_Signal = ppm; |
||
3655 | 146e: 30 93 a6 00 sts 0x00A6, r19 |
||
3656 | 1472: 20 93 a5 00 sts 0x00A5, r18 |
||
3657 | if(anz_ppm_werte < 255) anz_ppm_werte++; |
||
3658 | 1476: 80 91 a9 00 lds r24, 0x00A9 |
||
3659 | 147a: 8f 3f cpi r24, 0xFF ; 255 |
||
3660 | 147c: 29 f0 breq .+10 ; 0x1488 <__vector_5+0x112> |
||
3661 | 147e: 80 91 a9 00 lds r24, 0x00A9 |
||
3662 | 1482: 8f 5f subi r24, 0xFF ; 255 |
||
3663 | 1484: 80 93 a9 00 sts 0x00A9, r24 |
||
3664 | ZeitZumAdWandeln = 1; |
||
3665 | 1488: 81 e0 ldi r24, 0x01 ; 1 |
||
3666 | 148a: 80 93 65 00 sts 0x0065, r24 |
||
3667 | } |
||
3668 | } |
||
3669 | 148e: 9f 91 pop r25 |
||
3670 | 1490: 8f 91 pop r24 |
||
3671 | 1492: 5f 91 pop r21 |
||
3672 | 1494: 4f 91 pop r20 |
||
3673 | 1496: 3f 91 pop r19 |
||
3674 | 1498: 2f 91 pop r18 |
||
3675 | 149a: 0f 90 pop r0 |
||
3676 | 149c: 0f be out 0x3f, r0 ; 63 |
||
3677 | 149e: 0f 90 pop r0 |
||
3678 | 14a0: 1f 90 pop r1 |
||
3679 | 14a2: 18 95 reti |
||
3680 | |||
3681 | 000014a4 <__vector_1>: |
||
3682 | |||
3683 | //############################################################################ |
||
3684 | // |
||
3685 | SIGNAL(SIG_INTERRUPT0) |
||
3686 | //############################################################################ |
||
3687 | { |
||
3688 | 14a4: 1f 92 push r1 |
||
3689 | 14a6: 0f 92 push r0 |
||
3690 | 14a8: 0f b6 in r0, 0x3f ; 63 |
||
3691 | 14aa: 0f 92 push r0 |
||
3692 | 14ac: 11 24 eor r1, r1 |
||
3693 | 14ae: 8f 93 push r24 |
||
3694 | CLR_INT0_FLAG; // IntFlag Loeschen |
||
3695 | 14b0: 8a b7 in r24, 0x3a ; 58 |
||
3696 | 14b2: 8f 7b andi r24, 0xBF ; 191 |
||
3697 | 14b4: 8a bf out 0x3a, r24 ; 58 |
||
3698 | } |
||
3699 | 14b6: 8f 91 pop r24 |
||
3700 | 14b8: 0f 90 pop r0 |
||
3701 | 14ba: 0f be out 0x3f, r0 ; 63 |
||
3702 | 14bc: 0f 90 pop r0 |
||
3703 | 14be: 1f 90 pop r1 |
||
3704 | 14c0: 18 95 reti |
||
3705 | |||
3706 | 000014c2 <InitIC2_Slave>: |
||
3707 | //############################################################################ |
||
3708 | //I2C (TWI) Interface Init |
||
3709 | void InitIC2_Slave(uint8_t adr) |
||
3710 | //############################################################################ |
||
3711 | { |
||
3712 | TWAR = adr + (2*MotorAdresse); // Eigene Adresse setzen |
||
3713 | 14c2: 90 91 66 00 lds r25, 0x0066 |
||
3714 | 14c6: 99 0f add r25, r25 |
||
3715 | 14c8: 98 0f add r25, r24 |
||
3716 | 14ca: 92 b9 out 0x02, r25 ; 2 |
||
3717 | TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWIE) | (1<<TWEA); |
||
3718 | 14cc: 85 ec ldi r24, 0xC5 ; 197 |
||
3719 | 14ce: 86 bf out 0x36, r24 ; 54 |
||
3720 | } |
||
3721 | 14d0: 08 95 ret |
||
3722 | |||
3723 | 000014d2 <__vector_17>: |
||
3724 | //############################################################################ |
||
3725 | //ISR, die bei einem Ereignis auf dem Bus ausgelöst wird. Im Register TWSR befindet |
||
3726 | //sich dann ein Statuscode, anhand dessen die Situation festgestellt werden kann. |
||
3727 | ISR (TWI_vect) |
||
3728 | //############################################################################ |
||
3729 | { |
||
3730 | 14d2: 1f 92 push r1 |
||
3731 | 14d4: 0f 92 push r0 |
||
3732 | 14d6: 0f b6 in r0, 0x3f ; 63 |
||
3733 | 14d8: 0f 92 push r0 |
||
3734 | 14da: 11 24 eor r1, r1 |
||
3735 | 14dc: 8f 93 push r24 |
||
3736 | 14de: 9f 93 push r25 |
||
3737 | switch (TWSR & 0xF8) |
||
3738 | 14e0: 81 b1 in r24, 0x01 ; 1 |
||
3739 | 14e2: 90 e0 ldi r25, 0x00 ; 0 |
||
3740 | 14e4: 88 7f andi r24, 0xF8 ; 248 |
||
3741 | 14e6: 90 70 andi r25, 0x00 ; 0 |
||
3742 | 14e8: 80 38 cpi r24, 0x80 ; 128 |
||
3743 | 14ea: 91 05 cpc r25, r1 |
||
3744 | 14ec: c9 f0 breq .+50 ; 0x1520 <__vector_17+0x4e> |
||
3745 | 14ee: 81 38 cpi r24, 0x81 ; 129 |
||
3746 | 14f0: 91 05 cpc r25, r1 |
||
3747 | 14f2: 34 f4 brge .+12 ; 0x1500 <__vector_17+0x2e> |
||
3748 | 14f4: 00 97 sbiw r24, 0x00 ; 0 |
||
3749 | 14f6: 91 f1 breq .+100 ; 0x155c <__vector_17+0x8a> |
||
3750 | 14f8: 80 36 cpi r24, 0x60 ; 96 |
||
3751 | 14fa: 91 05 cpc r25, r1 |
||
3752 | 14fc: 91 f5 brne .+100 ; 0x1562 <__vector_17+0x90> |
||
3753 | 14fe: 0a c0 rjmp .+20 ; 0x1514 <__vector_17+0x42> |
||
3754 | 1500: 88 3b cpi r24, 0xB8 ; 184 |
||
3755 | 1502: 91 05 cpc r25, r1 |
||
3756 | 1504: b9 f0 breq .+46 ; 0x1534 <__vector_17+0x62> |
||
3757 | 1506: 88 3f cpi r24, 0xF8 ; 248 |
||
3758 | 1508: 91 05 cpc r25, r1 |
||
3759 | 150a: 29 f1 breq .+74 ; 0x1556 <__vector_17+0x84> |
||
3760 | 150c: 88 3a cpi r24, 0xA8 ; 168 |
||
3761 | 150e: 91 05 cpc r25, r1 |
||
3762 | 1510: 41 f5 brne .+80 ; 0x1562 <__vector_17+0x90> |
||
3763 | 1512: 10 c0 rjmp .+32 ; 0x1534 <__vector_17+0x62> |
||
3764 | { |
||
3765 | case SR_SLA_ACK: |
||
3766 | TWCR |= (1<<TWINT); |
||
3767 | 1514: 86 b7 in r24, 0x36 ; 54 |
||
3768 | 1516: 80 68 ori r24, 0x80 ; 128 |
||
3769 | 1518: 86 bf out 0x36, r24 ; 54 |
||
3770 | Byte_Counter=0; |
||
3771 | 151a: 10 92 ae 00 sts 0x00AE, r1 |
||
3772 | 151e: 23 c0 rjmp .+70 ; 0x1566 <__vector_17+0x94> |
||
3773 | return; |
||
3774 | // Daten Empfangen |
||
3775 | case SR_PREV_ACK: |
||
3776 | I2C_RXBuffer = TWDR; |
||
3777 | 1520: 83 b1 in r24, 0x03 ; 3 |
||
3778 | 1522: 80 93 95 03 sts 0x0395, r24 |
||
3779 | I2C_Timeout = 500; |
||
3780 | 1526: 84 ef ldi r24, 0xF4 ; 244 |
||
3781 | 1528: 91 e0 ldi r25, 0x01 ; 1 |
||
3782 | 152a: 90 93 81 00 sts 0x0081, r25 |
||
3783 | 152e: 80 93 80 00 sts 0x0080, r24 |
||
3784 | 1532: 0e c0 rjmp .+28 ; 0x1550 <__vector_17+0x7e> |
||
3785 | } |
||
3786 | TWCR |= (1<<TWINT); |
||
3787 | return; |
||
3788 | // Daten Senden |
||
3789 | case SW_DATA_ACK: |
||
3790 | if (Byte_Counter==0) |
||
3791 | 1534: 80 91 ae 00 lds r24, 0x00AE |
||
3792 | 1538: 88 23 and r24, r24 |
||
3793 | 153a: 39 f4 brne .+14 ; 0x154a <__vector_17+0x78> |
||
3794 | { |
||
3795 | TWDR = Mittelstrom; |
||
3796 | 153c: 80 91 7d 00 lds r24, 0x007D |
||
3797 | 1540: 83 b9 out 0x03, r24 ; 3 |
||
3798 | Byte_Counter++; |
||
3799 | 1542: 81 e0 ldi r24, 0x01 ; 1 |
||
3800 | 1544: 80 93 ae 00 sts 0x00AE, r24 |
||
3801 | 1548: 03 c0 rjmp .+6 ; 0x1550 <__vector_17+0x7e> |
||
3802 | } |
||
3803 | else |
||
3804 | { |
||
3805 | TWDR = MaxPWM; |
||
3806 | 154a: 80 91 64 00 lds r24, 0x0064 |
||
3807 | 154e: 83 b9 out 0x03, r24 ; 3 |
||
3808 | } |
||
3809 | TWCR |= (1<<TWINT); |
||
3810 | 1550: 86 b7 in r24, 0x36 ; 54 |
||
3811 | 1552: 80 68 ori r24, 0x80 ; 128 |
||
3812 | 1554: 07 c0 rjmp .+14 ; 0x1564 <__vector_17+0x92> |
||
3813 | return; |
||
3814 | // Bus-Fehler zurücksetzen |
||
3815 | case TWI_BUS_ERR_2: |
||
3816 | TWCR |=(1<<TWSTO) | (1<<TWINT); |
||
3817 | 1556: 86 b7 in r24, 0x36 ; 54 |
||
3818 | 1558: 80 69 ori r24, 0x90 ; 144 |
||
3819 | 155a: 86 bf out 0x36, r24 ; 54 |
||
3820 | // Bus-Fehler zurücksetzen |
||
3821 | case TWI_BUS_ERR_1: |
||
3822 | TWCR |=(1<<TWSTO) | (1<<TWINT); |
||
3823 | 155c: 86 b7 in r24, 0x36 ; 54 |
||
3824 | 155e: 80 69 ori r24, 0x90 ; 144 |
||
3825 | 1560: 86 bf out 0x36, r24 ; 54 |
||
3826 | } |
||
3827 | TWCR =(1<<TWEA) | (1<<TWINT) | (1<<TWEN) | (1<<TWIE); // TWI Reset |
||
3828 | 1562: 85 ec ldi r24, 0xC5 ; 197 |
||
3829 | 1564: 86 bf out 0x36, r24 ; 54 |
||
3830 | } |
||
3831 | 1566: 9f 91 pop r25 |
||
3832 | 1568: 8f 91 pop r24 |
||
3833 | 156a: 0f 90 pop r0 |
||
3834 | 156c: 0f be out 0x3f, r0 ; 63 |
||
3835 | 156e: 0f 90 pop r0 |
||
3836 | 1570: 1f 90 pop r1 |
||
3837 | 1572: 18 95 reti |
||
3838 | |||
3839 | 00001574 <__vector_4>: |
||
3840 | |||
3841 | //############################################################################ |
||
3842 | // |
||
3843 | SIGNAL(SIG_OVERFLOW2) |
||
3844 | //############################################################################ |
||
3845 | { |
||
3846 | 1574: 1f 92 push r1 |
||
3847 | 1576: 0f 92 push r0 |
||
3848 | 1578: 0f b6 in r0, 0x3f ; 63 |
||
3849 | 157a: 0f 92 push r0 |
||
3850 | 157c: 11 24 eor r1, r1 |
||
3851 | } |
||
3852 | 157e: 0f 90 pop r0 |
||
3853 | 1580: 0f be out 0x3f, r0 ; 63 |
||
3854 | 1582: 0f 90 pop r0 |
||
3855 | 1584: 1f 90 pop r1 |
||
3856 | 1586: 18 95 reti |
||
3857 | |||
3858 | 00001588 <Manuell>: |
||
3859 | //############################################################################ |
||
3860 | // |
||
3861 | void Manuell(void) |
||
3862 | //############################################################################ |
||
3863 | { |
||
3864 | switch(Phase) |
||
3865 | 1588: 80 91 af 00 lds r24, 0x00AF |
||
3866 | 158c: 82 30 cpi r24, 0x02 ; 2 |
||
3867 | 158e: 69 f1 breq .+90 ; 0x15ea <Manuell+0x62> |
||
3868 | 1590: 83 30 cpi r24, 0x03 ; 3 |
||
3869 | 1592: 30 f4 brcc .+12 ; 0x15a0 <Manuell+0x18> |
||
3870 | 1594: 88 23 and r24, r24 |
||
3871 | 1596: 69 f0 breq .+26 ; 0x15b2 <Manuell+0x2a> |
||
3872 | 1598: 81 30 cpi r24, 0x01 ; 1 |
||
3873 | 159a: 09 f0 breq .+2 ; 0x159e <Manuell+0x16> |
||
3874 | 159c: 63 c0 rjmp .+198 ; 0x1664 <Manuell+0xdc> |
||
3875 | 159e: 17 c0 rjmp .+46 ; 0x15ce <Manuell+0x46> |
||
3876 | 15a0: 84 30 cpi r24, 0x04 ; 4 |
||
3877 | 15a2: 09 f4 brne .+2 ; 0x15a6 <Manuell+0x1e> |
||
3878 | 15a4: 3f c0 rjmp .+126 ; 0x1624 <Manuell+0x9c> |
||
3879 | 15a6: 84 30 cpi r24, 0x04 ; 4 |
||
3880 | 15a8: 68 f1 brcs .+90 ; 0x1604 <Manuell+0x7c> |
||
3881 | 15aa: 85 30 cpi r24, 0x05 ; 5 |
||
3882 | 15ac: 09 f0 breq .+2 ; 0x15b0 <Manuell+0x28> |
||
3883 | 15ae: 5a c0 rjmp .+180 ; 0x1664 <Manuell+0xdc> |
||
3884 | 15b0: 4b c0 rjmp .+150 ; 0x1648 <Manuell+0xc0> |
||
3885 | { |
||
3886 | case 0: |
||
3887 | STEUER_A_H; |
||
3888 | 15b2: 81 ea ldi r24, 0xA1 ; 161 |
||
3889 | 15b4: 8f bd out 0x2f, r24 ; 47 |
||
3890 | 15b6: 81 e6 ldi r24, 0x61 ; 97 |
||
3891 | 15b8: 85 bd out 0x25, r24 ; 37 |
||
3892 | 15ba: 88 e0 ldi r24, 0x08 ; 8 |
||
3893 | 15bc: 87 bb out 0x17, r24 ; 23 |
||
3894 | STEUER_B_L; |
||
3895 | 15be: 82 b3 in r24, 0x12 ; 18 |
||
3896 | 15c0: 87 7d andi r24, 0xD7 ; 215 |
||
3897 | 15c2: 82 bb out 0x12, r24 ; 18 |
||
3898 | 15c4: 94 9a sbi 0x12, 4 ; 18 |
||
3899 | SENSE_C; |
||
3900 | 15c6: 80 91 8d 00 lds r24, 0x008D |
||
3901 | 15ca: 82 60 ori r24, 0x02 ; 2 |
||
3902 | 15cc: 38 c0 rjmp .+112 ; 0x163e <Manuell+0xb6> |
||
3903 | SENSE_RISING_INT; |
||
3904 | break; |
||
3905 | case 1: |
||
3906 | STEUER_A_H; |
||
3907 | 15ce: 81 ea ldi r24, 0xA1 ; 161 |
||
3908 | 15d0: 8f bd out 0x2f, r24 ; 47 |
||
3909 | 15d2: 81 e6 ldi r24, 0x61 ; 97 |
||
3910 | 15d4: 85 bd out 0x25, r24 ; 37 |
||
3911 | 15d6: 88 e0 ldi r24, 0x08 ; 8 |
||
3912 | 15d8: 87 bb out 0x17, r24 ; 23 |
||
3913 | STEUER_C_L; |
||
3914 | 15da: 82 b3 in r24, 0x12 ; 18 |
||
3915 | 15dc: 87 7e andi r24, 0xE7 ; 231 |
||
3916 | 15de: 82 bb out 0x12, r24 ; 18 |
||
3917 | 15e0: 95 9a sbi 0x12, 5 ; 18 |
||
3918 | SENSE_B; |
||
3919 | 15e2: 80 91 8d 00 lds r24, 0x008D |
||
3920 | 15e6: 81 60 ori r24, 0x01 ; 1 |
||
3921 | 15e8: 1a c0 rjmp .+52 ; 0x161e <Manuell+0x96> |
||
3922 | SENSE_FALLING_INT; |
||
3923 | break; |
||
3924 | case 2: |
||
3925 | STEUER_B_H; |
||
3926 | 15ea: 81 ea ldi r24, 0xA1 ; 161 |
||
3927 | 15ec: 8f bd out 0x2f, r24 ; 47 |
||
3928 | 15ee: 81 e6 ldi r24, 0x61 ; 97 |
||
3929 | 15f0: 85 bd out 0x25, r24 ; 37 |
||
3930 | 15f2: 84 e0 ldi r24, 0x04 ; 4 |
||
3931 | 15f4: 87 bb out 0x17, r24 ; 23 |
||
3932 | STEUER_C_L; |
||
3933 | 15f6: 82 b3 in r24, 0x12 ; 18 |
||
3934 | 15f8: 87 7e andi r24, 0xE7 ; 231 |
||
3935 | 15fa: 82 bb out 0x12, r24 ; 18 |
||
3936 | 15fc: 95 9a sbi 0x12, 5 ; 18 |
||
3937 | SENSE_A; |
||
3938 | 15fe: 80 91 8d 00 lds r24, 0x008D |
||
3939 | 1602: 1d c0 rjmp .+58 ; 0x163e <Manuell+0xb6> |
||
3940 | SENSE_RISING_INT; |
||
3941 | break; |
||
3942 | case 3: |
||
3943 | STEUER_B_H; |
||
3944 | 1604: 81 ea ldi r24, 0xA1 ; 161 |
||
3945 | 1606: 8f bd out 0x2f, r24 ; 47 |
||
3946 | 1608: 81 e6 ldi r24, 0x61 ; 97 |
||
3947 | 160a: 85 bd out 0x25, r24 ; 37 |
||
3948 | 160c: 84 e0 ldi r24, 0x04 ; 4 |
||
3949 | 160e: 87 bb out 0x17, r24 ; 23 |
||
3950 | STEUER_A_L; |
||
3951 | 1610: 82 b3 in r24, 0x12 ; 18 |
||
3952 | 1612: 8f 7c andi r24, 0xCF ; 207 |
||
3953 | 1614: 82 bb out 0x12, r24 ; 18 |
||
3954 | 1616: 93 9a sbi 0x12, 3 ; 18 |
||
3955 | SENSE_C; |
||
3956 | 1618: 80 91 8d 00 lds r24, 0x008D |
||
3957 | 161c: 82 60 ori r24, 0x02 ; 2 |
||
3958 | 161e: 87 b9 out 0x07, r24 ; 7 |
||
3959 | SENSE_FALLING_INT; |
||
3960 | 1620: 40 98 cbi 0x08, 0 ; 8 |
||
3961 | 1622: 08 95 ret |
||
3962 | break; |
||
3963 | case 4: |
||
3964 | STEUER_C_H; |
||
3965 | 1624: 81 ea ldi r24, 0xA1 ; 161 |
||
3966 | 1626: 8f bd out 0x2f, r24 ; 47 |
||
3967 | 1628: 81 e6 ldi r24, 0x61 ; 97 |
||
3968 | 162a: 85 bd out 0x25, r24 ; 37 |
||
3969 | 162c: 82 e0 ldi r24, 0x02 ; 2 |
||
3970 | 162e: 87 bb out 0x17, r24 ; 23 |
||
3971 | STEUER_A_L; |
||
3972 | 1630: 82 b3 in r24, 0x12 ; 18 |
||
3973 | 1632: 8f 7c andi r24, 0xCF ; 207 |
||
3974 | 1634: 82 bb out 0x12, r24 ; 18 |
||
3975 | 1636: 93 9a sbi 0x12, 3 ; 18 |
||
3976 | SENSE_B; |
||
3977 | 1638: 80 91 8d 00 lds r24, 0x008D |
||
3978 | 163c: 81 60 ori r24, 0x01 ; 1 |
||
3979 | 163e: 87 b9 out 0x07, r24 ; 7 |
||
3980 | SENSE_RISING_INT; |
||
3981 | 1640: 88 b1 in r24, 0x08 ; 8 |
||
3982 | 1642: 83 60 ori r24, 0x03 ; 3 |
||
3983 | 1644: 88 b9 out 0x08, r24 ; 8 |
||
3984 | 1646: 08 95 ret |
||
3985 | break; |
||
3986 | case 5: |
||
3987 | STEUER_C_H; |
||
3988 | 1648: 81 ea ldi r24, 0xA1 ; 161 |
||
3989 | 164a: 8f bd out 0x2f, r24 ; 47 |
||
3990 | 164c: 81 e6 ldi r24, 0x61 ; 97 |
||
3991 | 164e: 85 bd out 0x25, r24 ; 37 |
||
3992 | 1650: 82 e0 ldi r24, 0x02 ; 2 |
||
3993 | 1652: 87 bb out 0x17, r24 ; 23 |
||
3994 | STEUER_B_L; |
||
3995 | 1654: 82 b3 in r24, 0x12 ; 18 |
||
3996 | 1656: 87 7d andi r24, 0xD7 ; 215 |
||
3997 | 1658: 82 bb out 0x12, r24 ; 18 |
||
3998 | 165a: 94 9a sbi 0x12, 4 ; 18 |
||
3999 | SENSE_A; |
||
4000 | 165c: 80 91 8d 00 lds r24, 0x008D |
||
4001 | 1660: 87 b9 out 0x07, r24 ; 7 |
||
4002 | SENSE_FALLING_INT; |
||
4003 | 1662: 40 98 cbi 0x08, 0 ; 8 |
||
4004 | 1664: 08 95 ret |
||
4005 | |||
4006 | 00001666 <__vector_16>: |
||
4007 | // + Interruptroutine |
||
4008 | // + Wird durch den Analogkomperator ausgelöst |
||
4009 | // + Dadurch wird das Kommutieren erzeugt |
||
4010 | SIGNAL(SIG_COMPARATOR) |
||
4011 | //############################################################################ |
||
4012 | { |
||
4013 | 1666: 1f 92 push r1 |
||
4014 | 1668: 0f 92 push r0 |
||
4015 | 166a: 0f b6 in r0, 0x3f ; 63 |
||
4016 | 166c: 0f 92 push r0 |
||
4017 | 166e: 11 24 eor r1, r1 |
||
4018 | 1670: cf 92 push r12 |
||
4019 | 1672: df 92 push r13 |
||
4020 | 1674: ef 92 push r14 |
||
4021 | 1676: ff 92 push r15 |
||
4022 | 1678: 0f 93 push r16 |
||
4023 | 167a: 1f 93 push r17 |
||
4024 | 167c: 2f 93 push r18 |
||
4025 | 167e: 3f 93 push r19 |
||
4026 | 1680: 4f 93 push r20 |
||
4027 | 1682: 5f 93 push r21 |
||
4028 | 1684: 6f 93 push r22 |
||
4029 | 1686: 7f 93 push r23 |
||
4030 | 1688: 8f 93 push r24 |
||
4031 | 168a: 9f 93 push r25 |
||
4032 | 168c: af 93 push r26 |
||
4033 | 168e: bf 93 push r27 |
||
4034 | 1690: ef 93 push r30 |
||
4035 | 1692: ff 93 push r31 |
||
4036 | } |
||
4037 | |||
4038 | |||
4039 | break; |
||
4040 | case 4: |
||
4041 | STEUER_C_H; |
||
4042 | 1694: 61 ea ldi r22, 0xA1 ; 161 |
||
4043 | 1696: f6 2e mov r15, r22 |
||
4044 | 1698: 01 e6 ldi r16, 0x61 ; 97 |
||
4045 | 169a: 52 e0 ldi r21, 0x02 ; 2 |
||
4046 | 169c: c5 2e mov r12, r21 |
||
4047 | Phase++; |
||
4048 | CntKommutierungen++; |
||
4049 | } |
||
4050 | else |
||
4051 | { |
||
4052 | STEUER_B_H; |
||
4053 | 169e: 44 e0 ldi r20, 0x04 ; 4 |
||
4054 | 16a0: d4 2e mov r13, r20 |
||
4055 | break; |
||
4056 | case 5: |
||
4057 | STEUER_B_L; |
||
4058 | if(!sense) |
||
4059 | { |
||
4060 | STEUER_A_H; |
||
4061 | 16a2: 38 e0 ldi r19, 0x08 ; 8 |
||
4062 | 16a4: e3 2e mov r14, r19 |
||
4063 | //############################################################################ |
||
4064 | { |
||
4065 | unsigned char sense = 0; |
||
4066 | do |
||
4067 | { |
||
4068 | if(SENSE_H) sense = 1; else sense = 0; |
||
4069 | 16a6: 88 b1 in r24, 0x08 ; 8 |
||
4070 | 16a8: 90 e0 ldi r25, 0x00 ; 0 |
||
4071 | 16aa: 25 e0 ldi r18, 0x05 ; 5 |
||
4072 | 16ac: 96 95 lsr r25 |
||
4073 | 16ae: 87 95 ror r24 |
||
4074 | 16b0: 2a 95 dec r18 |
||
4075 | 16b2: e1 f7 brne .-8 ; 0x16ac <__vector_16+0x46> |
||
4076 | 16b4: 18 2f mov r17, r24 |
||
4077 | 16b6: 11 70 andi r17, 0x01 ; 1 |
||
4078 | switch(Phase) |
||
4079 | 16b8: 80 91 af 00 lds r24, 0x00AF |
||
4080 | 16bc: 82 30 cpi r24, 0x02 ; 2 |
||
4081 | 16be: 09 f4 brne .+2 ; 0x16c2 <__vector_16+0x5c> |
||
4082 | 16c0: 50 c0 rjmp .+160 ; 0x1762 <__vector_16+0xfc> |
||
4083 | 16c2: 83 30 cpi r24, 0x03 ; 3 |
||
4084 | 16c4: 30 f4 brcc .+12 ; 0x16d2 <__vector_16+0x6c> |
||
4085 | 16c6: 88 23 and r24, r24 |
||
4086 | 16c8: 71 f0 breq .+28 ; 0x16e6 <__vector_16+0x80> |
||
4087 | 16ca: 81 30 cpi r24, 0x01 ; 1 |
||
4088 | 16cc: 09 f0 breq .+2 ; 0x16d0 <__vector_16+0x6a> |
||
4089 | 16ce: a5 c0 rjmp .+330 ; 0x181a <__vector_16+0x1b4> |
||
4090 | 16d0: 22 c0 rjmp .+68 ; 0x1716 <__vector_16+0xb0> |
||
4091 | 16d2: 84 30 cpi r24, 0x04 ; 4 |
||
4092 | 16d4: 09 f4 brne .+2 ; 0x16d8 <__vector_16+0x72> |
||
4093 | 16d6: 70 c0 rjmp .+224 ; 0x17b8 <__vector_16+0x152> |
||
4094 | 16d8: 84 30 cpi r24, 0x04 ; 4 |
||
4095 | 16da: 08 f4 brcc .+2 ; 0x16de <__vector_16+0x78> |
||
4096 | 16dc: 58 c0 rjmp .+176 ; 0x178e <__vector_16+0x128> |
||
4097 | 16de: 85 30 cpi r24, 0x05 ; 5 |
||
4098 | 16e0: 09 f0 breq .+2 ; 0x16e4 <__vector_16+0x7e> |
||
4099 | 16e2: 9b c0 rjmp .+310 ; 0x181a <__vector_16+0x1b4> |
||
4100 | 16e4: 80 c0 rjmp .+256 ; 0x17e6 <__vector_16+0x180> |
||
4101 | { |
||
4102 | case 0: |
||
4103 | STEUER_A_H; |
||
4104 | 16e6: ff bc out 0x2f, r15 ; 47 |
||
4105 | 16e8: 05 bd out 0x25, r16 ; 37 |
||
4106 | 16ea: e7 ba out 0x17, r14 ; 23 |
||
4107 | if(sense) |
||
4108 | 16ec: 11 23 and r17, r17 |
||
4109 | 16ee: 71 f0 breq .+28 ; 0x170c <__vector_16+0xa6> |
||
4110 | { |
||
4111 | STEUER_C_L; |
||
4112 | 16f0: 82 b3 in r24, 0x12 ; 18 |
||
4113 | 16f2: 87 7e andi r24, 0xE7 ; 231 |
||
4114 | 16f4: 82 bb out 0x12, r24 ; 18 |
||
4115 | 16f6: 95 9a sbi 0x12, 5 ; 18 |
||
4116 | if(ZeitZumAdWandeln) AdConvert(); |
||
4117 | 16f8: 80 91 65 00 lds r24, 0x0065 |
||
4118 | 16fc: 81 11 cpse r24, r1 |
||
4119 | 16fe: b5 dd rcall .-1174 ; 0x126a <AdConvert> |
||
4120 | SENSE_FALLING_INT; |
||
4121 | 1700: 40 98 cbi 0x08, 0 ; 8 |
||
4122 | SENSE_B; |
||
4123 | 1702: 80 91 8d 00 lds r24, 0x008D |
||
4124 | 1706: 81 60 ori r24, 0x01 ; 1 |
||
4125 | 1708: 87 b9 out 0x07, r24 ; 7 |
||
4126 | 170a: 18 c0 rjmp .+48 ; 0x173c <__vector_16+0xd6> |
||
4127 | Phase++; |
||
4128 | CntKommutierungen++; |
||
4129 | } |
||
4130 | else |
||
4131 | { |
||
4132 | STEUER_B_L; |
||
4133 | 170c: 82 b3 in r24, 0x12 ; 18 |
||
4134 | 170e: 87 7d andi r24, 0xD7 ; 215 |
||
4135 | 1710: 82 bb out 0x12, r24 ; 18 |
||
4136 | 1712: 94 9a sbi 0x12, 4 ; 18 |
||
4137 | 1714: 82 c0 rjmp .+260 ; 0x181a <__vector_16+0x1b4> |
||
4138 | } |
||
4139 | break; |
||
4140 | case 1: |
||
4141 | STEUER_C_L; |
||
4142 | 1716: 82 b3 in r24, 0x12 ; 18 |
||
4143 | 1718: 87 7e andi r24, 0xE7 ; 231 |
||
4144 | 171a: 82 bb out 0x12, r24 ; 18 |
||
4145 | 171c: 95 9a sbi 0x12, 5 ; 18 |
||
4146 | if(!sense) |
||
4147 | 171e: 11 23 and r17, r17 |
||
4148 | 1720: e1 f4 brne .+56 ; 0x175a <__vector_16+0xf4> |
||
4149 | { |
||
4150 | STEUER_B_H; |
||
4151 | 1722: ff bc out 0x2f, r15 ; 47 |
||
4152 | 1724: 05 bd out 0x25, r16 ; 37 |
||
4153 | 1726: d7 ba out 0x17, r13 ; 23 |
||
4154 | if(ZeitZumAdWandeln) AdConvert(); |
||
4155 | 1728: 80 91 65 00 lds r24, 0x0065 |
||
4156 | 172c: 81 11 cpse r24, r1 |
||
4157 | 172e: 9d dd rcall .-1222 ; 0x126a <AdConvert> |
||
4158 | SENSE_A; |
||
4159 | 1730: 80 91 8d 00 lds r24, 0x008D |
||
4160 | 1734: 87 b9 out 0x07, r24 ; 7 |
||
4161 | SENSE_RISING_INT; |
||
4162 | 1736: 88 b1 in r24, 0x08 ; 8 |
||
4163 | 1738: 83 60 ori r24, 0x03 ; 3 |
||
4164 | 173a: 88 b9 out 0x08, r24 ; 8 |
||
4165 | Phase++; |
||
4166 | 173c: 80 91 af 00 lds r24, 0x00AF |
||
4167 | 1740: 8f 5f subi r24, 0xFF ; 255 |
||
4168 | 1742: 80 93 af 00 sts 0x00AF, r24 |
||
4169 | CntKommutierungen++; |
||
4170 | 1746: 80 91 89 00 lds r24, 0x0089 |
||
4171 | 174a: 90 91 8a 00 lds r25, 0x008A |
||
4172 | 174e: 01 96 adiw r24, 0x01 ; 1 |
||
4173 | 1750: 90 93 8a 00 sts 0x008A, r25 |
||
4174 | 1754: 80 93 89 00 sts 0x0089, r24 |
||
4175 | 1758: 60 c0 rjmp .+192 ; 0x181a <__vector_16+0x1b4> |
||
4176 | } |
||
4177 | else |
||
4178 | { |
||
4179 | STEUER_A_H; |
||
4180 | 175a: ff bc out 0x2f, r15 ; 47 |
||
4181 | 175c: 05 bd out 0x25, r16 ; 37 |
||
4182 | 175e: e7 ba out 0x17, r14 ; 23 |
||
4183 | 1760: 5c c0 rjmp .+184 ; 0x181a <__vector_16+0x1b4> |
||
4184 | } |
||
4185 | |||
4186 | break; |
||
4187 | case 2: |
||
4188 | STEUER_B_H; |
||
4189 | 1762: ff bc out 0x2f, r15 ; 47 |
||
4190 | 1764: 05 bd out 0x25, r16 ; 37 |
||
4191 | 1766: d7 ba out 0x17, r13 ; 23 |
||
4192 | if(sense) |
||
4193 | 1768: 11 23 and r17, r17 |
||
4194 | 176a: 61 f0 breq .+24 ; 0x1784 <__vector_16+0x11e> |
||
4195 | { |
||
4196 | STEUER_A_L; |
||
4197 | 176c: 82 b3 in r24, 0x12 ; 18 |
||
4198 | 176e: 8f 7c andi r24, 0xCF ; 207 |
||
4199 | 1770: 82 bb out 0x12, r24 ; 18 |
||
4200 | 1772: 93 9a sbi 0x12, 3 ; 18 |
||
4201 | if(ZeitZumAdWandeln) AdConvert(); |
||
4202 | 1774: 80 91 65 00 lds r24, 0x0065 |
||
4203 | 1778: 81 11 cpse r24, r1 |
||
4204 | 177a: 77 dd rcall .-1298 ; 0x126a <AdConvert> |
||
4205 | SENSE_C; |
||
4206 | 177c: 80 91 8d 00 lds r24, 0x008D |
||
4207 | 1780: 82 60 ori r24, 0x02 ; 2 |
||
4208 | 1782: 29 c0 rjmp .+82 ; 0x17d6 <__vector_16+0x170> |
||
4209 | Phase++; |
||
4210 | CntKommutierungen++; |
||
4211 | } |
||
4212 | else |
||
4213 | { |
||
4214 | STEUER_C_L; |
||
4215 | 1784: 82 b3 in r24, 0x12 ; 18 |
||
4216 | 1786: 87 7e andi r24, 0xE7 ; 231 |
||
4217 | 1788: 82 bb out 0x12, r24 ; 18 |
||
4218 | 178a: 95 9a sbi 0x12, 5 ; 18 |
||
4219 | 178c: 46 c0 rjmp .+140 ; 0x181a <__vector_16+0x1b4> |
||
4220 | } |
||
4221 | |||
4222 | break; |
||
4223 | case 3: |
||
4224 | STEUER_A_L; |
||
4225 | 178e: 82 b3 in r24, 0x12 ; 18 |
||
4226 | 1790: 8f 7c andi r24, 0xCF ; 207 |
||
4227 | 1792: 82 bb out 0x12, r24 ; 18 |
||
4228 | 1794: 93 9a sbi 0x12, 3 ; 18 |
||
4229 | if(!sense) |
||
4230 | 1796: 11 23 and r17, r17 |
||
4231 | 1798: 59 f4 brne .+22 ; 0x17b0 <__vector_16+0x14a> |
||
4232 | { |
||
4233 | STEUER_C_H; |
||
4234 | 179a: ff bc out 0x2f, r15 ; 47 |
||
4235 | 179c: 05 bd out 0x25, r16 ; 37 |
||
4236 | 179e: c7 ba out 0x17, r12 ; 23 |
||
4237 | if(ZeitZumAdWandeln) AdConvert(); |
||
4238 | 17a0: 80 91 65 00 lds r24, 0x0065 |
||
4239 | 17a4: 81 11 cpse r24, r1 |
||
4240 | 17a6: 61 dd rcall .-1342 ; 0x126a <AdConvert> |
||
4241 | SENSE_B; |
||
4242 | 17a8: 80 91 8d 00 lds r24, 0x008D |
||
4243 | 17ac: 81 60 ori r24, 0x01 ; 1 |
||
4244 | 17ae: c2 cf rjmp .-124 ; 0x1734 <__vector_16+0xce> |
||
4245 | Phase++; |
||
4246 | CntKommutierungen++; |
||
4247 | } |
||
4248 | else |
||
4249 | { |
||
4250 | STEUER_B_H; |
||
4251 | 17b0: ff bc out 0x2f, r15 ; 47 |
||
4252 | 17b2: 05 bd out 0x25, r16 ; 37 |
||
4253 | 17b4: d7 ba out 0x17, r13 ; 23 |
||
4254 | 17b6: 31 c0 rjmp .+98 ; 0x181a <__vector_16+0x1b4> |
||
4255 | } |
||
4256 | |||
4257 | |||
4258 | break; |
||
4259 | case 4: |
||
4260 | STEUER_C_H; |
||
4261 | 17b8: ff bc out 0x2f, r15 ; 47 |
||
4262 | 17ba: 05 bd out 0x25, r16 ; 37 |
||
4263 | 17bc: c7 ba out 0x17, r12 ; 23 |
||
4264 | if(sense) |
||
4265 | 17be: 11 23 and r17, r17 |
||
4266 | 17c0: 69 f0 breq .+26 ; 0x17dc <__vector_16+0x176> |
||
4267 | { |
||
4268 | STEUER_B_L; |
||
4269 | 17c2: 82 b3 in r24, 0x12 ; 18 |
||
4270 | 17c4: 87 7d andi r24, 0xD7 ; 215 |
||
4271 | 17c6: 82 bb out 0x12, r24 ; 18 |
||
4272 | 17c8: 94 9a sbi 0x12, 4 ; 18 |
||
4273 | if(ZeitZumAdWandeln) AdConvert(); |
||
4274 | 17ca: 80 91 65 00 lds r24, 0x0065 |
||
4275 | 17ce: 81 11 cpse r24, r1 |
||
4276 | 17d0: 4c dd rcall .-1384 ; 0x126a <AdConvert> |
||
4277 | SENSE_A; |
||
4278 | 17d2: 80 91 8d 00 lds r24, 0x008D |
||
4279 | 17d6: 87 b9 out 0x07, r24 ; 7 |
||
4280 | SENSE_FALLING_INT; |
||
4281 | 17d8: 40 98 cbi 0x08, 0 ; 8 |
||
4282 | 17da: b0 cf rjmp .-160 ; 0x173c <__vector_16+0xd6> |
||
4283 | Phase++; |
||
4284 | CntKommutierungen++; |
||
4285 | } |
||
4286 | else |
||
4287 | { |
||
4288 | STEUER_A_L; |
||
4289 | 17dc: 82 b3 in r24, 0x12 ; 18 |
||
4290 | 17de: 8f 7c andi r24, 0xCF ; 207 |
||
4291 | 17e0: 82 bb out 0x12, r24 ; 18 |
||
4292 | 17e2: 93 9a sbi 0x12, 3 ; 18 |
||
4293 | 17e4: 1a c0 rjmp .+52 ; 0x181a <__vector_16+0x1b4> |
||
4294 | } |
||
4295 | |||
4296 | break; |
||
4297 | case 5: |
||
4298 | STEUER_B_L; |
||
4299 | 17e6: 82 b3 in r24, 0x12 ; 18 |
||
4300 | 17e8: 87 7d andi r24, 0xD7 ; 215 |
||
4301 | 17ea: 82 bb out 0x12, r24 ; 18 |
||
4302 | 17ec: 94 9a sbi 0x12, 4 ; 18 |
||
4303 | if(!sense) |
||
4304 | 17ee: 11 23 and r17, r17 |
||
4305 | 17f0: 89 f4 brne .+34 ; 0x1814 <__vector_16+0x1ae> |
||
4306 | { |
||
4307 | STEUER_A_H; |
||
4308 | 17f2: ff bc out 0x2f, r15 ; 47 |
||
4309 | 17f4: 05 bd out 0x25, r16 ; 37 |
||
4310 | 17f6: e7 ba out 0x17, r14 ; 23 |
||
4311 | if(ZeitZumAdWandeln) AdConvert(); |
||
4312 | 17f8: 80 91 65 00 lds r24, 0x0065 |
||
4313 | 17fc: 81 11 cpse r24, r1 |
||
4314 | 17fe: 35 dd rcall .-1430 ; 0x126a <AdConvert> |
||
4315 | SENSE_C; |
||
4316 | 1800: 80 91 8d 00 lds r24, 0x008D |
||
4317 | 1804: 82 60 ori r24, 0x02 ; 2 |
||
4318 | 1806: 87 b9 out 0x07, r24 ; 7 |
||
4319 | SENSE_RISING_INT; |
||
4320 | 1808: 88 b1 in r24, 0x08 ; 8 |
||
4321 | 180a: 83 60 ori r24, 0x03 ; 3 |
||
4322 | 180c: 88 b9 out 0x08, r24 ; 8 |
||
4323 | Phase = 0; |
||
4324 | 180e: 10 92 af 00 sts 0x00AF, r1 |
||
4325 | 1812: 99 cf rjmp .-206 ; 0x1746 <__vector_16+0xe0> |
||
4326 | CntKommutierungen++; |
||
4327 | } |
||
4328 | else |
||
4329 | { |
||
4330 | STEUER_C_H; |
||
4331 | 1814: ff bc out 0x2f, r15 ; 47 |
||
4332 | 1816: 05 bd out 0x25, r16 ; 37 |
||
4333 | 1818: c7 ba out 0x17, r12 ; 23 |
||
4334 | } |
||
4335 | break; |
||
4336 | } |
||
4337 | } |
||
4338 | while((SENSE_L && sense) || (SENSE_H && !sense)); |
||
4339 | 181a: 45 99 sbic 0x08, 5 ; 8 |
||
4340 | 181c: 03 c0 rjmp .+6 ; 0x1824 <__vector_16+0x1be> |
||
4341 | 181e: 11 23 and r17, r17 |
||
4342 | 1820: 09 f0 breq .+2 ; 0x1824 <__vector_16+0x1be> |
||
4343 | 1822: 41 cf rjmp .-382 ; 0x16a6 <__vector_16+0x40> |
||
4344 | 1824: 45 9b sbis 0x08, 5 ; 8 |
||
4345 | 1826: 03 c0 rjmp .+6 ; 0x182e <__vector_16+0x1c8> |
||
4346 | 1828: 11 23 and r17, r17 |
||
4347 | 182a: 09 f4 brne .+2 ; 0x182e <__vector_16+0x1c8> |
||
4348 | 182c: 3c cf rjmp .-392 ; 0x16a6 <__vector_16+0x40> |
||
4349 | ZeitZumAdWandeln = 0; |
||
4350 | 182e: 10 92 65 00 sts 0x0065, r1 |
||
4351 | } |
||
4352 | 1832: ff 91 pop r31 |
||
4353 | 1834: ef 91 pop r30 |
||
4354 | 1836: bf 91 pop r27 |
||
4355 | 1838: af 91 pop r26 |
||
4356 | 183a: 9f 91 pop r25 |
||
4357 | 183c: 8f 91 pop r24 |
||
4358 | 183e: 7f 91 pop r23 |
||
4359 | 1840: 6f 91 pop r22 |
||
4360 | 1842: 5f 91 pop r21 |
||
4361 | 1844: 4f 91 pop r20 |
||
4362 | 1846: 3f 91 pop r19 |
||
4363 | 1848: 2f 91 pop r18 |
||
4364 | 184a: 1f 91 pop r17 |
||
4365 | 184c: 0f 91 pop r16 |
||
4366 | 184e: ff 90 pop r15 |
||
4367 | 1850: ef 90 pop r14 |
||
4368 | 1852: df 90 pop r13 |
||
4369 | 1854: cf 90 pop r12 |
||
4370 | 1856: 0f 90 pop r0 |
||
4371 | 1858: 0f be out 0x3f, r0 ; 63 |
||
4372 | 185a: 0f 90 pop r0 |
||
4373 | 185c: 1f 90 pop r1 |
||
4374 | 185e: 18 95 reti |
||
4375 | |||
4376 | 00001860 <__udivmodqi4>: |
||
4377 | 1860: 99 1b sub r25, r25 |
||
4378 | 1862: 79 e0 ldi r23, 0x09 ; 9 |
||
4379 | 1864: 04 c0 rjmp .+8 ; 0x186e <__udivmodqi4_ep> |
||
4380 | |||
4381 | 00001866 <__udivmodqi4_loop>: |
||
4382 | 1866: 99 1f adc r25, r25 |
||
4383 | 1868: 96 17 cp r25, r22 |
||
4384 | 186a: 08 f0 brcs .+2 ; 0x186e <__udivmodqi4_ep> |
||
4385 | 186c: 96 1b sub r25, r22 |
||
4386 | |||
4387 | 0000186e <__udivmodqi4_ep>: |
||
4388 | 186e: 88 1f adc r24, r24 |
||
4389 | 1870: 7a 95 dec r23 |
||
4390 | 1872: c9 f7 brne .-14 ; 0x1866 <__udivmodqi4_loop> |
||
4391 | 1874: 80 95 com r24 |
||
4392 | 1876: 08 95 ret |
||
4393 | |||
4394 | 00001878 <__udivmodhi4>: |
||
4395 | 1878: aa 1b sub r26, r26 |
||
4396 | 187a: bb 1b sub r27, r27 |
||
4397 | 187c: 51 e1 ldi r21, 0x11 ; 17 |
||
4398 | 187e: 07 c0 rjmp .+14 ; 0x188e <__udivmodhi4_ep> |
||
4399 | |||
4400 | 00001880 <__udivmodhi4_loop>: |
||
4401 | 1880: aa 1f adc r26, r26 |
||
4402 | 1882: bb 1f adc r27, r27 |
||
4403 | 1884: a6 17 cp r26, r22 |
||
4404 | 1886: b7 07 cpc r27, r23 |
||
4405 | 1888: 10 f0 brcs .+4 ; 0x188e <__udivmodhi4_ep> |
||
4406 | 188a: a6 1b sub r26, r22 |
||
4407 | 188c: b7 0b sbc r27, r23 |
||
4408 | |||
4409 | 0000188e <__udivmodhi4_ep>: |
||
4410 | 188e: 88 1f adc r24, r24 |
||
4411 | 1890: 99 1f adc r25, r25 |
||
4412 | 1892: 5a 95 dec r21 |
||
4413 | 1894: a9 f7 brne .-22 ; 0x1880 <__udivmodhi4_loop> |
||
4414 | 1896: 80 95 com r24 |
||
4415 | 1898: 90 95 com r25 |
||
4416 | 189a: bc 01 movw r22, r24 |
||
4417 | 189c: cd 01 movw r24, r26 |
||
4418 | 189e: 08 95 ret |
||
4419 | |||
4420 | 000018a0 <__udivmodsi4>: |
||
4421 | 18a0: a1 e2 ldi r26, 0x21 ; 33 |
||
4422 | 18a2: 1a 2e mov r1, r26 |
||
4423 | 18a4: aa 1b sub r26, r26 |
||
4424 | 18a6: bb 1b sub r27, r27 |
||
4425 | 18a8: fd 01 movw r30, r26 |
||
4426 | 18aa: 0d c0 rjmp .+26 ; 0x18c6 <__udivmodsi4_ep> |
||
4427 | |||
4428 | 000018ac <__udivmodsi4_loop>: |
||
4429 | 18ac: aa 1f adc r26, r26 |
||
4430 | 18ae: bb 1f adc r27, r27 |
||
4431 | 18b0: ee 1f adc r30, r30 |
||
4432 | 18b2: ff 1f adc r31, r31 |
||
4433 | 18b4: a2 17 cp r26, r18 |
||
4434 | 18b6: b3 07 cpc r27, r19 |
||
4435 | 18b8: e4 07 cpc r30, r20 |
||
4436 | 18ba: f5 07 cpc r31, r21 |
||
4437 | 18bc: 20 f0 brcs .+8 ; 0x18c6 <__udivmodsi4_ep> |
||
4438 | 18be: a2 1b sub r26, r18 |
||
4439 | 18c0: b3 0b sbc r27, r19 |
||
4440 | 18c2: e4 0b sbc r30, r20 |
||
4441 | 18c4: f5 0b sbc r31, r21 |
||
4442 | |||
4443 | 000018c6 <__udivmodsi4_ep>: |
||
4444 | 18c6: 66 1f adc r22, r22 |
||
4445 | 18c8: 77 1f adc r23, r23 |
||
4446 | 18ca: 88 1f adc r24, r24 |
||
4447 | 18cc: 99 1f adc r25, r25 |
||
4448 | 18ce: 1a 94 dec r1 |
||
4449 | 18d0: 69 f7 brne .-38 ; 0x18ac <__udivmodsi4_loop> |
||
4450 | 18d2: 60 95 com r22 |
||
4451 | 18d4: 70 95 com r23 |
||
4452 | 18d6: 80 95 com r24 |
||
4453 | 18d8: 90 95 com r25 |
||
4454 | 18da: 9b 01 movw r18, r22 |
||
4455 | 18dc: ac 01 movw r20, r24 |
||
4456 | 18de: bd 01 movw r22, r26 |
||
4457 | 18e0: cf 01 movw r24, r30 |
||
4458 | 18e2: 08 95 ret |
||
4459 | |||
4460 | 000018e4 <fdevopen>: |
||
4461 | 18e4: 0f 93 push r16 |
||
4462 | 18e6: 1f 93 push r17 |
||
4463 | 18e8: cf 93 push r28 |
||
4464 | 18ea: df 93 push r29 |
||
4465 | 18ec: 8c 01 movw r16, r24 |
||
4466 | 18ee: eb 01 movw r28, r22 |
||
4467 | 18f0: 00 97 sbiw r24, 0x00 ; 0 |
||
4468 | 18f2: 31 f4 brne .+12 ; 0x1900 <fdevopen+0x1c> |
||
4469 | 18f4: 61 15 cp r22, r1 |
||
4470 | 18f6: 71 05 cpc r23, r1 |
||
4471 | 18f8: 19 f4 brne .+6 ; 0x1900 <fdevopen+0x1c> |
||
4472 | 18fa: 20 e0 ldi r18, 0x00 ; 0 |
||
4473 | 18fc: 30 e0 ldi r19, 0x00 ; 0 |
||
4474 | 18fe: 37 c0 rjmp .+110 ; 0x196e <fdevopen+0x8a> |
||
4475 | 1900: 81 e0 ldi r24, 0x01 ; 1 |
||
4476 | 1902: 90 e0 ldi r25, 0x00 ; 0 |
||
4477 | 1904: 6e e0 ldi r22, 0x0E ; 14 |
||
4478 | 1906: 70 e0 ldi r23, 0x00 ; 0 |
||
4479 | 1908: 38 d0 rcall .+112 ; 0x197a <calloc> |
||
4480 | 190a: fc 01 movw r30, r24 |
||
4481 | 190c: 9c 01 movw r18, r24 |
||
4482 | 190e: 00 97 sbiw r24, 0x00 ; 0 |
||
4483 | 1910: 71 f1 breq .+92 ; 0x196e <fdevopen+0x8a> |
||
4484 | 1912: 80 e8 ldi r24, 0x80 ; 128 |
||
4485 | 1914: 83 83 std Z+3, r24 ; 0x03 |
||
4486 | 1916: 20 97 sbiw r28, 0x00 ; 0 |
||
4487 | 1918: 71 f0 breq .+28 ; 0x1936 <fdevopen+0x52> |
||
4488 | 191a: d3 87 std Z+11, r29 ; 0x0b |
||
4489 | 191c: c2 87 std Z+10, r28 ; 0x0a |
||
4490 | 191e: 81 e8 ldi r24, 0x81 ; 129 |
||
4491 | 1920: 83 83 std Z+3, r24 ; 0x03 |
||
4492 | 1922: 80 91 96 03 lds r24, 0x0396 |
||
4493 | 1926: 90 91 97 03 lds r25, 0x0397 |
||
4494 | 192a: 89 2b or r24, r25 |
||
4495 | 192c: 21 f4 brne .+8 ; 0x1936 <fdevopen+0x52> |
||
4496 | 192e: f0 93 97 03 sts 0x0397, r31 |
||
4497 | 1932: e0 93 96 03 sts 0x0396, r30 |
||
4498 | 1936: 01 15 cp r16, r1 |
||
4499 | 1938: 11 05 cpc r17, r1 |
||
4500 | 193a: c9 f0 breq .+50 ; 0x196e <fdevopen+0x8a> |
||
4501 | 193c: 11 87 std Z+9, r17 ; 0x09 |
||
4502 | 193e: 00 87 std Z+8, r16 ; 0x08 |
||
4503 | 1940: 83 81 ldd r24, Z+3 ; 0x03 |
||
4504 | 1942: 82 60 ori r24, 0x02 ; 2 |
||
4505 | 1944: 83 83 std Z+3, r24 ; 0x03 |
||
4506 | 1946: 80 91 98 03 lds r24, 0x0398 |
||
4507 | 194a: 90 91 99 03 lds r25, 0x0399 |
||
4508 | 194e: 89 2b or r24, r25 |
||
4509 | 1950: 71 f4 brne .+28 ; 0x196e <fdevopen+0x8a> |
||
4510 | 1952: f0 93 99 03 sts 0x0399, r31 |
||
4511 | 1956: e0 93 98 03 sts 0x0398, r30 |
||
4512 | 195a: 80 91 9a 03 lds r24, 0x039A |
||
4513 | 195e: 90 91 9b 03 lds r25, 0x039B |
||
4514 | 1962: 89 2b or r24, r25 |
||
4515 | 1964: 21 f4 brne .+8 ; 0x196e <fdevopen+0x8a> |
||
4516 | 1966: f0 93 9b 03 sts 0x039B, r31 |
||
4517 | 196a: e0 93 9a 03 sts 0x039A, r30 |
||
4518 | 196e: c9 01 movw r24, r18 |
||
4519 | 1970: df 91 pop r29 |
||
4520 | 1972: cf 91 pop r28 |
||
4521 | 1974: 1f 91 pop r17 |
||
4522 | 1976: 0f 91 pop r16 |
||
4523 | 1978: 08 95 ret |
||
4524 | |||
4525 | 0000197a <calloc>: |
||
4526 | 197a: 0f 93 push r16 |
||
4527 | 197c: 1f 93 push r17 |
||
4528 | 197e: cf 93 push r28 |
||
4529 | 1980: df 93 push r29 |
||
4530 | 1982: 68 9f mul r22, r24 |
||
4531 | 1984: 80 01 movw r16, r0 |
||
4532 | 1986: 69 9f mul r22, r25 |
||
4533 | 1988: 10 0d add r17, r0 |
||
4534 | 198a: 78 9f mul r23, r24 |
||
4535 | 198c: 10 0d add r17, r0 |
||
4536 | 198e: 11 24 eor r1, r1 |
||
4537 | 1990: c8 01 movw r24, r16 |
||
4538 | 1992: 0d d0 rcall .+26 ; 0x19ae <malloc> |
||
4539 | 1994: ec 01 movw r28, r24 |
||
4540 | 1996: 00 97 sbiw r24, 0x00 ; 0 |
||
4541 | 1998: 21 f0 breq .+8 ; 0x19a2 <calloc+0x28> |
||
4542 | 199a: 60 e0 ldi r22, 0x00 ; 0 |
||
4543 | 199c: 70 e0 ldi r23, 0x00 ; 0 |
||
4544 | 199e: a8 01 movw r20, r16 |
||
4545 | 19a0: 0b d1 rcall .+534 ; 0x1bb8 <memset> |
||
4546 | 19a2: ce 01 movw r24, r28 |
||
4547 | 19a4: df 91 pop r29 |
||
4548 | 19a6: cf 91 pop r28 |
||
4549 | 19a8: 1f 91 pop r17 |
||
4550 | 19aa: 0f 91 pop r16 |
||
4551 | 19ac: 08 95 ret |
||
4552 | |||
4553 | 000019ae <malloc>: |
||
4554 | 19ae: cf 93 push r28 |
||
4555 | 19b0: df 93 push r29 |
||
4556 | 19b2: bc 01 movw r22, r24 |
||
4557 | 19b4: 82 30 cpi r24, 0x02 ; 2 |
||
4558 | 19b6: 91 05 cpc r25, r1 |
||
4559 | 19b8: 10 f4 brcc .+4 ; 0x19be <malloc+0x10> |
||
4560 | 19ba: 62 e0 ldi r22, 0x02 ; 2 |
||
4561 | 19bc: 70 e0 ldi r23, 0x00 ; 0 |
||
4562 | 19be: a0 91 9e 03 lds r26, 0x039E |
||
4563 | 19c2: b0 91 9f 03 lds r27, 0x039F |
||
4564 | 19c6: ed 01 movw r28, r26 |
||
4565 | 19c8: e0 e0 ldi r30, 0x00 ; 0 |
||
4566 | 19ca: f0 e0 ldi r31, 0x00 ; 0 |
||
4567 | 19cc: 40 e0 ldi r20, 0x00 ; 0 |
||
4568 | 19ce: 50 e0 ldi r21, 0x00 ; 0 |
||
4569 | 19d0: 21 c0 rjmp .+66 ; 0x1a14 <malloc+0x66> |
||
4570 | 19d2: 88 81 ld r24, Y |
||
4571 | 19d4: 99 81 ldd r25, Y+1 ; 0x01 |
||
4572 | 19d6: 86 17 cp r24, r22 |
||
4573 | 19d8: 97 07 cpc r25, r23 |
||
4574 | 19da: 69 f4 brne .+26 ; 0x19f6 <malloc+0x48> |
||
4575 | 19dc: 8a 81 ldd r24, Y+2 ; 0x02 |
||
4576 | 19de: 9b 81 ldd r25, Y+3 ; 0x03 |
||
4577 | 19e0: 30 97 sbiw r30, 0x00 ; 0 |
||
4578 | 19e2: 19 f0 breq .+6 ; 0x19ea <malloc+0x3c> |
||
4579 | 19e4: 93 83 std Z+3, r25 ; 0x03 |
||
4580 | 19e6: 82 83 std Z+2, r24 ; 0x02 |
||
4581 | 19e8: 04 c0 rjmp .+8 ; 0x19f2 <malloc+0x44> |
||
4582 | 19ea: 90 93 9f 03 sts 0x039F, r25 |
||
4583 | 19ee: 80 93 9e 03 sts 0x039E, r24 |
||
4584 | 19f2: fe 01 movw r30, r28 |
||
4585 | 19f4: 34 c0 rjmp .+104 ; 0x1a5e <malloc+0xb0> |
||
4586 | 19f6: 68 17 cp r22, r24 |
||
4587 | 19f8: 79 07 cpc r23, r25 |
||
4588 | 19fa: 38 f4 brcc .+14 ; 0x1a0a <malloc+0x5c> |
||
4589 | 19fc: 41 15 cp r20, r1 |
||
4590 | 19fe: 51 05 cpc r21, r1 |
||
4591 | 1a00: 19 f0 breq .+6 ; 0x1a08 <malloc+0x5a> |
||
4592 | 1a02: 84 17 cp r24, r20 |
||
4593 | 1a04: 95 07 cpc r25, r21 |
||
4594 | 1a06: 08 f4 brcc .+2 ; 0x1a0a <malloc+0x5c> |
||
4595 | 1a08: ac 01 movw r20, r24 |
||
4596 | 1a0a: fe 01 movw r30, r28 |
||
4597 | 1a0c: 8a 81 ldd r24, Y+2 ; 0x02 |
||
4598 | 1a0e: 9b 81 ldd r25, Y+3 ; 0x03 |
||
4599 | 1a10: 9c 01 movw r18, r24 |
||
4600 | 1a12: e9 01 movw r28, r18 |
||
4601 | 1a14: 20 97 sbiw r28, 0x00 ; 0 |
||
4602 | 1a16: e9 f6 brne .-70 ; 0x19d2 <malloc+0x24> |
||
4603 | 1a18: 41 15 cp r20, r1 |
||
4604 | 1a1a: 51 05 cpc r21, r1 |
||
4605 | 1a1c: a9 f1 breq .+106 ; 0x1a88 <malloc+0xda> |
||
4606 | 1a1e: ca 01 movw r24, r20 |
||
4607 | 1a20: 86 1b sub r24, r22 |
||
4608 | 1a22: 97 0b sbc r25, r23 |
||
4609 | 1a24: 04 97 sbiw r24, 0x04 ; 4 |
||
4610 | 1a26: 08 f4 brcc .+2 ; 0x1a2a <malloc+0x7c> |
||
4611 | 1a28: ba 01 movw r22, r20 |
||
4612 | 1a2a: e0 e0 ldi r30, 0x00 ; 0 |
||
4613 | 1a2c: f0 e0 ldi r31, 0x00 ; 0 |
||
4614 | 1a2e: 2a c0 rjmp .+84 ; 0x1a84 <malloc+0xd6> |
||
4615 | 1a30: 8d 91 ld r24, X+ |
||
4616 | 1a32: 9c 91 ld r25, X |
||
4617 | 1a34: 11 97 sbiw r26, 0x01 ; 1 |
||
4618 | 1a36: 84 17 cp r24, r20 |
||
4619 | 1a38: 95 07 cpc r25, r21 |
||
4620 | 1a3a: f9 f4 brne .+62 ; 0x1a7a <malloc+0xcc> |
||
4621 | 1a3c: 64 17 cp r22, r20 |
||
4622 | 1a3e: 75 07 cpc r23, r21 |
||
4623 | 1a40: 81 f4 brne .+32 ; 0x1a62 <malloc+0xb4> |
||
4624 | 1a42: 12 96 adiw r26, 0x02 ; 2 |
||
4625 | 1a44: 8d 91 ld r24, X+ |
||
4626 | 1a46: 9c 91 ld r25, X |
||
4627 | 1a48: 13 97 sbiw r26, 0x03 ; 3 |
||
4628 | 1a4a: 30 97 sbiw r30, 0x00 ; 0 |
||
4629 | 1a4c: 19 f0 breq .+6 ; 0x1a54 <malloc+0xa6> |
||
4630 | 1a4e: 93 83 std Z+3, r25 ; 0x03 |
||
4631 | 1a50: 82 83 std Z+2, r24 ; 0x02 |
||
4632 | 1a52: 04 c0 rjmp .+8 ; 0x1a5c <malloc+0xae> |
||
4633 | 1a54: 90 93 9f 03 sts 0x039F, r25 |
||
4634 | 1a58: 80 93 9e 03 sts 0x039E, r24 |
||
4635 | 1a5c: fd 01 movw r30, r26 |
||
4636 | 1a5e: 32 96 adiw r30, 0x02 ; 2 |
||
4637 | 1a60: 4f c0 rjmp .+158 ; 0x1b00 <malloc+0x152> |
||
4638 | 1a62: ca 01 movw r24, r20 |
||
4639 | 1a64: 86 1b sub r24, r22 |
||
4640 | 1a66: 97 0b sbc r25, r23 |
||
4641 | 1a68: fd 01 movw r30, r26 |
||
4642 | 1a6a: e8 0f add r30, r24 |
||
4643 | 1a6c: f9 1f adc r31, r25 |
||
4644 | 1a6e: 61 93 st Z+, r22 |
||
4645 | 1a70: 71 93 st Z+, r23 |
||
4646 | 1a72: 02 97 sbiw r24, 0x02 ; 2 |
||
4647 | 1a74: 8d 93 st X+, r24 |
||
4648 | 1a76: 9c 93 st X, r25 |
||
4649 | 1a78: 43 c0 rjmp .+134 ; 0x1b00 <malloc+0x152> |
||
4650 | 1a7a: fd 01 movw r30, r26 |
||
4651 | 1a7c: 82 81 ldd r24, Z+2 ; 0x02 |
||
4652 | 1a7e: 93 81 ldd r25, Z+3 ; 0x03 |
||
4653 | 1a80: 9c 01 movw r18, r24 |
||
4654 | 1a82: d9 01 movw r26, r18 |
||
4655 | 1a84: 10 97 sbiw r26, 0x00 ; 0 |
||
4656 | 1a86: a1 f6 brne .-88 ; 0x1a30 <malloc+0x82> |
||
4657 | 1a88: 80 91 9c 03 lds r24, 0x039C |
||
4658 | 1a8c: 90 91 9d 03 lds r25, 0x039D |
||
4659 | 1a90: 89 2b or r24, r25 |
||
4660 | 1a92: 41 f4 brne .+16 ; 0x1aa4 <malloc+0xf6> |
||
4661 | 1a94: 80 91 73 00 lds r24, 0x0073 |
||
4662 | 1a98: 90 91 74 00 lds r25, 0x0074 |
||
4663 | 1a9c: 90 93 9d 03 sts 0x039D, r25 |
||
4664 | 1aa0: 80 93 9c 03 sts 0x039C, r24 |
||
4665 | 1aa4: 40 91 75 00 lds r20, 0x0075 |
||
4666 | 1aa8: 50 91 76 00 lds r21, 0x0076 |
||
4667 | 1aac: 41 15 cp r20, r1 |
||
4668 | 1aae: 51 05 cpc r21, r1 |
||
4669 | 1ab0: 41 f4 brne .+16 ; 0x1ac2 <malloc+0x114> |
||
4670 | 1ab2: 4d b7 in r20, 0x3d ; 61 |
||
4671 | 1ab4: 5e b7 in r21, 0x3e ; 62 |
||
4672 | 1ab6: 80 91 71 00 lds r24, 0x0071 |
||
4673 | 1aba: 90 91 72 00 lds r25, 0x0072 |
||
4674 | 1abe: 48 1b sub r20, r24 |
||
4675 | 1ac0: 59 0b sbc r21, r25 |
||
4676 | 1ac2: 20 91 9c 03 lds r18, 0x039C |
||
4677 | 1ac6: 30 91 9d 03 lds r19, 0x039D |
||
4678 | 1aca: 24 17 cp r18, r20 |
||
4679 | 1acc: 35 07 cpc r19, r21 |
||
4680 | 1ace: b0 f4 brcc .+44 ; 0x1afc <malloc+0x14e> |
||
4681 | 1ad0: ca 01 movw r24, r20 |
||
4682 | 1ad2: 82 1b sub r24, r18 |
||
4683 | 1ad4: 93 0b sbc r25, r19 |
||
4684 | 1ad6: 86 17 cp r24, r22 |
||
4685 | 1ad8: 97 07 cpc r25, r23 |
||
4686 | 1ada: 80 f0 brcs .+32 ; 0x1afc <malloc+0x14e> |
||
4687 | 1adc: ab 01 movw r20, r22 |
||
4688 | 1ade: 4e 5f subi r20, 0xFE ; 254 |
||
4689 | 1ae0: 5f 4f sbci r21, 0xFF ; 255 |
||
4690 | 1ae2: 84 17 cp r24, r20 |
||
4691 | 1ae4: 95 07 cpc r25, r21 |
||
4692 | 1ae6: 50 f0 brcs .+20 ; 0x1afc <malloc+0x14e> |
||
4693 | 1ae8: 42 0f add r20, r18 |
||
4694 | 1aea: 53 1f adc r21, r19 |
||
4695 | 1aec: 50 93 9d 03 sts 0x039D, r21 |
||
4696 | 1af0: 40 93 9c 03 sts 0x039C, r20 |
||
4697 | 1af4: f9 01 movw r30, r18 |
||
4698 | 1af6: 61 93 st Z+, r22 |
||
4699 | 1af8: 71 93 st Z+, r23 |
||
4700 | 1afa: 02 c0 rjmp .+4 ; 0x1b00 <malloc+0x152> |
||
4701 | 1afc: e0 e0 ldi r30, 0x00 ; 0 |
||
4702 | 1afe: f0 e0 ldi r31, 0x00 ; 0 |
||
4703 | 1b00: cf 01 movw r24, r30 |
||
4704 | 1b02: df 91 pop r29 |
||
4705 | 1b04: cf 91 pop r28 |
||
4706 | 1b06: 08 95 ret |
||
4707 | |||
4708 | 00001b08 <free>: |
||
4709 | 1b08: cf 93 push r28 |
||
4710 | 1b0a: df 93 push r29 |
||
4711 | 1b0c: 00 97 sbiw r24, 0x00 ; 0 |
||
4712 | 1b0e: 09 f4 brne .+2 ; 0x1b12 <free+0xa> |
||
4713 | 1b10: 50 c0 rjmp .+160 ; 0x1bb2 <free+0xaa> |
||
4714 | 1b12: ec 01 movw r28, r24 |
||
4715 | 1b14: 22 97 sbiw r28, 0x02 ; 2 |
||
4716 | 1b16: 1b 82 std Y+3, r1 ; 0x03 |
||
4717 | 1b18: 1a 82 std Y+2, r1 ; 0x02 |
||
4718 | 1b1a: a0 91 9e 03 lds r26, 0x039E |
||
4719 | 1b1e: b0 91 9f 03 lds r27, 0x039F |
||
4720 | 1b22: 10 97 sbiw r26, 0x00 ; 0 |
||
4721 | 1b24: 09 f1 breq .+66 ; 0x1b68 <free+0x60> |
||
4722 | 1b26: 40 e0 ldi r20, 0x00 ; 0 |
||
4723 | 1b28: 50 e0 ldi r21, 0x00 ; 0 |
||
4724 | 1b2a: ac 17 cp r26, r28 |
||
4725 | 1b2c: bd 07 cpc r27, r29 |
||
4726 | 1b2e: 08 f1 brcs .+66 ; 0x1b72 <free+0x6a> |
||
4727 | 1b30: bb 83 std Y+3, r27 ; 0x03 |
||
4728 | 1b32: aa 83 std Y+2, r26 ; 0x02 |
||
4729 | 1b34: fe 01 movw r30, r28 |
||
4730 | 1b36: 21 91 ld r18, Z+ |
||
4731 | 1b38: 31 91 ld r19, Z+ |
||
4732 | 1b3a: e2 0f add r30, r18 |
||
4733 | 1b3c: f3 1f adc r31, r19 |
||
4734 | 1b3e: ae 17 cp r26, r30 |
||
4735 | 1b40: bf 07 cpc r27, r31 |
||
4736 | 1b42: 79 f4 brne .+30 ; 0x1b62 <free+0x5a> |
||
4737 | 1b44: 8d 91 ld r24, X+ |
||
4738 | 1b46: 9c 91 ld r25, X |
||
4739 | 1b48: 11 97 sbiw r26, 0x01 ; 1 |
||
4740 | 1b4a: 28 0f add r18, r24 |
||
4741 | 1b4c: 39 1f adc r19, r25 |
||
4742 | 1b4e: 2e 5f subi r18, 0xFE ; 254 |
||
4743 | 1b50: 3f 4f sbci r19, 0xFF ; 255 |
||
4744 | 1b52: 39 83 std Y+1, r19 ; 0x01 |
||
4745 | 1b54: 28 83 st Y, r18 |
||
4746 | 1b56: 12 96 adiw r26, 0x02 ; 2 |
||
4747 | 1b58: 8d 91 ld r24, X+ |
||
4748 | 1b5a: 9c 91 ld r25, X |
||
4749 | 1b5c: 13 97 sbiw r26, 0x03 ; 3 |
||
4750 | 1b5e: 9b 83 std Y+3, r25 ; 0x03 |
||
4751 | 1b60: 8a 83 std Y+2, r24 ; 0x02 |
||
4752 | 1b62: 41 15 cp r20, r1 |
||
4753 | 1b64: 51 05 cpc r21, r1 |
||
4754 | 1b66: 71 f4 brne .+28 ; 0x1b84 <free+0x7c> |
||
4755 | 1b68: d0 93 9f 03 sts 0x039F, r29 |
||
4756 | 1b6c: c0 93 9e 03 sts 0x039E, r28 |
||
4757 | 1b70: 20 c0 rjmp .+64 ; 0x1bb2 <free+0xaa> |
||
4758 | 1b72: 12 96 adiw r26, 0x02 ; 2 |
||
4759 | 1b74: 8d 91 ld r24, X+ |
||
4760 | 1b76: 9c 91 ld r25, X |
||
4761 | 1b78: 13 97 sbiw r26, 0x03 ; 3 |
||
4762 | 1b7a: ad 01 movw r20, r26 |
||
4763 | 1b7c: 00 97 sbiw r24, 0x00 ; 0 |
||
4764 | 1b7e: 11 f0 breq .+4 ; 0x1b84 <free+0x7c> |
||
4765 | 1b80: dc 01 movw r26, r24 |
||
4766 | 1b82: d3 cf rjmp .-90 ; 0x1b2a <free+0x22> |
||
4767 | 1b84: fa 01 movw r30, r20 |
||
4768 | 1b86: d3 83 std Z+3, r29 ; 0x03 |
||
4769 | 1b88: c2 83 std Z+2, r28 ; 0x02 |
||
4770 | 1b8a: 21 91 ld r18, Z+ |
||
4771 | 1b8c: 31 91 ld r19, Z+ |
||
4772 | 1b8e: e2 0f add r30, r18 |
||
4773 | 1b90: f3 1f adc r31, r19 |
||
4774 | 1b92: ce 17 cp r28, r30 |
||
4775 | 1b94: df 07 cpc r29, r31 |
||
4776 | 1b96: 69 f4 brne .+26 ; 0x1bb2 <free+0xaa> |
||
4777 | 1b98: 88 81 ld r24, Y |
||
4778 | 1b9a: 99 81 ldd r25, Y+1 ; 0x01 |
||
4779 | 1b9c: 28 0f add r18, r24 |
||
4780 | 1b9e: 39 1f adc r19, r25 |
||
4781 | 1ba0: 2e 5f subi r18, 0xFE ; 254 |
||
4782 | 1ba2: 3f 4f sbci r19, 0xFF ; 255 |
||
4783 | 1ba4: fa 01 movw r30, r20 |
||
4784 | 1ba6: 31 83 std Z+1, r19 ; 0x01 |
||
4785 | 1ba8: 20 83 st Z, r18 |
||
4786 | 1baa: 8a 81 ldd r24, Y+2 ; 0x02 |
||
4787 | 1bac: 9b 81 ldd r25, Y+3 ; 0x03 |
||
4788 | 1bae: 93 83 std Z+3, r25 ; 0x03 |
||
4789 | 1bb0: 82 83 std Z+2, r24 ; 0x02 |
||
4790 | 1bb2: df 91 pop r29 |
||
4791 | 1bb4: cf 91 pop r28 |
||
4792 | 1bb6: 08 95 ret |
||
4793 | |||
4794 | 00001bb8 <memset>: |
||
4795 | 1bb8: dc 01 movw r26, r24 |
||
4796 | 1bba: 01 c0 rjmp .+2 ; 0x1bbe <memset+0x6> |
||
4797 | 1bbc: 6d 93 st X+, r22 |
||
4798 | 1bbe: 41 50 subi r20, 0x01 ; 1 |
||
4799 | 1bc0: 50 40 sbci r21, 0x00 ; 0 |
||
4800 | 1bc2: e0 f7 brcc .-8 ; 0x1bbc <memset+0x4> |
||
4801 | 1bc4: 08 95 ret |
||
4802 | |||
4803 | 00001bc6 <_exit>: |
||
4804 | 1bc6: f8 94 cli |
||
4805 | |||
4806 | 00001bc8 <__stop_program>: |
||
4807 | 1bc8: ff cf rjmp .-2 ; 0x1bc8 <__stop_program> |