From ff1fd6c9aeb64430886807cf156f4d9e212acdc5 Mon Sep 17 00:00:00 2001 From: Kenneth van Ewijk Date: Tue, 1 Mar 2016 11:33:08 +0100 Subject: [PATCH] Added week 4 --- MIC-Week1/.vs/MIC-Week1/v14/.atsuo | Bin 32256 -> 38912 bytes MIC-Week1/MIC-Week1.atsln | 6 + MIC-Week4/Debug/MIC-Week4.eep | 1 + MIC-Week4/Debug/MIC-Week4.lss | 236 ++++++++++++++ MIC-Week4/Debug/MIC-Week4.map | 449 ++++++++++++++++++++++++++ MIC-Week4/Debug/MIC-Week4.srec | 20 ++ MIC-Week4/Debug/Makefile | 129 ++++++++ MIC-Week4/Debug/main.d | 46 +++ MIC-Week4/Debug/makedep.mk | 6 + MIC-Week4/MIC-Week4.componentinfo.xml | 86 +++++ MIC-Week4/MIC-Week4.cproj | 118 +++++++ MIC-Week4/main.c | 207 ++++++++++++ 12 files changed, 1304 insertions(+) create mode 100644 MIC-Week4/Debug/MIC-Week4.eep create mode 100644 MIC-Week4/Debug/MIC-Week4.lss create mode 100644 MIC-Week4/Debug/MIC-Week4.map create mode 100644 MIC-Week4/Debug/MIC-Week4.srec create mode 100644 MIC-Week4/Debug/Makefile create mode 100644 MIC-Week4/Debug/main.d create mode 100644 MIC-Week4/Debug/makedep.mk create mode 100644 MIC-Week4/MIC-Week4.componentinfo.xml create mode 100644 MIC-Week4/MIC-Week4.cproj create mode 100644 MIC-Week4/main.c diff --git a/MIC-Week1/.vs/MIC-Week1/v14/.atsuo b/MIC-Week1/.vs/MIC-Week1/v14/.atsuo index 56481e736ecb4b45c353cc5581b9392d086154cd..6337d2a35b246332d64307f157a4fda188f4d5a9 100644 GIT binary patch delta 3773 zcmd^CYiv|S6rQ=gyWK6j3v_MiW6O3a&|)99u-)2F-DC_G~o{#@driJ@7%q&mY0EOjES@P z?wL6=bLPx7bpbo1K5^X0?bur1+>$F8Nf_n7H~gM zgWkNfTGZIL`G%~6oQIzC@st$>yf}BV0~{od`gp(#3-vXx zi#x(9hlWnq7sfuP z;23iJ>VXKrWBDB41-T{qq&s2PV0L5N;jz?+PEk&WUHP^oENAjzS%OA4ZFA+z03A+l zwX~tVi^gWx)BB_Er`+r?%eZTvZ6u4d#dVgWWNF6eUVXNoe98GXWu)l`*tB-V`>Av= zm3%-<&xp*)8qztVz~8Ul#fK<`r(atccU0z>>tm6a9G2wTn$6DmIF>yoXy@ zq1~Z2?duAkLZ?ELvczn`myq+kAJ4~;Z$qL+1Vl*ty<$MVS$k2^_jPR)oZ+W6bx+Mt z45|_pq8dZX@S2!`XE7$!h^crM!%PU0bv$Ys`V+cp)Td)qSd>GSQDyx=66Vst{6*dW zfIZ!hC$WuL`Zn&$V%Du)WRvuI-R!w{W$Z6(y;VDlN+Nzb(c;niYwlG>GHV}ZmYE6t zO?GwH|A)-})H2Sgi10x^`g)t+~A`#EgA8K0;;OW zpkQ;*z5{uZ^R`O6A|*Eevd30Fx}l_J*OXc1wAwx3>V=%9{H4=re}#!1Lf z+dB|gZ*+p4x6Jw8j~EruW_J#iM)PTXER$NhrqaIHczVa}p-a)J&^>=7Thf`St4lRym@>cL-cr2Ddo1&Gp$305Bx;mD09gjVvl&91F=CwCc wL<7+@+UOp8TZTr_-k6sTMAKoo#$+g-JwUZxl_onTTmLC~5+Pf96GJI~0MN=cj{pDw delta 2300 zcmcgseN0GcvQ^1k%u`EnJ6vjfC ze9bWfJ{VMia;T$A3&}Fq&v|GchqSi}4Q=6Etx~79DZoIgh?k$YP=<-k0CI z=bm%!JsH#t%qxJW{n5Xlii3Rr|>W`%S5 zoy>@IhH-a90`Kb`=5k#8NeAE%QT+2lyA?IH$a{zjvXh9kW>1q_kf+h{NXH>4bTcA>+)uF~MH+N^ zIwAv+OToab(VDXtSA~dOh$4g&LE3vFa|LQ<*()QfDxArKYMg6`zSUx4p}2MK?ye%l)$QVN90jJuVwQ@N3oKfx08XK;ATBAk}$KB{t;7e zol>Fc32t0mhX+r5rl&Vcp%@B~Sg^oaW`js?IToR*!(diGOh5*`B#mjv!9}N_tQ8vg zP_{2RCvz;6Co6J1W2%SIxe@3cZ#qUbw#CwFMi3rF=?gE>!aF5{A#xO#kW zPVP9@gRb%>>KmZH zVH#HIPlC5G3>TX^`92qP^f;(Bs;!*op7B*l_~8TE9Xr-`n=*;j@_J8}{U+NGo%fYV z9?t<+sZ*|Sl{?GIA^3EGzNj3e~qR zIuJ;{SO9Mye+jPk6ykgr-kCNMkLi^3p&G$L{Y@KrNSL8}^u|9r%DO0A;8RMR9#4hj zlyDsMRJbcDeXa{=qUT4pD2($;NBa?-nrY1zb$5r-J!TRTsSauQqVi8JD!r#~=4!bW?wOb509n8ccTKN&*sCasU$dc*$zKVS)u(zGQ8Ro1K(e^ zz@8}!^tYwLnQ1%pU2jCVkiM#1>pG{iKcuRU3=6g%>OPx>y^}#|yAYl{32Zw5Z`-d+ oHTvyn%)fA^6}+=yka)q=c1`}|m(lUxex3gs+pa{7Gc*(Y3&3pJZ2$lO diff --git a/MIC-Week1/MIC-Week1.atsln b/MIC-Week1/MIC-Week1.atsln index 553dbd3..6863701 100644 --- a/MIC-Week1/MIC-Week1.atsln +++ b/MIC-Week1/MIC-Week1.atsln @@ -9,6 +9,8 @@ Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "MIC-Week2", "..\MIC-Week2\M EndProject Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "MIC-Week3", "..\MIC-Week3\MIC-Week3.cproj", "{BE05994E-ACDC-4291-8CC2-C7093898F867}" EndProject +Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "MIC-Week4", "..\MIC-Week4\MIC-Week4.cproj", "{A7BD1991-6E26-4C61-A739-4CB38ED58191}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|AVR = Debug|AVR @@ -27,6 +29,10 @@ Global {BE05994E-ACDC-4291-8CC2-C7093898F867}.Debug|AVR.Build.0 = Debug|AVR {BE05994E-ACDC-4291-8CC2-C7093898F867}.Release|AVR.ActiveCfg = Release|AVR {BE05994E-ACDC-4291-8CC2-C7093898F867}.Release|AVR.Build.0 = Release|AVR + {A7BD1991-6E26-4C61-A739-4CB38ED58191}.Debug|AVR.ActiveCfg = Debug|AVR + {A7BD1991-6E26-4C61-A739-4CB38ED58191}.Debug|AVR.Build.0 = Debug|AVR + {A7BD1991-6E26-4C61-A739-4CB38ED58191}.Release|AVR.ActiveCfg = Release|AVR + {A7BD1991-6E26-4C61-A739-4CB38ED58191}.Release|AVR.Build.0 = Release|AVR EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/MIC-Week4/Debug/MIC-Week4.eep b/MIC-Week4/Debug/MIC-Week4.eep new file mode 100644 index 0000000..7c166a1 --- /dev/null +++ b/MIC-Week4/Debug/MIC-Week4.eep @@ -0,0 +1 @@ +:00000001FF diff --git a/MIC-Week4/Debug/MIC-Week4.lss b/MIC-Week4/Debug/MIC-Week4.lss new file mode 100644 index 0000000..40ab2a8 --- /dev/null +++ b/MIC-Week4/Debug/MIC-Week4.lss @@ -0,0 +1,236 @@ + +MIC-Week4.elf: file format elf32-avr + +Sections: +Idx Name Size VMA LMA File off Algn + 0 .data 00000000 00800100 00800100 00000170 2**0 + CONTENTS, ALLOC, LOAD, DATA + 1 .text 0000011c 00000000 00000000 00000054 2**1 + CONTENTS, ALLOC, LOAD, READONLY, CODE + 2 .comment 00000030 00000000 00000000 00000170 2**0 + CONTENTS, READONLY + 3 .note.gnu.avr.deviceinfo 0000003c 00000000 00000000 000001a0 2**2 + CONTENTS, READONLY + 4 .debug_aranges 00000058 00000000 00000000 000001dc 2**0 + CONTENTS, READONLY, DEBUGGING + 5 .debug_info 0000084e 00000000 00000000 00000234 2**0 + CONTENTS, READONLY, DEBUGGING + 6 .debug_abbrev 000001e3 00000000 00000000 00000a82 2**0 + CONTENTS, READONLY, DEBUGGING + 7 .debug_line 000004b5 00000000 00000000 00000c65 2**0 + CONTENTS, READONLY, DEBUGGING + 8 .debug_frame 00000094 00000000 00000000 0000111c 2**2 + CONTENTS, READONLY, DEBUGGING + 9 .debug_str 000001ef 00000000 00000000 000011b0 2**0 + CONTENTS, READONLY, DEBUGGING + 10 .debug_loc 00000361 00000000 00000000 0000139f 2**0 + CONTENTS, READONLY, DEBUGGING + 11 .debug_ranges 000000e0 00000000 00000000 00001700 2**0 + CONTENTS, READONLY, DEBUGGING + +Disassembly of section .text: + +00000000 <__vectors>: + 0: 45 c0 rjmp .+138 ; 0x8c <__ctors_end> + 2: 00 00 nop + 4: 53 c0 rjmp .+166 ; 0xac <__bad_interrupt> + 6: 00 00 nop + 8: 51 c0 rjmp .+162 ; 0xac <__bad_interrupt> + a: 00 00 nop + c: 4f c0 rjmp .+158 ; 0xac <__bad_interrupt> + e: 00 00 nop + 10: 4d c0 rjmp .+154 ; 0xac <__bad_interrupt> + 12: 00 00 nop + 14: 4b c0 rjmp .+150 ; 0xac <__bad_interrupt> + 16: 00 00 nop + 18: 49 c0 rjmp .+146 ; 0xac <__bad_interrupt> + 1a: 00 00 nop + 1c: 47 c0 rjmp .+142 ; 0xac <__bad_interrupt> + 1e: 00 00 nop + 20: 45 c0 rjmp .+138 ; 0xac <__bad_interrupt> + 22: 00 00 nop + 24: 43 c0 rjmp .+134 ; 0xac <__bad_interrupt> + 26: 00 00 nop + 28: 41 c0 rjmp .+130 ; 0xac <__bad_interrupt> + 2a: 00 00 nop + 2c: 3f c0 rjmp .+126 ; 0xac <__bad_interrupt> + 2e: 00 00 nop + 30: 3d c0 rjmp .+122 ; 0xac <__bad_interrupt> + 32: 00 00 nop + 34: 3b c0 rjmp .+118 ; 0xac <__bad_interrupt> + 36: 00 00 nop + 38: 39 c0 rjmp .+114 ; 0xac <__bad_interrupt> + 3a: 00 00 nop + 3c: 37 c0 rjmp .+110 ; 0xac <__bad_interrupt> + 3e: 00 00 nop + 40: 35 c0 rjmp .+106 ; 0xac <__bad_interrupt> + 42: 00 00 nop + 44: 33 c0 rjmp .+102 ; 0xac <__bad_interrupt> + 46: 00 00 nop + 48: 31 c0 rjmp .+98 ; 0xac <__bad_interrupt> + 4a: 00 00 nop + 4c: 2f c0 rjmp .+94 ; 0xac <__bad_interrupt> + 4e: 00 00 nop + 50: 2d c0 rjmp .+90 ; 0xac <__bad_interrupt> + 52: 00 00 nop + 54: 2b c0 rjmp .+86 ; 0xac <__bad_interrupt> + 56: 00 00 nop + 58: 29 c0 rjmp .+82 ; 0xac <__bad_interrupt> + 5a: 00 00 nop + 5c: 27 c0 rjmp .+78 ; 0xac <__bad_interrupt> + 5e: 00 00 nop + 60: 25 c0 rjmp .+74 ; 0xac <__bad_interrupt> + 62: 00 00 nop + 64: 23 c0 rjmp .+70 ; 0xac <__bad_interrupt> + 66: 00 00 nop + 68: 21 c0 rjmp .+66 ; 0xac <__bad_interrupt> + 6a: 00 00 nop + 6c: 1f c0 rjmp .+62 ; 0xac <__bad_interrupt> + 6e: 00 00 nop + 70: 1d c0 rjmp .+58 ; 0xac <__bad_interrupt> + 72: 00 00 nop + 74: 1b c0 rjmp .+54 ; 0xac <__bad_interrupt> + 76: 00 00 nop + 78: 19 c0 rjmp .+50 ; 0xac <__bad_interrupt> + 7a: 00 00 nop + 7c: 17 c0 rjmp .+46 ; 0xac <__bad_interrupt> + 7e: 00 00 nop + 80: 15 c0 rjmp .+42 ; 0xac <__bad_interrupt> + 82: 00 00 nop + 84: 13 c0 rjmp .+38 ; 0xac <__bad_interrupt> + 86: 00 00 nop + 88: 11 c0 rjmp .+34 ; 0xac <__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 + +00000098 <__do_clear_bss>: + 98: 21 e0 ldi r18, 0x01 ; 1 + 9a: a0 e0 ldi r26, 0x00 ; 0 + 9c: b1 e0 ldi r27, 0x01 ; 1 + 9e: 01 c0 rjmp .+2 ; 0xa2 <.do_clear_bss_start> + +000000a0 <.do_clear_bss_loop>: + a0: 1d 92 st X+, r1 + +000000a2 <.do_clear_bss_start>: + a2: a0 30 cpi r26, 0x00 ; 0 + a4: b2 07 cpc r27, r18 + a6: e1 f7 brne .-8 ; 0xa0 <.do_clear_bss_loop> + a8: 25 d0 rcall .+74 ; 0xf4
+ aa: 36 c0 rjmp .+108 ; 0x118 <_exit> + +000000ac <__bad_interrupt>: + ac: a9 cf rjmp .-174 ; 0x0 <__vectors> + +000000ae : +} + +// Set pulse width for RED on pin PB5, 0=off, 255=max +void setBlue( unsigned char blue ) +{ + OCR1C = blue; + ae: 18 16 cp r1, r24 + b0: 19 06 cpc r1, r25 + b2: 6c f4 brge .+26 ; 0xce + b4: 20 e0 ldi r18, 0x00 ; 0 + b6: 30 e0 ldi r19, 0x00 ; 0 + b8: ef ec ldi r30, 0xCF ; 207 + ba: f7 e0 ldi r31, 0x07 ; 7 + bc: 31 97 sbiw r30, 0x01 ; 1 + be: f1 f7 brne .-4 ; 0xbc + c0: 00 c0 rjmp .+0 ; 0xc2 + c2: 00 00 nop + c4: 2f 5f subi r18, 0xFF ; 255 + c6: 3f 4f sbci r19, 0xFF ; 255 + c8: 28 17 cp r18, r24 + ca: 39 07 cpc r19, r25 + cc: a9 f7 brne .-22 ; 0xb8 + ce: 08 95 ret + +000000d0 : + d0: 1b bc out 0x2b, r1 ; 43 + d2: 1a bc out 0x2a, r1 ; 42 + d4: 19 bc out 0x29, r1 ; 41 + d6: 18 bc out 0x28, r1 ; 40 + d8: 10 92 79 00 sts 0x0079, r1 + dc: 10 92 78 00 sts 0x0078, r1 + e0: 89 ea ldi r24, 0xA9 ; 169 + e2: 8f bd out 0x2f, r24 ; 47 + e4: 8b e0 ldi r24, 0x0B ; 11 + e6: 8e bd out 0x2e, r24 ; 46 + e8: 08 95 ret + +000000ea : +// void setBlue( unsigned char blue) + +// Initialize ADC: +void adcInit( void ) +{ + ADMUX = 0b11100001; // AREF=2,56 V, result left adjusted, channel1 at pin PF1 + ea: 81 ee ldi r24, 0xE1 ; 225 + ec: 87 b9 out 0x07, r24 ; 7 + ADCSRA = 0b10000110; // ADC-enable, no interrupt, no free running, division by 64 + ee: 86 e8 ldi r24, 0x86 ; 134 + f0: 86 b9 out 0x06, r24 ; 6 + f2: 08 95 ret + +000000f4
: + + +// Main program: Counting on T1 +int main( void ) +{ + DDRB = 0xFF; + f4: 8f ef ldi r24, 0xFF ; 255 + f6: 87 bb out 0x17, r24 ; 23 + DDRF = 0x00; // set PORTF for input (ADC) + f8: 10 92 61 00 sts 0x0061, r1 + DDRA = 0xFF; // set PORTA for output + fc: 8a bb out 0x1a, r24 ; 26 + adcInit(); // initialize ADC + fe: f5 df rcall .-22 ; 0xea + timer1Init(); + 100: e7 df rcall .-50 ; 0xd0 + + while (1) + { + ADCSRA |= BIT(6); // Start ADC + 102: 36 9a sbi 0x06, 6 ; 6 + while ( ADCSRA & BIT(6) ) ; // Wait for completion + 104: 36 99 sbic 0x06, 6 ; 6 + 106: fe cf rjmp .-4 ; 0x104 + setRed(ADCH); // Show MSB (bit 9:2) of ADC + 108: 85 b1 in r24, 0x05 ; 5 +} + +// Set pulse width for RED on pin PB5, 0=off, 255=max +void setRed( unsigned char red ) +{ + OCR1A = red; + 10a: 90 e0 ldi r25, 0x00 ; 0 + 10c: 9b bd out 0x2b, r25 ; 43 + 10e: 8a bd out 0x2a, r24 ; 42 + while (1) + { + ADCSRA |= BIT(6); // Start ADC + while ( ADCSRA & BIT(6) ) ; // Wait for completion + setRed(ADCH); // Show MSB (bit 9:2) of ADC + wait(100); // every 50 ms (busy waiting) + 110: 84 e6 ldi r24, 0x64 ; 100 + 112: 90 e0 ldi r25, 0x00 ; 0 + 114: cc df rcall .-104 ; 0xae + } + 116: f5 cf rjmp .-22 ; 0x102 + +00000118 <_exit>: + 118: f8 94 cli + +0000011a <__stop_program>: + 11a: ff cf rjmp .-2 ; 0x11a <__stop_program> diff --git a/MIC-Week4/Debug/MIC-Week4.map b/MIC-Week4/Debug/MIC-Week4.map new file mode 100644 index 0000000..95796d7 --- /dev/null +++ b/MIC-Week4/Debug/MIC-Week4.map @@ -0,0 +1,449 @@ +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) +c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_clear_bss.o) + main.o (__do_clear_bss) + +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.setRed 0x00000000 0x8 main.o + .text.setGreen + 0x00000000 0x8 main.o + .text.setBlue 0x00000000 0xc main.o + .text.opgaveextra + 0x00000000 0x1f2 main.o + .bss.hours 0x00000000 0x2 main.o + .bss.minutes 0x00000000 0x2 main.o + .bss.sCount 0x00000000 0x2 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) + .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(_clear_bss.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(_clear_bss.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(_clear_bss.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(_clear_bss.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(_clear_bss.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(_clear_bss.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(_clear_bss.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(_clear_bss.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(_clear_bss.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(_clear_bss.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 0x11c + *(.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 0x00000098 0x10 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_clear_bss.o) + 0x00000098 __do_clear_bss + *(.init4) + *(.init5) + *(.init5) + *(.init6) + *(.init6) + *(.init7) + *(.init7) + *(.init8) + *(.init8) + *(.init9) + .init9 0x000000a8 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 0x000000ac 0x2 C:/Program Files (x86)/Atmel/Studio/7.0/Packs/Atmel/ATmega_DFP/1.0.91/gcc/dev/atmega128/avr51/crtatmega128.o + 0x000000ac __vector_22 + 0x000000ac __vector_28 + 0x000000ac __vector_1 + 0x000000ac __vector_32 + 0x000000ac __vector_34 + 0x000000ac __vector_24 + 0x000000ac __vector_12 + 0x000000ac __bad_interrupt + 0x000000ac __vector_6 + 0x000000ac __vector_31 + 0x000000ac __vector_3 + 0x000000ac __vector_23 + 0x000000ac __vector_30 + 0x000000ac __vector_25 + 0x000000ac __vector_11 + 0x000000ac __vector_13 + 0x000000ac __vector_17 + 0x000000ac __vector_19 + 0x000000ac __vector_7 + 0x000000ac __vector_27 + 0x000000ac __vector_5 + 0x000000ac __vector_33 + 0x000000ac __vector_4 + 0x000000ac __vector_9 + 0x000000ac __vector_2 + 0x000000ac __vector_21 + 0x000000ac __vector_15 + 0x000000ac __vector_29 + 0x000000ac __vector_8 + 0x000000ac __vector_26 + 0x000000ac __vector_14 + 0x000000ac __vector_10 + 0x000000ac __vector_16 + 0x000000ac __vector_18 + 0x000000ac __vector_20 + 0x000000ae . = ALIGN (0x2) + *(.text.*) + .text.wait 0x000000ae 0x22 main.o + 0x000000ae wait + .text.timer1Init + 0x000000d0 0x1a main.o + 0x000000d0 timer1Init + .text.adcInit 0x000000ea 0xa main.o + 0x000000ea adcInit + .text.main 0x000000f4 0x24 main.o + 0x000000f4 main + 0x00000118 . = ALIGN (0x2) + *(.fini9) + .fini9 0x00000118 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) + 0x00000118 _exit + 0x00000118 exit + *(.fini9) + *(.fini8) + *(.fini8) + *(.fini7) + *(.fini7) + *(.fini6) + *(.fini6) + *(.fini5) + *(.fini5) + *(.fini4) + *(.fini4) + *(.fini3) + *(.fini3) + *(.fini2) + *(.fini2) + *(.fini1) + *(.fini1) + *(.fini0) + .fini0 0x00000118 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) + 0x0000011c _etext = . + +.data 0x00800100 0x0 load address 0x0000011c + 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, .) + 0x0000011c __data_load_start = LOADADDR (.data) + 0x0000011c __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 0x58 + *(.debug_aranges) + .debug_aranges + 0x00000000 0x58 main.o + +.debug_pubnames + *(.debug_pubnames) + +.debug_info 0x00000000 0x84e + *(.debug_info .gnu.linkonce.wi.*) + .debug_info 0x00000000 0x84e main.o + +.debug_abbrev 0x00000000 0x1e3 + *(.debug_abbrev) + .debug_abbrev 0x00000000 0x1e3 main.o + +.debug_line 0x00000000 0x4b5 + *(.debug_line .debug_line.* .debug_line_end) + .debug_line 0x00000000 0x4b5 main.o + +.debug_frame 0x00000000 0x94 + *(.debug_frame) + .debug_frame 0x00000000 0x94 main.o + +.debug_str 0x00000000 0x1ef + *(.debug_str) + .debug_str 0x00000000 0x1ef main.o + 0x223 (size before relaxing) + +.debug_loc 0x00000000 0x361 + *(.debug_loc) + .debug_loc 0x00000000 0x361 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 0xe0 + *(.debug_ranges) + .debug_ranges 0x00000000 0xe0 main.o + +.debug_macro + *(.debug_macro) +OUTPUT(MIC-Week4.elf elf32-avr) +LOAD linker stubs diff --git a/MIC-Week4/Debug/MIC-Week4.srec b/MIC-Week4/Debug/MIC-Week4.srec new file mode 100644 index 0000000..3415c65 --- /dev/null +++ b/MIC-Week4/Debug/MIC-Week4.srec @@ -0,0 +1,20 @@ +S01100004D49432D5765656B342E737265634D +S113000045C0000053C0000051C000004FC00000B4 +S11300104DC000004BC0000049C0000047C00000B4 +S113002045C0000043C0000041C000003FC00000C4 +S11300303DC000003BC0000039C0000037C00000D4 +S113004035C0000033C0000031C000002FC00000E4 +S11300502DC000002BC0000029C0000027C00000F4 +S113006025C0000023C0000021C000001FC0000004 +S11300701DC000001BC0000019C0000017C0000014 +S113008015C0000013C0000011C0000011241FBEE1 +S1130090CFEFD0E1DEBFCDBF21E0A0E0B1E001C0F1 +S11300A01D92A030B207E1F725D036C0A9CF1816AB +S11300B019066CF420E030E0EFECF7E03197F1F74B +S11300C000C000002F5F3F4F28173907A9F7089594 +S11300D01BBC1ABC19BC18BC109279001092780091 +S11300E089EA8FBD8BE08EBD089581EE87B986E8DD +S11300F086B908958FEF87BB109261008ABBF5DF44 +S1130100E7DF369A3699FECF85B190E09BBD8ABD74 +S10F011084E690E0CCDFF5CFF894FFCF3C +S9030000FC diff --git a/MIC-Week4/Debug/Makefile b/MIC-Week4/Debug/Makefile new file mode 100644 index 0000000..164d7c1 --- /dev/null +++ b/MIC-Week4/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-Week4.elf + +OUTPUT_FILE_PATH_AS_ARGS +=MIC-Week4.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-Week4.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-Week4.elf" "MIC-Week4.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-Week4.elf" "MIC-Week4.eep" || exit 0 + "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objdump.exe" -h -S "MIC-Week4.elf" > "MIC-Week4.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-Week4.elf" "MIC-Week4.srec" + "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-size.exe" "MIC-Week4.elf" + + + + + + + +# Other Targets +clean: + -$(RM) $(OBJS_AS_ARGS) $(EXECUTABLES) + -$(RM) $(C_DEPS_AS_ARGS) + rm -rf "MIC-Week4.elf" "MIC-Week4.a" "MIC-Week4.hex" "MIC-Week4.lss" "MIC-Week4.eep" "MIC-Week4.map" "MIC-Week4.srec" "MIC-Week4.usersignatures" + \ No newline at end of file diff --git a/MIC-Week4/Debug/main.d b/MIC-Week4/Debug/main.d new file mode 100644 index 0000000..5405d3a --- /dev/null +++ b/MIC-Week4/Debug/main.d @@ -0,0 +1,46 @@ +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\interrupt.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: + +c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\interrupt.h: diff --git a/MIC-Week4/Debug/makedep.mk b/MIC-Week4/Debug/makedep.mk new file mode 100644 index 0000000..6a14fde --- /dev/null +++ b/MIC-Week4/Debug/makedep.mk @@ -0,0 +1,6 @@ +################################################################################ +# Automatically-generated file. Do not edit or delete the file +################################################################################ + +main.c + diff --git a/MIC-Week4/MIC-Week4.componentinfo.xml b/MIC-Week4/MIC-Week4.componentinfo.xml new file mode 100644 index 0000000..657f734 --- /dev/null +++ b/MIC-Week4/MIC-Week4.componentinfo.xml @@ -0,0 +1,86 @@ + + + + + + + Device + Startup + + + Atmel + 1.0.0 + C:/Program Files (x86)\Atmel\Studio\7.0\Packs + + + + + C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.0.91\include + + include + C + + + include + + + + + C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.0.91\include\avr\iom128.h + + header + C + w6TcdtnSFTUbj2H2rTwkDQ== + + include/avr/iom128.h + + + + + C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.0.91\templates\main.c + template + source + C Exe + a50mn6LpYEswUxuI7De0ug== + + templates/main.c + Main file (.c) + + + + C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.0.91\templates\main.cpp + template + source + C Exe + YXFphlh0CtZJU+ebktABgQ== + + templates/main.cpp + Main file (.cpp) + + + + C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.0.91\gcc\dev\atmega128 + + libraryPrefix + GCC + + + gcc/dev/atmega128 + + + + + ATmega_DFP + C:/Program Files (x86)/Atmel/Studio/7.0/Packs/Atmel/ATmega_DFP/1.0.91/Atmel.ATmega_DFP.pdsc + 1.0.91 + true + ATmega128 + + + + Resolved + Fixed + true + + + \ No newline at end of file diff --git a/MIC-Week4/MIC-Week4.cproj b/MIC-Week4/MIC-Week4.cproj new file mode 100644 index 0000000..0a0e729 --- /dev/null +++ b/MIC-Week4/MIC-Week4.cproj @@ -0,0 +1,118 @@ + + + + 2.0 + 7.0 + com.Atmel.AVRGCC8.C + {a7bd1991-6e26-4c61-a739-4cb38ed58191} + ATmega128 + none + Executable + C + $(MSBuildProjectName) + .elf + $(MSBuildProjectDirectory)\$(Configuration) + MIC-Week4 + MIC-Week4 + MIC-Week4 + Native + true + false + true + true + + + true + + 2 + 1 + + + + + + + + + + + + + + + + + -mmcu=atmega128 -B "%24(PackRepoDir)\Atmel\ATmega_DFP\1.0.91\gcc\dev\atmega128" + True + True + True + True + True + False + True + True + + + NDEBUG + + + + + %24(PackRepoDir)\Atmel\ATmega_DFP\1.0.91\include + + + Optimize for size (-Os) + True + True + True + + + libm + + + + + + + + + -mmcu=atmega128 -B "%24(PackRepoDir)\Atmel\ATmega_DFP\1.0.91\gcc\dev\atmega128" + True + True + True + True + True + False + True + True + + + DEBUG + + + + + %24(PackRepoDir)\Atmel\ATmega_DFP\1.0.91\include + + + Optimize (-O1) + True + True + Default (-g2) + True + + + libm + + + Default (-Wa,-g) + + + + + + compile + + + + \ No newline at end of file diff --git a/MIC-Week4/main.c b/MIC-Week4/main.c new file mode 100644 index 0000000..fda90d1 --- /dev/null +++ b/MIC-Week4/main.c @@ -0,0 +1,207 @@ +/* + * Project name: + Demo4_5 : PWM with timer 1 Fast PWM mode at PORTB.5, PB.6 en PB.7 + parallel, 3x, for RGB LED + * Author: Avans-TI, JW + * Revision History: + 20101230: - initial release; + * Description: + This program gives an interrupt on each ms + * Test configuration: + MCU: ATmega128 + Dev.Board: BIGAVR6 + Oscillator: External Clock 08.0000 MHz + Ext. Modules: - + SW: AVR-GCC + * NOTES: + - Turn ON the PORT LEDs at SW12.1 - SW12.8 +*/ + +#define F_CPU 8000000 + +#include +#include +#include + +#define BIT(x) (1 << (x)) + +unsigned int sCount=0, minutes=0, hours=0; + +// wait(): busy waiting for 'ms' millisecond +// Used library: util/delay.h +void wait( int ms ) +{ + for (int tms=0; tms=0; red-=delta) + { + setRed( red ); // 8-bits PWM on pin OCR1a + delta -= 2; // progressive steps down + wait(100); // delay of 100 ms (busy waiting) + } + setRed( 0 ); + delta = 1; + wait(100); + + // GREEN + for (int green = 0; green<=255; green+=delta) + { + setGreen( green ); // 8-bits PWM on pin OCR1a + delta += 2; // progressive steps up + wait(100); // delay of 100 ms (busy waiting) + } + for (int green = 255; green>=0; green-=delta) + { + setGreen( green ); // 8-bits PWM on pin OCR1a + delta -= 2; // progressive steps up + wait(100); // delay of 100 ms (busy waiting) + } + setGreen( 0 ); + delta = 1; + wait(100); + + // BLUE + for (int blue = 0; blue<=255; blue+=delta) + { + setBlue( blue ); // 8-bits PWM on pin OCR1a + delta += 2; // progressive steps up + wait(100); // delay of 100 ms (busy waiting) + } + for (int blue = 255; blue>=0; blue-=delta) + { + setBlue( blue ); // 8-bits PWM on pin OCR1a + delta -= 2; // progressive steps up + wait(100); // delay of 100 ms (busy waiting) + } + setBlue( 0 ); + delta = 1; + wait(100); + + + // YELLOW + for (int yellow = 0; yellow<=255; yellow+=delta) + { + setBlue( yellow ); + setGreen( yellow ); // 8-bits PWM on pin OCR1a + delta += 2; // progressive steps up + wait(100); // delay of 100 ms (busy waiting) + } + for (int yellow = 255; yellow>=0; yellow-=delta) + { + setBlue( yellow ); + setGreen( yellow ); // 8-bits PWM on pin OCR1a + delta -= 2; // progressive steps up + wait(100); // delay of 100 ms (busy waiting) + } + setBlue( 0 ); + setGreen( 0 ); + delta = 1; + wait(100); + + // WHITE + for (int white = 0; white<=255; white+=delta) + { + setBlue( white ); + setRed( white ); + setGreen( white ); // 8-bits PWM on pin OCR1a + delta += 2; // progressive steps up + wait(100); // delay of 100 ms (busy waiting) + } + for (int white = 255; white>=0; white-=delta) + { + setBlue( white ); + setRed( white ); + setGreen( white ); // 8-bits PWM on pin OCR1a + delta -= 2; // progressive steps up + wait(100); // delay of 100 ms (busy waiting) + } + setBlue( 0 ); + setGreen( 0 ); + setRed( 0 ); + delta = 1; + wait(100); + } +} \ No newline at end of file