Added week 4
This commit is contained in:
Binary file not shown.
@@ -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
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
:00000001FF
|
||||
@@ -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 <main>
|
||||
aa: 36 c0 rjmp .+108 ; 0x118 <_exit>
|
||||
|
||||
000000ac <__bad_interrupt>:
|
||||
ac: a9 cf rjmp .-174 ; 0x0 <__vectors>
|
||||
|
||||
000000ae <wait>:
|
||||
}
|
||||
|
||||
// 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 <wait+0x20>
|
||||
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 <wait+0xe>
|
||||
c0: 00 c0 rjmp .+0 ; 0xc2 <wait+0x14>
|
||||
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 <wait+0xa>
|
||||
ce: 08 95 ret
|
||||
|
||||
000000d0 <timer1Init>:
|
||||
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 <adcInit>:
|
||||
// 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>:
|
||||
|
||||
|
||||
// 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 <adcInit>
|
||||
timer1Init();
|
||||
100: e7 df rcall .-50 ; 0xd0 <timer1Init>
|
||||
|
||||
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 <main+0x10>
|
||||
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 <wait>
|
||||
}
|
||||
116: f5 cf rjmp .-22 ; 0x102 <main+0xe>
|
||||
|
||||
00000118 <_exit>:
|
||||
118: f8 94 cli
|
||||
|
||||
0000011a <__stop_program>:
|
||||
11a: ff cf rjmp .-2 ; 0x11a <__stop_program>
|
||||
@@ -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
|
||||
@@ -0,0 +1,20 @@
|
||||
S01100004D49432D5765656B342E737265634D
|
||||
S113000045C0000053C0000051C000004FC00000B4
|
||||
S11300104DC000004BC0000049C0000047C00000B4
|
||||
S113002045C0000043C0000041C000003FC00000C4
|
||||
S11300303DC000003BC0000039C0000037C00000D4
|
||||
S113004035C0000033C0000031C000002FC00000E4
|
||||
S11300502DC000002BC0000029C0000027C00000F4
|
||||
S113006025C0000023C0000021C000001FC0000004
|
||||
S11300701DC000001BC0000019C0000017C0000014
|
||||
S113008015C0000013C0000011C0000011241FBEE1
|
||||
S1130090CFEFD0E1DEBFCDBF21E0A0E0B1E001C0F1
|
||||
S11300A01D92A030B207E1F725D036C0A9CF1816AB
|
||||
S11300B019066CF420E030E0EFECF7E03197F1F74B
|
||||
S11300C000C000002F5F3F4F28173907A9F7089594
|
||||
S11300D01BBC1ABC19BC18BC109279001092780091
|
||||
S11300E089EA8FBD8BE08EBD089581EE87B986E8DD
|
||||
S11300F086B908958FEF87BB109261008ABBF5DF44
|
||||
S1130100E7DF369A3699FECF85B190E09BBD8ABD74
|
||||
S10F011084E690E0CCDFF5CFF894FFCF3C
|
||||
S9030000FC
|
||||
@@ -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"
|
||||
|
||||
@@ -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:
|
||||
@@ -0,0 +1,6 @@
|
||||
################################################################################
|
||||
# Automatically-generated file. Do not edit or delete the file
|
||||
################################################################################
|
||||
|
||||
main.c
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
|
||||
<ProjectComponents>
|
||||
<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
|
||||
<CApiVersion></CApiVersion>
|
||||
<CBundle></CBundle>
|
||||
<CClass>Device</CClass>
|
||||
<CGroup>Startup</CGroup>
|
||||
<CSub></CSub>
|
||||
<CVariant></CVariant>
|
||||
<CVendor>Atmel</CVendor>
|
||||
<CVersion>1.0.0</CVersion>
|
||||
<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
|
||||
<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
|
||||
<Description></Description>
|
||||
<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
|
||||
<d4p1:anyType i:type="FileInfo">
|
||||
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.0.91\include</AbsolutePath>
|
||||
<Attribute></Attribute>
|
||||
<Category>include</Category>
|
||||
<Condition>C</Condition>
|
||||
<FileContentHash i:nil="true" />
|
||||
<FileVersion></FileVersion>
|
||||
<Name>include</Name>
|
||||
<SelectString></SelectString>
|
||||
<SourcePath></SourcePath>
|
||||
</d4p1:anyType>
|
||||
<d4p1:anyType i:type="FileInfo">
|
||||
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.0.91\include\avr\iom128.h</AbsolutePath>
|
||||
<Attribute></Attribute>
|
||||
<Category>header</Category>
|
||||
<Condition>C</Condition>
|
||||
<FileContentHash>w6TcdtnSFTUbj2H2rTwkDQ==</FileContentHash>
|
||||
<FileVersion></FileVersion>
|
||||
<Name>include/avr/iom128.h</Name>
|
||||
<SelectString></SelectString>
|
||||
<SourcePath></SourcePath>
|
||||
</d4p1:anyType>
|
||||
<d4p1:anyType i:type="FileInfo">
|
||||
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.0.91\templates\main.c</AbsolutePath>
|
||||
<Attribute>template</Attribute>
|
||||
<Category>source</Category>
|
||||
<Condition>C Exe</Condition>
|
||||
<FileContentHash>a50mn6LpYEswUxuI7De0ug==</FileContentHash>
|
||||
<FileVersion></FileVersion>
|
||||
<Name>templates/main.c</Name>
|
||||
<SelectString>Main file (.c)</SelectString>
|
||||
<SourcePath></SourcePath>
|
||||
</d4p1:anyType>
|
||||
<d4p1:anyType i:type="FileInfo">
|
||||
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.0.91\templates\main.cpp</AbsolutePath>
|
||||
<Attribute>template</Attribute>
|
||||
<Category>source</Category>
|
||||
<Condition>C Exe</Condition>
|
||||
<FileContentHash>YXFphlh0CtZJU+ebktABgQ==</FileContentHash>
|
||||
<FileVersion></FileVersion>
|
||||
<Name>templates/main.cpp</Name>
|
||||
<SelectString>Main file (.cpp)</SelectString>
|
||||
<SourcePath></SourcePath>
|
||||
</d4p1:anyType>
|
||||
<d4p1:anyType i:type="FileInfo">
|
||||
<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.0.91\gcc\dev\atmega128</AbsolutePath>
|
||||
<Attribute></Attribute>
|
||||
<Category>libraryPrefix</Category>
|
||||
<Condition>GCC</Condition>
|
||||
<FileContentHash i:nil="true" />
|
||||
<FileVersion></FileVersion>
|
||||
<Name>gcc/dev/atmega128</Name>
|
||||
<SelectString></SelectString>
|
||||
<SourcePath></SourcePath>
|
||||
</d4p1:anyType>
|
||||
</Files>
|
||||
<PackName>ATmega_DFP</PackName>
|
||||
<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/Atmel/ATmega_DFP/1.0.91/Atmel.ATmega_DFP.pdsc</PackPath>
|
||||
<PackVersion>1.0.91</PackVersion>
|
||||
<PresentInProject>true</PresentInProject>
|
||||
<ReferenceConditionId>ATmega128</ReferenceConditionId>
|
||||
<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
|
||||
<d4p1:string></d4p1:string>
|
||||
</RteComponents>
|
||||
<Status>Resolved</Status>
|
||||
<VersionMode>Fixed</VersionMode>
|
||||
<IsComponentInAtProject>true</IsComponentInAtProject>
|
||||
</ProjectComponent>
|
||||
</ProjectComponents>
|
||||
</Store>
|
||||
@@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectVersion>7.0</ProjectVersion>
|
||||
<ToolchainName>com.Atmel.AVRGCC8.C</ToolchainName>
|
||||
<ProjectGuid>{a7bd1991-6e26-4c61-a739-4cb38ed58191}</ProjectGuid>
|
||||
<avrdevice>ATmega128</avrdevice>
|
||||
<avrdeviceseries>none</avrdeviceseries>
|
||||
<OutputType>Executable</OutputType>
|
||||
<Language>C</Language>
|
||||
<OutputFileName>$(MSBuildProjectName)</OutputFileName>
|
||||
<OutputFileExtension>.elf</OutputFileExtension>
|
||||
<OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
|
||||
<AssemblyName>MIC-Week4</AssemblyName>
|
||||
<Name>MIC-Week4</Name>
|
||||
<RootNamespace>MIC-Week4</RootNamespace>
|
||||
<ToolchainFlavour>Native</ToolchainFlavour>
|
||||
<KeepTimersRunning>true</KeepTimersRunning>
|
||||
<OverrideVtor>false</OverrideVtor>
|
||||
<CacheFlash>true</CacheFlash>
|
||||
<ProgFlashFromRam>true</ProgFlashFromRam>
|
||||
<RamSnippetAddress />
|
||||
<UncachedRange />
|
||||
<preserveEEPROM>true</preserveEEPROM>
|
||||
<OverrideVtorValue />
|
||||
<BootSegment>2</BootSegment>
|
||||
<eraseonlaunchrule>1</eraseonlaunchrule>
|
||||
<AsfFrameworkConfig>
|
||||
<framework-data xmlns="">
|
||||
<options />
|
||||
<configurations />
|
||||
<files />
|
||||
<documentation help="" />
|
||||
<offline-documentation help="" />
|
||||
<dependencies>
|
||||
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.28.1" />
|
||||
</dependencies>
|
||||
</framework-data>
|
||||
</AsfFrameworkConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<ToolchainSettings>
|
||||
<AvrGcc>
|
||||
<avrgcc.common.Device>-mmcu=atmega128 -B "%24(PackRepoDir)\Atmel\ATmega_DFP\1.0.91\gcc\dev\atmega128"</avrgcc.common.Device>
|
||||
<avrgcc.common.optimization.RelaxBranches>True</avrgcc.common.optimization.RelaxBranches>
|
||||
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
|
||||
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
|
||||
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
|
||||
<avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
|
||||
<avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
|
||||
<avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
|
||||
<avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
|
||||
<avrgcc.compiler.symbols.DefSymbols>
|
||||
<ListValues>
|
||||
<Value>NDEBUG</Value>
|
||||
</ListValues>
|
||||
</avrgcc.compiler.symbols.DefSymbols>
|
||||
<avrgcc.compiler.directories.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.0.91\include</Value>
|
||||
</ListValues>
|
||||
</avrgcc.compiler.directories.IncludePaths>
|
||||
<avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
|
||||
<avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
|
||||
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
|
||||
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
|
||||
<avrgcc.linker.libraries.Libraries>
|
||||
<ListValues>
|
||||
<Value>libm</Value>
|
||||
</ListValues>
|
||||
</avrgcc.linker.libraries.Libraries>
|
||||
</AvrGcc>
|
||||
</ToolchainSettings>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<ToolchainSettings>
|
||||
<AvrGcc>
|
||||
<avrgcc.common.Device>-mmcu=atmega128 -B "%24(PackRepoDir)\Atmel\ATmega_DFP\1.0.91\gcc\dev\atmega128"</avrgcc.common.Device>
|
||||
<avrgcc.common.optimization.RelaxBranches>True</avrgcc.common.optimization.RelaxBranches>
|
||||
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
|
||||
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
|
||||
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
|
||||
<avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
|
||||
<avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
|
||||
<avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
|
||||
<avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
|
||||
<avrgcc.compiler.symbols.DefSymbols>
|
||||
<ListValues>
|
||||
<Value>DEBUG</Value>
|
||||
</ListValues>
|
||||
</avrgcc.compiler.symbols.DefSymbols>
|
||||
<avrgcc.compiler.directories.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\Atmel\ATmega_DFP\1.0.91\include</Value>
|
||||
</ListValues>
|
||||
</avrgcc.compiler.directories.IncludePaths>
|
||||
<avrgcc.compiler.optimization.level>Optimize (-O1)</avrgcc.compiler.optimization.level>
|
||||
<avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
|
||||
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
|
||||
<avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
|
||||
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
|
||||
<avrgcc.linker.libraries.Libraries>
|
||||
<ListValues>
|
||||
<Value>libm</Value>
|
||||
</ListValues>
|
||||
</avrgcc.linker.libraries.Libraries>
|
||||
<avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
|
||||
</AvrGcc>
|
||||
</ToolchainSettings>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="main.c">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
|
||||
</Project>
|
||||
@@ -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 <avr/io.h>
|
||||
#include <util/delay.h>
|
||||
#include <avr/interrupt.h>
|
||||
|
||||
#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<ms; tms++)
|
||||
{
|
||||
_delay_ms( 1 ); // library function (max 30 ms at 8MHz)
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize timer 1: fast PWM at pin PORTB.6 (hundredth ms)
|
||||
void timer1Init( void )
|
||||
{
|
||||
OCR1A = 0; // RED, default, off
|
||||
OCR1B = 0; // GREEN, default, off
|
||||
OCR1C = 0; // BLUE, default, off
|
||||
TCCR1A = 0b10101001; // compare output OC1A,OC1B,OC1C
|
||||
TCCR1B = 0b00001011; // fast PWM 8 bit, prescaler=64, RUN
|
||||
}
|
||||
|
||||
// Set pulse width for RED on pin PB5, 0=off, 255=max
|
||||
void setRed( unsigned char red )
|
||||
{
|
||||
OCR1A = red;
|
||||
}
|
||||
|
||||
// Set pulse width for RED on pin PB5, 0=off, 255=max
|
||||
void setGreen( unsigned char green )
|
||||
{
|
||||
OCR1B = green;
|
||||
}
|
||||
|
||||
// Set pulse width for RED on pin PB5, 0=off, 255=max
|
||||
void setBlue( unsigned char blue )
|
||||
{
|
||||
OCR1C = blue;
|
||||
}
|
||||
|
||||
// void setGreen( unsigned char green)
|
||||
// void setBlue( unsigned char blue)
|
||||
|
||||
// Initialize ADC:
|
||||
void adcInit( void )
|
||||
{
|
||||
ADMUX = 0b11100001; // AREF=2,56 V, result left adjusted, channel1 at pin PF1
|
||||
ADCSRA = 0b10000110; // ADC-enable, no interrupt, no free running, division by 64
|
||||
}
|
||||
|
||||
|
||||
// Main program: Counting on T1
|
||||
int main( void )
|
||||
{
|
||||
DDRB = 0xFF;
|
||||
DDRF = 0x00; // set PORTF for input (ADC)
|
||||
DDRA = 0xFF; // set PORTA for output
|
||||
adcInit(); // initialize ADC
|
||||
timer1Init();
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
// Main program: Counting on T1
|
||||
int opgaveextra( void )
|
||||
{
|
||||
DDRB = 0xFF; // set PORTB for compare output
|
||||
timer1Init();
|
||||
wait(100);
|
||||
|
||||
while (1)
|
||||
{
|
||||
int delta = 1;
|
||||
setRed (0);
|
||||
setBlue(0);
|
||||
setGreen(0);
|
||||
|
||||
// change some colors
|
||||
// RED
|
||||
for (int red = 0; red<=255; red+=delta)
|
||||
{
|
||||
setRed( red ); // 8-bits PWM on pin OCR1a
|
||||
delta += 2; // progressive steps up
|
||||
wait(100); // delay of 100 ms (busy waiting)
|
||||
}
|
||||
for (int red = 255; red>=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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user