diff --git a/MIC-Week1/Debug/MIC-Week1.eep b/MIC-Week1/Debug/MIC-Week1.eep new file mode 100644 index 0000000..7c166a1 --- /dev/null +++ b/MIC-Week1/Debug/MIC-Week1.eep @@ -0,0 +1 @@ +:00000001FF diff --git a/MIC-Week1/Debug/MIC-Week1.lss b/MIC-Week1/Debug/MIC-Week1.lss new file mode 100644 index 0000000..56d3a86 --- /dev/null +++ b/MIC-Week1/Debug/MIC-Week1.lss @@ -0,0 +1,195 @@ + +MIC-Week1.elf: file format elf32-avr + +Sections: +Idx Name Size VMA LMA File off Algn + 0 .data 00000000 00800100 00800100 00000136 2**0 + CONTENTS, ALLOC, LOAD, DATA + 1 .text 000000e2 00000000 00000000 00000054 2**1 + CONTENTS, ALLOC, LOAD, READONLY, CODE + 2 .comment 00000030 00000000 00000000 00000136 2**0 + CONTENTS, READONLY + 3 .note.gnu.avr.deviceinfo 0000003c 00000000 00000000 00000168 2**2 + CONTENTS, READONLY + 4 .debug_aranges 00000028 00000000 00000000 000001a4 2**0 + CONTENTS, READONLY, DEBUGGING + 5 .debug_info 0000017b 00000000 00000000 000001cc 2**0 + CONTENTS, READONLY, DEBUGGING + 6 .debug_abbrev 00000115 00000000 00000000 00000347 2**0 + CONTENTS, READONLY, DEBUGGING + 7 .debug_line 00000173 00000000 00000000 0000045c 2**0 + CONTENTS, READONLY, DEBUGGING + 8 .debug_frame 00000034 00000000 00000000 000005d0 2**2 + CONTENTS, READONLY, DEBUGGING + 9 .debug_str 0000017c 00000000 00000000 00000604 2**0 + CONTENTS, READONLY, DEBUGGING + 10 .debug_loc 0000006a 00000000 00000000 00000780 2**0 + CONTENTS, READONLY, DEBUGGING + 11 .debug_ranges 00000018 00000000 00000000 000007ea 2**0 + CONTENTS, READONLY, DEBUGGING + +Disassembly of section .text: + +00000000 <__vectors>: + 0: 45 c0 rjmp .+138 ; 0x8c <__ctors_end> + 2: 00 00 nop + 4: 4b c0 rjmp .+150 ; 0x9c <__bad_interrupt> + 6: 00 00 nop + 8: 49 c0 rjmp .+146 ; 0x9c <__bad_interrupt> + a: 00 00 nop + c: 47 c0 rjmp .+142 ; 0x9c <__bad_interrupt> + e: 00 00 nop + 10: 45 c0 rjmp .+138 ; 0x9c <__bad_interrupt> + 12: 00 00 nop + 14: 43 c0 rjmp .+134 ; 0x9c <__bad_interrupt> + 16: 00 00 nop + 18: 41 c0 rjmp .+130 ; 0x9c <__bad_interrupt> + 1a: 00 00 nop + 1c: 3f c0 rjmp .+126 ; 0x9c <__bad_interrupt> + 1e: 00 00 nop + 20: 3d c0 rjmp .+122 ; 0x9c <__bad_interrupt> + 22: 00 00 nop + 24: 3b c0 rjmp .+118 ; 0x9c <__bad_interrupt> + 26: 00 00 nop + 28: 39 c0 rjmp .+114 ; 0x9c <__bad_interrupt> + 2a: 00 00 nop + 2c: 37 c0 rjmp .+110 ; 0x9c <__bad_interrupt> + 2e: 00 00 nop + 30: 35 c0 rjmp .+106 ; 0x9c <__bad_interrupt> + 32: 00 00 nop + 34: 33 c0 rjmp .+102 ; 0x9c <__bad_interrupt> + 36: 00 00 nop + 38: 31 c0 rjmp .+98 ; 0x9c <__bad_interrupt> + 3a: 00 00 nop + 3c: 2f c0 rjmp .+94 ; 0x9c <__bad_interrupt> + 3e: 00 00 nop + 40: 2d c0 rjmp .+90 ; 0x9c <__bad_interrupt> + 42: 00 00 nop + 44: 2b c0 rjmp .+86 ; 0x9c <__bad_interrupt> + 46: 00 00 nop + 48: 29 c0 rjmp .+82 ; 0x9c <__bad_interrupt> + 4a: 00 00 nop + 4c: 27 c0 rjmp .+78 ; 0x9c <__bad_interrupt> + 4e: 00 00 nop + 50: 25 c0 rjmp .+74 ; 0x9c <__bad_interrupt> + 52: 00 00 nop + 54: 23 c0 rjmp .+70 ; 0x9c <__bad_interrupt> + 56: 00 00 nop + 58: 21 c0 rjmp .+66 ; 0x9c <__bad_interrupt> + 5a: 00 00 nop + 5c: 1f c0 rjmp .+62 ; 0x9c <__bad_interrupt> + 5e: 00 00 nop + 60: 1d c0 rjmp .+58 ; 0x9c <__bad_interrupt> + 62: 00 00 nop + 64: 1b c0 rjmp .+54 ; 0x9c <__bad_interrupt> + 66: 00 00 nop + 68: 19 c0 rjmp .+50 ; 0x9c <__bad_interrupt> + 6a: 00 00 nop + 6c: 17 c0 rjmp .+46 ; 0x9c <__bad_interrupt> + 6e: 00 00 nop + 70: 15 c0 rjmp .+42 ; 0x9c <__bad_interrupt> + 72: 00 00 nop + 74: 13 c0 rjmp .+38 ; 0x9c <__bad_interrupt> + 76: 00 00 nop + 78: 11 c0 rjmp .+34 ; 0x9c <__bad_interrupt> + 7a: 00 00 nop + 7c: 0f c0 rjmp .+30 ; 0x9c <__bad_interrupt> + 7e: 00 00 nop + 80: 0d c0 rjmp .+26 ; 0x9c <__bad_interrupt> + 82: 00 00 nop + 84: 0b c0 rjmp .+22 ; 0x9c <__bad_interrupt> + 86: 00 00 nop + 88: 09 c0 rjmp .+18 ; 0x9c <__bad_interrupt> + ... + +0000008c <__ctors_end>: + 8c: 11 24 eor r1, r1 + 8e: 1f be out 0x3f, r1 ; 63 + 90: cf ef ldi r28, 0xFF ; 255 + 92: d0 e1 ldi r29, 0x10 ; 16 + 94: de bf out 0x3e, r29 ; 62 + 96: cd bf out 0x3d, r28 ; 61 + 98: 13 d0 rcall .+38 ; 0xc0
+ 9a: 21 c0 rjmp .+66 ; 0xde <_exit> + +0000009c <__bad_interrupt>: + 9c: b1 cf rjmp .-158 ; 0x0 <__vectors> + +0000009e : + clock value is set. This is used by _delay_ms inside + util/delay.h +Version : DMK, Initial code +*******************************************************************/ +{ + for (int i=0; i + a4: 20 e0 ldi r18, 0x00 ; 0 + a6: 30 e0 ldi r19, 0x00 ; 0 + #else + //round up by default + __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); + #endif + + __builtin_avr_delay_cycles(__ticks_dc); + a8: ef ec ldi r30, 0xCF ; 207 + aa: f7 e0 ldi r31, 0x07 ; 7 + ac: 31 97 sbiw r30, 0x01 ; 1 + ae: f1 f7 brne .-4 ; 0xac + b0: 00 c0 rjmp .+0 ; 0xb2 + b2: 00 00 nop + b4: 2f 5f subi r18, 0xFF ; 255 + b6: 3f 4f sbci r19, 0xFF ; 255 + b8: 28 17 cp r18, r24 + ba: 39 07 cpc r19, r25 + bc: a9 f7 brne .-22 ; 0xa8 + be: 08 95 ret + +000000c0
: + } +} + +int main(void) +{ + DDRD = 0b11111111; // All pins PORTD are set to output + c0: 8f ef ldi r24, 0xFF ; 255 + c2: 81 bb out 0x11, r24 ; 17 + + PORTD = 0b00000001; + c4: 81 e0 ldi r24, 0x01 ; 1 + c6: 82 bb out 0x12, r24 ; 18 + + while (1) + { + PORTD = 0b10000000; + c8: d0 e8 ldi r29, 0x80 ; 128 + wait( 500 ); + PORTD = 0b01000000; + ca: c0 e4 ldi r28, 0x40 ; 64 + + PORTD = 0b00000001; + + while (1) + { + PORTD = 0b10000000; + cc: d2 bb out 0x12, r29 ; 18 + wait( 500 ); + ce: 84 ef ldi r24, 0xF4 ; 244 + d0: 91 e0 ldi r25, 0x01 ; 1 + d2: e5 df rcall .-54 ; 0x9e + PORTD = 0b01000000; + d4: c2 bb out 0x12, r28 ; 18 + wait ( 500 ); + d6: 84 ef ldi r24, 0xF4 ; 244 + d8: 91 e0 ldi r25, 0x01 ; 1 + da: e1 df rcall .-62 ; 0x9e + + } + dc: f7 cf rjmp .-18 ; 0xcc + +000000de <_exit>: + de: f8 94 cli + +000000e0 <__stop_program>: + e0: ff cf rjmp .-2 ; 0xe0 <__stop_program> diff --git a/MIC-Week1/Debug/MIC-Week1.map b/MIC-Week1/Debug/MIC-Week1.map new file mode 100644 index 0000000..5b3c718 --- /dev/null +++ b/MIC-Week1/Debug/MIC-Week1.map @@ -0,0 +1,415 @@ +Archive member included to satisfy reference by file (symbol) + +c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_exit.o) + C:/Program Files (x86)/Atmel/Studio/7.0/Packs/Atmel/ATmega_DFP/1.0.91/gcc/dev/atmega128/avr51/crtatmega128.o (exit) + +Discarded input sections + + .data 0x00000000 0x0 C:/Program Files (x86)/Atmel/Studio/7.0/Packs/Atmel/ATmega_DFP/1.0.91/gcc/dev/atmega128/avr51/crtatmega128.o + .bss 0x00000000 0x0 C:/Program Files (x86)/Atmel/Studio/7.0/Packs/Atmel/ATmega_DFP/1.0.91/gcc/dev/atmega128/avr51/crtatmega128.o + .text 0x00000000 0x0 main.o + .data 0x00000000 0x0 main.o + .bss 0x00000000 0x0 main.o + .text 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_exit.o) + .data 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_exit.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_exit.o) + .text.libgcc.mul + 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_exit.o) + .text.libgcc.div + 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_exit.o) + .text.libgcc 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_exit.o) + .text.libgcc.prologue + 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_exit.o) + .text.libgcc.builtins + 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_exit.o) + .text.libgcc.fmul + 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_exit.o) + .text.libgcc.fixed + 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_exit.o) + +Memory Configuration + +Name Origin Length Attributes +text 0x00000000 0x00020000 xr +data 0x00800100 0x0000ff00 rw !x +eeprom 0x00810000 0x00010000 rw !x +fuse 0x00820000 0x00000400 rw !x +lock 0x00830000 0x00000400 rw !x +signature 0x00840000 0x00000400 rw !x +user_signatures 0x00850000 0x00000400 rw !x +*default* 0x00000000 0xffffffff + +Linker script and memory map + +Address of section .data set to 0x800100 +LOAD C:/Program Files (x86)/Atmel/Studio/7.0/Packs/Atmel/ATmega_DFP/1.0.91/gcc/dev/atmega128/avr51/crtatmega128.o +LOAD main.o +START GROUP +LOAD c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr51\libm.a +END GROUP +START GROUP +LOAD c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a +LOAD c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr51\libm.a +LOAD c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr51\libc.a +LOAD C:/Program Files (x86)/Atmel/Studio/7.0/Packs/Atmel/ATmega_DFP/1.0.91/gcc/dev/atmega128/avr51\libatmega128.a +END GROUP + +.hash + *(.hash) + +.dynsym + *(.dynsym) + +.dynstr + *(.dynstr) + +.gnu.version + *(.gnu.version) + +.gnu.version_d + *(.gnu.version_d) + +.gnu.version_r + *(.gnu.version_r) + +.rel.init + *(.rel.init) + +.rela.init + *(.rela.init) + +.rel.text + *(.rel.text) + *(.rel.text.*) + *(.rel.gnu.linkonce.t*) + +.rela.text + *(.rela.text) + *(.rela.text.*) + *(.rela.gnu.linkonce.t*) + +.rel.fini + *(.rel.fini) + +.rela.fini + *(.rela.fini) + +.rel.rodata + *(.rel.rodata) + *(.rel.rodata.*) + *(.rel.gnu.linkonce.r*) + +.rela.rodata + *(.rela.rodata) + *(.rela.rodata.*) + *(.rela.gnu.linkonce.r*) + +.rel.data + *(.rel.data) + *(.rel.data.*) + *(.rel.gnu.linkonce.d*) + +.rela.data + *(.rela.data) + *(.rela.data.*) + *(.rela.gnu.linkonce.d*) + +.rel.ctors + *(.rel.ctors) + +.rela.ctors + *(.rela.ctors) + +.rel.dtors + *(.rel.dtors) + +.rela.dtors + *(.rela.dtors) + +.rel.got + *(.rel.got) + +.rela.got + *(.rela.got) + +.rel.bss + *(.rel.bss) + +.rela.bss + *(.rela.bss) + +.rel.plt + *(.rel.plt) + +.rela.plt + *(.rela.plt) + +.text 0x00000000 0xe2 + *(.vectors) + .vectors 0x00000000 0x8c C:/Program Files (x86)/Atmel/Studio/7.0/Packs/Atmel/ATmega_DFP/1.0.91/gcc/dev/atmega128/avr51/crtatmega128.o + 0x00000000 __vector_default + 0x00000000 __vectors + *(.vectors) + *(.progmem.gcc*) + 0x0000008c . = ALIGN (0x2) + 0x0000008c __trampolines_start = . + *(.trampolines) + .trampolines 0x0000008c 0x0 linker stubs + *(.trampolines*) + 0x0000008c __trampolines_end = . + *(.progmem*) + 0x0000008c . = ALIGN (0x2) + *(.jumptables) + *(.jumptables*) + *(.lowtext) + *(.lowtext*) + 0x0000008c __ctors_start = . + *(.ctors) + 0x0000008c __ctors_end = . + 0x0000008c __dtors_start = . + *(.dtors) + 0x0000008c __dtors_end = . + SORT(*)(.ctors) + SORT(*)(.dtors) + *(.init0) + .init0 0x0000008c 0x0 C:/Program Files (x86)/Atmel/Studio/7.0/Packs/Atmel/ATmega_DFP/1.0.91/gcc/dev/atmega128/avr51/crtatmega128.o + 0x0000008c __init + *(.init0) + *(.init1) + *(.init1) + *(.init2) + .init2 0x0000008c 0xc C:/Program Files (x86)/Atmel/Studio/7.0/Packs/Atmel/ATmega_DFP/1.0.91/gcc/dev/atmega128/avr51/crtatmega128.o + *(.init2) + *(.init3) + *(.init3) + *(.init4) + *(.init4) + *(.init5) + *(.init5) + *(.init6) + *(.init6) + *(.init7) + *(.init7) + *(.init8) + *(.init8) + *(.init9) + .init9 0x00000098 0x4 C:/Program Files (x86)/Atmel/Studio/7.0/Packs/Atmel/ATmega_DFP/1.0.91/gcc/dev/atmega128/avr51/crtatmega128.o + *(.init9) + *(.text) + .text 0x0000009c 0x2 C:/Program Files (x86)/Atmel/Studio/7.0/Packs/Atmel/ATmega_DFP/1.0.91/gcc/dev/atmega128/avr51/crtatmega128.o + 0x0000009c __vector_22 + 0x0000009c __vector_28 + 0x0000009c __vector_1 + 0x0000009c __vector_32 + 0x0000009c __vector_34 + 0x0000009c __vector_24 + 0x0000009c __vector_12 + 0x0000009c __bad_interrupt + 0x0000009c __vector_6 + 0x0000009c __vector_31 + 0x0000009c __vector_3 + 0x0000009c __vector_23 + 0x0000009c __vector_30 + 0x0000009c __vector_25 + 0x0000009c __vector_11 + 0x0000009c __vector_13 + 0x0000009c __vector_17 + 0x0000009c __vector_19 + 0x0000009c __vector_7 + 0x0000009c __vector_27 + 0x0000009c __vector_5 + 0x0000009c __vector_33 + 0x0000009c __vector_4 + 0x0000009c __vector_9 + 0x0000009c __vector_2 + 0x0000009c __vector_21 + 0x0000009c __vector_15 + 0x0000009c __vector_29 + 0x0000009c __vector_8 + 0x0000009c __vector_26 + 0x0000009c __vector_14 + 0x0000009c __vector_10 + 0x0000009c __vector_16 + 0x0000009c __vector_18 + 0x0000009c __vector_20 + 0x0000009e . = ALIGN (0x2) + *(.text.*) + .text.wait 0x0000009e 0x22 main.o + 0x0000009e wait + .text.main 0x000000c0 0x1e main.o + 0x000000c0 main + 0x000000de . = ALIGN (0x2) + *(.fini9) + .fini9 0x000000de 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_exit.o) + 0x000000de _exit + 0x000000de exit + *(.fini9) + *(.fini8) + *(.fini8) + *(.fini7) + *(.fini7) + *(.fini6) + *(.fini6) + *(.fini5) + *(.fini5) + *(.fini4) + *(.fini4) + *(.fini3) + *(.fini3) + *(.fini2) + *(.fini2) + *(.fini1) + *(.fini1) + *(.fini0) + .fini0 0x000000de 0x4 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_exit.o) + *(.fini0) + 0x000000e2 _etext = . + +.data 0x00800100 0x0 load address 0x000000e2 + 0x00800100 PROVIDE (__data_start, .) + *(.data) + *(.data*) + *(.rodata) + *(.rodata*) + *(.gnu.linkonce.d*) + 0x00800100 . = ALIGN (0x2) + 0x00800100 _edata = . + 0x00800100 PROVIDE (__data_end, .) + +.bss 0x00800100 0x0 + 0x00800100 PROVIDE (__bss_start, .) + *(.bss) + *(.bss*) + *(COMMON) + 0x00800100 PROVIDE (__bss_end, .) + 0x000000e2 __data_load_start = LOADADDR (.data) + 0x000000e2 __data_load_end = (__data_load_start + SIZEOF (.data)) + +.noinit 0x00800100 0x0 + 0x00800100 PROVIDE (__noinit_start, .) + *(.noinit*) + 0x00800100 PROVIDE (__noinit_end, .) + 0x00800100 _end = . + 0x00800100 PROVIDE (__heap_start, .) + +.eeprom 0x00810000 0x0 + *(.eeprom*) + 0x00810000 __eeprom_end = . + +.fuse + *(.fuse) + *(.lfuse) + *(.hfuse) + *(.efuse) + +.lock + *(.lock*) + +.signature + *(.signature*) + +.user_signatures + *(.user_signatures*) + +.stab + *(.stab) + +.stabstr + *(.stabstr) + +.stab.excl + *(.stab.excl) + +.stab.exclstr + *(.stab.exclstr) + +.stab.index + *(.stab.index) + +.stab.indexstr + *(.stab.indexstr) + +.comment 0x00000000 0x30 + *(.comment) + .comment 0x00000000 0x30 main.o + 0x31 (size before relaxing) + +.note.gnu.avr.deviceinfo + 0x00000000 0x3c + .note.gnu.avr.deviceinfo + 0x00000000 0x3c C:/Program Files (x86)/Atmel/Studio/7.0/Packs/Atmel/ATmega_DFP/1.0.91/gcc/dev/atmega128/avr51/crtatmega128.o + +.note.gnu.build-id + *(.note.gnu.build-id) + +.debug + *(.debug) + +.line + *(.line) + +.debug_srcinfo + *(.debug_srcinfo) + +.debug_sfnames + *(.debug_sfnames) + +.debug_aranges 0x00000000 0x28 + *(.debug_aranges) + .debug_aranges + 0x00000000 0x28 main.o + +.debug_pubnames + *(.debug_pubnames) + +.debug_info 0x00000000 0x17b + *(.debug_info .gnu.linkonce.wi.*) + .debug_info 0x00000000 0x17b main.o + +.debug_abbrev 0x00000000 0x115 + *(.debug_abbrev) + .debug_abbrev 0x00000000 0x115 main.o + +.debug_line 0x00000000 0x173 + *(.debug_line .debug_line.* .debug_line_end) + .debug_line 0x00000000 0x173 main.o + +.debug_frame 0x00000000 0x34 + *(.debug_frame) + .debug_frame 0x00000000 0x34 main.o + +.debug_str 0x00000000 0x17c + *(.debug_str) + .debug_str 0x00000000 0x17c main.o + 0x1b0 (size before relaxing) + +.debug_loc 0x00000000 0x6a + *(.debug_loc) + .debug_loc 0x00000000 0x6a main.o + +.debug_macinfo + *(.debug_macinfo) + +.debug_weaknames + *(.debug_weaknames) + +.debug_funcnames + *(.debug_funcnames) + +.debug_typenames + *(.debug_typenames) + +.debug_varnames + *(.debug_varnames) + +.debug_pubtypes + *(.debug_pubtypes) + +.debug_ranges 0x00000000 0x18 + *(.debug_ranges) + .debug_ranges 0x00000000 0x18 main.o + +.debug_macro + *(.debug_macro) +OUTPUT(MIC-Week1.elf elf32-avr) +LOAD linker stubs diff --git a/MIC-Week1/Debug/MIC-Week1.srec b/MIC-Week1/Debug/MIC-Week1.srec new file mode 100644 index 0000000..52786b3 --- /dev/null +++ b/MIC-Week1/Debug/MIC-Week1.srec @@ -0,0 +1,17 @@ +S01100004D49432D5765656B312E7372656350 +S113000045C000004BC0000049C0000047C00000CC +S113001045C0000043C0000041C000003FC00000D4 +S11300203DC000003BC0000039C0000037C00000E4 +S113003035C0000033C0000031C000002FC00000F4 +S11300402DC000002BC0000029C0000027C0000004 +S113005025C0000023C0000021C000001FC0000014 +S11300601DC000001BC0000019C0000017C0000024 +S113007015C0000013C0000011C000000FC0000034 +S11300800DC000000BC0000009C0000011241FBEF9 +S1130090CFEFD0E1DEBFCDBF13D021C0B1CF181652 +S11300A019066CF420E030E0EFECF7E03197F1F75B +S11300B000C000002F5F3F4F28173907A9F70895A4 +S11300C08FEF81BB81E082BBD0E8C0E4D2BB84EF78 +S11300D091E0E5DFC2BB84EF91E0E1DFF7CFF89474 +S10500E0FFCF4C +S9030000FC diff --git a/MIC-Week1/Debug/Makefile b/MIC-Week1/Debug/Makefile new file mode 100644 index 0000000..84f1fec --- /dev/null +++ b/MIC-Week1/Debug/Makefile @@ -0,0 +1,129 @@ +################################################################################ +# Automatically-generated file. Do not edit! +################################################################################ + +SHELL := cmd.exe +RM := rm -rf + +USER_OBJS := + +LIBS := +PROJ := + +O_SRCS := +C_SRCS := +S_SRCS := +S_UPPER_SRCS := +OBJ_SRCS := +ASM_SRCS := +PREPROCESSING_SRCS := +OBJS := +OBJS_AS_ARGS := +C_DEPS := +C_DEPS_AS_ARGS := +EXECUTABLES := +OUTPUT_FILE_PATH := +OUTPUT_FILE_PATH_AS_ARGS := +AVR_APP_PATH :=$$$AVR_APP_PATH$$$ +QUOTE := " +ADDITIONAL_DEPENDENCIES:= +OUTPUT_FILE_DEP:= +LIB_DEP:= +LINKER_SCRIPT_DEP:= + +# Every subdirectory with source files must be described here +SUBDIRS := + + +# Add inputs and outputs from these tool invocations to the build variables +C_SRCS += \ +../main.c + + +PREPROCESSING_SRCS += + + +ASM_SRCS += + + +OBJS += \ +main.o + +OBJS_AS_ARGS += \ +main.o + +C_DEPS += \ +main.d + +C_DEPS_AS_ARGS += \ +main.d + +OUTPUT_FILE_PATH +=MIC-Week1.elf + +OUTPUT_FILE_PATH_AS_ARGS +=MIC-Week1.elf + +ADDITIONAL_DEPENDENCIES:= + +OUTPUT_FILE_DEP:= ./makedep.mk + +LIB_DEP+= + +LINKER_SCRIPT_DEP+= + + +# AVR32/GNU C Compiler + + + +./%.o: .././%.c + @echo Building file: $< + @echo Invoking: AVR/GNU C Compiler : 4.9.2 + $(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) -x c -funsigned-char -funsigned-bitfields -DDEBUG -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.0.91\include" -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega128 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.0.91\gcc\dev\atmega128" -c -std=gnu99 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<" + @echo Finished building: $< + + + + +# AVR32/GNU Preprocessing Assembler + + + +# AVR32/GNU Assembler + + + + +ifneq ($(MAKECMDGOALS),clean) +ifneq ($(strip $(C_DEPS)),) +-include $(C_DEPS) +endif +endif + +# Add inputs and outputs from these tool invocations to the build variables + +# All Target +all: $(OUTPUT_FILE_PATH) $(ADDITIONAL_DEPENDENCIES) + +$(OUTPUT_FILE_PATH): $(OBJS) $(USER_OBJS) $(OUTPUT_FILE_DEP) $(LIB_DEP) $(LINKER_SCRIPT_DEP) + @echo Building target: $@ + @echo Invoking: AVR/GNU Linker : 4.9.2 + $(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) -o$(OUTPUT_FILE_PATH_AS_ARGS) $(OBJS_AS_ARGS) $(USER_OBJS) $(LIBS) -Wl,-Map="MIC-Week1.map" -Wl,--start-group -Wl,-lm -Wl,--end-group -Wl,--gc-sections -mrelax -mmcu=atmega128 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.0.91\gcc\dev\atmega128" + @echo Finished building target: $@ + "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O ihex -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures "MIC-Week1.elf" "MIC-Week1.hex" + "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -j .eeprom --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex "MIC-Week1.elf" "MIC-Week1.eep" || exit 0 + "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objdump.exe" -h -S "MIC-Week1.elf" > "MIC-Week1.lss" + "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O srec -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures "MIC-Week1.elf" "MIC-Week1.srec" + "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-size.exe" "MIC-Week1.elf" + + + + + + + +# Other Targets +clean: + -$(RM) $(OBJS_AS_ARGS) $(EXECUTABLES) + -$(RM) $(C_DEPS_AS_ARGS) + rm -rf "MIC-Week1.elf" "MIC-Week1.a" "MIC-Week1.hex" "MIC-Week1.lss" "MIC-Week1.eep" "MIC-Week1.map" "MIC-Week1.srec" "MIC-Week1.usersignatures" + \ No newline at end of file diff --git a/MIC-Week1/Debug/main.d b/MIC-Week1/Debug/main.d new file mode 100644 index 0000000..affe786 --- /dev/null +++ b/MIC-Week1/Debug/main.d @@ -0,0 +1,43 @@ +main.d main.o: .././main.c \ + c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\io.h \ + c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\sfr_defs.h \ + c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\inttypes.h \ + c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\lib\gcc\avr\4.9.2\include\stdint.h \ + c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\stdint.h \ + C:\Program\ Files\ (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.0.91\include/avr/iom128.h \ + c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\portpins.h \ + c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\common.h \ + c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\version.h \ + c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\fuse.h \ + c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\lock.h \ + c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h \ + c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay_basic.h \ + c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\math.h + +c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\io.h: + +c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\sfr_defs.h: + +c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\inttypes.h: + +c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\lib\gcc\avr\4.9.2\include\stdint.h: + +c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\stdint.h: + +C:\Program\ Files\ (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.0.91\include/avr/iom128.h: + +c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\portpins.h: + +c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\common.h: + +c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\version.h: + +c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\fuse.h: + +c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\lock.h: + +c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h: + +c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay_basic.h: + +c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\math.h: diff --git a/MIC-Week1/Debug/makedep.mk b/MIC-Week1/Debug/makedep.mk new file mode 100644 index 0000000..6a14fde --- /dev/null +++ b/MIC-Week1/Debug/makedep.mk @@ -0,0 +1,6 @@ +################################################################################ +# Automatically-generated file. Do not edit or delete the file +################################################################################ + +main.c + diff --git a/MIC-Week1/MIC-Week1.cproj b/MIC-Week1/MIC-Week1.cproj index 40d17c0..f2c85a2 100644 --- a/MIC-Week1/MIC-Week1.cproj +++ b/MIC-Week1/MIC-Week1.cproj @@ -20,12 +20,12 @@ false true true - + 0x20000000 true - + exception_table 2 - 1 + 0 @@ -38,6 +38,19 @@ + com.atmel.avrdbg.tool.simulator + + 0x1E9702 + + + + + + com.atmel.avrdbg.tool.simulator + + + Simulator + diff --git a/MIC-Week1/main.c b/MIC-Week1/main.c index 7411d3d..cb7a4a9 100644 --- a/MIC-Week1/main.c +++ b/MIC-Week1/main.c @@ -5,14 +5,44 @@ * Author : kenny */ -#include +#define F_CPU 8000000UL +#include +#include + +/******************************************************************/ +void wait( int ms ) +/* +short: Busy wait number of millisecs +inputs: int ms (Number of millisecs to busy wait) +outputs: +notes: Busy wait, not very accurate. Make sure (external) + clock value is set. This is used by _delay_ms inside + util/delay.h +Version : DMK, Initial code +*******************************************************************/ +{ + for (int i=0; i