datalog.elf: file format elf32-avr Sections: Idx Name Size VMA LMA File off Algn 0 .data 00000052 00800100 000010f4 00001188 2**0 CONTENTS, ALLOC, LOAD, DATA 1 .text 000010f4 00000000 00000000 00000094 2**1 CONTENTS, ALLOC, LOAD, READONLY, CODE 2 .bss 00000051 00800152 00800152 000011da 2**0 ALLOC 3 .debug_aranges 00000140 00000000 00000000 000011da 2**0 CONTENTS, READONLY, DEBUGGING 4 .debug_pubnames 00000367 00000000 00000000 0000131a 2**0 CONTENTS, READONLY, DEBUGGING 5 .debug_info 000012e8 00000000 00000000 00001681 2**0 CONTENTS, READONLY, DEBUGGING 6 .debug_abbrev 00000a2f 00000000 00000000 00002969 2**0 CONTENTS, READONLY, DEBUGGING 7 .debug_line 000011e0 00000000 00000000 00003398 2**0 CONTENTS, READONLY, DEBUGGING 8 .debug_frame 000002d0 00000000 00000000 00004578 2**2 CONTENTS, READONLY, DEBUGGING 9 .debug_str 0000046a 00000000 00000000 00004848 2**0 CONTENTS, READONLY, DEBUGGING 10 .debug_loc 0000080b 00000000 00000000 00004cb2 2**0 CONTENTS, READONLY, DEBUGGING 11 .debug_ranges 00000018 00000000 00000000 000054bd 2**0 CONTENTS, READONLY, DEBUGGING Disassembly of section .text: 00000000 <__vectors>: 0: 0c 94 64 00 jmp 0xc8 ; 0xc8 <__ctors_end> 4: 0c 94 81 00 jmp 0x102 ; 0x102 <__bad_interrupt> 8: 0c 94 81 00 jmp 0x102 ; 0x102 <__bad_interrupt> c: 0c 94 81 00 jmp 0x102 ; 0x102 <__bad_interrupt> 10: 0c 94 81 00 jmp 0x102 ; 0x102 <__bad_interrupt> 14: 0c 94 81 00 jmp 0x102 ; 0x102 <__bad_interrupt> 18: 0c 94 81 00 jmp 0x102 ; 0x102 <__bad_interrupt> 1c: 0c 94 81 00 jmp 0x102 ; 0x102 <__bad_interrupt> 20: 0c 94 81 00 jmp 0x102 ; 0x102 <__bad_interrupt> 24: 0c 94 81 00 jmp 0x102 ; 0x102 <__bad_interrupt> 28: 0c 94 fc 03 jmp 0x7f8 ; 0x7f8 <__vector_10> 2c: 0c 94 81 00 jmp 0x102 ; 0x102 <__bad_interrupt> 30: 0c 94 81 00 jmp 0x102 ; 0x102 <__bad_interrupt> 34: 0c 94 81 00 jmp 0x102 ; 0x102 <__bad_interrupt> 38: 0c 94 81 00 jmp 0x102 ; 0x102 <__bad_interrupt> 3c: 0c 94 81 00 jmp 0x102 ; 0x102 <__bad_interrupt> 40: 0c 94 81 00 jmp 0x102 ; 0x102 <__bad_interrupt> 44: 0c 94 81 00 jmp 0x102 ; 0x102 <__bad_interrupt> 48: 0c 94 81 00 jmp 0x102 ; 0x102 <__bad_interrupt> 4c: 0c 94 81 00 jmp 0x102 ; 0x102 <__bad_interrupt> 50: 0c 94 81 00 jmp 0x102 ; 0x102 <__bad_interrupt> 54: 0c 94 81 00 jmp 0x102 ; 0x102 <__bad_interrupt> 58: 0c 94 5b 01 jmp 0x2b6 ; 0x2b6 <__vector_22> 0000005c : 5c: 51 0a 80 2a 00 00 00 0a 00 ff 00 00 59 55 18 01 Q..*........YU.. 6c: 11 1e 11 1b 50 0b 41 1b 41 1f 11 01 51 1f 51 1b ....P.A.A...Q.Q. ... 88: 00 00 51 0f 91 39 41 14 91 31 41 1e 41 0e 41 1d ..Q..9A..1A.A.A. 98: 50 0f 80 20 10 15 48 86 40 14 78 05 70 85 51 15 P.. ..H.@.x.p.Q. a8: 51 0e 51 95 51 8e 21 90 81 20 50 15 48 44 50 c5 Q.Q.Q.!.. P.HDP. b8: 28 c0 28 20 09 50 00 00 00 00 00 00 00 00 00 00 (.( .P.......... 000000c8 <__ctors_end>: c8: 11 24 eor r1, r1 ca: 1f be out 0x3f, r1 ; 63 cc: cf ef ldi r28, 0xFF ; 255 ce: d4 e0 ldi r29, 0x04 ; 4 d0: de bf out 0x3e, r29 ; 62 d2: cd bf out 0x3d, r28 ; 61 000000d4 <__do_copy_data>: d4: 11 e0 ldi r17, 0x01 ; 1 d6: a0 e0 ldi r26, 0x00 ; 0 d8: b1 e0 ldi r27, 0x01 ; 1 da: e4 ef ldi r30, 0xF4 ; 244 dc: f0 e1 ldi r31, 0x10 ; 16 de: 02 c0 rjmp .+4 ; 0xe4 <.do_copy_data_start> 000000e0 <.do_copy_data_loop>: e0: 05 90 lpm r0, Z+ e2: 0d 92 st X+, r0 000000e4 <.do_copy_data_start>: e4: a2 35 cpi r26, 0x52 ; 82 e6: b1 07 cpc r27, r17 e8: d9 f7 brne .-10 ; 0xe0 <.do_copy_data_loop> 000000ea <__do_clear_bss>: ea: 11 e0 ldi r17, 0x01 ; 1 ec: a2 e5 ldi r26, 0x52 ; 82 ee: b1 e0 ldi r27, 0x01 ; 1 f0: 01 c0 rjmp .+2 ; 0xf4 <.do_clear_bss_start> 000000f2 <.do_clear_bss_loop>: f2: 1d 92 st X+, r1 000000f4 <.do_clear_bss_start>: f4: a3 3a cpi r26, 0xA3 ; 163 f6: b1 07 cpc r27, r17 f8: e1 f7 brne .-8 ; 0xf2 <.do_clear_bss_loop> fa: 0e 94 da 03 call 0x7b4 ; 0x7b4
fe: 0c 94 78 08 jmp 0x10f0 ; 0x10f0 <_exit> 00000102 <__bad_interrupt>: 102: 0c 94 00 00 jmp 0 ; 0x0 <__vectors> 00000106 : * * Purpose : Do a Analog to Digital Conversion * *****************************************************************************/ uint ADC_read(uint8 input) { 106: df 92 push r13 108: ef 92 push r14 10a: ff 92 push r15 10c: 0f 93 push r16 10e: 1f 93 push r17 110: d8 2e mov r13, r24 ADMUX = input; 112: 80 93 7c 00 sts 0x007C, r24 if (input == 1) 116: 41 e0 ldi r20, 0x01 ; 1 118: 84 17 cp r24, r20 11a: 51 f4 brne .+20 ; 0x130 { ADMUX |= (1< while (SCK_OFF); 12a: 2b 9b sbis 0x05, 3 ; 5 12c: fe cf rjmp .-4 ; 0x12a 12e: 0a c0 rjmp .+20 ; 0x144 } else { ADMUX |= (1< for(i=0;i { ADCSRA |= (1< ADC_temp = ADCL; // read out ADCL register 180: 90 91 78 00 lds r25, 0x0078 ADC_temp += (ADCH << 8); // read out ADCH register 184: 80 91 79 00 lds r24, 0x0079 ADCr += ADC_temp; // accumulate result 188: f8 2f mov r31, r24 18a: e0 e0 ldi r30, 0x00 ; 0 18c: af 01 movw r20, r30 18e: 49 0f add r20, r25 190: 51 1d adc r21, r1 192: ca 01 movw r24, r20 194: a0 e0 ldi r26, 0x00 ; 0 196: b0 e0 ldi r27, 0x00 ; 0 198: e8 0e add r14, r24 19a: f9 1e adc r15, r25 19c: 0a 1f adc r16, r26 19e: 1b 1f adc r17, r27 //do a dummy readout first ADCSRA |= (1< ADC_temp = ADCL; // read out ADCL register ADC_temp += (ADCH << 8); // read out ADCH register ADCr += ADC_temp; // accumulate result } ADCr = ADCr / setup.adc_averages; // average the samples 1ac: 40 e0 ldi r20, 0x00 ; 0 1ae: 50 e0 ldi r21, 0x00 ; 0 1b0: c8 01 movw r24, r16 1b2: b7 01 movw r22, r14 1b4: 0e 94 30 08 call 0x1060 ; 0x1060 <__udivmodsi4> 1b8: 93 2f mov r25, r19 ADCSRA &= ~(1<: * Purpose : Stores LCD control data in the LCD_displayData buffer. * (The LCD_displayData is latched in the LCD_SOF interrupt.) * *****************************************************************************/ void LCD_WriteDigit(char c, char digit) { 1e2: cf 93 push r28 1e4: df 93 push r29 1e6: 98 2f mov r25, r24 char mask, nibble; volatile char *ptr; char i; if (digit > 5) // Skip if digit is illegal 1e8: 66 30 cpi r22, 0x06 ; 6 1ea: c8 f5 brcc .+114 ; 0x25e return; //Lookup character table for segmet data if ((c >= '*') && (c <= 'z')) 1ec: 8a 52 subi r24, 0x2A ; 42 1ee: 81 35 cpi r24, 0x51 ; 81 1f0: 18 f0 brcs .+6 ; 0x1f8 1f2: a0 e0 ldi r26, 0x00 ; 0 1f4: b0 e0 ldi r27, 0x00 ; 0 1f6: 0c c0 rjmp .+24 ; 0x210 { // c is a letter if (c >= 'a') // Convert to upper case 1f8: 91 36 cpi r25, 0x61 ; 97 1fa: 08 f0 brcs .+2 ; 0x1fe c &= ~0x20; // if necessarry 1fc: 9f 7d andi r25, 0xDF ; 223 c -= '*'; //mt seg = LCD_character_table[c]; seg = (unsigned int) pgm_read_word(&LCD_character_table[(uint8_t)c]); 1fe: 9a 52 subi r25, 0x2A ; 42 200: e9 2f mov r30, r25 202: f0 e0 ldi r31, 0x00 ; 0 204: ee 0f add r30, r30 206: ff 1f adc r31, r31 208: e4 5a subi r30, 0xA4 ; 164 20a: ff 4f sbci r31, 0xFF ; 255 20c: a5 91 lpm r26, Z+ 20e: b4 91 lpm r27, Z+ } // Adjust mask according to LCD segment mapping if (digit & 0x01) 210: 86 2f mov r24, r22 212: 90 e0 ldi r25, 0x00 ; 0 214: ec 01 movw r28, r24 216: c1 70 andi r28, 0x01 ; 1 218: d0 70 andi r29, 0x00 ; 0 21a: 60 fd sbrc r22, 0 21c: 02 c0 rjmp .+4 ; 0x222 21e: 90 ef ldi r25, 0xF0 ; 240 220: 01 c0 rjmp .+2 ; 0x224 222: 9f e0 ldi r25, 0x0F ; 15 mask = 0x0F; // Digit 1, 3, 5 else mask = 0xF0; // Digit 0, 2, 4 ptr = LCD_Data + (digit >> 1); // digit = {0,0,1,1,2,2} 224: 66 95 lsr r22 226: 70 e0 ldi r23, 0x00 ; 0 228: 69 5a subi r22, 0xA9 ; 169 22a: 7e 4f sbci r23, 0xFE ; 254 22c: 20 e0 ldi r18, 0x00 ; 0 22e: 30 e0 ldi r19, 0x00 ; 0 230: fb 01 movw r30, r22 232: e2 0f add r30, r18 234: f3 1f adc r31, r19 for (i = 0; i < 4; i++) { nibble = seg & 0x000F; 236: 4a 2f mov r20, r26 238: 4f 70 andi r20, 0x0F ; 15 seg >>= 4; 23a: 84 e0 ldi r24, 0x04 ; 4 23c: b6 95 lsr r27 23e: a7 95 ror r26 240: 8a 95 dec r24 242: e1 f7 brne .-8 ; 0x23c if (digit & 0x01) 244: 20 97 sbiw r28, 0x00 ; 0 246: 11 f0 breq .+4 ; 0x24c nibble <<= 4; 248: 42 95 swap r20 24a: 40 7f andi r20, 0xF0 ; 240 *ptr = (*ptr & mask) | nibble; 24c: 80 81 ld r24, Z 24e: 89 23 and r24, r25 250: 48 2b or r20, r24 252: 40 83 st Z, r20 254: 2b 5f subi r18, 0xFB ; 251 256: 3f 4f sbci r19, 0xFF ; 255 else mask = 0xF0; // Digit 0, 2, 4 ptr = LCD_Data + (digit >> 1); // digit = {0,0,1,1,2,2} for (i = 0; i < 4; i++) 258: 24 31 cpi r18, 0x14 ; 20 25a: 31 05 cpc r19, r1 25c: 49 f7 brne .-46 ; 0x230 if (digit & 0x01) nibble <<= 4; *ptr = (*ptr & mask) | nibble; ptr += 5; } } 25e: df 91 pop r29 260: cf 91 pop r28 262: 08 95 ret 00000264 : *****************************************************************************/ void LCD_AllSegments(char show) { unsigned char i; if (show) 264: 81 11 cpse r24, r1 266: 8f ef ldi r24, 0xFF ; 255 268: 20 e0 ldi r18, 0x00 ; 0 26a: 30 e0 ldi r19, 0x00 ; 0 26c: f9 01 movw r30, r18 26e: e9 5a subi r30, 0xA9 ; 169 270: fe 4f sbci r31, 0xFE ; 254 show = 0xFF; // Set/clear all bits in all LCD registers for (i=0; i < LCD_REGISTER_COUNT; i++) *(LCD_Data + i) = show; 272: 80 83 st Z, r24 274: 2f 5f subi r18, 0xFF ; 255 276: 3f 4f sbci r19, 0xFF ; 255 if (show) show = 0xFF; // Set/clear all bits in all LCD registers for (i=0; i < LCD_REGISTER_COUNT; i++) 278: 24 31 cpi r18, 0x14 ; 20 27a: 31 05 cpc r19, r1 27c: b9 f7 brne .-18 ; 0x26c *(LCD_Data + i) = show; } 27e: 08 95 ret 00000280 : * Set up the LCD (timing, contrast, etc.) * *****************************************************************************/ void LCD_Init(void) { LCD_AllSegments(FALSE); // Clear segment buffer. 280: 80 e0 ldi r24, 0x00 ; 0 282: 0e 94 32 01 call 0x264 ; 0x264 LCD_CONTRAST_LEVEL(LCD_INITIAL_CONTRAST); //Set the LCD contrast level 286: a7 ee ldi r26, 0xE7 ; 231 288: b0 e0 ldi r27, 0x00 ; 0 28a: 8c 91 ld r24, X 28c: 8f 60 ori r24, 0x0F ; 15 28e: 8c 93 st X, r24 // Select asynchronous clock source, enable all COM pins and enable all // segment pins. LCDCRB = (1<: * Purpose: Latch the LCD_displayData and Set LCD_status.updateComplete * *****************************************************************************/ ISR(LCD_vect) { 2b6: 1f 92 push r1 2b8: 0f 92 push r0 2ba: 0f b6 in r0, 0x3f ; 63 2bc: 0f 92 push r0 2be: 11 24 eor r1, r1 2c0: ef 92 push r14 2c2: ff 92 push r15 2c4: 0f 93 push r16 2c6: 1f 93 push r17 2c8: 2f 93 push r18 2ca: 3f 93 push r19 2cc: 4f 93 push r20 2ce: 5f 93 push r21 2d0: 6f 93 push r22 2d2: 7f 93 push r23 2d4: 8f 93 push r24 2d6: 9f 93 push r25 2d8: af 93 push r26 2da: bf 93 push r27 2dc: cf 93 push r28 2de: df 93 push r29 2e0: ef 93 push r30 2e2: ff 93 push r31 c_flash=0; // mt LCD_timer--; // Decreased every LCD frame 2e4: 00 91 00 01 lds r16, 0x0100 2e8: 01 50 subi r16, 0x01 ; 1 2ea: 00 93 00 01 sts 0x0100, r16 if (gScrollMode) 2ee: 80 91 56 01 lds r24, 0x0156 2f2: 88 23 and r24, r24 2f4: 81 f0 breq .+32 ; 0x316 <__vector_22+0x60> { // If we are in scroll mode, and the timer has expired, // we will update the LCD if (LCD_timer == 0) 2f6: 00 23 and r16, r16 2f8: 81 f4 brne .+32 ; 0x31a <__vector_22+0x64> { if (gLCD_Start_Scroll_Timer == 0) 2fa: 80 91 53 01 lds r24, 0x0153 2fe: 88 23 and r24, r24 300: 21 f4 brne .+8 ; 0x30a <__vector_22+0x54> { gLCD_Update_Required = TRUE; 302: 81 e0 ldi r24, 0x01 ; 1 304: 80 93 52 01 sts 0x0152, r24 308: 08 c0 rjmp .+16 ; 0x31a <__vector_22+0x64> } else gLCD_Start_Scroll_Timer--; 30a: 80 91 53 01 lds r24, 0x0153 30e: 81 50 subi r24, 0x01 ; 1 310: 80 93 53 01 sts 0x0153, r24 314: 02 c0 rjmp .+4 ; 0x31a <__vector_22+0x64> } else { // if not scrolling, // disble LCD start of frame interrupt // cbi(LCDCRA, LCDIE); //DEBUG gScroll = 0; 316: 10 92 84 01 sts 0x0184, r1 } EOL = FALSE; if (gLCD_Update_Required == TRUE) 31a: 80 91 52 01 lds r24, 0x0152 31e: 81 30 cpi r24, 0x01 ; 1 320: 09 f0 breq .+2 ; 0x324 <__vector_22+0x6e> 322: 52 c0 rjmp .+164 ; 0x3c8 <__vector_22+0x112> { // Duty cycle of flashing characters if (gFlashTimer < (LCD_FLASH_SEED >> 1)) 324: e0 90 54 01 lds r14, 0x0154 328: ff 24 eor r15, r15 32a: 10 e0 ldi r17, 0x00 ; 0 32c: c0 e0 ldi r28, 0x00 ; 0 32e: d0 e0 ldi r29, 0x00 ; 0 330: 6c 2f mov r22, r28 flash = 1; // Repeat for the six LCD characters for (i = 0; i < 6; i++) { if ((gScroll+i) >= 0 && (!EOL)) 332: 80 91 84 01 lds r24, 0x0184 336: 99 27 eor r25, r25 338: 87 fd sbrc r24, 7 33a: 90 95 com r25 33c: 8c 0f add r24, r28 33e: 9d 1f adc r25, r29 340: 97 fd sbrc r25, 7 342: 15 c0 rjmp .+42 ; 0x36e <__vector_22+0xb8> 344: 11 23 and r17, r17 346: 99 f4 brne .+38 ; 0x36e <__vector_22+0xb8> { // We have some visible characters c = gTextBuffer[i + gScroll]; 348: e0 91 84 01 lds r30, 0x0184 34c: ff 27 eor r31, r31 34e: e7 fd sbrc r30, 7 350: f0 95 com r31 352: ec 0f add r30, r28 354: fd 1f adc r31, r29 356: e5 59 subi r30, 0x95 ; 149 358: fe 4f sbci r31, 0xFE ; 254 35a: 80 81 ld r24, Z c_flash = c & 0x80 ? 1 : 0; 35c: f8 2e mov r15, r24 35e: ff 1c adc r15, r15 360: ff 24 eor r15, r15 362: ff 1c adc r15, r15 c = c & 0x7F; 364: 8f 77 andi r24, 0x7F ; 127 if (c == '\0') 366: 21 f4 brne .+8 ; 0x370 <__vector_22+0xba> 368: 1c 2f mov r17, r28 36a: 1f 5f subi r17, 0xFF ; 255 36c: 01 c0 rjmp .+2 ; 0x370 <__vector_22+0xba> 36e: 80 e2 ldi r24, 0x20 ; 32 else c = ' '; // Check if this character is flashing if (c_flash && flash) 370: ff 20 and r15, r15 372: 21 f0 breq .+8 ; 0x37c <__vector_22+0xc6> 374: 94 e0 ldi r25, 0x04 ; 4 376: 9e 15 cp r25, r14 378: 08 f4 brcc .+2 ; 0x37c <__vector_22+0xc6> LCD_WriteDigit(' ', i); 37a: 80 e2 ldi r24, 0x20 ; 32 else LCD_WriteDigit(c, i); 37c: 0e 94 f1 00 call 0x1e2 ; 0x1e2 380: 21 96 adiw r28, 0x01 ; 1 flash = 0; else flash = 1; // Repeat for the six LCD characters for (i = 0; i < 6; i++) 382: c6 30 cpi r28, 0x06 ; 6 384: d1 05 cpc r29, r1 386: a1 f6 brne .-88 ; 0x330 <__vector_22+0x7a> 388: ac ee ldi r26, 0xEC ; 236 38a: b0 e0 ldi r27, 0x00 ; 0 38c: fd 01 movw r30, r26 38e: e5 59 subi r30, 0x95 ; 149 390: ff 4f sbci r31, 0xFF ; 255 LCD_WriteDigit(c, i); } // Copy the segment buffer to the real segments for (i = 0; i < LCD_REGISTER_COUNT; i++) *(pLCDREG + i) = *(LCD_Data+i); 392: 80 81 ld r24, Z 394: 8d 93 st X+, r24 else LCD_WriteDigit(c, i); } // Copy the segment buffer to the real segments for (i = 0; i < LCD_REGISTER_COUNT; i++) 396: 81 e0 ldi r24, 0x01 ; 1 398: a0 30 cpi r26, 0x00 ; 0 39a: b8 07 cpc r27, r24 39c: b9 f7 brne .-18 ; 0x38c <__vector_22+0xd6> *(pLCDREG + i) = *(LCD_Data+i); // Handle colon if (gColon) 39e: 80 91 55 01 lds r24, 0x0155 3a2: 88 23 and r24, r24 3a4: 21 f0 breq .+8 ; 0x3ae <__vector_22+0xf8> *(pLCDREG + 8) = 0x01; 3a6: 81 e0 ldi r24, 0x01 ; 1 3a8: 80 93 f4 00 sts 0x00F4, r24 3ac: 02 c0 rjmp .+4 ; 0x3b2 <__vector_22+0xfc> else *(pLCDREG + 8) = 0x00; 3ae: 10 92 f4 00 sts 0x00F4, r1 // If the text scrolled off the display, // we have to start over again. if (EOL == 1) 3b2: 11 30 cpi r17, 0x01 ; 1 3b4: 11 f4 brne .+4 ; 0x3ba <__vector_22+0x104> gScroll = -6; 3b6: 8a ef ldi r24, 0xFA ; 250 3b8: 03 c0 rjmp .+6 ; 0x3c0 <__vector_22+0x10a> else gScroll++; 3ba: 80 91 84 01 lds r24, 0x0184 3be: 8f 5f subi r24, 0xFF ; 255 3c0: 80 93 84 01 sts 0x0184, r24 // No need to update anymore gLCD_Update_Required = FALSE; 3c4: 10 92 52 01 sts 0x0152, r1 } // LCD_timer is used when scrolling text if (LCD_timer == 0) 3c8: 00 23 and r16, r16 3ca: 19 f4 brne .+6 ; 0x3d2 <__vector_22+0x11c> { /* if ((gScroll <= 0) || EOL) LCD_timer = LCD_TIMER_SEED/2; else*/ LCD_timer = LCD_TIMER_SEED; 3cc: 83 e0 ldi r24, 0x03 ; 3 3ce: 80 93 00 01 sts 0x0100, r24 } // gFlashTimer is used when flashing characters if (gFlashTimer == LCD_FLASH_SEED) 3d2: 80 91 54 01 lds r24, 0x0154 3d6: 8a 30 cpi r24, 0x0A ; 10 3d8: 19 f4 brne .+6 ; 0x3e0 <__vector_22+0x12a> gFlashTimer= 0; 3da: 10 92 54 01 sts 0x0154, r1 3de: 05 c0 rjmp .+10 ; 0x3ea <__vector_22+0x134> else gFlashTimer++; 3e0: 80 91 54 01 lds r24, 0x0154 3e4: 8f 5f subi r24, 0xFF ; 255 3e6: 80 93 54 01 sts 0x0154, r24 } 3ea: ff 91 pop r31 3ec: ef 91 pop r30 3ee: df 91 pop r29 3f0: cf 91 pop r28 3f2: bf 91 pop r27 3f4: af 91 pop r26 3f6: 9f 91 pop r25 3f8: 8f 91 pop r24 3fa: 7f 91 pop r23 3fc: 6f 91 pop r22 3fe: 5f 91 pop r21 400: 4f 91 pop r20 402: 3f 91 pop r19 404: 2f 91 pop r18 406: 1f 91 pop r17 408: 0f 91 pop r16 40a: ff 90 pop r15 40c: ef 90 pop r14 40e: 0f 90 pop r0 410: 0f be out 0x3f, r0 ; 63 412: 0f 90 pop r0 414: 1f 90 pop r1 416: 18 95 reti 00000418 : * * Purpose : Writes a string to the LCD * *****************************************************************************/ void LCD_puts(char *pStr) { 418: bc 01 movw r22, r24 uint8_t i; // char i; while (gLCD_Update_Required); // Wait for access to buffer 41a: 80 91 52 01 lds r24, 0x0152 41e: 88 23 and r24, r24 420: e1 f7 brne .-8 ; 0x41a 422: 20 e0 ldi r18, 0x00 ; 0 424: 30 e0 ldi r19, 0x00 ; 0 426: 06 c0 rjmp .+12 ; 0x434 for (i = 0; pStr[i] && i < TEXTBUFFER_SIZE; i++) { gTextBuffer[i] = pStr[i]; 428: f9 01 movw r30, r18 42a: e5 59 subi r30, 0x95 ; 149 42c: fe 4f sbci r31, 0xFE ; 254 42e: 80 83 st Z, r24 430: 2f 5f subi r18, 0xFF ; 255 432: 3f 4f sbci r19, 0xFF ; 255 434: 42 2f mov r20, r18 { uint8_t i; // char i; while (gLCD_Update_Required); // Wait for access to buffer for (i = 0; pStr[i] && i < TEXTBUFFER_SIZE; i++) 436: fb 01 movw r30, r22 438: e2 0f add r30, r18 43a: f3 1f adc r31, r19 43c: 80 81 ld r24, Z 43e: 88 23 and r24, r24 440: 19 f0 breq .+6 ; 0x448 442: 29 31 cpi r18, 0x19 ; 25 444: 31 05 cpc r19, r1 446: 81 f7 brne .-32 ; 0x428 { gTextBuffer[i] = pStr[i]; } gTextBuffer[i] = '\0'; 448: e4 2f mov r30, r20 44a: f0 e0 ldi r31, 0x00 ; 0 44c: e5 59 subi r30, 0x95 ; 149 44e: fe 4f sbci r31, 0xFE ; 254 450: 10 82 st Z, r1 if (i > 6) 452: 47 30 cpi r20, 0x07 ; 7 454: 48 f0 brcs .+18 ; 0x468 { gScrollMode = 1; // Scroll if text is longer than display size 456: 81 e0 ldi r24, 0x01 ; 1 458: 80 93 56 01 sts 0x0156, r24 gScroll = 0; 45c: 10 92 84 01 sts 0x0184, r1 gLCD_Start_Scroll_Timer = 3; //Start-up delay before scrolling the text 460: 83 e0 ldi r24, 0x03 ; 3 462: 80 93 53 01 sts 0x0153, r24 466: 04 c0 rjmp .+8 ; 0x470 } else { gScrollMode = 0; 468: 10 92 56 01 sts 0x0156, r1 gScroll = 0; 46c: 10 92 84 01 sts 0x0184, r1 } gLCD_Update_Required = 1; 470: 81 e0 ldi r24, 0x01 ; 1 472: 80 93 52 01 sts 0x0152, r24 } 476: 08 95 ret 00000478 : * * Purpose : Clear the LCD * *****************************************************************************/ void LCD_Clear(void) { 478: 80 e0 ldi r24, 0x00 ; 0 47a: 90 e0 ldi r25, 0x00 ; 0 uint8_t i; // char i; for (i=0; i gTextBuffer[i] = ' '; gTextBuffer[0] = '\0'; // mt 5/2007 48e: 10 92 6b 01 sts 0x016B, r1 } 492: 08 95 ret 00000494 : * Purpose : Enable/disable colons on the LCD * *****************************************************************************/ void LCD_Colon(char show) { gColon = show; 494: 80 93 55 01 sts 0x0155, r24 } 498: 08 95 ret 0000049a : * * Purpose : Tells the LCD that there is new data to be presented * *****************************************************************************/ void LCD_UpdateRequired(char update, char scrollmode) { 49a: 98 2f mov r25, r24 while (gLCD_Update_Required); 49c: 80 91 52 01 lds r24, 0x0152 4a0: 88 23 and r24, r24 4a2: e1 f7 brne .-8 ; 0x49c gScrollMode = scrollmode; 4a4: 60 93 56 01 sts 0x0156, r22 gScroll = 0; 4a8: 10 92 84 01 sts 0x0184, r1 gLCD_Update_Required = update; 4ac: 90 93 52 01 sts 0x0152, r25 } 4b0: 08 95 ret 000004b2 : * Purpose : This function resets the blinking cycle of a flashing digit * *****************************************************************************/ void LCD_FlashReset(void) { gFlashTimer = 0; 4b2: 10 92 54 01 sts 0x0154, r1 } 4b6: 08 95 ret 000004b8 : void LCD_putc(uint8_t digit, char character) { if (digit < TEXTBUFFER_SIZE) 4b8: 89 31 cpi r24, 0x19 ; 25 4ba: 28 f4 brcc .+10 ; 0x4c6 gTextBuffer[digit] = character; 4bc: e8 2f mov r30, r24 4be: f0 e0 ldi r31, 0x00 ; 0 4c0: e5 59 subi r30, 0x95 ; 149 4c2: fe 4f sbci r31, 0xFE ; 254 4c4: 60 83 st Z, r22 4c6: 08 95 ret 000004c8 : } void LCD_ShowTime(uint32 tmr) { 4c8: 6f 92 push r6 4ca: 7f 92 push r7 4cc: 8f 92 push r8 4ce: 9f 92 push r9 4d0: af 92 push r10 4d2: bf 92 push r11 4d4: cf 92 push r12 4d6: df 92 push r13 4d8: ef 92 push r14 4da: ff 92 push r15 4dc: 0f 93 push r16 4de: 1f 93 push r17 4e0: df 93 push r29 4e2: cf 93 push r28 4e4: 00 d0 rcall .+0 ; 0x4e6 4e6: 00 d0 rcall .+0 ; 0x4e8 4e8: 00 d0 rcall .+0 ; 0x4ea 4ea: cd b7 in r28, 0x3d ; 61 4ec: de b7 in r29, 0x3e ; 62 4ee: 5b 01 movw r10, r22 4f0: 6c 01 movw r12, r24 uint hours = tmr / 360000; 4f2: 20 e4 ldi r18, 0x40 ; 64 4f4: 3e e7 ldi r19, 0x7E ; 126 4f6: 45 e0 ldi r20, 0x05 ; 5 4f8: 50 e0 ldi r21, 0x00 ; 0 4fa: 0e 94 30 08 call 0x1060 ; 0x1060 <__udivmodsi4> 4fe: 39 01 movw r6, r18 500: 4a 01 movw r8, r20 tmr = tmr - hours*360000; 502: b9 01 movw r22, r18 504: 80 e0 ldi r24, 0x00 ; 0 506: 90 e0 ldi r25, 0x00 ; 0 508: 20 ec ldi r18, 0xC0 ; 192 50a: 31 e8 ldi r19, 0x81 ; 129 50c: 4a ef ldi r20, 0xFA ; 250 50e: 5f ef ldi r21, 0xFF ; 255 510: 0e 94 fd 07 call 0xffa ; 0xffa <__mulsi3> 514: 7b 01 movw r14, r22 516: 8c 01 movw r16, r24 518: ea 0c add r14, r10 51a: fb 1c adc r15, r11 51c: 0c 1d adc r16, r12 51e: 1d 1d adc r17, r13 uint minutes = tmr / 6000; 520: c8 01 movw r24, r16 522: b7 01 movw r22, r14 524: 20 e7 ldi r18, 0x70 ; 112 526: 37 e1 ldi r19, 0x17 ; 23 528: 40 e0 ldi r20, 0x00 ; 0 52a: 50 e0 ldi r21, 0x00 ; 0 52c: 0e 94 30 08 call 0x1060 ; 0x1060 <__udivmodsi4> 530: 59 01 movw r10, r18 532: 6a 01 movw r12, r20 tmr = tmr - minutes*6000; uint seconds = tmr / 100; 534: 80 e7 ldi r24, 0x70 ; 112 536: 97 e1 ldi r25, 0x17 ; 23 538: 9c 01 movw r18, r24 53a: 2a 9d mul r18, r10 53c: c0 01 movw r24, r0 53e: 2b 9d mul r18, r11 540: 90 0d add r25, r0 542: 3a 9d mul r19, r10 544: 90 0d add r25, r0 546: 11 24 eor r1, r1 548: a0 e0 ldi r26, 0x00 ; 0 54a: b0 e0 ldi r27, 0x00 ; 0 54c: e8 1a sub r14, r24 54e: f9 0a sbc r15, r25 550: 0a 0b sbc r16, r26 552: 1b 0b sbc r17, r27 554: c8 01 movw r24, r16 556: b7 01 movw r22, r14 558: 24 e6 ldi r18, 0x64 ; 100 55a: 30 e0 ldi r19, 0x00 ; 0 55c: 40 e0 ldi r20, 0x00 ; 0 55e: 50 e0 ldi r21, 0x00 ; 0 560: 0e 94 30 08 call 0x1060 ; 0x1060 <__udivmodsi4> 564: 89 01 movw r16, r18 566: 9a 01 movw r18, r20 tmr = tmr - seconds*100; uint8 digits[6]; digits[0] = hours/10; 568: c3 01 movw r24, r6 56a: 6a e0 ldi r22, 0x0A ; 10 56c: 70 e0 ldi r23, 0x00 ; 0 56e: 0e 94 1c 08 call 0x1038 ; 0x1038 <__udivmodhi4> 572: 69 83 std Y+1, r22 ; 0x01 digits[1] = hours%10; 574: c3 01 movw r24, r6 576: 6a e0 ldi r22, 0x0A ; 10 578: 70 e0 ldi r23, 0x00 ; 0 57a: 0e 94 1c 08 call 0x1038 ; 0x1038 <__udivmodhi4> 57e: 8a 83 std Y+2, r24 ; 0x02 digits[2] = minutes/10; 580: c5 01 movw r24, r10 582: 6a e0 ldi r22, 0x0A ; 10 584: 70 e0 ldi r23, 0x00 ; 0 586: 0e 94 1c 08 call 0x1038 ; 0x1038 <__udivmodhi4> 58a: 6b 83 std Y+3, r22 ; 0x03 digits[3] = minutes%10; 58c: c5 01 movw r24, r10 58e: 6a e0 ldi r22, 0x0A ; 10 590: 70 e0 ldi r23, 0x00 ; 0 592: 0e 94 1c 08 call 0x1038 ; 0x1038 <__udivmodhi4> 596: 8c 83 std Y+4, r24 ; 0x04 digits[4] = seconds/10; 598: c8 01 movw r24, r16 59a: 6a e0 ldi r22, 0x0A ; 10 59c: 70 e0 ldi r23, 0x00 ; 0 59e: 0e 94 1c 08 call 0x1038 ; 0x1038 <__udivmodhi4> 5a2: 6d 83 std Y+5, r22 ; 0x05 digits[5] = seconds%10; 5a4: c8 01 movw r24, r16 5a6: 6a e0 ldi r22, 0x0A ; 10 5a8: 70 e0 ldi r23, 0x00 ; 0 5aa: 0e 94 1c 08 call 0x1038 ; 0x1038 <__udivmodhi4> 5ae: 8e 83 std Y+6, r24 ; 0x06 5b0: 20 e0 ldi r18, 0x00 ; 0 5b2: 30 e0 ldi r19, 0x00 ; 0 for (uint8 i = 0; i < 6; ++i) { LCD_putc(i, '0' + digits[i]); 5b4: ae 01 movw r20, r28 5b6: 4f 5f subi r20, 0xFF ; 255 5b8: 5f 4f sbci r21, 0xFF ; 255 5ba: fa 01 movw r30, r20 5bc: e2 0f add r30, r18 5be: f3 1f adc r31, r19 5c0: 80 81 ld r24, Z 5c2: 80 5d subi r24, 0xD0 ; 208 void LCD_putc(uint8_t digit, char character) { if (digit < TEXTBUFFER_SIZE) gTextBuffer[digit] = character; 5c4: f9 01 movw r30, r18 5c6: e5 59 subi r30, 0x95 ; 149 5c8: fe 4f sbci r31, 0xFE ; 254 5ca: 80 83 st Z, r24 5cc: 2f 5f subi r18, 0xFF ; 255 5ce: 3f 4f sbci r19, 0xFF ; 255 digits[2] = minutes/10; digits[3] = minutes%10; digits[4] = seconds/10; digits[5] = seconds%10; for (uint8 i = 0; i < 6; ++i) 5d0: 26 30 cpi r18, 0x06 ; 6 5d2: 31 05 cpc r19, r1 5d4: 91 f7 brne .-28 ; 0x5ba <__stack+0xbb> void LCD_putc(uint8_t digit, char character) { if (digit < TEXTBUFFER_SIZE) gTextBuffer[digit] = character; 5d6: 10 92 71 01 sts 0x0171, r1 * *****************************************************************************/ void LCD_UpdateRequired(char update, char scrollmode) { while (gLCD_Update_Required); 5da: 80 91 52 01 lds r24, 0x0152 5de: 88 23 and r24, r24 5e0: e1 f7 brne .-8 ; 0x5da <__stack+0xdb> gScrollMode = scrollmode; 5e2: 10 92 56 01 sts 0x0156, r1 gScroll = 0; 5e6: 10 92 84 01 sts 0x0184, r1 gLCD_Update_Required = update; 5ea: 81 e0 ldi r24, 0x01 ; 1 5ec: 80 93 52 01 sts 0x0152, r24 } LCD_putc(6, '\0'); LCD_UpdateRequired(1, 0); } 5f0: 26 96 adiw r28, 0x06 ; 6 5f2: 0f b6 in r0, 0x3f ; 63 5f4: f8 94 cli 5f6: de bf out 0x3e, r29 ; 62 5f8: 0f be out 0x3f, r0 ; 63 5fa: cd bf out 0x3d, r28 ; 61 5fc: cf 91 pop r28 5fe: df 91 pop r29 600: 1f 91 pop r17 602: 0f 91 pop r16 604: ff 90 pop r15 606: ef 90 pop r14 608: df 90 pop r13 60a: cf 90 pop r12 60c: bf 90 pop r11 60e: af 90 pop r10 610: 9f 90 pop r9 612: 8f 90 pop r8 614: 7f 90 pop r7 616: 6f 90 pop r6 618: 08 95 ret 0000061a : } #include #include "printf.h" int LCD_printf(const char * format, ...) { 61a: ef 92 push r14 61c: ff 92 push r15 61e: 0f 93 push r16 620: 1f 93 push r17 622: df 93 push r29 624: cf 93 push r28 626: cd b7 in r28, 0x3d ; 61 628: de b7 in r29, 0x3e ; 62 62a: 69 97 sbiw r28, 0x19 ; 25 62c: 0f b6 in r0, 0x3f ; 63 62e: f8 94 cli 630: de bf out 0x3e, r29 ; 62 632: 0f be out 0x3f, r0 ; 63 634: cd bf out 0x3d, r28 ; 61 636: fe 01 movw r30, r28 638: b2 96 adiw r30, 0x22 ; 34 63a: 61 91 ld r22, Z+ 63c: 71 91 ld r23, Z+ char buffer[TEXTBUFFER_SIZE]; va_list args; va_start(args, format); int result = vsprintf(buffer, format, args); 63e: 8e 01 movw r16, r28 640: 0f 5f subi r16, 0xFF ; 255 642: 1f 4f sbci r17, 0xFF ; 255 644: c8 01 movw r24, r16 646: af 01 movw r20, r30 648: 0e 94 41 05 call 0xa82 ; 0xa82 64c: f8 2e mov r15, r24 64e: e9 2e mov r14, r25 LCD_puts(buffer); 650: c8 01 movw r24, r16 652: 0e 94 0c 02 call 0x418 ; 0x418 return result; } 656: 8f 2d mov r24, r15 658: 9e 2d mov r25, r14 65a: 69 96 adiw r28, 0x19 ; 25 65c: 0f b6 in r0, 0x3f ; 63 65e: f8 94 cli 660: de bf out 0x3e, r29 ; 62 662: 0f be out 0x3f, r0 ; 63 664: cd bf out 0x3d, r28 ; 61 666: cf 91 pop r28 668: df 91 pop r29 66a: 1f 91 pop r17 66c: 0f 91 pop r16 66e: ff 90 pop r15 670: ef 90 pop r14 672: 08 95 ret 00000674 : * * Purpose : Delay-loop * *****************************************************************************/ void Delay(unsigned int millisec) { 674: 06 c0 rjmp .+12 ; 0x682 // mt, int i did not work in the simulator: int i; uint8_t i; while (millisec--) { 676: 20 e0 ldi r18, 0x00 ; 0 for (i=0; i<125; i++) { asm volatile ("nop"::); 678: 00 00 nop { // mt, int i did not work in the simulator: int i; uint8_t i; while (millisec--) { for (i=0; i<125; i++) { 67a: 2f 5f subi r18, 0xFF ; 255 67c: 2d 37 cpi r18, 0x7D ; 125 67e: e1 f7 brne .-8 ; 0x678 680: 01 97 sbiw r24, 0x01 ; 1 void Delay(unsigned int millisec) { // mt, int i did not work in the simulator: int i; uint8_t i; while (millisec--) { 682: 00 97 sbiw r24, 0x00 ; 0 684: c1 f7 brne .-16 ; 0x676 for (i=0; i<125; i++) { asm volatile ("nop"::); } } } 686: 08 95 ret 00000688 : { unsigned char calibrate = FALSE; int temp; unsigned char tempL; CLKPR = (1< Delay(1000); // wait for external crystal to stabilise 6ce: 88 ee ldi r24, 0xE8 ; 232 6d0: 93 e0 ldi r25, 0x03 ; 3 6d2: 0e 94 3a 03 call 0x674 ; 0x674 while(!calibrate) { cli(); // mt __disable_interrupt(); // disable global interrupt TIFR1 = 0xFF; // delete TIFR1 flags 6d6: 4f ef ldi r20, 0xFF ; 255 if (temp > 6250) { OSCCAL--; // the internRC oscillator runs to fast, decrease the OSCCAL } else if (temp < 6120) 6d8: 51 e0 ldi r21, 0x01 ; 1 Delay(1000); // wait for external crystal to stabilise while(!calibrate) { cli(); // mt __disable_interrupt(); // disable global interrupt 6da: f8 94 cli TIFR1 = 0xFF; // delete TIFR1 flags 6dc: 46 bb out 0x16, r20 ; 22 TIFR2 = 0xFF; // delete TIFR2 flags 6de: 47 bb out 0x17, r20 ; 23 TCNT1H = 0; // clear timer1 counter 6e0: 10 92 85 00 sts 0x0085, r1 TCNT1L = 0; 6e4: 10 92 84 00 sts 0x0084, r1 TCNT2 = 0; // clear timer2 counter 6e8: 10 92 b2 00 sts 0x00B2, r1 // shc/mt while ( !(TIFR2 && (1< TCCR1B = 0; // stop timer1 6f0: 10 92 81 00 sts 0x0081, r1 sei(); // __enable_interrupt(); // enable global interrupt 6f4: 78 94 sei // shc/mt if ( (TIFR1 && (1< { temp = 0xFFFF; // if timer1 overflows, set the temp to 0xFFFF } else { // read out the timer1 counter value tempL = TCNT1L; 6fa: 90 91 84 00 lds r25, 0x0084 temp = TCNT1H; 6fe: 80 91 85 00 lds r24, 0x0085 temp = (temp << 8); 702: 38 2f mov r19, r24 704: 20 e0 ldi r18, 0x00 ; 0 temp += tempL; 706: b9 01 movw r22, r18 708: 69 0f add r22, r25 70a: 71 1d adc r23, r1 70c: cb 01 movw r24, r22 } if (temp > 6250) 70e: 78 e1 ldi r23, 0x18 ; 24 710: 8b 36 cpi r24, 0x6B ; 107 712: 97 07 cpc r25, r23 714: 24 f0 brlt .+8 ; 0x71e { OSCCAL--; // the internRC oscillator runs to fast, decrease the OSCCAL 716: 80 91 66 00 lds r24, 0x0066 71a: 81 50 subi r24, 0x01 ; 1 71c: 08 c0 rjmp .+16 ; 0x72e } else if (temp < 6120) 71e: 88 5e subi r24, 0xE8 ; 232 720: 97 41 sbci r25, 0x17 ; 23 722: 14 f0 brlt .+4 ; 0x728 724: 81 e0 ldi r24, 0x01 ; 1 726: 06 c0 rjmp .+12 ; 0x734 { OSCCAL++; // the internRC oscillator runs to slow, increase the OSCCAL 728: 80 91 66 00 lds r24, 0x0066 72c: 8f 5f subi r24, 0xFF ; 255 72e: 80 93 66 00 sts 0x0066, r24 732: 80 e0 ldi r24, 0x00 ; 0 } else calibrate = TRUE; // the interRC is correct TCCR1B = (1< else calibrate = TRUE; // the interRC is correct TCCR1B = (1<: * Purpose : Initializate the different modules * *****************************************************************************/ void Initialization(void) { OSCCAL_calibration(); // calibrate the OSCCAL byte 73e: 0e 94 44 03 call 0x688 ; 0x688 CLKPR = (1< USART_Init(UART_4800); // Baud rate = 4800bps 752: 8c e0 ldi r24, 0x0C ; 12 754: 90 e0 ldi r25, 0x00 ; 0 756: 0e 94 25 04 call 0x84a ; 0x84a LCD_Init(); // initialize the LCD 75a: 0e 94 40 01 call 0x280 ; 0x280 //Disable JTAG to use ADC4-7 MCUCR |= ( 1 <: { // Program initalization Initialization(); 7b4: 0e 94 9f 03 call 0x73e ; 0x73e sei(); // mt __enable_interrupt(); 7b8: 78 94 sei LCD_puts("hello"); 7ba: 82 e0 ldi r24, 0x02 ; 2 7bc: 91 e0 ldi r25, 0x01 ; 1 7be: 0e 94 0c 02 call 0x418 ; 0x418 USART_printf("\r\n# hello\r\n"); 7c2: 00 d0 rcall .+0 ; 0x7c4 7c4: 88 e0 ldi r24, 0x08 ; 8 7c6: 91 e0 ldi r25, 0x01 ; 1 7c8: ed b7 in r30, 0x3d ; 61 7ca: fe b7 in r31, 0x3e ; 62 7cc: 92 83 std Z+2, r25 ; 0x02 7ce: 81 83 std Z+1, r24 ; 0x01 7d0: 0e 94 4c 04 call 0x898 ; 0x898 Delay(1000); 7d4: 0f 90 pop r0 7d6: 0f 90 pop r0 7d8: 88 ee ldi r24, 0xE8 ; 232 7da: 93 e0 ldi r25, 0x03 ; 3 7dc: 0e 94 3a 03 call 0x674 ; 0x674 for (;;) { ParseCommand(); 7e0: 0e 94 ca 05 call 0xb94 ; 0xb94 7e4: fd cf rjmp .-6 ; 0x7e0 000007e6 : *****************************************************************************/ void Timer0_Init(void) { //mt char i; // uint8_t i; DDRB |= (1<: // mtA // #pragma vector = TIMER0_COMP_vect // __interrupt void TIMER0_COMP_interrupt(void) // SIGNAL(SIG_OUTPUT_COMPARE0) ISR(TIMER0_COMP_vect) { 7f8: 1f 92 push r1 7fa: 0f 92 push r0 7fc: 0f b6 in r0, 0x3f ; 63 7fe: 0f 92 push r0 800: 11 24 eor r1, r1 802: 8f 93 push r24 804: 9f 93 push r25 806: af 93 push r26 808: bf 93 push r27 setup.elapsed_time += 1; 80a: 80 91 8d 01 lds r24, 0x018D 80e: 90 91 8e 01 lds r25, 0x018E 812: a0 91 8f 01 lds r26, 0x018F 816: b0 91 90 01 lds r27, 0x0190 81a: 01 96 adiw r24, 0x01 ; 1 81c: a1 1d adc r26, r1 81e: b1 1d adc r27, r1 820: 80 93 8d 01 sts 0x018D, r24 824: 90 93 8e 01 sts 0x018E, r25 828: a0 93 8f 01 sts 0x018F, r26 82c: b0 93 90 01 sts 0x0190, r27 PORTB ^= (1<: * *****************************************************************************/ void USART_Init(unsigned int baudrate) { // Set baud rate UBRRH = (unsigned char)(baudrate>>8); 84a: 90 93 c5 00 sts 0x00C5, r25 UBRRL = (unsigned char)baudrate; 84e: 80 93 c4 00 sts 0x00C4, r24 // Disable 2x speed UCSRA = 0; 852: 10 92 c0 00 sts 0x00C0, r1 // cbiBF(PORTB, 6); // cbiBF(PORTB, 7); #ifdef WITH_TRANSMIT // enabled receive and transmit UCSRB = (1<: * Purpose : Send one byte through the USART * *****************************************************************************/ void USART_Tx(char data) { 864: 98 2f mov r25, r24 sbiBF(PORTB, 6); 866: 2e 9a sbi 0x05, 6 ; 5 while (!(UCSRA & (1< UDR = data; 870: 90 93 c6 00 sts 0x00C6, r25 // cbiBF(PORTB, 6); } 874: 08 95 ret 00000876 : * Purpose : Receives one byte from the USART * *****************************************************************************/ char USART_Rx(void) { sbiBF(PORTB, 7); 876: 2f 9a sbi 0x05, 7 ; 5 while (!(UCSRA & (1< // cbiBF(PORTB, 5); return UDR; 880: 80 91 c6 00 lds r24, 0x00C6 } 884: 08 95 ret 00000886 : char USART_Poll(void) { if (!(UCSRA & (1< 88e: 80 e0 ldi r24, 0x00 ; 0 890: 08 95 ret return '\0'; return UDR; 892: 80 91 c6 00 lds r24, 0x00C6 } 896: 08 95 ret 00000898 : int USART_printf(const char * format, ...) { 898: 0f 93 push r16 89a: 1f 93 push r17 89c: df 93 push r29 89e: cf 93 push r28 8a0: cd b7 in r28, 0x3d ; 61 8a2: de b7 in r29, 0x3e ; 62 8a4: c0 55 subi r28, 0x50 ; 80 8a6: d0 40 sbci r29, 0x00 ; 0 8a8: 0f b6 in r0, 0x3f ; 63 8aa: f8 94 cli 8ac: de bf out 0x3e, r29 ; 62 8ae: 0f be out 0x3f, r0 ; 63 8b0: cd bf out 0x3d, r28 ; 61 8b2: fe 01 movw r30, r28 8b4: e9 5a subi r30, 0xA9 ; 169 8b6: ff 4f sbci r31, 0xFF ; 255 8b8: 61 91 ld r22, Z+ 8ba: 71 91 ld r23, Z+ char buffer[80]; va_list args; va_start(args, format); int result = vsprintf(buffer, format, args); 8bc: 8e 01 movw r16, r28 8be: 0f 5f subi r16, 0xFF ; 255 8c0: 1f 4f sbci r17, 0xFF ; 255 8c2: c8 01 movw r24, r16 8c4: af 01 movw r20, r30 8c6: 0e 94 41 05 call 0xa82 ; 0xa82 8ca: 38 2f mov r19, r24 8cc: f8 01 movw r30, r16 8ce: 08 c0 rjmp .+16 ; 0x8e0 * *****************************************************************************/ void USART_Tx(char data) { sbiBF(PORTB, 6); 8d0: 2e 9a sbi 0x05, 6 ; 5 while (!(UCSRA & (1< UDR = data; 8da: 20 93 c6 00 sts 0x00C6, r18 va_list args; va_start(args, format); int result = vsprintf(buffer, format, args); va_end(args); for (char * b = buffer; *b != '\0'; ++b) 8de: 31 96 adiw r30, 0x01 ; 1 8e0: 20 81 ld r18, Z 8e2: 22 23 and r18, r18 8e4: a9 f7 brne .-22 ; 0x8d0 USART_Tx(*b); return result; } 8e6: 83 2f mov r24, r19 8e8: c0 5b subi r28, 0xB0 ; 176 8ea: df 4f sbci r29, 0xFF ; 255 8ec: 0f b6 in r0, 0x3f ; 63 8ee: f8 94 cli 8f0: de bf out 0x3e, r29 ; 62 8f2: 0f be out 0x3f, r0 ; 63 8f4: cd bf out 0x3d, r28 ; 61 8f6: cf 91 pop r28 8f8: df 91 pop r29 8fa: 1f 91 pop r17 8fc: 0f 91 pop r16 8fe: 08 95 ret 00000900 : */ //#include // Needed for modf int luint2str(char * str, uint32 integer) { 900: 8f 92 push r8 902: 9f 92 push r9 904: af 92 push r10 906: bf 92 push r11 908: cf 92 push r12 90a: df 92 push r13 90c: ef 92 push r14 90e: ff 92 push r15 910: 1f 93 push r17 912: cf 93 push r28 914: df 93 push r29 916: 4c 01 movw r8, r24 918: 6a 01 movw r12, r20 91a: 7b 01 movw r14, r22 uint8 base = 10; if (integer == 0) 91c: 41 15 cp r20, r1 91e: 51 05 cpc r21, r1 920: 61 05 cpc r22, r1 922: 71 05 cpc r23, r1 924: 19 f0 breq .+6 ; 0x92c 926: 80 e0 ldi r24, 0x00 ; 0 928: 90 e0 ldi r25, 0x00 ; 0 92a: 20 c0 rjmp .+64 ; 0x96c { str[0] = '0'; 92c: 80 e3 ldi r24, 0x30 ; 48 92e: f4 01 movw r30, r8 930: 80 83 st Z, r24 str[1] = '\0'; 932: 11 82 std Z+1, r1 ; 0x01 934: 41 e0 ldi r20, 0x01 ; 1 936: 50 e0 ldi r21, 0x00 ; 0 938: 3d c0 rjmp .+122 ; 0x9b4 int i = 0; uint remainder; while (integer >= base) { remainder = integer % base; 93a: c7 01 movw r24, r14 93c: b6 01 movw r22, r12 93e: 2a e0 ldi r18, 0x0A ; 10 940: 30 e0 ldi r19, 0x00 ; 0 942: 40 e0 ldi r20, 0x00 ; 0 944: 50 e0 ldi r21, 0x00 ; 0 946: 0e 94 30 08 call 0x1060 ; 0x1060 <__udivmodsi4> 94a: 16 2f mov r17, r22 integer = integer / base; 94c: c7 01 movw r24, r14 94e: b6 01 movw r22, r12 950: 2a e0 ldi r18, 0x0A ; 10 952: 30 e0 ldi r19, 0x00 ; 0 954: 40 e0 ldi r20, 0x00 ; 0 956: 50 e0 ldi r21, 0x00 ; 0 958: 0e 94 30 08 call 0x1060 ; 0x1060 <__udivmodsi4> 95c: c9 01 movw r24, r18 95e: da 01 movw r26, r20 960: 6c 01 movw r12, r24 962: 7d 01 movw r14, r26 str[i] = (char)((uint)'0' + remainder); 964: 10 5d subi r17, 0xD0 ; 208 966: f5 01 movw r30, r10 968: 10 83 st Z, r17 ++i; 96a: ce 01 movw r24, r28 96c: 54 01 movw r10, r8 96e: a8 0e add r10, r24 970: b9 1e adc r11, r25 972: ec 01 movw r28, r24 974: 21 96 adiw r28, 0x01 ; 1 } int i = 0; uint remainder; while (integer >= base) 976: fa e0 ldi r31, 0x0A ; 10 978: cf 16 cp r12, r31 97a: d1 04 cpc r13, r1 97c: e1 04 cpc r14, r1 97e: f1 04 cpc r15, r1 980: e0 f6 brcc .-72 ; 0x93a ++i; } if (integer != 0) { str[i] = (char)((uint)'0' + integer); 982: 8c 2d mov r24, r12 984: 80 5d subi r24, 0xD0 ; 208 986: f5 01 movw r30, r10 988: 80 83 st Z, r24 ++i; 98a: ae 01 movw r20, r28 } //reverse the string for (int j = 0; j < i/2; ++j) 98c: be 01 movw r22, r28 98e: 75 95 asr r23 990: 67 95 ror r22 992: d4 01 movw r26, r8 994: 20 e0 ldi r18, 0x00 ; 0 996: 30 e0 ldi r19, 0x00 ; 0 998: 07 c0 rjmp .+14 ; 0x9a8 { char t = str[j]; 99a: 9c 91 ld r25, X str[j] = str[i - 1 - j]; 99c: 80 81 ld r24, Z 99e: 8d 93 st X+, r24 str[i -1 - j] = t; 9a0: 90 83 st Z, r25 str[i] = (char)((uint)'0' + integer); ++i; } //reverse the string for (int j = 0; j < i/2; ++j) 9a2: 2f 5f subi r18, 0xFF ; 255 9a4: 3f 4f sbci r19, 0xFF ; 255 9a6: 31 97 sbiw r30, 0x01 ; 1 9a8: 26 17 cp r18, r22 9aa: 37 07 cpc r19, r23 9ac: b4 f3 brlt .-20 ; 0x99a { char t = str[j]; str[j] = str[i - 1 - j]; str[i -1 - j] = t; } str[i] = '\0'; 9ae: c8 0d add r28, r8 9b0: d9 1d adc r29, r9 9b2: 18 82 st Y, r1 return i; } 9b4: ca 01 movw r24, r20 9b6: df 91 pop r29 9b8: cf 91 pop r28 9ba: 1f 91 pop r17 9bc: ff 90 pop r15 9be: ef 90 pop r14 9c0: df 90 pop r13 9c2: cf 90 pop r12 9c4: bf 90 pop r11 9c6: af 90 pop r10 9c8: 9f 90 pop r9 9ca: 8f 90 pop r8 9cc: 08 95 ret 000009ce : int uint2str(char * str, uint integer) { 9ce: 0f 93 push r16 9d0: 1f 93 push r17 9d2: cf 93 push r28 9d4: df 93 push r29 9d6: 8c 01 movw r16, r24 9d8: 9b 01 movw r18, r22 uint8 base = 10; if (integer == 0) 9da: 61 15 cp r22, r1 9dc: 71 05 cpc r23, r1 9de: 19 f0 breq .+6 ; 0x9e6 9e0: 80 e0 ldi r24, 0x00 ; 0 9e2: 90 e0 ldi r25, 0x00 ; 0 9e4: 16 c0 rjmp .+44 ; 0xa12 { str[0] = '0'; 9e6: 80 e3 ldi r24, 0x30 ; 48 9e8: f8 01 movw r30, r16 9ea: 80 83 st Z, r24 str[1] = '\0'; 9ec: 11 82 std Z+1, r1 ; 0x01 9ee: 41 e0 ldi r20, 0x01 ; 1 9f0: 50 e0 ldi r21, 0x00 ; 0 9f2: 2f c0 rjmp .+94 ; 0xa52 int i = 0; uint remainder; while (integer >= base) { remainder = integer % base; 9f4: c9 01 movw r24, r18 9f6: 6a e0 ldi r22, 0x0A ; 10 9f8: 70 e0 ldi r23, 0x00 ; 0 9fa: 0e 94 1c 08 call 0x1038 ; 0x1038 <__udivmodhi4> 9fe: 48 2f mov r20, r24 integer = integer / base; a00: c9 01 movw r24, r18 a02: 6a e0 ldi r22, 0x0A ; 10 a04: 70 e0 ldi r23, 0x00 ; 0 a06: 0e 94 1c 08 call 0x1038 ; 0x1038 <__udivmodhi4> a0a: 9b 01 movw r18, r22 str[i] = (char)((uint)'0' + remainder); a0c: 40 5d subi r20, 0xD0 ; 208 a0e: 40 83 st Z, r20 ++i; a10: ce 01 movw r24, r28 a12: f8 01 movw r30, r16 a14: e8 0f add r30, r24 a16: f9 1f adc r31, r25 a18: ec 01 movw r28, r24 a1a: 21 96 adiw r28, 0x01 ; 1 } int i = 0; uint remainder; while (integer >= base) a1c: 2a 30 cpi r18, 0x0A ; 10 a1e: 31 05 cpc r19, r1 a20: 48 f7 brcc .-46 ; 0x9f4 ++i; } if (integer != 0) { str[i] = (char)((uint)'0' + integer); a22: 82 2f mov r24, r18 a24: 80 5d subi r24, 0xD0 ; 208 a26: 80 83 st Z, r24 ++i; a28: ae 01 movw r20, r28 } //reverse the string for (int j = 0; j < i/2; ++j) a2a: be 01 movw r22, r28 a2c: 75 95 asr r23 a2e: 67 95 ror r22 a30: d8 01 movw r26, r16 a32: 20 e0 ldi r18, 0x00 ; 0 a34: 30 e0 ldi r19, 0x00 ; 0 a36: 07 c0 rjmp .+14 ; 0xa46 { char t = str[j]; a38: 9c 91 ld r25, X str[j] = str[i - 1 - j]; a3a: 80 81 ld r24, Z a3c: 8d 93 st X+, r24 str[i -1 - j] = t; a3e: 90 83 st Z, r25 str[i] = (char)((uint)'0' + integer); ++i; } //reverse the string for (int j = 0; j < i/2; ++j) a40: 2f 5f subi r18, 0xFF ; 255 a42: 3f 4f sbci r19, 0xFF ; 255 a44: 31 97 sbiw r30, 0x01 ; 1 a46: 26 17 cp r18, r22 a48: 37 07 cpc r19, r23 a4a: b4 f3 brlt .-20 ; 0xa38 { char t = str[j]; str[j] = str[i - 1 - j]; str[i -1 - j] = t; } str[i] = '\0'; a4c: c0 0f add r28, r16 a4e: d1 1f adc r29, r17 a50: 18 82 st Y, r1 return i; } a52: ca 01 movw r24, r20 a54: df 91 pop r29 a56: cf 91 pop r28 a58: 1f 91 pop r17 a5a: 0f 91 pop r16 a5c: 08 95 ret 00000a5e : return s; } */ int str2str(char * str1, char * str2) { a5e: 20 e0 ldi r18, 0x00 ; 0 a60: 30 e0 ldi r19, 0x00 ; 0 a62: 03 c0 rjmp .+6 ; 0xa6a int i = 0; for (i = 0; str2[i] != '\0'; ++i) { str1[i] = str2[i]; a64: ec 93 st X, r30 } */ int str2str(char * str1, char * str2) { int i = 0; for (i = 0; str2[i] != '\0'; ++i) a66: 2f 5f subi r18, 0xFF ; 255 a68: 3f 4f sbci r19, 0xFF ; 255 a6a: fb 01 movw r30, r22 a6c: e2 0f add r30, r18 a6e: f3 1f adc r31, r19 a70: e0 81 ld r30, Z a72: dc 01 movw r26, r24 a74: a2 0f add r26, r18 a76: b3 1f adc r27, r19 a78: ee 23 and r30, r30 a7a: a1 f7 brne .-24 ; 0xa64 { str1[i] = str2[i]; } str1[i] = '\0'; a7c: 1c 92 st X, r1 return i; } a7e: c9 01 movw r24, r18 a80: 08 95 ret 00000a82 : { int s; int f; s = 0; for (f = 0; format[f] != '\0'; ++f) { if (format[f] == '%') a82: af 92 push r10 a84: bf 92 push r11 a86: cf 92 push r12 a88: df 92 push r13 a8a: ef 92 push r14 a8c: ff 92 push r15 a8e: 0f 93 push r16 a90: 1f 93 push r17 a92: cf 93 push r28 a94: df 93 push r29 a96: 7c 01 movw r14, r24 a98: 5b 01 movw r10, r22 a9a: da 01 movw r26, r20 a9c: c0 e0 ldi r28, 0x00 ; 0 a9e: d0 e0 ldi r29, 0x00 ; 0 aa0: cc 24 eor r12, r12 aa2: dd 24 eor r13, r13 aa4: 4f c0 rjmp .+158 ; 0xb44 aa6: 85 32 cpi r24, 0x25 ; 37 aa8: 09 f0 breq .+2 ; 0xaac aaa: 44 c0 rjmp .+136 ; 0xb34 { switch (format[f+1]) aac: 81 81 ldd r24, Z+1 ; 0x01 aae: 89 36 cpi r24, 0x69 ; 105 ab0: 81 f0 breq .+32 ; 0xad2 ab2: 8a 36 cpi r24, 0x6A ; 106 ab4: 28 f4 brcc .+10 ; 0xac0 ab6: 83 36 cpi r24, 0x63 ; 99 ab8: 91 f1 breq .+100 ; 0xb1e aba: 84 36 cpi r24, 0x64 ; 100 abc: 39 f4 brne .+14 ; 0xacc abe: 09 c0 rjmp .+18 ; 0xad2 ac0: 83 37 cpi r24, 0x73 ; 115 ac2: 11 f1 breq .+68 ; 0xb08 ac4: 85 37 cpi r24, 0x75 ; 117 ac6: 29 f0 breq .+10 ; 0xad2 ac8: 8c 36 cpi r24, 0x6C ; 108 aca: 71 f0 breq .+28 ; 0xae8 acc: cf ef ldi r28, 0xFF ; 255 ace: df ef ldi r29, 0xFF ; 255 ad0: 44 c0 rjmp .+136 ; 0xb5a { case 'd': case 'u': case 'i': { uint integer = va_arg(args, uint); ad2: 8d 01 movw r16, r26 ad4: 0e 5f subi r16, 0xFE ; 254 ad6: 1f 4f sbci r17, 0xFF ; 255 s += uint2str(str+s, integer); ad8: 6d 91 ld r22, X+ ada: 7c 91 ld r23, X adc: c7 01 movw r24, r14 ade: 8c 0f add r24, r28 ae0: 9d 1f adc r25, r29 ae2: 0e 94 e7 04 call 0x9ce ; 0x9ce ae6: 0c c0 rjmp .+24 ; 0xb00 break; } case 'l': { uint32 integer = va_arg(args, uint32); ae8: 8d 01 movw r16, r26 aea: 0c 5f subi r16, 0xFC ; 252 aec: 1f 4f sbci r17, 0xFF ; 255 s += luint2str(str+s, integer); aee: 4d 91 ld r20, X+ af0: 5d 91 ld r21, X+ af2: 6d 91 ld r22, X+ af4: 7c 91 ld r23, X af6: c7 01 movw r24, r14 af8: 8c 0f add r24, r28 afa: 9d 1f adc r25, r29 afc: 0e 94 80 04 call 0x900 ; 0x900 b00: c8 0f add r28, r24 b02: d9 1f adc r29, r25 b04: d8 01 movw r26, r16 b06: 12 c0 rjmp .+36 ; 0xb2c break; } case 's': { char * str2 = va_arg(args, char*); b08: 8d 01 movw r16, r26 b0a: 0e 5f subi r16, 0xFE ; 254 b0c: 1f 4f sbci r17, 0xFF ; 255 s += str2str(str+s, str2); b0e: 6d 91 ld r22, X+ b10: 7c 91 ld r23, X b12: c7 01 movw r24, r14 b14: 8c 0f add r24, r28 b16: 9d 1f adc r25, r29 b18: 0e 94 2f 05 call 0xa5e ; 0xa5e b1c: f1 cf rjmp .-30 ; 0xb00 // float flt = va_arg(args, double); // s += float2str(str+s, flt); // break; // } case 'c': str[s] = (char)(va_arg(args, int)); b1e: f7 01 movw r30, r14 b20: ec 0f add r30, r28 b22: fd 1f adc r31, r29 b24: 8c 91 ld r24, X b26: 80 83 st Z, r24 ++s; b28: 21 96 adiw r28, 0x01 ; 1 b2a: 12 96 adiw r26, 0x02 ; 2 break; case '\0': default: return -1; } ++f; b2c: 08 94 sec b2e: c1 1c adc r12, r1 b30: d1 1c adc r13, r1 b32: 05 c0 rjmp .+10 ; 0xb3e } else { str[s] = format[f]; b34: f7 01 movw r30, r14 b36: ec 0f add r30, r28 b38: fd 1f adc r31, r29 b3a: 80 83 st Z, r24 ++s; b3c: 21 96 adiw r28, 0x01 ; 1 int vsprintf(char * str, const char * format, va_list args) { int s; int f; s = 0; for (f = 0; format[f] != '\0'; ++f) b3e: 08 94 sec b40: c1 1c adc r12, r1 b42: d1 1c adc r13, r1 b44: f5 01 movw r30, r10 b46: ec 0d add r30, r12 b48: fd 1d adc r31, r13 b4a: 80 81 ld r24, Z b4c: 88 23 and r24, r24 b4e: 09 f0 breq .+2 ; 0xb52 b50: aa cf rjmp .-172 ; 0xaa6 { str[s] = format[f]; ++s; } } str[s] = '\0'; b52: ec 0e add r14, r28 b54: fd 1e adc r15, r29 b56: f7 01 movw r30, r14 b58: 10 82 st Z, r1 return s; } b5a: ce 01 movw r24, r28 b5c: df 91 pop r29 b5e: cf 91 pop r28 b60: 1f 91 pop r17 b62: 0f 91 pop r16 b64: ff 90 pop r15 b66: ef 90 pop r14 b68: df 90 pop r13 b6a: cf 90 pop r12 b6c: bf 90 pop r11 b6e: af 90 pop r10 b70: 08 95 ret 00000b72 : int sprintf(char * str, const char * format, ...) { b72: df 93 push r29 b74: cf 93 push r28 b76: cd b7 in r28, 0x3d ; 61 b78: de b7 in r29, 0x3e ; 62 b7a: 9e 01 movw r18, r28 b7c: 27 5f subi r18, 0xF7 ; 247 b7e: 3f 4f sbci r19, 0xFF ; 255 int result = 0; va_list args; va_start(args, format); result = vsprintf(str, format, args); b80: 8d 81 ldd r24, Y+5 ; 0x05 b82: 9e 81 ldd r25, Y+6 ; 0x06 b84: 6f 81 ldd r22, Y+7 ; 0x07 b86: 78 85 ldd r23, Y+8 ; 0x08 b88: a9 01 movw r20, r18 b8a: 0e 94 41 05 call 0xa82 ; 0xa82 va_end(args); return result; } b8e: cf 91 pop r28 b90: df 91 pop r29 b92: 08 95 ret 00000b94 : uint8 ParseCommand() { b94: af 92 push r10 b96: bf 92 push r11 b98: cf 92 push r12 b9a: df 92 push r13 b9c: ef 92 push r14 b9e: ff 92 push r15 ba0: 0f 93 push r16 ba2: 1f 93 push r17 ba4: df 93 push r29 ba6: cf 93 push r28 ba8: cd b7 in r28, 0x3d ; 61 baa: de b7 in r29, 0x3e ; 62 bac: 2a 97 sbiw r28, 0x0a ; 10 bae: 0f b6 in r0, 0x3f ; 63 bb0: f8 94 cli bb2: de bf out 0x3e, r29 ; 62 bb4: 0f be out 0x3f, r0 ; 63 bb6: cd bf out 0x3d, r28 ; 61 //return 0; USART_Tx('#'); bb8: 83 e2 ldi r24, 0x23 ; 35 bba: 0e 94 32 04 call 0x864 ; 0x864 char c = USART_Rx(); bbe: 0e 94 3b 04 call 0x876 ; 0x876 bc2: c8 2e mov r12, r24 LCD_puts("input"); bc4: 84 e1 ldi r24, 0x14 ; 20 bc6: 91 e0 ldi r25, 0x01 ; 1 bc8: 0e 94 0c 02 call 0x418 ; 0x418 char arg[MAX_TOKEN_SIZE]; USART_Tx(c); bcc: 8c 2d mov r24, r12 bce: 0e 94 32 04 call 0x864 ; 0x864 bd2: dd 24 eor r13, r13 uint8 i = 0; do { arg[i] = USART_Rx(); bd4: 5e 01 movw r10, r28 bd6: 08 94 sec bd8: a1 1c adc r10, r1 bda: b1 1c adc r11, r1 bdc: ed 2c mov r14, r13 bde: ff 24 eor r15, r15 be0: 0e 94 3b 04 call 0x876 ; 0x876 be4: 85 01 movw r16, r10 be6: 0e 0d add r16, r14 be8: 1f 1d adc r17, r15 bea: d8 01 movw r26, r16 bec: 8c 93 st X, r24 USART_Tx(arg[i]); bee: 0e 94 32 04 call 0x864 ; 0x864 switch (arg[i]) bf2: f8 01 movw r30, r16 bf4: 00 81 ld r16, Z bf6: 0d 30 cpi r16, 0x0D ; 13 bf8: 49 f0 breq .+18 ; 0xc0c bfa: 0e 30 cpi r16, 0x0E ; 14 bfc: 18 f4 brcc .+6 ; 0xc04 bfe: 0a 30 cpi r16, 0x0A ; 10 c00: 49 f4 brne .+18 ; 0xc14 c02: 04 c0 rjmp .+8 ; 0xc0c c04: 00 32 cpi r16, 0x20 ; 32 c06: 39 f0 breq .+14 ; 0xc16 c08: 0b 33 cpi r16, 0x3B ; 59 c0a: 21 f4 brne .+8 ; 0xc14 case ' ': break; case ';': case '\r': case '\n': arg[i] = '\0'; c0c: ea 0c add r14, r10 c0e: fb 1c adc r15, r11 c10: d7 01 movw r26, r14 c12: 1c 92 st X, r1 default: ++i; c14: d3 94 inc r13 break; } } while ((arg[i-1] != '\0') && (i < MAX_TOKEN_SIZE)); c16: ed 2c mov r14, r13 c18: ff 24 eor r15, r15 c1a: 87 01 movw r16, r14 c1c: 01 50 subi r16, 0x01 ; 1 c1e: 10 40 sbci r17, 0x00 ; 0 c20: f5 01 movw r30, r10 c22: e0 0f add r30, r16 c24: f1 1f adc r31, r17 c26: 80 81 ld r24, Z c28: 88 23 and r24, r24 c2a: 19 f0 breq .+6 ; 0xc32 c2c: b9 e0 ldi r27, 0x09 ; 9 c2e: bd 15 cp r27, r13 c30: a8 f6 brcc .-86 ; 0xbdc USART_printf("\r\n"); c32: 00 d0 rcall .+0 ; 0xc34 c34: 8a e1 ldi r24, 0x1A ; 26 c36: 91 e0 ldi r25, 0x01 ; 1 c38: ed b7 in r30, 0x3d ; 61 c3a: fe b7 in r31, 0x3e ; 62 c3c: 92 83 std Z+2, r25 ; 0x02 c3e: 81 83 std Z+1, r24 ; 0x01 c40: 0e 94 4c 04 call 0x898 ; 0x898 if (arg[i-1] != '\0') c44: fe 01 movw r30, r28 c46: 31 96 adiw r30, 0x01 ; 1 c48: 0e 0f add r16, r30 c4a: 1f 1f adc r17, r31 c4c: 0f 90 pop r0 c4e: 0f 90 pop r0 c50: d8 01 movw r26, r16 c52: 8c 91 ld r24, X c54: 88 23 and r24, r24 c56: 79 f0 breq .+30 ; 0xc76 { LCD_puts("?"); c58: 8d e1 ldi r24, 0x1D ; 29 c5a: 91 e0 ldi r25, 0x01 ; 1 c5c: 0e 94 0c 02 call 0x418 ; 0x418 USART_printf("?\r\n"); c60: 00 d0 rcall .+0 ; 0xc62 c62: 8f e1 ldi r24, 0x1F ; 31 c64: 91 e0 ldi r25, 0x01 ; 1 c66: ed b7 in r30, 0x3d ; 61 c68: fe b7 in r31, 0x3e ; 62 c6a: 92 83 std Z+2, r25 ; 0x02 c6c: 81 83 std Z+1, r24 ; 0x01 c6e: 0e 94 4c 04 call 0x898 ; 0x898 c72: 8f ef ldi r24, 0xFF ; 255 c74: 2d c0 rjmp .+90 ; 0xcd0 return 255; } arg[i] = '\0'; c76: ee 0d add r30, r14 c78: ff 1d adc r31, r15 c7a: 10 82 st Z, r1 command funct = NULL; switch (c) c7c: f4 e6 ldi r31, 0x64 ; 100 c7e: cf 16 cp r12, r31 c80: 91 f0 breq .+36 ; 0xca6 c82: fc 15 cp r31, r12 c84: 20 f0 brcs .+8 ; 0xc8e c86: 8d e0 ldi r24, 0x0D ; 13 c88: c8 16 cp r12, r24 c8a: a1 f4 brne .+40 ; 0xcb4 c8c: 06 c0 rjmp .+12 ; 0xc9a c8e: a0 e7 ldi r26, 0x70 ; 112 c90: ca 16 cp r12, r26 c92: 31 f0 breq .+12 ; 0xca0 c94: b2 e7 ldi r27, 0x72 ; 114 c96: cb 16 cp r12, r27 c98: 69 f4 brne .+26 ; 0xcb4 c9a: ec ea ldi r30, 0xAC ; 172 c9c: f6 e0 ldi r31, 0x06 ; 6 c9e: 05 c0 rjmp .+10 ; 0xcaa ca0: ee e1 ldi r30, 0x1E ; 30 ca2: f7 e0 ldi r31, 0x07 ; 7 ca4: 02 c0 rjmp .+4 ; 0xcaa case 'r': funct = &read; break; case 'p': funct = &poll; break; ca6: eb e7 ldi r30, 0x7B ; 123 ca8: f6 e0 ldi r31, 0x06 ; 6 // break; default: break; } if (funct == NULL || funct(arg) != 0) caa: ce 01 movw r24, r28 cac: 01 96 adiw r24, 0x01 ; 1 cae: 09 95 icall cb0: 88 23 and r24, r24 cb2: 81 f0 breq .+32 ; 0xcd4 { LCD_puts("?"); cb4: 8d e1 ldi r24, 0x1D ; 29 cb6: 91 e0 ldi r25, 0x01 ; 1 cb8: 0e 94 0c 02 call 0x418 ; 0x418 USART_printf("?\r\n"); cbc: 00 d0 rcall .+0 ; 0xcbe cbe: 8f e1 ldi r24, 0x1F ; 31 cc0: 91 e0 ldi r25, 0x01 ; 1 cc2: ed b7 in r30, 0x3d ; 61 cc4: fe b7 in r31, 0x3e ; 62 cc6: 92 83 std Z+2, r25 ; 0x02 cc8: 81 83 std Z+1, r24 ; 0x01 cca: 0e 94 4c 04 call 0x898 ; 0x898 cce: 8e ef ldi r24, 0xFE ; 254 cd0: 0f 90 pop r0 cd2: 0f 90 pop r0 return 254; } return 0; } cd4: 2a 96 adiw r28, 0x0a ; 10 cd6: 0f b6 in r0, 0x3f ; 63 cd8: f8 94 cli cda: de bf out 0x3e, r29 ; 62 cdc: 0f be out 0x3f, r0 ; 63 cde: cd bf out 0x3d, r28 ; 61 ce0: cf 91 pop r28 ce2: df 91 pop r29 ce4: 1f 91 pop r17 ce6: 0f 91 pop r16 ce8: ff 90 pop r15 cea: ef 90 pop r14 cec: df 90 pop r13 cee: cf 90 pop r12 cf0: bf 90 pop r11 cf2: af 90 pop r10 cf4: 08 95 ret 00000cf6 : LCD_Colon(0); return 0; } uint8 dac(char * arg) { cf6: fc 01 movw r30, r24 if (arg[0] != '\0') cf8: 80 81 ld r24, Z cfa: 88 23 and r24, r24 cfc: 49 f0 breq .+18 ; 0xd10 { setup.dac_value = atoi(arg); cfe: cf 01 movw r24, r30 d00: 0e 94 52 08 call 0x10a4 ; 0x10a4 d04: 90 93 92 01 sts 0x0192, r25 d08: 80 93 91 01 sts 0x0191, r24 DAC_Set(setup.dac_value); d0c: 0e 94 a8 07 call 0xf50 ; 0xf50 } USART_printf("# DAC %i\r\n", setup.dac_value); d10: 00 d0 rcall .+0 ; 0xd12 d12: 00 d0 rcall .+0 ; 0xd14 d14: 83 e2 ldi r24, 0x23 ; 35 d16: 91 e0 ldi r25, 0x01 ; 1 d18: ed b7 in r30, 0x3d ; 61 d1a: fe b7 in r31, 0x3e ; 62 d1c: 92 83 std Z+2, r25 ; 0x02 d1e: 81 83 std Z+1, r24 ; 0x01 d20: 80 91 91 01 lds r24, 0x0191 d24: 90 91 92 01 lds r25, 0x0192 d28: 94 83 std Z+4, r25 ; 0x04 d2a: 83 83 std Z+3, r24 ; 0x03 d2c: 0e 94 4c 04 call 0x898 ; 0x898 LCD_printf("DAC %i", setup.dac_value); d30: 8e e2 ldi r24, 0x2E ; 46 d32: 91 e0 ldi r25, 0x01 ; 1 d34: ed b7 in r30, 0x3d ; 61 d36: fe b7 in r31, 0x3e ; 62 d38: 92 83 std Z+2, r25 ; 0x02 d3a: 81 83 std Z+1, r24 ; 0x01 d3c: 80 91 91 01 lds r24, 0x0191 d40: 90 91 92 01 lds r25, 0x0192 d44: 94 83 std Z+4, r25 ; 0x04 d46: 83 83 std Z+3, r24 ; 0x03 d48: 0e 94 0d 03 call 0x61a ; 0x61a d4c: 0f 90 pop r0 d4e: 0f 90 pop r0 d50: 0f 90 pop r0 d52: 0f 90 pop r0 return 0; } d54: 80 e0 ldi r24, 0x00 ; 0 d56: 08 95 ret 00000d58 : #include #include uint8 read(char * arg) { d58: ef 92 push r14 d5a: ff 92 push r15 d5c: 0f 93 push r16 d5e: 1f 93 push r17 d60: cf 93 push r28 d62: df 93 push r29 d64: 8c 01 movw r16, r24 if (arg[0] == '\0') d66: dc 01 movw r26, r24 d68: 8c 91 ld r24, X d6a: 88 23 and r24, r24 d6c: 31 f0 breq .+12 ; 0xd7a d6e: e8 01 movw r28, r16 { for (char * a = arg; *a != '\0'; ++a) { //uint8 channel = *a - '0'; //if (channel >= 0 && channel <= 7) USART_printf("%i ", ADC_read(*a - '0')); d70: 95 e3 ldi r25, 0x35 ; 53 d72: e9 2e mov r14, r25 d74: 91 e0 ldi r25, 0x01 ; 1 d76: f9 2e mov r15, r25 d78: 2e c0 rjmp .+92 ; 0xdd6 #include uint8 read(char * arg) { if (arg[0] == '\0') d7a: 10 e0 ldi r17, 0x00 ; 0 { for (uint8 i=0; i < 8; ++i) { USART_printf("%i ", ADC_read(i)); d7c: c5 e3 ldi r28, 0x35 ; 53 d7e: d1 e0 ldi r29, 0x01 ; 1 d80: 81 2f mov r24, r17 d82: 0e 94 83 00 call 0x106 ; 0x106 d86: 00 d0 rcall .+0 ; 0xd88 d88: 00 d0 rcall .+0 ; 0xd8a d8a: ed b7 in r30, 0x3d ; 61 d8c: fe b7 in r31, 0x3e ; 62 d8e: d2 83 std Z+2, r29 ; 0x02 d90: c1 83 std Z+1, r28 ; 0x01 d92: 94 83 std Z+4, r25 ; 0x04 d94: 83 83 std Z+3, r24 ; 0x03 d96: 0e 94 4c 04 call 0x898 ; 0x898 uint8 read(char * arg) { if (arg[0] == '\0') { for (uint8 i=0; i < 8; ++i) d9a: 1f 5f subi r17, 0xFF ; 255 d9c: 0f 90 pop r0 d9e: 0f 90 pop r0 da0: 0f 90 pop r0 da2: 0f 90 pop r0 da4: 18 30 cpi r17, 0x08 ; 8 da6: 61 f7 brne .-40 ; 0xd80 da8: 34 c0 rjmp .+104 ; 0xe12 { for (char * a = arg; *a != '\0'; ++a) { //uint8 channel = *a - '0'; //if (channel >= 0 && channel <= 7) USART_printf("%i ", ADC_read(*a - '0')); daa: 80 53 subi r24, 0x30 ; 48 dac: 0e 94 83 00 call 0x106 ; 0x106 db0: 00 d0 rcall .+0 ; 0xdb2 db2: 00 d0 rcall .+0 ; 0xdb4 db4: ad b7 in r26, 0x3d ; 61 db6: be b7 in r27, 0x3e ; 62 db8: 12 96 adiw r26, 0x02 ; 2 dba: fc 92 st X, r15 dbc: ee 92 st -X, r14 dbe: 11 97 sbiw r26, 0x01 ; 1 dc0: 14 96 adiw r26, 0x04 ; 4 dc2: 9c 93 st X, r25 dc4: 8e 93 st -X, r24 dc6: 13 97 sbiw r26, 0x03 ; 3 dc8: 0e 94 4c 04 call 0x898 ; 0x898 USART_printf("%i ", ADC_read(i)); } } else { for (char * a = arg; *a != '\0'; ++a) dcc: 21 96 adiw r28, 0x01 ; 1 dce: 0f 90 pop r0 dd0: 0f 90 pop r0 dd2: 0f 90 pop r0 dd4: 0f 90 pop r0 dd6: 88 81 ld r24, Y dd8: 88 23 and r24, r24 dda: 39 f7 brne .-50 ; 0xdaa { //uint8 channel = *a - '0'; //if (channel >= 0 && channel <= 7) USART_printf("%i ", ADC_read(*a - '0')); } LCD_printf("%i", setup.adc_values[(int)(arg[0] - '0')]); ddc: 00 d0 rcall .+0 ; 0xdde dde: 00 d0 rcall .+0 ; 0xde0 de0: 89 e3 ldi r24, 0x39 ; 57 de2: 91 e0 ldi r25, 0x01 ; 1 de4: ed b7 in r30, 0x3d ; 61 de6: fe b7 in r31, 0x3e ; 62 de8: 92 83 std Z+2, r25 ; 0x02 dea: 81 83 std Z+1, r24 ; 0x01 dec: d8 01 movw r26, r16 dee: ec 91 ld r30, X df0: f0 e0 ldi r31, 0x00 ; 0 df2: ee 0f add r30, r30 df4: ff 1f adc r31, r31 df6: ed 5c subi r30, 0xCD ; 205 df8: fe 4f sbci r31, 0xFE ; 254 dfa: 80 81 ld r24, Z dfc: 91 81 ldd r25, Z+1 ; 0x01 dfe: ed b7 in r30, 0x3d ; 61 e00: fe b7 in r31, 0x3e ; 62 e02: 94 83 std Z+4, r25 ; 0x04 e04: 83 83 std Z+3, r24 ; 0x03 e06: 0e 94 0d 03 call 0x61a ; 0x61a e0a: 0f 90 pop r0 e0c: 0f 90 pop r0 e0e: 0f 90 pop r0 e10: 0f 90 pop r0 } USART_printf("\r\n"); e12: 00 d0 rcall .+0 ; 0xe14 e14: 8c e3 ldi r24, 0x3C ; 60 e16: 91 e0 ldi r25, 0x01 ; 1 e18: ad b7 in r26, 0x3d ; 61 e1a: be b7 in r27, 0x3e ; 62 e1c: 12 96 adiw r26, 0x02 ; 2 e1e: 9c 93 st X, r25 e20: 8e 93 st -X, r24 e22: 11 97 sbiw r26, 0x01 ; 1 e24: 0e 94 4c 04 call 0x898 ; 0x898 e28: 0f 90 pop r0 e2a: 0f 90 pop r0 return 0; } e2c: 80 e0 ldi r24, 0x00 ; 0 e2e: df 91 pop r29 e30: cf 91 pop r28 e32: 1f 91 pop r17 e34: 0f 91 pop r16 e36: ff 90 pop r15 e38: ef 90 pop r14 e3a: 08 95 ret 00000e3c : uint8 poll(char * arg) { e3c: cf 92 push r12 e3e: df 92 push r13 e40: ef 92 push r14 e42: ff 92 push r15 e44: 0f 93 push r16 e46: 1f 93 push r17 e48: cf 93 push r28 e4a: df 93 push r29 e4c: ec 01 movw r28, r24 uint32 tmr = 0; USART_printf("# poll\r\n"); e4e: 00 d0 rcall .+0 ; 0xe50 e50: 8f e3 ldi r24, 0x3F ; 63 e52: 91 e0 ldi r25, 0x01 ; 1 e54: ed b7 in r30, 0x3d ; 61 e56: fe b7 in r31, 0x3e ; 62 e58: 92 83 std Z+2, r25 ; 0x02 e5a: 81 83 std Z+1, r24 ; 0x01 e5c: 0e 94 4c 04 call 0x898 ; 0x898 LCD_puts("poll"); e60: 0f 90 pop r0 e62: 0f 90 pop r0 e64: 88 e4 ldi r24, 0x48 ; 72 e66: 91 e0 ldi r25, 0x01 ; 1 e68: 0e 94 0c 02 call 0x418 ; 0x418 e6c: ee 24 eor r14, r14 e6e: ff 24 eor r15, r15 e70: 87 01 movw r16, r14 //USART_printf("#t ADC0 ADC1 ADC2 ADC3 ADC4 ADC5 ADC6 ADC7\r\n); do { setup.elapsed_time = 0; USART_printf("%l ", tmr); e72: 2d e4 ldi r18, 0x4D ; 77 e74: c2 2e mov r12, r18 e76: 21 e0 ldi r18, 0x01 ; 1 e78: d2 2e mov r13, r18 USART_printf("# poll\r\n"); LCD_puts("poll"); //USART_printf("#t ADC0 ADC1 ADC2 ADC3 ADC4 ADC5 ADC6 ADC7\r\n); do { setup.elapsed_time = 0; e7a: 10 92 8d 01 sts 0x018D, r1 e7e: 10 92 8e 01 sts 0x018E, r1 e82: 10 92 8f 01 sts 0x018F, r1 e86: 10 92 90 01 sts 0x0190, r1 USART_printf("%l ", tmr); e8a: 00 d0 rcall .+0 ; 0xe8c e8c: 00 d0 rcall .+0 ; 0xe8e e8e: 00 d0 rcall .+0 ; 0xe90 e90: ed b7 in r30, 0x3d ; 61 e92: fe b7 in r31, 0x3e ; 62 e94: d2 82 std Z+2, r13 ; 0x02 e96: c1 82 std Z+1, r12 ; 0x01 e98: e3 82 std Z+3, r14 ; 0x03 e9a: f4 82 std Z+4, r15 ; 0x04 e9c: 05 83 std Z+5, r16 ; 0x05 e9e: 16 83 std Z+6, r17 ; 0x06 ea0: 0e 94 4c 04 call 0x898 ; 0x898 read(arg); ea4: 8d b7 in r24, 0x3d ; 61 ea6: 9e b7 in r25, 0x3e ; 62 ea8: 06 96 adiw r24, 0x06 ; 6 eaa: 0f b6 in r0, 0x3f ; 63 eac: f8 94 cli eae: 9e bf out 0x3e, r25 ; 62 eb0: 0f be out 0x3f, r0 ; 63 eb2: 8d bf out 0x3d, r24 ; 61 eb4: ce 01 movw r24, r28 eb6: 0e 94 ac 06 call 0xd58 ; 0xd58 if (arg[0] == '\0' || arg[1] == 't') eba: 88 81 ld r24, Y ebc: 88 23 and r24, r24 ebe: 19 f0 breq .+6 ; 0xec6 ec0: 89 81 ldd r24, Y+1 ; 0x01 ec2: 84 37 cpi r24, 0x74 ; 116 ec4: 61 f4 brne .+24 ; 0xede { LCD_Colon(1); ec6: 81 e0 ldi r24, 0x01 ; 1 ec8: 0e 94 4a 02 call 0x494 ; 0x494 LCD_ShowTime(tmr); ecc: c8 01 movw r24, r16 ece: b7 01 movw r22, r14 ed0: 0e 94 64 02 call 0x4c8 ; 0x4c8 ed4: 04 c0 rjmp .+8 ; 0xede // return 255; //} while (setup.elapsed_time < setup.poll_delay) { if (USART_Poll() != '\0') ed6: 0e 94 43 04 call 0x886 ; 0x886 eda: 88 23 and r24, r24 edc: 29 f5 brne .+74 ; 0xf28 //{ // USART_printf("# tmr>delay\r\n"); // return 255; //} while (setup.elapsed_time < setup.poll_delay) ede: 20 91 8d 01 lds r18, 0x018D ee2: 30 91 8e 01 lds r19, 0x018E ee6: 40 91 8f 01 lds r20, 0x018F eea: 50 91 90 01 lds r21, 0x0190 eee: 80 91 85 01 lds r24, 0x0185 ef2: 90 91 86 01 lds r25, 0x0186 ef6: a0 e0 ldi r26, 0x00 ; 0 ef8: b0 e0 ldi r27, 0x00 ; 0 efa: 28 17 cp r18, r24 efc: 39 07 cpc r19, r25 efe: 4a 07 cpc r20, r26 f00: 5b 07 cpc r21, r27 f02: 48 f3 brcs .-46 ; 0xed6 //USART_printf("# STOP %i\r\n", tmr+setup.elapsed_time); LCD_Colon(0); return 0; } } tmr += setup.elapsed_time; f04: e2 0e add r14, r18 f06: f3 1e adc r15, r19 f08: 04 1f adc r16, r20 f0a: 15 1f adc r17, r21 } while (tmr < setup.poll_timeout); f0c: 80 91 89 01 lds r24, 0x0189 f10: 90 91 8a 01 lds r25, 0x018A f14: a0 91 8b 01 lds r26, 0x018B f18: b0 91 8c 01 lds r27, 0x018C f1c: e8 16 cp r14, r24 f1e: f9 06 cpc r15, r25 f20: 0a 07 cpc r16, r26 f22: 1b 07 cpc r17, r27 f24: 08 f4 brcc .+2 ; 0xf28 f26: a9 cf rjmp .-174 ; 0xe7a //USART_printf("# done.\r\n"); LCD_Colon(0); f28: 80 e0 ldi r24, 0x00 ; 0 f2a: 0e 94 4a 02 call 0x494 ; 0x494 return 0; } f2e: 80 e0 ldi r24, 0x00 ; 0 f30: df 91 pop r29 f32: cf 91 pop r28 f34: 1f 91 pop r17 f36: 0f 91 pop r16 f38: ff 90 pop r15 f3a: ef 90 pop r14 f3c: df 90 pop r13 f3e: cf 90 pop r12 f40: 08 95 ret 00000f42 : void DAC_Init(void) { //prevDDR = DAC_DDR; //prevPORT = DAC_PORT; DAC_DDR = 0xFF & ~(1<: void DAC_Set(int output) { f50: ac 01 movw r20, r24 void DAC_Init(void) { //prevDDR = DAC_DDR; //prevPORT = DAC_PORT; DAC_DDR = 0xFF & ~(1< DAC_PORT |= (1< while (SCK_ON); f6c: 2b 99 sbic 0x05, 3 ; 5 f6e: fe cf rjmp .-4 ; 0xf6c //Wait for clock off //Set CS low DAC_PORT &= ~(1< while (SCK_ON); f78: 2b 99 sbic 0x05, 3 ; 5 f7a: fe cf rjmp .-4 ; 0xf78 //BUF DAC_PORT |= (1< while (SCK_ON); f82: 2b 99 sbic 0x05, 3 ; 5 f84: fe cf rjmp .-4 ; 0xf82 //GA if (output > 0xFFF) f86: 80 e1 ldi r24, 0x10 ; 16 f88: 40 30 cpi r20, 0x00 ; 0 f8a: 58 07 cpc r21, r24 f8c: 24 f0 brlt .+8 ; 0xf96 { DAC_PORT &= ~(1< } else DAC_PORT |= (1< while (SCK_ON); f9c: 2b 99 sbic 0x05, 3 ; 5 f9e: fe cf rjmp .-4 ; 0xf9c //SHDN DAC_PORT |= (1< while (SCK_ON); fa6: 2b 99 sbic 0x05, 3 ; 5 fa8: fe cf rjmp .-4 ; 0xfa6 faa: 2b e0 ldi r18, 0x0B ; 11 fac: 30 e0 ldi r19, 0x00 ; 0 //Now send the 12 data bits for (int i=1; i <= 12; ++i) { if ((output & (1<<(12-i))) == 0x00) fae: ca 01 movw r24, r20 fb0: 02 2e mov r0, r18 fb2: 02 c0 rjmp .+4 ; 0xfb8 fb4: 95 95 asr r25 fb6: 87 95 ror r24 fb8: 0a 94 dec r0 fba: e2 f7 brpl .-8 ; 0xfb4 fbc: 80 fd sbrc r24, 0 fbe: 02 c0 rjmp .+4 ; 0xfc4 DAC_PORT &= ~(1< else DAC_PORT |= (1< while (SCK_ON); fca: 2b 99 sbic 0x05, 3 ; 5 fcc: fe cf rjmp .-4 ; 0xfca fce: 21 50 subi r18, 0x01 ; 1 fd0: 30 40 sbci r19, 0x00 ; 0 while (SCK_OFF); while (SCK_ON); //Now send the 12 data bits for (int i=1; i <= 12; ++i) fd2: 8f ef ldi r24, 0xFF ; 255 fd4: 2f 3f cpi r18, 0xFF ; 255 fd6: 38 07 cpc r19, r24 fd8: 51 f7 brne .-44 ; 0xfae while (SCK_OFF); while (SCK_ON); } // Set CS to 1 DAC_PORT |= (1< while (SCK_ON); fe0: 2b 99 sbic 0x05, 3 ; 5 fe2: fe cf rjmp .-4 ; 0xfe0 //Toggle LDAC DAC_PORT &= ~(1< while (SCK_ON); fea: 2b 99 sbic 0x05, 3 ; 5 fec: fe cf rjmp .-4 ; 0xfea DAC_PORT |= (1< while (SCK_ON); ff4: 2b 99 sbic 0x05, 3 ; 5 ff6: fe cf rjmp .-4 ; 0xff4 } ff8: 08 95 ret 00000ffa <__mulsi3>: ffa: 62 9f mul r22, r18 ffc: d0 01 movw r26, r0 ffe: 73 9f mul r23, r19 1000: f0 01 movw r30, r0 1002: 82 9f mul r24, r18 1004: e0 0d add r30, r0 1006: f1 1d adc r31, r1 1008: 64 9f mul r22, r20 100a: e0 0d add r30, r0 100c: f1 1d adc r31, r1 100e: 92 9f mul r25, r18 1010: f0 0d add r31, r0 1012: 83 9f mul r24, r19 1014: f0 0d add r31, r0 1016: 74 9f mul r23, r20 1018: f0 0d add r31, r0 101a: 65 9f mul r22, r21 101c: f0 0d add r31, r0 101e: 99 27 eor r25, r25 1020: 72 9f mul r23, r18 1022: b0 0d add r27, r0 1024: e1 1d adc r30, r1 1026: f9 1f adc r31, r25 1028: 63 9f mul r22, r19 102a: b0 0d add r27, r0 102c: e1 1d adc r30, r1 102e: f9 1f adc r31, r25 1030: bd 01 movw r22, r26 1032: cf 01 movw r24, r30 1034: 11 24 eor r1, r1 1036: 08 95 ret 00001038 <__udivmodhi4>: 1038: aa 1b sub r26, r26 103a: bb 1b sub r27, r27 103c: 51 e1 ldi r21, 0x11 ; 17 103e: 07 c0 rjmp .+14 ; 0x104e <__udivmodhi4_ep> 00001040 <__udivmodhi4_loop>: 1040: aa 1f adc r26, r26 1042: bb 1f adc r27, r27 1044: a6 17 cp r26, r22 1046: b7 07 cpc r27, r23 1048: 10 f0 brcs .+4 ; 0x104e <__udivmodhi4_ep> 104a: a6 1b sub r26, r22 104c: b7 0b sbc r27, r23 0000104e <__udivmodhi4_ep>: 104e: 88 1f adc r24, r24 1050: 99 1f adc r25, r25 1052: 5a 95 dec r21 1054: a9 f7 brne .-22 ; 0x1040 <__udivmodhi4_loop> 1056: 80 95 com r24 1058: 90 95 com r25 105a: bc 01 movw r22, r24 105c: cd 01 movw r24, r26 105e: 08 95 ret 00001060 <__udivmodsi4>: 1060: a1 e2 ldi r26, 0x21 ; 33 1062: 1a 2e mov r1, r26 1064: aa 1b sub r26, r26 1066: bb 1b sub r27, r27 1068: fd 01 movw r30, r26 106a: 0d c0 rjmp .+26 ; 0x1086 <__udivmodsi4_ep> 0000106c <__udivmodsi4_loop>: 106c: aa 1f adc r26, r26 106e: bb 1f adc r27, r27 1070: ee 1f adc r30, r30 1072: ff 1f adc r31, r31 1074: a2 17 cp r26, r18 1076: b3 07 cpc r27, r19 1078: e4 07 cpc r30, r20 107a: f5 07 cpc r31, r21 107c: 20 f0 brcs .+8 ; 0x1086 <__udivmodsi4_ep> 107e: a2 1b sub r26, r18 1080: b3 0b sbc r27, r19 1082: e4 0b sbc r30, r20 1084: f5 0b sbc r31, r21 00001086 <__udivmodsi4_ep>: 1086: 66 1f adc r22, r22 1088: 77 1f adc r23, r23 108a: 88 1f adc r24, r24 108c: 99 1f adc r25, r25 108e: 1a 94 dec r1 1090: 69 f7 brne .-38 ; 0x106c <__udivmodsi4_loop> 1092: 60 95 com r22 1094: 70 95 com r23 1096: 80 95 com r24 1098: 90 95 com r25 109a: 9b 01 movw r18, r22 109c: ac 01 movw r20, r24 109e: bd 01 movw r22, r26 10a0: cf 01 movw r24, r30 10a2: 08 95 ret 000010a4 : 10a4: fc 01 movw r30, r24 10a6: 88 27 eor r24, r24 10a8: 99 27 eor r25, r25 10aa: e8 94 clt 10ac: 21 91 ld r18, Z+ 10ae: 20 32 cpi r18, 0x20 ; 32 10b0: e9 f3 breq .-6 ; 0x10ac 10b2: 29 30 cpi r18, 0x09 ; 9 10b4: 10 f0 brcs .+4 ; 0x10ba 10b6: 2e 30 cpi r18, 0x0E ; 14 10b8: c8 f3 brcs .-14 ; 0x10ac 10ba: 2b 32 cpi r18, 0x2B ; 43 10bc: 41 f0 breq .+16 ; 0x10ce 10be: 2d 32 cpi r18, 0x2D ; 45 10c0: 39 f4 brne .+14 ; 0x10d0 10c2: 68 94 set 10c4: 04 c0 rjmp .+8 ; 0x10ce 10c6: 0e 94 70 08 call 0x10e0 ; 0x10e0 <__mulhi_const_10> 10ca: 82 0f add r24, r18 10cc: 91 1d adc r25, r1 10ce: 21 91 ld r18, Z+ 10d0: 20 53 subi r18, 0x30 ; 48 10d2: 2a 30 cpi r18, 0x0A ; 10 10d4: c0 f3 brcs .-16 ; 0x10c6 10d6: 1e f4 brtc .+6 ; 0x10de 10d8: 90 95 com r25 10da: 81 95 neg r24 10dc: 9f 4f sbci r25, 0xFF ; 255 10de: 08 95 ret 000010e0 <__mulhi_const_10>: 10e0: 7a e0 ldi r23, 0x0A ; 10 10e2: 97 9f mul r25, r23 10e4: 90 2d mov r25, r0 10e6: 87 9f mul r24, r23 10e8: 80 2d mov r24, r0 10ea: 91 0d add r25, r1 10ec: 11 24 eor r1, r1 10ee: 08 95 ret 000010f0 <_exit>: 10f0: f8 94 cli 000010f2 <__stop_program>: 10f2: ff cf rjmp .-2 ; 0x10f2 <__stop_program>