14 Commits

Author SHA1 Message Date
Sem van der Hoeven
3196b86762 finished 4.b1 2021-03-03 11:55:41 +01:00
Sem van der Hoeven
bd2a5e6091 added start for 4.b1 2021-03-03 11:22:43 +01:00
Sem van der Hoeven
4d57eddb8f [EDIT] fix 3.2 2021-03-03 09:44:08 +01:00
Sem van der Hoeven
0a1a3fd47f added 3.2 2021-02-24 12:50:50 +01:00
Sem van der Hoeven
0625ca1ccb lcd done 2021-02-24 11:50:32 +01:00
Sem van der Hoeven
4a6d4a5728 merge conflicts 2021-02-24 11:20:24 +01:00
Sem van der Hoeven
80909212ad added test lcd project 2021-02-24 11:19:54 +01:00
stijn
12029c15d3 opdracht 3.3 beter 2021-02-24 10:55:26 +01:00
stijn
4904c6afcb opdracht 3.3 2021-02-24 10:32:59 +01:00
Guilliam Lutz
c6a652d2be opdracht 2.5 probeersel 2021-02-11 23:58:48 +01:00
stijn
4fbfd5bac6 Merge remote-tracking branch 'origin/main' into main 2021-02-11 23:03:23 +01:00
stijn
e6b527ccfc [add] opdradcht 2.5 2021-02-11 23:03:01 +01:00
Sem van der Hoeven
f1418a3c8e add comments 2021-02-10 20:24:39 +01:00
Sem van der Hoeven
0c2250f044 remove comment 2021-02-10 20:20:32 +01:00
47 changed files with 4922 additions and 637 deletions

View File

@@ -19,7 +19,11 @@ Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "Opdracht 2.2", "Opdracht 2.
EndProject
Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "opdracht 2.3", "opdracht 2.3\opdracht 2.3.cproj", "{E0046CE4-D6F8-435F-9C6E-72E6EB89CCB3}"
EndProject
Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "opdracht 2.4", "opdracht 2.4\opdracht 2.4.cproj", "{0FA0C637-5AC0-44F3-999B-49C114B97183}"
Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "opdracht 2.5", "opdracht 2.5\opdracht 2.5.cproj", "{C81B68AA-F4BB-4A5D-81F8-2737DCD1D4A7}"
EndProject
Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "testlcd", "testlcd\testlcd.cproj", "{B964892D-A92F-44D4-AF99-3ADC61820917}"
EndProject
Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "opdracht 3.2", "opdracht 3.2\opdracht 3.2.cproj", "{EB7415C6-2130-46AD-9842-612C67ADE6D4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -59,10 +63,18 @@ Global
{E0046CE4-D6F8-435F-9C6E-72E6EB89CCB3}.Debug|AVR.Build.0 = Debug|AVR
{E0046CE4-D6F8-435F-9C6E-72E6EB89CCB3}.Release|AVR.ActiveCfg = Release|AVR
{E0046CE4-D6F8-435F-9C6E-72E6EB89CCB3}.Release|AVR.Build.0 = Release|AVR
{0FA0C637-5AC0-44F3-999B-49C114B97183}.Debug|AVR.ActiveCfg = Debug|AVR
{0FA0C637-5AC0-44F3-999B-49C114B97183}.Debug|AVR.Build.0 = Debug|AVR
{0FA0C637-5AC0-44F3-999B-49C114B97183}.Release|AVR.ActiveCfg = Release|AVR
{0FA0C637-5AC0-44F3-999B-49C114B97183}.Release|AVR.Build.0 = Release|AVR
{C81B68AA-F4BB-4A5D-81F8-2737DCD1D4A7}.Debug|AVR.ActiveCfg = Debug|AVR
{C81B68AA-F4BB-4A5D-81F8-2737DCD1D4A7}.Debug|AVR.Build.0 = Debug|AVR
{C81B68AA-F4BB-4A5D-81F8-2737DCD1D4A7}.Release|AVR.ActiveCfg = Release|AVR
{C81B68AA-F4BB-4A5D-81F8-2737DCD1D4A7}.Release|AVR.Build.0 = Release|AVR
{B964892D-A92F-44D4-AF99-3ADC61820917}.Debug|AVR.ActiveCfg = Debug|AVR
{B964892D-A92F-44D4-AF99-3ADC61820917}.Debug|AVR.Build.0 = Debug|AVR
{B964892D-A92F-44D4-AF99-3ADC61820917}.Release|AVR.ActiveCfg = Release|AVR
{B964892D-A92F-44D4-AF99-3ADC61820917}.Release|AVR.Build.0 = Release|AVR
{EB7415C6-2130-46AD-9842-612C67ADE6D4}.Debug|AVR.ActiveCfg = Debug|AVR
{EB7415C6-2130-46AD-9842-612C67ADE6D4}.Debug|AVR.Build.0 = Debug|AVR
{EB7415C6-2130-46AD-9842-612C67ADE6D4}.Release|AVR.ActiveCfg = Release|AVR
{EB7415C6-2130-46AD-9842-612C67ADE6D4}.Release|AVR.Build.0 = Release|AVR
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@@ -1,242 +0,0 @@
Opdracht 2.2.elf: file format elf32-avr
Sections:
Idx Name Size VMA LMA File off Algn
0 .data 00000000 00800100 00800100 00000192 2**0
ALLOC, LOAD, DATA
1 .text 000000a4 00000000 00000000 00000054 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
2 .comment 0000002f 00000000 00000000 00000192 2**0
CONTENTS, READONLY
3 .debug_aranges 00000038 00000000 00000000 000001c1 2**0
CONTENTS, READONLY, DEBUGGING
4 .debug_info 00000b2a 00000000 00000000 000001f9 2**0
CONTENTS, READONLY, DEBUGGING
5 .debug_abbrev 00000830 00000000 00000000 00000d23 2**0
CONTENTS, READONLY, DEBUGGING
6 .debug_line 000002e4 00000000 00000000 00001553 2**0
CONTENTS, READONLY, DEBUGGING
7 .debug_frame 00000074 00000000 00000000 00001838 2**2
CONTENTS, READONLY, DEBUGGING
8 .debug_str 0000027d 00000000 00000000 000018ac 2**0
CONTENTS, READONLY, DEBUGGING
9 .debug_loc 000000e2 00000000 00000000 00001b29 2**0
CONTENTS, READONLY, DEBUGGING
10 .debug_ranges 00000028 00000000 00000000 00001c0b 2**0
CONTENTS, READONLY, DEBUGGING
11 .text 00000004 0000013a 0000013a 0000018e 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
12 .note.gnu.avr.deviceinfo 0000003c 00000000 00000000 00001c34 2**2
CONTENTS, READONLY, DEBUGGING
13 .text.wait 0000001e 0000011c 0000011c 00000170 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
14 .text.__vector_2 00000028 000000a4 000000a4 000000f8 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
15 .text.__vector_3 00000028 000000cc 000000cc 00000120 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
16 .text.main 00000028 000000f4 000000f4 00000148 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
Disassembly of section .text:
00000000 <__vectors>:
0: 0c 94 46 00 jmp 0x8c ; 0x8c <__ctors_end>
4: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
8: 0c 94 52 00 jmp 0xa4 ; 0xa4 <_etext>
c: 0c 94 66 00 jmp 0xcc ; 0xcc <__vector_3>
10: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
14: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
18: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
1c: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
20: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
24: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
28: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
2c: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
30: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
34: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
38: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
3c: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
40: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
44: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
48: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
4c: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
50: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
54: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
58: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
5c: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
60: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
64: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
68: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
6c: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
70: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
74: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
78: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
7c: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
80: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
84: 0c 94 9d 00 jmp 0x13a ; 0x13a <__bad_interrupt>
88: 0c 94 9d 00 jmp 0x13a ; 0x13a <__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: 0e 94 7a 00 call 0xf4 ; 0xf4 <main>
9c: 0c 94 50 00 jmp 0xa0 ; 0xa0 <_exit>
000000a0 <_exit>:
a0: f8 94 cli
000000a2 <__stop_program>:
a2: ff cf rjmp .-2 ; 0xa2 <__stop_program>
Disassembly of section .text:
0000013a <__bad_interrupt>:
13a: 0c 94 00 00 jmp 0 ; 0x0 <__TEXT_REGION_ORIGIN__>
Disassembly of section .text.wait:
0000011c <wait>:
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
void wait( int ms ) {
for (int i=0; i<ms; i++) {
11c: 20 e0 ldi r18, 0x00 ; 0
11e: 30 e0 ldi r19, 0x00 ; 0
120: 08 c0 rjmp .+16 ; 0x132 <wait+0x16>
#else
//round up by default
__ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
#endif
__builtin_avr_delay_cycles(__ticks_dc);
122: e3 ec ldi r30, 0xC3 ; 195
124: f9 e0 ldi r31, 0x09 ; 9
126: 31 97 sbiw r30, 0x01 ; 1
128: f1 f7 brne .-4 ; 0x126 <wait+0xa>
12a: 00 c0 rjmp .+0 ; 0x12c <wait+0x10>
12c: 00 00 nop
12e: 2f 5f subi r18, 0xFF ; 255
130: 3f 4f sbci r19, 0xFF ; 255
132: 28 17 cp r18, r24
134: 39 07 cpc r19, r25
136: ac f3 brlt .-22 ; 0x122 <wait+0x6>
_delay_ms( 1 ); // library function (max 30 ms at 8MHz)
}
}
138: 08 95 ret
Disassembly of section .text.__vector_2:
000000a4 <__vector_2>:
ISR( INT1_vect ) {
a4: 1f 92 push r1
a6: 0f 92 push r0
a8: 0f b6 in r0, 0x3f ; 63
aa: 0f 92 push r0
ac: 11 24 eor r1, r1
ae: 8f 93 push r24
if (PORTC == 0b10000000)
b0: 85 b3 in r24, 0x15 ; 21
b2: 80 38 cpi r24, 0x80 ; 128
b4: 11 f4 brne .+4 ; 0xba <__vector_2+0x16>
{
PORTC == 0b00000001;
b6: 85 b3 in r24, 0x15 ; 21
b8: 03 c0 rjmp .+6 ; 0xc0 <__vector_2+0x1c>
} else {
PORTC = PORTC << 1;
ba: 85 b3 in r24, 0x15 ; 21
bc: 88 0f add r24, r24
be: 85 bb out 0x15, r24 ; 21
}
}
c0: 8f 91 pop r24
c2: 0f 90 pop r0
c4: 0f be out 0x3f, r0 ; 63
c6: 0f 90 pop r0
c8: 1f 90 pop r1
ca: 18 95 reti
Disassembly of section .text.__vector_3:
000000cc <__vector_3>:
ISR( INT2_vect ) {
cc: 1f 92 push r1
ce: 0f 92 push r0
d0: 0f b6 in r0, 0x3f ; 63
d2: 0f 92 push r0
d4: 11 24 eor r1, r1
d6: 8f 93 push r24
if (PORTC == 0b00000001)
d8: 85 b3 in r24, 0x15 ; 21
da: 81 30 cpi r24, 0x01 ; 1
dc: 11 f4 brne .+4 ; 0xe2 <__vector_3+0x16>
{
PORTC = 0b10000000;
de: 80 e8 ldi r24, 0x80 ; 128
e0: 85 bb out 0x15, r24 ; 21
}
PORTC = PORTC >> 1;
e2: 85 b3 in r24, 0x15 ; 21
e4: 86 95 lsr r24
e6: 85 bb out 0x15, r24 ; 21
}
e8: 8f 91 pop r24
ea: 0f 90 pop r0
ec: 0f be out 0x3f, r0 ; 63
ee: 0f 90 pop r0
f0: 1f 90 pop r1
f2: 18 95 reti
Disassembly of section .text.main:
000000f4 <main>:
int main(void)
{
/* Replace with your application code */
// Init I/O
DDRD = 0xF0; // PORTD (7:4) is output, (3:0) is input
f4: 80 ef ldi r24, 0xF0 ; 240
f6: 81 bb out 0x11, r24 ; 17
DDRC = 0xFF;
f8: 8f ef ldi r24, 0xFF ; 255
fa: 84 bb out 0x14, r24 ; 20
// Init Interrupt hardware
EICRA |= 0x2C; // INT2 falling edge, INT1 rising edge
fc: ea e6 ldi r30, 0x6A ; 106
fe: f0 e0 ldi r31, 0x00 ; 0
100: 80 81 ld r24, Z
102: 8c 62 ori r24, 0x2C ; 44
104: 80 83 st Z, r24
EIMSK |= 0x06; // Enable INT2 & INT1
106: 89 b7 in r24, 0x39 ; 57
108: 86 60 ori r24, 0x06 ; 6
10a: 89 bf out 0x39, r24 ; 57
PORTC = 0x01;
10c: 81 e0 ldi r24, 0x01 ; 1
10e: 85 bb out 0x15, r24 ; 21
sei();
110: 78 94 sei
while (1)
{
wait(500);
112: 84 ef ldi r24, 0xF4 ; 244
114: 91 e0 ldi r25, 0x01 ; 1
116: 0e 94 8e 00 call 0x11c ; 0x11c <wait>
11a: fb cf rjmp .-10 ; 0x112 <main+0x1e>

View File

@@ -11,7 +11,6 @@ Idx Name Size VMA LMA File off Algn
CONTENTS, READONLY
3 .debug_aranges 00000028 00000000 00000000 0000017f 2**0
CONTENTS, READONLY, DEBUGGING
<<<<<<< HEAD
4 .debug_info 00000b4d 00000000 00000000 000001a7 2**0
CONTENTS, READONLY, DEBUGGING
5 .debug_abbrev 00000830 00000000 00000000 00000cf4 2**0
@@ -29,25 +28,6 @@ Idx Name Size VMA LMA File off Algn
11 .text 00000004 000000f8 000000f8 0000014c 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
12 .note.gnu.avr.deviceinfo 0000003c 00000000 00000000 00001b28 2**2
=======
4 .debug_info 00000b26 00000000 00000000 000001a7 2**0
CONTENTS, READONLY, DEBUGGING
5 .debug_abbrev 00000830 00000000 00000000 00000ccd 2**0
CONTENTS, READONLY, DEBUGGING
6 .debug_line 000002ae 00000000 00000000 000014fd 2**0
CONTENTS, READONLY, DEBUGGING
7 .debug_frame 00000034 00000000 00000000 000017ac 2**2
CONTENTS, READONLY, DEBUGGING
8 .debug_str 0000027d 00000000 00000000 000017e0 2**0
CONTENTS, READONLY, DEBUGGING
9 .debug_loc 00000089 00000000 00000000 00001a5d 2**0
CONTENTS, READONLY, DEBUGGING
10 .debug_ranges 00000018 00000000 00000000 00001ae6 2**0
CONTENTS, READONLY, DEBUGGING
11 .text 00000004 000000f8 000000f8 0000014c 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
12 .note.gnu.avr.deviceinfo 0000003c 00000000 00000000 00001b00 2**2
>>>>>>> main
CONTENTS, READONLY, DEBUGGING
13 .text.wait 0000001e 000000da 000000da 0000012e 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
@@ -112,11 +92,7 @@ Disassembly of section .text:
Disassembly of section .text:
000000f8 <__bad_interrupt>:
<<<<<<< HEAD
f8: 0c 94 00 00 jmp 0 ; 0x0 <__vectors>
=======
f8: 0c 94 00 00 jmp 0 ; 0x0 <__TEXT_REGION_ORIGIN__>
>>>>>>> main
Disassembly of section .text.wait:

View File

@@ -11,7 +11,6 @@ Idx Name Size VMA LMA File off Algn
CONTENTS, READONLY
3 .debug_aranges 00000020 00000000 00000000 0000012d 2**0
CONTENTS, READONLY, DEBUGGING
<<<<<<< HEAD
4 .debug_info 000009fe 00000000 00000000 0000014d 2**0
CONTENTS, READONLY, DEBUGGING
5 .debug_abbrev 00000756 00000000 00000000 00000b4b 2**0
@@ -27,23 +26,6 @@ Idx Name Size VMA LMA File off Algn
10 .text 00000004 000000a4 000000a4 000000f8 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
11 .note.gnu.avr.deviceinfo 0000003c 00000000 00000000 000016fc 2**2
=======
4 .debug_info 000009d7 00000000 00000000 0000014d 2**0
CONTENTS, READONLY, DEBUGGING
5 .debug_abbrev 00000756 00000000 00000000 00000b24 2**0
CONTENTS, READONLY, DEBUGGING
6 .debug_line 000001a6 00000000 00000000 0000127a 2**0
CONTENTS, READONLY, DEBUGGING
7 .debug_frame 00000024 00000000 00000000 00001420 2**2
CONTENTS, READONLY, DEBUGGING
8 .debug_str 0000027d 00000000 00000000 00001444 2**0
CONTENTS, READONLY, DEBUGGING
9 .debug_ranges 00000010 00000000 00000000 000016c1 2**0
CONTENTS, READONLY, DEBUGGING
10 .text 00000004 000000a4 000000a4 000000f8 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
11 .note.gnu.avr.deviceinfo 0000003c 00000000 00000000 000016d4 2**2
>>>>>>> main
CONTENTS, READONLY, DEBUGGING
12 .text.main 00000002 000000a8 000000a8 000000fc 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
@@ -106,11 +88,7 @@ Disassembly of section .text:
Disassembly of section .text:
000000a4 <__bad_interrupt>:
<<<<<<< HEAD
a4: 0c 94 00 00 jmp 0 ; 0x0 <__TEXT_REGION_ORIGIN__>
=======
a4: 0c 94 00 00 jmp 0 ; 0x0 <__vectors>
>>>>>>> main
Disassembly of section .text.main:

View File

@@ -11,7 +11,6 @@ Idx Name Size VMA LMA File off Algn
CONTENTS, READONLY
3 .debug_aranges 00000050 00000000 00000000 000001eb 2**0
CONTENTS, READONLY, DEBUGGING
<<<<<<< HEAD
4 .debug_info 00000cfe 00000000 00000000 0000023b 2**0
CONTENTS, READONLY, DEBUGGING
5 .debug_abbrev 000008c5 00000000 00000000 00000f39 2**0
@@ -29,25 +28,6 @@ Idx Name Size VMA LMA File off Algn
11 .text 00000004 00000164 00000164 000001b8 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
12 .note.gnu.avr.deviceinfo 0000003c 00000000 00000000 00002098 2**2
=======
4 .debug_info 00000cd7 00000000 00000000 0000023b 2**0
CONTENTS, READONLY, DEBUGGING
5 .debug_abbrev 000008c5 00000000 00000000 00000f12 2**0
CONTENTS, READONLY, DEBUGGING
6 .debug_line 0000036f 00000000 00000000 000017d7 2**0
CONTENTS, READONLY, DEBUGGING
7 .debug_frame 0000008c 00000000 00000000 00001b48 2**2
CONTENTS, READONLY, DEBUGGING
8 .debug_str 0000027d 00000000 00000000 00001bd4 2**0
CONTENTS, READONLY, DEBUGGING
9 .debug_loc 000001dc 00000000 00000000 00001e51 2**0
CONTENTS, READONLY, DEBUGGING
10 .debug_ranges 00000040 00000000 00000000 0000202d 2**0
CONTENTS, READONLY, DEBUGGING
11 .text 00000004 00000164 00000164 000001b8 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
12 .note.gnu.avr.deviceinfo 0000003c 00000000 00000000 00002070 2**2
>>>>>>> main
CONTENTS, READONLY, DEBUGGING
13 .text.wait 0000001e 0000010e 0000010e 00000162 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
@@ -118,11 +98,7 @@ Disassembly of section .text:
Disassembly of section .text:
00000164 <__bad_interrupt>:
<<<<<<< HEAD
164: 0c 94 00 00 jmp 0 ; 0x0 <__vectors>
=======
164: 0c 94 00 00 jmp 0 ; 0x0 <__TEXT_REGION_ORIGIN__>
>>>>>>> main
Disassembly of section .text.wait:

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<executable name="opdracht 1.7a.elf">
<memory name="program">
<units>bytes</units>
<length>131072</length>
<used>168</used>
<free>130904</free>
</memory>
<memory name="data">
<units>bytes</units>
<length>4096</length>
<used>0</used>
<free>4096</free>
</memory>
</executable>
</project>

View File

@@ -1,227 +0,0 @@
opdracht 2.1.elf: file format elf32-avr
Sections:
Idx Name Size VMA LMA File off Algn
0 .data 00000000 00800100 00800100 0000017c 2**0
ALLOC, LOAD, DATA
1 .text 000000a4 00000000 00000000 00000054 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
2 .comment 0000002f 00000000 00000000 0000017c 2**0
CONTENTS, READONLY
3 .debug_aranges 00000038 00000000 00000000 000001ab 2**0
CONTENTS, READONLY, DEBUGGING
4 .debug_info 00000b2a 00000000 00000000 000001e3 2**0
CONTENTS, READONLY, DEBUGGING
5 .debug_abbrev 00000830 00000000 00000000 00000d0d 2**0
CONTENTS, READONLY, DEBUGGING
6 .debug_line 000002cb 00000000 00000000 0000153d 2**0
CONTENTS, READONLY, DEBUGGING
7 .debug_frame 00000074 00000000 00000000 00001808 2**2
CONTENTS, READONLY, DEBUGGING
8 .debug_str 0000027d 00000000 00000000 0000187c 2**0
CONTENTS, READONLY, DEBUGGING
9 .debug_loc 000000e2 00000000 00000000 00001af9 2**0
CONTENTS, READONLY, DEBUGGING
10 .debug_ranges 00000028 00000000 00000000 00001bdb 2**0
CONTENTS, READONLY, DEBUGGING
11 .text 00000004 00000124 00000124 00000178 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
12 .note.gnu.avr.deviceinfo 0000003c 00000000 00000000 00001c04 2**2
CONTENTS, READONLY, DEBUGGING
13 .text.wait 0000001e 000000ca 000000ca 0000011e 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
14 .text.__vector_1 0000001e 000000e8 000000e8 0000013c 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
15 .text.__vector_2 0000001e 00000106 00000106 0000015a 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
16 .text.main 00000026 000000a4 000000a4 000000f8 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
Disassembly of section .text:
00000000 <__vectors>:
0: 0c 94 46 00 jmp 0x8c ; 0x8c <__ctors_end>
4: 0c 94 74 00 jmp 0xe8 ; 0xe8 <__vector_1>
8: 0c 94 83 00 jmp 0x106 ; 0x106 <__vector_2>
c: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
10: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
14: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
18: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
1c: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
20: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
24: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
28: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
2c: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
30: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
34: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
38: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
3c: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
40: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
44: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
48: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
4c: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
50: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
54: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
58: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
5c: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
60: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
64: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
68: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
6c: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
70: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
74: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
78: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
7c: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
80: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
84: 0c 94 92 00 jmp 0x124 ; 0x124 <__bad_interrupt>
88: 0c 94 92 00 jmp 0x124 ; 0x124 <__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: 0e 94 52 00 call 0xa4 ; 0xa4 <_etext>
9c: 0c 94 50 00 jmp 0xa0 ; 0xa0 <_exit>
000000a0 <_exit>:
a0: f8 94 cli
000000a2 <__stop_program>:
a2: ff cf rjmp .-2 ; 0xa2 <__stop_program>
Disassembly of section .text:
00000124 <__bad_interrupt>:
124: 0c 94 00 00 jmp 0 ; 0x0 <__TEXT_REGION_ORIGIN__>
Disassembly of section .text.wait:
000000ca <wait>:
clock value is set. This is used by _delay_ms inside
util/delay.h
Version : DMK, Initial code
*******************************************************************/
void wait( int ms ) {
for (int i=0; i<ms; i++) {
ca: 20 e0 ldi r18, 0x00 ; 0
cc: 30 e0 ldi r19, 0x00 ; 0
ce: 08 c0 rjmp .+16 ; 0xe0 <wait+0x16>
#else
//round up by default
__ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
#endif
__builtin_avr_delay_cycles(__ticks_dc);
d0: ef ec ldi r30, 0xCF ; 207
d2: f7 e0 ldi r31, 0x07 ; 7
d4: 31 97 sbiw r30, 0x01 ; 1
d6: f1 f7 brne .-4 ; 0xd4 <wait+0xa>
d8: 00 c0 rjmp .+0 ; 0xda <wait+0x10>
da: 00 00 nop
dc: 2f 5f subi r18, 0xFF ; 255
de: 3f 4f sbci r19, 0xFF ; 255
e0: 28 17 cp r18, r24
e2: 39 07 cpc r19, r25
e4: ac f3 brlt .-22 ; 0xd0 <wait+0x6>
_delay_ms( 1 ); // library function (max 30 ms at 8MHz)
}
}
e6: 08 95 ret
Disassembly of section .text.__vector_1:
000000e8 <__vector_1>:
inputs:
outputs:
notes: Set PORTD.5
Version : DMK, Initial code
*******************************************************************/
ISR( INT0_vect ) {
e8: 1f 92 push r1
ea: 0f 92 push r0
ec: 0f b6 in r0, 0x3f ; 63
ee: 0f 92 push r0
f0: 11 24 eor r1, r1
f2: 8f 93 push r24
PORTD |= (1<<5);
f4: 82 b3 in r24, 0x12 ; 18
f6: 80 62 ori r24, 0x20 ; 32
f8: 82 bb out 0x12, r24 ; 18
}
fa: 8f 91 pop r24
fc: 0f 90 pop r0
fe: 0f be out 0x3f, r0 ; 63
100: 0f 90 pop r0
102: 1f 90 pop r1
104: 18 95 reti
Disassembly of section .text.__vector_2:
00000106 <__vector_2>:
inputs:
outputs:
notes: Clear PORTD.5
Version : DMK, Initial code
*******************************************************************/
ISR( INT1_vect ) {
106: 1f 92 push r1
108: 0f 92 push r0
10a: 0f b6 in r0, 0x3f ; 63
10c: 0f 92 push r0
10e: 11 24 eor r1, r1
110: 8f 93 push r24
PORTD &= ~(1<<5);
112: 82 b3 in r24, 0x12 ; 18
114: 8f 7d andi r24, 0xDF ; 223
116: 82 bb out 0x12, r24 ; 18
}
118: 8f 91 pop r24
11a: 0f 90 pop r0
11c: 0f be out 0x3f, r0 ; 63
11e: 0f 90 pop r0
120: 1f 90 pop r1
122: 18 95 reti
Disassembly of section .text.main:
000000a4 <main>:
notes: Slow background task after init ISR
Version : DMK, Initial code
*******************************************************************/
int main( void ) {
// Init I/O
DDRD = 0xF0; // PORTD(7:4) output, PORTD(3:0) input
a4: 80 ef ldi r24, 0xF0 ; 240
a6: 81 bb out 0x11, r24 ; 17
// Init Interrupt hardware
EICRA |= 0x0B; // INT1 falling edge, INT0 rising edge
a8: ea e6 ldi r30, 0x6A ; 106
aa: f0 e0 ldi r31, 0x00 ; 0
ac: 80 81 ld r24, Z
ae: 8b 60 ori r24, 0x0B ; 11
b0: 80 83 st Z, r24
EIMSK |= 0x03; // Enable INT1 & INT0
b2: 89 b7 in r24, 0x39 ; 57
b4: 83 60 ori r24, 0x03 ; 3
b6: 89 bf out 0x39, r24 ; 57
// Enable global interrupt system
//SREG = 0x80; // Of direct via SREG of via wrapper
sei();
b8: 78 94 sei
while (1) {
PORTD ^= (1<<7); // Toggle PORTD.7
ba: 82 b3 in r24, 0x12 ; 18
bc: 80 58 subi r24, 0x80 ; 128
be: 82 bb out 0x12, r24 ; 18
wait( 500 );
c0: 84 ef ldi r24, 0xF4 ; 244
c2: 91 e0 ldi r25, 0x01 ; 1
c4: 0e 94 65 00 call 0xca ; 0xca <wait>
c8: f8 cf rjmp .-16 ; 0xba <main+0x16>

View File

@@ -34,7 +34,6 @@ SEGMENT_DELAY segments[] = {
{0x01,50},{0x00,50},{0x01,50},{0x00,50},{0x01,50},{0x00,50},{0x01,50},{0x00,50},
{0b01000000,50},{0x00,50},{0b01000000,50},{0x00,50},{0b01000000,50},{0x00,50},{0b01000000,50},{0x00,50},
{0x08,50},{0x00,50},{0x08,50},{0x00,50},{0x08,50},{0x00,50},{0x08,50},{0x00,50}
/* go in a figure 8 pattern pattern*/
};
@@ -54,14 +53,14 @@ void wait( int ms )
int main( void )
{
DDRA = 0xFF;
DDRA = 0xFF; // set PORTA to all output
while (1==1)
{
// Set index to begin of pattern array
int index = 0;
// as long as delay has meaningful content
// loop through the array
for (int i = 0; i < sizeof(segments)/sizeof(segments[0]); i++)
{
// Write data to PORTA
@@ -72,6 +71,7 @@ int main( void )
index++;
}
}
/*we need to free the memory taken up by the array, otherwise it won't clear properly*/
free(segments);

View File

@@ -28,54 +28,66 @@
<ResetRule>0</ResetRule>
<eraseonlaunchrule>0</eraseonlaunchrule>
<EraseKey />
<AsfFrameworkConfig>
<framework-data xmlns="">
<options />
<configurations />
<files />
<documentation help="" />
<offline-documentation help="" />
<dependencies>
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.49.1" />
</dependencies>
</framework-data>
</AsfFrameworkConfig>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<ToolchainSettings>
<com.microchip.xc8>
<com.microchip.xc8.common.optimization.RelaxBranches>True</com.microchip.xc8.common.optimization.RelaxBranches>
<com.microchip.xc8.compiler.general.ChangeDefaultCharTypeUnsigned>True</com.microchip.xc8.compiler.general.ChangeDefaultCharTypeUnsigned>
<com.microchip.xc8.compiler.general.ChangeDefaultBitFieldUnsigned>True</com.microchip.xc8.compiler.general.ChangeDefaultBitFieldUnsigned>
<com.microchip.xc8.compiler.symbols.DefSymbols>
<ListValues>
<Value>(%24DeviceMacro)</Value>
<Value>NDEBUG</Value>
</ListValues>
</com.microchip.xc8.compiler.symbols.DefSymbols>
<com.microchip.xc8.compiler.optimization.level>Optimize for size (-Os)</com.microchip.xc8.compiler.optimization.level>
<com.microchip.xc8.compiler.optimization.PackStructureMembers>True</com.microchip.xc8.compiler.optimization.PackStructureMembers>
<com.microchip.xc8.compiler.optimization.AllocateBytesNeededForEnum>True</com.microchip.xc8.compiler.optimization.AllocateBytesNeededForEnum>
<com.microchip.xc8.compiler.warnings.AllWarnings>True</com.microchip.xc8.compiler.warnings.AllWarnings>
<com.microchip.xc8.linker.libraries.Libraries>
<ListValues>
<Value>libm</Value>
</ListValues>
</com.microchip.xc8.linker.libraries.Libraries>
</com.microchip.xc8>
<com.microchip.xc8.common.optimization.RelaxBranches>True</com.microchip.xc8.common.optimization.RelaxBranches>
<com.microchip.xc8.compiler.general.ChangeDefaultCharTypeUnsigned>True</com.microchip.xc8.compiler.general.ChangeDefaultCharTypeUnsigned>
<com.microchip.xc8.compiler.general.ChangeDefaultBitFieldUnsigned>True</com.microchip.xc8.compiler.general.ChangeDefaultBitFieldUnsigned>
<com.microchip.xc8.compiler.symbols.DefSymbols>
<ListValues>
<Value>(%24DeviceMacro)</Value>
<Value>NDEBUG</Value>
</ListValues>
</com.microchip.xc8.compiler.symbols.DefSymbols>
<com.microchip.xc8.compiler.optimization.level>Optimize for size (-Os)</com.microchip.xc8.compiler.optimization.level>
<com.microchip.xc8.compiler.optimization.PackStructureMembers>True</com.microchip.xc8.compiler.optimization.PackStructureMembers>
<com.microchip.xc8.compiler.optimization.AllocateBytesNeededForEnum>True</com.microchip.xc8.compiler.optimization.AllocateBytesNeededForEnum>
<com.microchip.xc8.compiler.warnings.AllWarnings>True</com.microchip.xc8.compiler.warnings.AllWarnings>
<com.microchip.xc8.linker.libraries.Libraries>
<ListValues>
<Value>libm</Value>
</ListValues>
</com.microchip.xc8.linker.libraries.Libraries>
</com.microchip.xc8>
</ToolchainSettings>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<ToolchainSettings>
<com.microchip.xc8>
<com.microchip.xc8.compiler.general.ChangeDefaultCharTypeUnsigned>True</com.microchip.xc8.compiler.general.ChangeDefaultCharTypeUnsigned>
<com.microchip.xc8.compiler.general.ChangeDefaultBitFieldUnsigned>True</com.microchip.xc8.compiler.general.ChangeDefaultBitFieldUnsigned>
<com.microchip.xc8.compiler.symbols.DefSymbols>
<ListValues>
<Value>(%24DeviceMacro)</Value>
<Value>DEBUG</Value>
</ListValues>
</com.microchip.xc8.compiler.symbols.DefSymbols>
<com.microchip.xc8.compiler.optimization.level>Optimize debugging experience (-Og)</com.microchip.xc8.compiler.optimization.level>
<com.microchip.xc8.compiler.optimization.PackStructureMembers>True</com.microchip.xc8.compiler.optimization.PackStructureMembers>
<com.microchip.xc8.compiler.optimization.AllocateBytesNeededForEnum>True</com.microchip.xc8.compiler.optimization.AllocateBytesNeededForEnum>
<com.microchip.xc8.compiler.optimization.DebugLevel>Default (-g2)</com.microchip.xc8.compiler.optimization.DebugLevel>
<com.microchip.xc8.compiler.warnings.AllWarnings>True</com.microchip.xc8.compiler.warnings.AllWarnings>
<com.microchip.xc8.linker.libraries.Libraries>
<ListValues>
<Value>libm</Value>
</ListValues>
</com.microchip.xc8.linker.libraries.Libraries>
<com.microchip.xc8.assembler.debugging.DebugLevel>Default (-Wa,-g)</com.microchip.xc8.assembler.debugging.DebugLevel>
</com.microchip.xc8>
<com.microchip.xc8.compiler.general.ChangeDefaultCharTypeUnsigned>True</com.microchip.xc8.compiler.general.ChangeDefaultCharTypeUnsigned>
<com.microchip.xc8.compiler.general.ChangeDefaultBitFieldUnsigned>True</com.microchip.xc8.compiler.general.ChangeDefaultBitFieldUnsigned>
<com.microchip.xc8.compiler.symbols.DefSymbols>
<ListValues>
<Value>(%24DeviceMacro)</Value>
<Value>DEBUG</Value>
</ListValues>
</com.microchip.xc8.compiler.symbols.DefSymbols>
<com.microchip.xc8.compiler.optimization.level>Optimize debugging experience (-Og)</com.microchip.xc8.compiler.optimization.level>
<com.microchip.xc8.compiler.optimization.PackStructureMembers>True</com.microchip.xc8.compiler.optimization.PackStructureMembers>
<com.microchip.xc8.compiler.optimization.AllocateBytesNeededForEnum>True</com.microchip.xc8.compiler.optimization.AllocateBytesNeededForEnum>
<com.microchip.xc8.compiler.optimization.DebugLevel>Default (-g2)</com.microchip.xc8.compiler.optimization.DebugLevel>
<com.microchip.xc8.compiler.warnings.AllWarnings>True</com.microchip.xc8.compiler.warnings.AllWarnings>
<com.microchip.xc8.linker.libraries.Libraries>
<ListValues>
<Value>libm</Value>
</ListValues>
</com.microchip.xc8.linker.libraries.Libraries>
<com.microchip.xc8.assembler.debugging.DebugLevel>Default (-Wa,-g)</com.microchip.xc8.assembler.debugging.DebugLevel>
</com.microchip.xc8>
</ToolchainSettings>
</PropertyGroup>
<ItemGroup>

View File

@@ -0,0 +1,137 @@
################################################################################
# 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 += \
../lcd_control.c \
../main.c
PREPROCESSING_SRCS +=
ASM_SRCS +=
OBJS += \
lcd_control.o \
main.o
OBJS_AS_ARGS += \
lcd_control.o \
main.o
C_DEPS += \
lcd_control.d \
main.d
C_DEPS_AS_ARGS += \
lcd_control.d \
main.d
OUTPUT_FILE_PATH +=opdracht\ 2.5.elf
OUTPUT_FILE_PATH_AS_ARGS +="opdracht 2.5.elf"
ADDITIONAL_DEPENDENCIES:=
OUTPUT_FILE_DEP:= ./makedep.mk
LIB_DEP+=
LINKER_SCRIPT_DEP+=
# AVR32/GNU C Compiler
./lcd_control.o: .././lcd_control.c
@echo Building file: $<
@echo Invoking: XC8 C Compiler : 2.31
$(QUOTE)C:\Program Files\Microchip\xc8\v2.31\bin\xc8-cc.exe$(QUOTE) -mcpu=ATmega128 -mdfp="C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\xc8" -c -x c -funsigned-char -funsigned-bitfields -mext=cci -D__ATmega128__ -DDEBUG -Og -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<"
@echo Finished building: $<
./main.o: .././main.c
@echo Building file: $<
@echo Invoking: XC8 C Compiler : 2.31
$(QUOTE)C:\Program Files\Microchip\xc8\v2.31\bin\xc8-cc.exe$(QUOTE) -mcpu=ATmega128 -mdfp="C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\xc8" -c -x c -funsigned-char -funsigned-bitfields -mext=cci -D__ATmega128__ -DDEBUG -Og -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -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: XC8 C Linker : 2.31
$(QUOTE)C:\Program Files\Microchip\xc8\v2.31\bin\xc8-cc.exe$(QUOTE) -o$(OUTPUT_FILE_PATH_AS_ARGS) $(OBJS_AS_ARGS) $(USER_OBJS) $(LIBS) -mcpu=ATmega128 -mdfp="C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\xc8" -Wl,-Map="opdracht 2.5.map" -funsigned-char -funsigned-bitfields -Wl,--start-group -Wl,-lm -Wl,--end-group -Wl,--gc-sections -Og -ffunction-sections -fdata-sections -fpack-struct -fshort-enums --memorysummary,memoryfile.xml
@echo Finished building target: $@
"C:\Program Files\Microchip\xc8\v2.31\bin\avr-objcopy.exe" -O ihex -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures "opdracht 2.5.elf" "opdracht 2.5.hex"
"C:\Program Files\Microchip\xc8\v2.31\bin\avr-objcopy.exe" -j .eeprom --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex "opdracht 2.5.elf" "opdracht 2.5.eep" || exit 0
"C:\Program Files\Microchip\xc8\v2.31\bin\avr-objdump.exe" -h -S "opdracht 2.5.elf" > "opdracht 2.5.lss"
# Other Targets
clean:
-$(RM) $(OBJS_AS_ARGS) $(EXECUTABLES)
-$(RM) $(C_DEPS_AS_ARGS)
rm -rf "opdracht 2.5.elf" "opdracht 2.5.hex" "opdracht 2.5.eep" "opdracht 2.5.map" "opdracht 2.5.usersignatures" "opdracht 2.5.a" "opdracht 2.5.lss"

View File

@@ -0,0 +1,8 @@
################################################################################
# Automatically-generated file. Do not edit or delete the file
################################################################################
lcd_control.c
main.c

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<executable name="opdracht 2.5.elf">
<memory name="program">
<units>bytes</units>
<length>131072</length>
<used>544</used>
<free>130528</free>
</memory>
<memory name="data">
<units>bytes</units>
<length>4096</length>
<used>0</used>
<free>4096</free>
</memory>
</executable>
</project>

View File

@@ -0,0 +1,341 @@
opdracht 2.5.elf: file format elf32-avr
Sections:
Idx Name Size VMA LMA File off Algn
0 .data 00000000 00800100 00800100 00000274 2**0
ALLOC, LOAD, DATA
1 .text 000000a4 00000000 00000000 00000054 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
2 .comment 0000002f 00000000 00000000 00000274 2**0
CONTENTS, READONLY
3 .debug_aranges 00000090 00000000 00000000 000002a3 2**0
CONTENTS, READONLY, DEBUGGING
4 .debug_info 000011bb 00000000 00000000 00000333 2**0
CONTENTS, READONLY, DEBUGGING
5 .debug_abbrev 0000095a 00000000 00000000 000014ee 2**0
CONTENTS, READONLY, DEBUGGING
6 .debug_line 00000526 00000000 00000000 00001e48 2**0
CONTENTS, READONLY, DEBUGGING
7 .debug_frame 00000110 00000000 00000000 00002370 2**2
CONTENTS, READONLY, DEBUGGING
8 .debug_str 000002ae 00000000 00000000 00002480 2**0
CONTENTS, READONLY, DEBUGGING
9 .debug_loc 00000242 00000000 00000000 0000272e 2**0
CONTENTS, READONLY, DEBUGGING
10 .debug_ranges 00000070 00000000 00000000 00002970 2**0
CONTENTS, READONLY, DEBUGGING
11 .text 00000004 0000021c 0000021c 00000270 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
12 .note.gnu.avr.deviceinfo 0000003c 00000000 00000000 000029e0 2**2
CONTENTS, READONLY, DEBUGGING
13 .text.sbi_porta 00000016 000001f8 000001f8 0000024c 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
14 .text.cbi_porta 00000018 000001e0 000001e0 00000234 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
15 .text.lcd_strobe_lcd_e 0000002a 0000012c 0000012c 00000180 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
16 .text.lcd_write_character 00000028 00000156 00000156 000001aa 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
17 .text.lcd_write_command 00000028 0000017e 0000017e 000001d2 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
18 .text.lcd_clear 0000001a 000001c6 000001c6 0000021a 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
19 .text.init_4bits_mode 00000050 000000ae 000000ae 00000102 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
20 .text.lcd_write_string 0000002e 000000fe 000000fe 00000152 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
21 .progmemx.data 0000000a 000000a4 000000a4 000000f8 2**0
CONTENTS, ALLOC, LOAD, READONLY, PROGMEMX
22 .text.main 00000020 000001a6 000001a6 000001fa 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
23 .text.libgcc 0000000e 0000020e 0000020e 00000262 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
Disassembly of section .text:
00000000 <__vectors>:
0: 0c 94 46 00 jmp 0x8c ; 0x8c <__ctors_end>
4: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
8: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
c: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
10: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
14: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
18: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
1c: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
20: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
24: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
28: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
2c: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
30: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
34: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
38: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
3c: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
40: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
44: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
48: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
4c: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
50: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
54: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
58: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
5c: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
60: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
64: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
68: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
6c: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
70: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
74: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
78: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
7c: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
80: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
84: 0c 94 0e 01 jmp 0x21c ; 0x21c <__bad_interrupt>
88: 0c 94 0e 01 jmp 0x21c ; 0x21c <__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: 0e 94 d3 00 call 0x1a6 ; 0x1a6 <main>
9c: 0c 94 50 00 jmp 0xa0 ; 0xa0 <_exit>
000000a0 <_exit>:
a0: f8 94 cli
000000a2 <__stop_program>:
a2: ff cf rjmp .-2 ; 0xa2 <__stop_program>
Disassembly of section .text:
0000021c <__bad_interrupt>:
21c: 0c 94 00 00 jmp 0 ; 0x0 <__vectors>
Disassembly of section .text.sbi_porta:
000001f8 <sbi_porta>:
void cbi_portc(int index){
PORTC &= ~(1<<index);
}
void sbi_porta(int index){
PORTA |= (1<<index);
1f8: 9b b3 in r25, 0x1b ; 27
1fa: 21 e0 ldi r18, 0x01 ; 1
1fc: 30 e0 ldi r19, 0x00 ; 0
1fe: 02 c0 rjmp .+4 ; 0x204 <sbi_porta+0xc>
200: 22 0f add r18, r18
202: 33 1f adc r19, r19
204: 8a 95 dec r24
206: e2 f7 brpl .-8 ; 0x200 <sbi_porta+0x8>
208: 29 2b or r18, r25
20a: 2b bb out 0x1b, r18 ; 27
20c: 08 95 ret
Disassembly of section .text.cbi_porta:
000001e0 <cbi_porta>:
PORTC |= (1<<index);
}
void cbi_portc(int index){
PORTC &= ~(1<<index);
1e0: 9b b3 in r25, 0x1b ; 27
1e2: 21 e0 ldi r18, 0x01 ; 1
1e4: 30 e0 ldi r19, 0x00 ; 0
1e6: 02 c0 rjmp .+4 ; 0x1ec <cbi_porta+0xc>
1e8: 22 0f add r18, r18
1ea: 33 1f adc r19, r19
1ec: 8a 95 dec r24
1ee: e2 f7 brpl .-8 ; 0x1e8 <cbi_porta+0x8>
1f0: 20 95 com r18
1f2: 29 23 and r18, r25
1f4: 2b bb out 0x1b, r18 ; 27
1f6: 08 95 ret
Disassembly of section .text.lcd_strobe_lcd_e:
0000012c <lcd_strobe_lcd_e>:
12c: 86 e0 ldi r24, 0x06 ; 6
12e: 90 e0 ldi r25, 0x00 ; 0
130: 0e 94 fc 00 call 0x1f8 ; 0x1f8 <sbi_porta>
134: 83 ec ldi r24, 0xC3 ; 195
136: 99 e0 ldi r25, 0x09 ; 9
138: 01 97 sbiw r24, 0x01 ; 1
13a: f1 f7 brne .-4 ; 0x138 <lcd_strobe_lcd_e+0xc>
13c: 00 c0 rjmp .+0 ; 0x13e <lcd_strobe_lcd_e+0x12>
13e: 00 00 nop
140: 86 e0 ldi r24, 0x06 ; 6
142: 90 e0 ldi r25, 0x00 ; 0
144: 0e 94 f0 00 call 0x1e0 ; 0x1e0 <cbi_porta>
148: 83 ec ldi r24, 0xC3 ; 195
14a: 99 e0 ldi r25, 0x09 ; 9
14c: 01 97 sbiw r24, 0x01 ; 1
14e: f1 f7 brne .-4 ; 0x14c <lcd_strobe_lcd_e+0x20>
150: 00 c0 rjmp .+0 ; 0x152 <lcd_strobe_lcd_e+0x26>
152: 00 00 nop
154: 08 95 ret
Disassembly of section .text.lcd_write_character:
00000156 <lcd_write_character>:
156: cf 93 push r28
158: c8 2f mov r28, r24
15a: 85 bb out 0x15, r24 ; 21
15c: 84 e0 ldi r24, 0x04 ; 4
15e: 90 e0 ldi r25, 0x00 ; 0
160: 0e 94 fc 00 call 0x1f8 ; 0x1f8 <sbi_porta>
164: 0e 94 96 00 call 0x12c ; 0x12c <lcd_strobe_lcd_e>
168: c2 95 swap r28
16a: c0 7f andi r28, 0xF0 ; 240
16c: c5 bb out 0x15, r28 ; 21
16e: 84 e0 ldi r24, 0x04 ; 4
170: 90 e0 ldi r25, 0x00 ; 0
172: 0e 94 fc 00 call 0x1f8 ; 0x1f8 <sbi_porta>
176: 0e 94 96 00 call 0x12c ; 0x12c <lcd_strobe_lcd_e>
17a: cf 91 pop r28
17c: 08 95 ret
Disassembly of section .text.lcd_write_command:
0000017e <lcd_write_command>:
17e: cf 93 push r28
180: c8 2f mov r28, r24
182: 85 bb out 0x15, r24 ; 21
184: 84 e0 ldi r24, 0x04 ; 4
186: 90 e0 ldi r25, 0x00 ; 0
188: 0e 94 f0 00 call 0x1e0 ; 0x1e0 <cbi_porta>
18c: 0e 94 96 00 call 0x12c ; 0x12c <lcd_strobe_lcd_e>
190: c2 95 swap r28
192: c0 7f andi r28, 0xF0 ; 240
194: c5 bb out 0x15, r28 ; 21
196: 84 e0 ldi r24, 0x04 ; 4
198: 90 e0 ldi r25, 0x00 ; 0
19a: 0e 94 f0 00 call 0x1e0 ; 0x1e0 <cbi_porta>
19e: 0e 94 96 00 call 0x12c ; 0x12c <lcd_strobe_lcd_e>
1a2: cf 91 pop r28
1a4: 08 95 ret
Disassembly of section .text.lcd_clear:
000001c6 <lcd_clear>:
1c6: 81 e0 ldi r24, 0x01 ; 1
1c8: 0e 94 bf 00 call 0x17e ; 0x17e <lcd_write_command>
1cc: 87 e8 ldi r24, 0x87 ; 135
1ce: 93 e1 ldi r25, 0x13 ; 19
1d0: 01 97 sbiw r24, 0x01 ; 1
1d2: f1 f7 brne .-4 ; 0x1d0 <lcd_clear+0xa>
1d4: 00 c0 rjmp .+0 ; 0x1d6 <lcd_clear+0x10>
1d6: 00 00 nop
1d8: 80 e8 ldi r24, 0x80 ; 128
1da: 0e 94 bf 00 call 0x17e ; 0x17e <lcd_write_command>
1de: 08 95 ret
Disassembly of section .text.init_4bits_mode:
000000ae <init_4bits_mode>:
ae: cf 93 push r28
b0: 8f ef ldi r24, 0xFF ; 255
b2: 84 bb out 0x14, r24 ; 20
b4: 85 bb out 0x15, r24 ; 21
b6: 81 bb out 0x11, r24 ; 17
b8: 8a bb out 0x1a, r24 ; 26
ba: 15 ba out 0x15, r1 ; 21
bc: 1b ba out 0x1b, r1 ; 27
be: c0 e2 ldi r28, 0x20 ; 32
c0: c5 bb out 0x15, r28 ; 21
c2: 0e 94 96 00 call 0x12c ; 0x12c <lcd_strobe_lcd_e>
c6: c5 bb out 0x15, r28 ; 21
c8: 0e 94 96 00 call 0x12c ; 0x12c <lcd_strobe_lcd_e>
cc: 80 e8 ldi r24, 0x80 ; 128
ce: 85 bb out 0x15, r24 ; 21
d0: 0e 94 96 00 call 0x12c ; 0x12c <lcd_strobe_lcd_e>
d4: 15 ba out 0x15, r1 ; 21
d6: 0e 94 96 00 call 0x12c ; 0x12c <lcd_strobe_lcd_e>
da: 80 ef ldi r24, 0xF0 ; 240
dc: 85 bb out 0x15, r24 ; 21
de: 0e 94 96 00 call 0x12c ; 0x12c <lcd_strobe_lcd_e>
e2: 15 ba out 0x15, r1 ; 21
e4: 0e 94 96 00 call 0x12c ; 0x12c <lcd_strobe_lcd_e>
e8: 80 e6 ldi r24, 0x60 ; 96
ea: 85 bb out 0x15, r24 ; 21
ec: 0e 94 96 00 call 0x12c ; 0x12c <lcd_strobe_lcd_e>
f0: 82 e0 ldi r24, 0x02 ; 2
f2: 0e 94 bf 00 call 0x17e ; 0x17e <lcd_write_command>
f6: 0e 94 96 00 call 0x12c ; 0x12c <lcd_strobe_lcd_e>
fa: cf 91 pop r28
fc: 08 95 ret
Disassembly of section .text.lcd_write_string:
000000fe <lcd_write_string>:
fe: cf 92 push r12
100: df 92 push r13
102: ef 92 push r14
104: 6b 01 movw r12, r22
106: e8 2e mov r14, r24
108: 07 c0 rjmp .+14 ; 0x118 <lcd_write_string+0x1a>
10a: 86 2f mov r24, r22
10c: 0e 94 ab 00 call 0x156 ; 0x156 <lcd_write_character>
110: 8f ef ldi r24, 0xFF ; 255
112: c8 1a sub r12, r24
114: d8 0a sbc r13, r24
116: e8 0a sbc r14, r24
118: f6 01 movw r30, r12
11a: 5e 2d mov r21, r14
11c: 0e 94 07 01 call 0x20e ; 0x20e <__xload_1>
120: 61 11 cpse r22, r1
122: f3 cf rjmp .-26 ; 0x10a <lcd_write_string+0xc>
124: ef 90 pop r14
126: df 90 pop r13
128: cf 90 pop r12
12a: 08 95 ret
Disassembly of section .text.main:
000001a6 <main>:
int main(void)
{
init_4bits_mode();
1a6: 0e 94 57 00 call 0xae ; 0xae <init_4bits_mode>
#else
//round up by default
__ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
#endif
__builtin_avr_delay_cycles(__ticks_dc);
1aa: 87 ea ldi r24, 0xA7 ; 167
1ac: 91 e6 ldi r25, 0x61 ; 97
1ae: 01 97 sbiw r24, 0x01 ; 1
1b0: f1 f7 brne .-4 ; 0x1ae <main+0x8>
1b2: 00 c0 rjmp .+0 ; 0x1b4 <main+0xe>
1b4: 00 00 nop
_delay_ms(10);
lcd_clear();
1b6: 0e 94 e3 00 call 0x1c6 ; 0x1c6 <lcd_clear>
lcd_write_string("Pintebaas");
1ba: 64 ea ldi r22, 0xA4 ; 164
1bc: 70 e0 ldi r23, 0x00 ; 0
1be: 80 e0 ldi r24, 0x00 ; 0
1c0: 0e 94 7f 00 call 0xfe ; 0xfe <lcd_write_string>
1c4: ff cf rjmp .-2 ; 0x1c4 <main+0x1e>
Disassembly of section .text.libgcc:
0000020e <__xload_1>:
20e: 57 fd sbrc r21, 7
210: 03 c0 rjmp .+6 ; 0x218 <__xload_1+0xa>
212: 5b bf out 0x3b, r21 ; 59
214: 67 91 elpm r22, Z+
216: 08 95 ret
218: 60 81 ld r22, Z
21a: 08 95 ret

View File

@@ -0,0 +1,123 @@
/*
* lcd_controlc.c
*
* Created: 24-2-2021 11:55:12
* Author: Sem
*/
#define F_CPU 10e6
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#include "lcd_control.h"
void _delay_ms(double __ms);
void lcd_clear() {
lcd_write_command (0x01); //Leeg display
_delay_ms(2);
lcd_write_command (0x80); //Cursor terug naar start
}
void lcd_strobe_lcd_e(void) {
sbi_porta(LCD_E); // E high
_delay_ms(1);
cbi_porta(LCD_E); // E low
_delay_ms(1);
}
void sbi_portc(int index){
PORTC |= (1<<index);
}
void cbi_portc(int index){
PORTC &= ~(1<<index);
}
void sbi_porta(int index){
PORTA |= (1<<index);
}
void cbi_porta(int index){
PORTA &= ~(1<<index);
}
void init_4bits_mode(void) {
// PORTC output mode and all low (also E and RS pin)
// Init I/O
DDRC = 0xFF; // PORTD(7) output, PORTD(6:0) input
PORTC = 0xFF;
DDRD = 0xFF;
DDRA = 0xFF;
PORTC = 0x00;
PORTA = 0x00;
PORTC = 0x20; // function for 4-bit 1 row
lcd_strobe_lcd_e();
PORTC = 0x20; // function high nibble 4-bit 2 row
lcd_strobe_lcd_e();
PORTC = 0x80; // function low nibble 4-bit 2 row
lcd_strobe_lcd_e();
PORTC = 0x00; // function high nibble turn on visible blinking-block cursor
lcd_strobe_lcd_e();
PORTC = 0xF0; // function low nibble turn on visible blinking-block cursor
lcd_strobe_lcd_e();
PORTC = 0x00; // Entry mode set high nibble
lcd_strobe_lcd_e();
PORTC = 0x60; // Entry mode set low nibble
lcd_strobe_lcd_e();
// return home
lcd_write_command(0x02);
lcd_strobe_lcd_e();
}
void lcd_write_character(unsigned char byte){
//upper nibble
PORTC = byte;
sbi_porta(LCD_RS);
lcd_strobe_lcd_e();
//lower nibble
PORTC = (byte<<4);
sbi_porta(LCD_RS);
lcd_strobe_lcd_e();
}
void lcd_write_command(unsigned char byte){
//upper nibble
PORTC = byte;
cbi_porta(LCD_RS);
lcd_strobe_lcd_e();
//lower nibble
PORTC = (byte<<4);
cbi_porta(LCD_RS);
lcd_strobe_lcd_e();
}
void lcd_write_string(const char *str) {
for(;*str; str++){
lcd_write_character(*str);
}
}
void lcd_move_right(void){
lcd_write_command(0x1E);
}

View File

@@ -0,0 +1,29 @@
/*
* lcd_control.h
*
* Created: 24-2-2021 11:56:16
* Author: Sem
*/
#ifndef LCD_CONTROL_H_
#define LCD_CONTROL_H_
#define LCD_E 6
#define LCD_RS 4
void _delay_ms(double __ms);
void lcd_strobe_lcd_e(void);
void sbi_portc(int index);
void cbi_portc(int index);
void sbi_porta(int index);
void cbi_porta(int index);
void init_4bits_mode(void);
void lcd_write_string(const char *str);
void lcd_write_character(unsigned char byte);
void lcd_write_command(unsigned char byte);
void lcd_clear();
#endif /* LCD_CONTROL_H_ */

View File

@@ -0,0 +1,35 @@
/*
* main.c
*
* Created: 11-Feb-21 11:01:07 PM
* Author: lemms
*/
#define F_CPU 10e6
#include <xc.h>
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#include "lcd_control.h"
int main(void)
{
init_4bits_mode();
_delay_ms(10);
lcd_clear();
lcd_write_string("Pintebaas");
while(1)
{
//TODO:: Please write your application code
}
}

View File

@@ -4,7 +4,7 @@
<SchemaVersion>2.0</SchemaVersion>
<ProjectVersion>7.0</ProjectVersion>
<ToolchainName>com.microchip.xc8</ToolchainName>
<ProjectGuid>{a8e029a0-3e6c-453c-ac34-4d6f411bed60}</ProjectGuid>
<ProjectGuid>{c81b68aa-f4bb-4a5d-81f8-2737dcd1d4a7}</ProjectGuid>
<avrdevice>ATmega128</avrdevice>
<avrdeviceseries>none</avrdeviceseries>
<OutputType>Executable</OutputType>
@@ -30,71 +30,74 @@
<EraseKey />
<AsfFrameworkConfig>
<framework-data xmlns="">
<options />
<configurations />
<files />
<documentation help="" />
<offline-documentation help="" />
<dependencies>
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.49.1" />
</dependencies>
</framework-data>
<options />
<configurations />
<files />
<documentation help="" />
<offline-documentation help="" />
<dependencies>
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.49.1" />
</dependencies>
</framework-data>
</AsfFrameworkConfig>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<ToolchainSettings>
<com.microchip.xc8>
<com.microchip.xc8.common.optimization.RelaxBranches>True</com.microchip.xc8.common.optimization.RelaxBranches>
<com.microchip.xc8.compiler.general.ChangeDefaultCharTypeUnsigned>True</com.microchip.xc8.compiler.general.ChangeDefaultCharTypeUnsigned>
<com.microchip.xc8.compiler.general.ChangeDefaultBitFieldUnsigned>True</com.microchip.xc8.compiler.general.ChangeDefaultBitFieldUnsigned>
<com.microchip.xc8.compiler.symbols.DefSymbols>
<ListValues>
<Value>(%24DeviceMacro)</Value>
<Value>NDEBUG</Value>
</ListValues>
</com.microchip.xc8.compiler.symbols.DefSymbols>
<com.microchip.xc8.compiler.optimization.level>Optimize for size (-Os)</com.microchip.xc8.compiler.optimization.level>
<com.microchip.xc8.compiler.optimization.PackStructureMembers>True</com.microchip.xc8.compiler.optimization.PackStructureMembers>
<com.microchip.xc8.compiler.optimization.AllocateBytesNeededForEnum>True</com.microchip.xc8.compiler.optimization.AllocateBytesNeededForEnum>
<com.microchip.xc8.compiler.warnings.AllWarnings>True</com.microchip.xc8.compiler.warnings.AllWarnings>
<com.microchip.xc8.linker.libraries.Libraries>
<ListValues>
<Value>libm</Value>
</ListValues>
</com.microchip.xc8.linker.libraries.Libraries>
</com.microchip.xc8>
<com.microchip.xc8.common.optimization.RelaxBranches>True</com.microchip.xc8.common.optimization.RelaxBranches>
<com.microchip.xc8.compiler.general.ChangeDefaultCharTypeUnsigned>True</com.microchip.xc8.compiler.general.ChangeDefaultCharTypeUnsigned>
<com.microchip.xc8.compiler.general.ChangeDefaultBitFieldUnsigned>True</com.microchip.xc8.compiler.general.ChangeDefaultBitFieldUnsigned>
<com.microchip.xc8.compiler.symbols.DefSymbols>
<ListValues>
<Value>(%24DeviceMacro)</Value>
<Value>NDEBUG</Value>
</ListValues>
</com.microchip.xc8.compiler.symbols.DefSymbols>
<com.microchip.xc8.compiler.optimization.level>Optimize for size (-Os)</com.microchip.xc8.compiler.optimization.level>
<com.microchip.xc8.compiler.optimization.PackStructureMembers>True</com.microchip.xc8.compiler.optimization.PackStructureMembers>
<com.microchip.xc8.compiler.optimization.AllocateBytesNeededForEnum>True</com.microchip.xc8.compiler.optimization.AllocateBytesNeededForEnum>
<com.microchip.xc8.compiler.warnings.AllWarnings>True</com.microchip.xc8.compiler.warnings.AllWarnings>
<com.microchip.xc8.linker.libraries.Libraries>
<ListValues>
<Value>libm</Value>
</ListValues>
</com.microchip.xc8.linker.libraries.Libraries>
</com.microchip.xc8>
</ToolchainSettings>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<ToolchainSettings>
<com.microchip.xc8>
<com.microchip.xc8.compiler.general.ChangeDefaultCharTypeUnsigned>True</com.microchip.xc8.compiler.general.ChangeDefaultCharTypeUnsigned>
<com.microchip.xc8.compiler.general.ChangeDefaultBitFieldUnsigned>True</com.microchip.xc8.compiler.general.ChangeDefaultBitFieldUnsigned>
<com.microchip.xc8.compiler.symbols.DefSymbols>
<ListValues>
<Value>(%24DeviceMacro)</Value>
<Value>DEBUG</Value>
</ListValues>
</com.microchip.xc8.compiler.symbols.DefSymbols>
<com.microchip.xc8.compiler.optimization.level>Optimize debugging experience (-Og)</com.microchip.xc8.compiler.optimization.level>
<com.microchip.xc8.compiler.optimization.PackStructureMembers>True</com.microchip.xc8.compiler.optimization.PackStructureMembers>
<com.microchip.xc8.compiler.optimization.AllocateBytesNeededForEnum>True</com.microchip.xc8.compiler.optimization.AllocateBytesNeededForEnum>
<com.microchip.xc8.compiler.optimization.DebugLevel>Default (-g2)</com.microchip.xc8.compiler.optimization.DebugLevel>
<com.microchip.xc8.compiler.warnings.AllWarnings>True</com.microchip.xc8.compiler.warnings.AllWarnings>
<com.microchip.xc8.linker.libraries.Libraries>
<ListValues>
<Value>libm</Value>
</ListValues>
</com.microchip.xc8.linker.libraries.Libraries>
<com.microchip.xc8.assembler.debugging.DebugLevel>Default (-Wa,-g)</com.microchip.xc8.assembler.debugging.DebugLevel>
</com.microchip.xc8>
<com.microchip.xc8.compiler.general.ChangeDefaultCharTypeUnsigned>True</com.microchip.xc8.compiler.general.ChangeDefaultCharTypeUnsigned>
<com.microchip.xc8.compiler.general.ChangeDefaultBitFieldUnsigned>True</com.microchip.xc8.compiler.general.ChangeDefaultBitFieldUnsigned>
<com.microchip.xc8.compiler.symbols.DefSymbols>
<ListValues>
<Value>(%24DeviceMacro)</Value>
<Value>DEBUG</Value>
</ListValues>
</com.microchip.xc8.compiler.symbols.DefSymbols>
<com.microchip.xc8.compiler.optimization.level>Optimize debugging experience (-Og)</com.microchip.xc8.compiler.optimization.level>
<com.microchip.xc8.compiler.optimization.PackStructureMembers>True</com.microchip.xc8.compiler.optimization.PackStructureMembers>
<com.microchip.xc8.compiler.optimization.AllocateBytesNeededForEnum>True</com.microchip.xc8.compiler.optimization.AllocateBytesNeededForEnum>
<com.microchip.xc8.compiler.optimization.DebugLevel>Default (-g2)</com.microchip.xc8.compiler.optimization.DebugLevel>
<com.microchip.xc8.compiler.warnings.AllWarnings>True</com.microchip.xc8.compiler.warnings.AllWarnings>
<com.microchip.xc8.linker.libraries.Libraries>
<ListValues>
<Value>libm</Value>
</ListValues>
</com.microchip.xc8.linker.libraries.Libraries>
<com.microchip.xc8.assembler.debugging.DebugLevel>Default (-Wa,-g)</com.microchip.xc8.assembler.debugging.DebugLevel>
</com.microchip.xc8>
</ToolchainSettings>
</PropertyGroup>
<ItemGroup>
<Compile Include="ldc.c">
<Compile Include="lcd_control.c">
<SubType>compile</SubType>
</Compile>
<Compile Include="ldc.h">
<Compile Include="lcd_control.h">
<SubType>compile</SubType>
</Compile>
<Compile Include="main.c">
<SubType>compile</SubType>
</Compile>
</ItemGroup>

View File

@@ -0,0 +1,139 @@
################################################################################
# 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 += \
../lcd_control.c \
../main.c
PREPROCESSING_SRCS +=
ASM_SRCS +=
OBJS += \
lcd_control.o \
main.o
OBJS_AS_ARGS += \
lcd_control.o \
main.o
C_DEPS += \
lcd_control.d \
main.d
C_DEPS_AS_ARGS += \
lcd_control.d \
main.d
OUTPUT_FILE_PATH +=opdracht\ 3.2.elf
OUTPUT_FILE_PATH_AS_ARGS +="opdracht 3.2.elf"
ADDITIONAL_DEPENDENCIES:=
OUTPUT_FILE_DEP:= ./makedep.mk
LIB_DEP+=
LINKER_SCRIPT_DEP+=
# AVR32/GNU C Compiler
./lcd_control.o: .././lcd_control.c
@echo Building file: $<
@echo Invoking: AVR/GNU C Compiler : 5.4.0
$(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.6.364\include" -Og -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.6.364\gcc\dev\atmega128" -c -std=gnu99 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<"
@echo Finished building: $<
./main.o: .././main.c
@echo Building file: $<
@echo Invoking: AVR/GNU C Compiler : 5.4.0
$(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.6.364\include" -Og -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.6.364\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 : 5.4.0
$(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="opdracht 3.2.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.6.364\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 "opdracht 3.2.elf" "opdracht 3.2.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 "opdracht 3.2.elf" "opdracht 3.2.eep" || exit 0
"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objdump.exe" -h -S "opdracht 3.2.elf" > "opdracht 3.2.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 "opdracht 3.2.elf" "opdracht 3.2.srec"
"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-size.exe" "opdracht 3.2.elf"
# Other Targets
clean:
-$(RM) $(OBJS_AS_ARGS) $(EXECUTABLES)
-$(RM) $(C_DEPS_AS_ARGS)
rm -rf "opdracht 3.2.elf" "opdracht 3.2.a" "opdracht 3.2.hex" "opdracht 3.2.lss" "opdracht 3.2.eep" "opdracht 3.2.map" "opdracht 3.2.srec" "opdracht 3.2.usersignatures"

View File

@@ -0,0 +1,8 @@
################################################################################
# Automatically-generated file. Do not edit or delete the file
################################################################################
lcd_control.c
main.c

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,150 @@
S01400006F7064726163687420332E322E7372656308
S113000045C0000060C000005EC000005CC000008D
S11300105AC0000058C0000056C0000054C0000080
S113002052C0000050C00000DDC000004CC0000001
S11300304AC0000048C0000046C0000044C00000A0
S113004042C0000040C000003EC000003CC00000B0
S11300503AC0000038C0000036C0000034C00000C0
S113006032C0000030C000002EC000002CC00000D0
S11300702AC0000028C0000026C0000024C00000E0
S113008022C0000020C000001EC0000011241FBEBA
S1130090CFEFD0E1DEBFCDBF11E0A0E0B1E0E2E2FE
S11300A0F9E000E00BBF02C007900D92AA30B1073F
S11300B0D9F721E0AAE0B1E001C01D92AC30B2074B
S11300C0E1F729D12CC49CCF9BB321E030E002C0DE
S11300D0220F331F8A95E2F7292B2BBB08959BB37C
S11300E021E030E002C0220F331F8A95E2F7209509
S11300F029232BBB089586E090E0E6DF83EC99E0AA
S11301000197F1F700C0000086E090E0E8DF83EC9F
S113011099E00197F1F700C000000895CF93C82F2C
S113012085BB84E090E0D0DFE6DFC295C07FC5BB2D
S113013084E090E0C9DFDFDFCF910895CF93C82F2B
S113014085BB84E090E0CBDFD6DFC295C07FC5BB22
S113015084E090E0C4DFCFDFCF91089581E0EEDF4B
S113016087E893E10197F1F700C0000080E8E6CF4B
S11301700895CF938FEF84BB85BB8ABB15BA1BBA96
S1130180C0E2C5BBB8DFC5BBB6DF80E885BBB3DF63
S113019015BAB1DF80EF85BBAEDF15BAACDF80E600
S11301A085BBA9DF82E0CADFA6DFCF910895CF9394
S11301B0DF93EC0102C0B2DF219688818111FBCF6D
S11301C0DF91CF91089520E030E008C0EFECF7E034
S11301D03197F1F700C000002F5F3F4F2817390710
S11301E0ACF308951F920F920FB60F9211240BB621
S11301F00F92CF92DF92EF92FF920F931F932F9360
S11302003F934F935F936F937F938F939F93AF939A
S1130210BF93EF93FF93CF93DF93CDB7DEB7CDB604
S1130220DEB68091000184BD80910A0190910B019A
S1130230019690930B0180930A0190DF80910A014B
S113024090910B0101969F938F930F2EF2E0EF2E66
S1130250F1E0FF2EF02DFF92EF921F921F921F925A
S11302601F9274D001962DB73EB7285F3F4F0FB64B
S1130270F8943EBF0FBE2DBF281B390B0FB6F89460
S11302803EBF0FBE2DBF0DB71EB70F5F1F4F20918E
S11302900A0130910B012F5F3F4F3F932F93FF9241
S11302A0EF929F938F931F930F9350D0802F912F92
S11302B07EDF8DB79EB708960FB6F8949EBF0FBE2B
S11302C08DBF0FB6F894DEBE0FBECDBEDF91CF91C9
S11302D0FF91EF91BF91AF919F918F917F916F911A
S11302E05F914F913F912F911F910F91FF90EF904C
S11302F0DF90CF900F900BBE0F900FBE0F901F900A
S113030018958091000184BD87B7806487BF789475
S113031087E085BD089581B38F7781BB8FEF8ABB5A
S113032087BB27DF8FE19EE40197F1F700C000004F
S113033015DF85E091E03BDFE4DF84B58BBB809182
S11303400A0188BB8AE090E03EDFF7CF0F931F934A
S1130350CF93DF93CDB7DEB72E970FB6F894DEBFF9
S11303600FBECDBF0D891E898F89988D26E02C8301
S11303701A83098397FF02C080E090E801979E8367
S11303808D83AE01455E5F4F698D7A8DCE010196F6
S113039019D04D815E8157FD0AC02F8138854217DF
S11303A053070CF49A01F801E20FF31F10822E9602
S11303B00FB6F894DEBF0FBECDBFDF91CF911F9172
S11303C00F9108952F923F924F925F926F927F9276
S11303D08F929F92AF92BF92CF92DF92EF92FF9251
S11303E00F931F93CF93DF93CDB7DEB72B970FB641
S11303F0F894DEBF0FBECDBF6C017B018A01FC0106
S113040017821682838181FFBFC1CE0101963C0110
S1130410F6019381F70193FD859193FF81917F010B
S1130420882309F4ADC1853239F493FD859193FF96
S113043081917F01853221F4B60190E0D6D1E8CFD5
S1130440912C212C312CFFE1F315D8F08B3279F06B
S113045038F4803279F08332A1F4232D20611DC059
S11304608D3261F0803369F4232D216016C0832D11
S11304708260382EE32DE4603E2E2AC0F32DF8600E
S11304801DC037FC2DC020ED280F2A3040F08E32DD
S1130490B9F436FC75C1232D2064322E19C036FE02
S11304A006C08AE0989E200D1124922E11C0EAE025
S11304B02E9E200D1124222EF32DF0623F2E08C013
S11304C08C3621F4832D8068382E02C0883641F49E
S11304D0F70193FD859193FF81917F018111B3CF42
S11304E0982F9F7D9554933028F40C5F1F4F9FE302
S11304F099830DC0833631F0833771F0833509F069
S113050055C020C0F801808189830E5F1F4F882465
S11305108394912C530112C02801F2E04F0E511C18
S1130520F801A080B18036FE03C0692D70E002C0DE
S11305306FEF7FEFC5014ED14C018201F32DFF77A0
S11305403F2E15C0280122E0420E511CF801A08064
S1130550B18036FE03C0692D70E002C06FEF7FEFFB
S1130560C5012DD14C01F32DF0683F2E820133FCDF
S113057019C0822D90E088169906A0F4B60180E295
S113058090E033D12A94F5CFF50137FC859137FEFD
S113059081915F01B60190E028D121102A9421E0D5
S11305A0821A91088114910479F7E1C0843611F01C
S11305B0893639F5F80137FE07C06081718182817F
S11305C093810C5F1F4F08C060817181072E000C5E
S11305D0880B990B0E5F1F4FF32DFF763F2E97FF6D
S11305E009C090958095709561957F4F8F4F9F4F6F
S11305F0F0683F2E2AE030E0A30133D1882E86181C
S113060044C0853731F4232D2F7EB22E2AE030E00A
S113061025C0932D997FB92E8F36C1F018F48835F3
S113062079F0AEC0803719F0883721F0A9C0E92FDE
S1130630E061BE2EB4FE0DC0FB2DF460BF2E09C0D8
S113064034FE0AC0292F2660B22E06C028E030E00E
S113065005C020E130E002C020E132E0F801B7FE3D
S113066007C060817181828193810C5F1F4F06C036
S11306706081718180E090E00E5F1F4FA301F1D093
S1130680882E8618FB2DFF773F2E36FE0DC0232DB6
S11306902E7FA22E891458F434FE0BC032FC09C0FC
S11306A0832D8E7EA82E05C0B82CA32C03C0B82C95
S11306B001C0B92CA4FE0FC0FE01E80DF11D80811C
S11306C0803321F49A2D997EA92E09C0A2FE06C07A
S11306D0B394B39404C08A2D867809F0B394A3FC30
S11306E010C0A0FE06C0B21480F4280C922C9B18F3
S11306F00DC0B21458F4B60180E290E076D0B39401
S1130700F8CFB21418F42B1802C0982C212CA4FE94
S11307100FC0B60180E390E068D0A2FE16C0A1FC31
S113072003C088E790E002C088E590E0B6010CC001
S11307308A2D867851F0A1FE02C08BE201C080E2CE
S1130740A7FC8DE2B60190E050D0891430F4B601D4
S113075080E390E04AD09A94F8CF8A94F301E80DAC
S1130760F11D8081B60190E040D08110F6CF2220A7
S113077009F44ECEB60180E290E037D02A94F7CF48
S1130780F6018681978102C08FEF9FEF2B960FB6FB
S1130790F894DEBF0FBECDBFDF91CF911F910F91B3
S11307A0FF90EF90DF90CF90BF90AF909F908F908D
S11307B07F906F905F904F903F902F900895FC0131
S11307C00590615070400110D8F7809590958E0F78
S11307D09F1F0895FC016150704001900110D8F7EB
S11307E0809590958E0F9F1F08950F931F93CF931D
S11307F0DF93FB01238121FD03C08FEF9FEF2CC00A
S113080022FF16C046815781248135814217530740
S113081044F4A081B1819D012F5F3F4F3183208338
S11308208C93268137812F5F3F4F3783268314C0F3
S11308308B01EC01FB010084F185E02D0995892BE6
S1130840E1F6D80116968D919C911797019617960B
S11308509C938E931697CE01DF91CF911F910F91A8
S11308600895FA01AA27283051F1203181F1E89442
S11308706F936E7F6E5F7F4F8F4F9F4FAF4FB1E08F
S11308803ED0B4E03CD0670F781F891F9A1FA11D8A
S1130890680F791F8A1F911DA11D6A0F711D811D8B
S11308A0911DA11D20D009F468943F912AE0269F50
S11308B011243019305D3193DEF6CF010895462FAF
S11308C04770405D4193B3E00FD0C9F7F6CF462F90
S11308D04F70405D4A3318F0495D31FD40524193F9
S11308E002D0A9F7EACFB4E0A695979587957795B6
S11308F06795BA95C9F700976105710508959B013D
S1130900AC010A2E06945795479537952795BA95C5
S1130910C9F7620F731F841F951FA01D0895F894D3
S1050920FFCF03
S10D0922FFFF256400796565740089
S9030000FC

View File

@@ -0,0 +1,122 @@
/*
* lcd_controlc.c
*
* Created: 24-2-2021 11:55:12
* Author: Sem
*/
#define F_CPU 10e6
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#include "lcd_control.h"
void _delay_ms(double __ms);
void lcd_clear() {
lcd_write_command (0x01); //Leeg display
_delay_ms(2);
lcd_write_command (0x80); //Cursor terug naar start
}
void lcd_strobe_lcd_e(void) {
sbi_porta(LCD_E); // E high
_delay_ms(1);
cbi_porta(LCD_E); // E low
_delay_ms(1);
}
void sbi_portc(int index){
PORTC |= (1<<index);
}
void cbi_portc(int index){
PORTC &= ~(1<<index);
}
void sbi_porta(int index){
PORTA |= (1<<index);
}
void cbi_porta(int index){
PORTA &= ~(1<<index);
}
void init_4bits_mode(void) {
// PORTC output mode and all low (also E and RS pin)
// Init I/O
DDRC = 0xFF; // PORTD(7) output, PORTD(6:0) input
PORTC = 0xFF;
DDRA = 0xFF;
PORTC = 0x00;
PORTA = 0x00;
PORTC = 0x20; // function for 4-bit 1 row
lcd_strobe_lcd_e();
PORTC = 0x20; // function high nibble 4-bit 2 row
lcd_strobe_lcd_e();
PORTC = 0x80; // function low nibble 4-bit 2 row
lcd_strobe_lcd_e();
PORTC = 0x00; // function high nibble turn on visible blinking-block cursor
lcd_strobe_lcd_e();
PORTC = 0xF0; // function low nibble turn on visible blinking-block cursor
lcd_strobe_lcd_e();
PORTC = 0x00; // Entry mode set high nibble
lcd_strobe_lcd_e();
PORTC = 0x60; // Entry mode set low nibble
lcd_strobe_lcd_e();
// return home
lcd_write_command(0x02);
lcd_strobe_lcd_e();
}
void lcd_write_character(unsigned char byte){
//upper nibble
PORTC = byte;
sbi_porta(LCD_RS);
lcd_strobe_lcd_e();
//lower nibble
PORTC = (byte<<4);
sbi_porta(LCD_RS);
lcd_strobe_lcd_e();
}
void lcd_write_command(unsigned char byte){
//upper nibble
PORTC = byte;
cbi_porta(LCD_RS);
lcd_strobe_lcd_e();
//lower nibble
PORTC = (byte<<4);
cbi_porta(LCD_RS);
lcd_strobe_lcd_e();
}
void lcd_write_string(const char *str) {
for(;*str; str++){
lcd_write_character(*str);
}
}
void lcd_move_right(void){
lcd_write_command(0x1E);
}

View File

@@ -0,0 +1,29 @@
/*
* lcd_control.h
*
* Created: 24-2-2021 11:56:16
* Author: Sem
*/
#ifndef LCD_CONTROL_H_
#define LCD_CONTROL_H_
#define LCD_E 6
#define LCD_RS 4
void _delay_ms(double __ms);
void lcd_strobe_lcd_e(void);
void sbi_portc(int index);
void cbi_portc(int index);
void sbi_porta(int index);
void cbi_porta(int index);
void init_4bits_mode(void);
void lcd_write_string(const char *str);
void lcd_write_character(unsigned char byte);
void lcd_write_command(unsigned char byte);
void lcd_clear();
#endif /* LCD_CONTROL_H_ */

View File

@@ -0,0 +1,81 @@
/*
* counter_t2_interrupt.c
*
* Created: 21/02/2021 13:00:25
* Author : Etienne
*/
#define F_CPU 8e6
#include <stdlib.h>
#include <stdio.h>
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#include "lcd_control.h"
#define BIT(x) (1 << (x))
// 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)
}
}
char * toArray(int number)
{
int n = log10(number) + 1;
int i;
char *numberArray = calloc(n, sizeof(char));
for (i = n-1; i >= 0; --i, number /= 10)
{
numberArray[i] = (number % 10) + '0';
}
return numberArray;
}
int TimerPreset = -1; // 0xF6, 10 till overflow
int number = 0;
// Interrupt routine timer2 overflow
ISR( TIMER2_OVF_vect ) {
TCNT2 = TimerPreset; // Preset value
number++; // Increment counter
lcd_clear();
int length = snprintf(NULL, 0, "%d", number + 1);
char str[length + 1];
snprintf(str, length + 1, "%d", number + 1);
lcd_write_string(str);
}
// Initialize timer2
void timer2Init( void ) {
TCNT2 = TimerPreset; // Preset value of counter 2
TIMSK |= BIT(6); // T2 overflow interrupt enable
sei(); // turn_on intr all
TCCR2 = 0x07; // Initialize T2: ext.counting, rising edge, run
}
int main(void) {
DDRD &= ~BIT(7); // PD7 op input: DDRD=xxxx xxx0
DDRA = 0xFF; // set PORTA for output (shows countregister)
DDRB = 0xFF; // set PORTB for output (shows tenthvalue)
init_4bits_mode();
_delay_ms(10);
lcd_clear();
lcd_write_string("yeet");
timer2Init();
while (1) {
PORTA = TCNT2; // show value counter 2
PORTB = number; // show value tenth counter
wait(10);
}
}

View File

@@ -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.6.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.6.364\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.6.364\include\avr\iom128.h</AbsolutePath>
<Attribute></Attribute>
<Category>header</Category>
<Condition>C</Condition>
<FileContentHash>JdJ7J9I/SJh965SEyyyVYw==</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.6.364\templates\main.c</AbsolutePath>
<Attribute>template</Attribute>
<Category>source</Category>
<Condition>C Exe</Condition>
<FileContentHash>jmg1Ivqg0tP1uOL2/aRLyg==</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.6.364\templates\main.cpp</AbsolutePath>
<Attribute>template</Attribute>
<Category>source</Category>
<Condition>C Exe</Condition>
<FileContentHash>mkKaE95TOoATsuBGv6jmxg==</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.6.364\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.6.364/Atmel.ATmega_DFP.pdsc</PackPath>
<PackVersion>1.6.364</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>

View File

@@ -0,0 +1,136 @@
<?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>{eb7415c6-2130-46ad-9842-612c67ade6d4}</ProjectGuid>
<avrdevice>ATmega128</avrdevice>
<avrdeviceseries>none</avrdeviceseries>
<OutputType>Executable</OutputType>
<Language>C</Language>
<OutputFileName>$(MSBuildProjectName)</OutputFileName>
<OutputFileExtension>.elf</OutputFileExtension>
<OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
<AssemblyName>opdracht 3.2</AssemblyName>
<Name>opdracht 3.2</Name>
<RootNamespace>opdracht 3.2</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>
<ResetRule>0</ResetRule>
<eraseonlaunchrule>0</eraseonlaunchrule>
<EraseKey />
<AsfFrameworkConfig>
<framework-data xmlns="">
<options />
<configurations />
<files />
<documentation help="" />
<offline-documentation help="" />
<dependencies>
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.49.1" />
</dependencies>
</framework-data>
</AsfFrameworkConfig>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<ToolchainSettings>
<AvrGcc>
<avrgcc.common.Device>-mmcu=atmega128 -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\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.6.364\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.assembler.general.IncludePaths>
<ListValues>
<Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\include\</Value>
</ListValues>
</avrgcc.assembler.general.IncludePaths>
</AvrGcc>
</ToolchainSettings>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<ToolchainSettings>
<AvrGcc>
<avrgcc.common.Device>-mmcu=atmega128 -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\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.6.364\include\</Value>
</ListValues>
</avrgcc.compiler.directories.IncludePaths>
<avrgcc.compiler.optimization.level>Optimize debugging experience (-Og)</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.general.IncludePaths>
<ListValues>
<Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\include\</Value>
</ListValues>
</avrgcc.assembler.general.IncludePaths>
<avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
</AvrGcc>
</ToolchainSettings>
</PropertyGroup>
<ItemGroup>
<Compile Include="lcd_control.c">
<SubType>compile</SubType>
</Compile>
<Compile Include="lcd_control.h">
<SubType>compile</SubType>
</Compile>
<Compile Include="main.c">
<SubType>compile</SubType>
</Compile>
</ItemGroup>
<Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
</Project>

View File

@@ -0,0 +1,127 @@
################################################################################
# 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 +=opdracht\ 3.3.elf
OUTPUT_FILE_PATH_AS_ARGS +="opdracht 3.3.elf"
ADDITIONAL_DEPENDENCIES:=
OUTPUT_FILE_DEP:= ./makedep.mk
LIB_DEP+=
LINKER_SCRIPT_DEP+=
# AVR32/GNU C Compiler
./main.o: .././main.c
@echo Building file: $<
@echo Invoking: AVR/GNU C Compiler : 5.4.0
$(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.6.364\include" -Og -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.6.364\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 : 5.4.0
$(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="opdracht 3.3.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.6.364\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 "opdracht 3.3.elf" "opdracht 3.3.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 "opdracht 3.3.elf" "opdracht 3.3.eep" || exit 0
"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objdump.exe" -h -S "opdracht 3.3.elf" > "opdracht 3.3.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 "opdracht 3.3.elf" "opdracht 3.3.srec"
"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-size.exe" "opdracht 3.3.elf"
# Other Targets
clean:
-$(RM) $(OBJS_AS_ARGS) $(EXECUTABLES)
-$(RM) $(C_DEPS_AS_ARGS)
rm -rf "opdracht 3.3.elf" "opdracht 3.3.a" "opdracht 3.3.hex" "opdracht 3.3.lss" "opdracht 3.3.eep" "opdracht 3.3.map" "opdracht 3.3.srec" "opdracht 3.3.usersignatures"

View File

@@ -0,0 +1,6 @@
################################################################################
# Automatically-generated file. Do not edit or delete the file
################################################################################
main.c

View File

@@ -0,0 +1 @@
:00000001FF

View File

@@ -0,0 +1,262 @@
opdracht 3.3.elf: file format elf32-avr
Sections:
Idx Name Size VMA LMA File off Algn
0 .data 00000000 00800100 00800100 00000196 2**0
CONTENTS, ALLOC, LOAD, DATA
1 .text 00000142 00000000 00000000 00000054 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
2 .comment 00000030 00000000 00000000 00000196 2**0
CONTENTS, READONLY
3 .note.gnu.avr.deviceinfo 0000003c 00000000 00000000 000001c8 2**2
CONTENTS, READONLY
4 .debug_aranges 00000038 00000000 00000000 00000204 2**0
CONTENTS, READONLY, DEBUGGING
5 .debug_info 00000944 00000000 00000000 0000023c 2**0
CONTENTS, READONLY, DEBUGGING
6 .debug_abbrev 00000878 00000000 00000000 00000b80 2**0
CONTENTS, READONLY, DEBUGGING
7 .debug_line 00000317 00000000 00000000 000013f8 2**0
CONTENTS, READONLY, DEBUGGING
8 .debug_frame 00000068 00000000 00000000 00001710 2**2
CONTENTS, READONLY, DEBUGGING
9 .debug_str 0000046a 00000000 00000000 00001778 2**0
CONTENTS, READONLY, DEBUGGING
10 .debug_loc 000000b3 00000000 00000000 00001be2 2**0
CONTENTS, READONLY, DEBUGGING
11 .debug_ranges 00000028 00000000 00000000 00001c95 2**0
CONTENTS, READONLY, DEBUGGING
Disassembly of section .text:
00000000 <__vectors>:
0: 45 c0 rjmp .+138 ; 0x8c <__ctors_end>
2: 00 00 nop
4: 60 c0 rjmp .+192 ; 0xc6 <__bad_interrupt>
6: 00 00 nop
8: 5e c0 rjmp .+188 ; 0xc6 <__bad_interrupt>
a: 00 00 nop
c: 5c c0 rjmp .+184 ; 0xc6 <__bad_interrupt>
e: 00 00 nop
10: 5a c0 rjmp .+180 ; 0xc6 <__bad_interrupt>
12: 00 00 nop
14: 58 c0 rjmp .+176 ; 0xc6 <__bad_interrupt>
16: 00 00 nop
18: 56 c0 rjmp .+172 ; 0xc6 <__bad_interrupt>
1a: 00 00 nop
1c: 54 c0 rjmp .+168 ; 0xc6 <__bad_interrupt>
1e: 00 00 nop
20: 52 c0 rjmp .+164 ; 0xc6 <__bad_interrupt>
22: 00 00 nop
24: 69 c0 rjmp .+210 ; 0xf8 <__vector_9>
26: 00 00 nop
28: 4e c0 rjmp .+156 ; 0xc6 <__bad_interrupt>
2a: 00 00 nop
2c: 4c c0 rjmp .+152 ; 0xc6 <__bad_interrupt>
2e: 00 00 nop
30: 4a c0 rjmp .+148 ; 0xc6 <__bad_interrupt>
32: 00 00 nop
34: 48 c0 rjmp .+144 ; 0xc6 <__bad_interrupt>
36: 00 00 nop
38: 46 c0 rjmp .+140 ; 0xc6 <__bad_interrupt>
3a: 00 00 nop
3c: 44 c0 rjmp .+136 ; 0xc6 <__bad_interrupt>
3e: 00 00 nop
40: 42 c0 rjmp .+132 ; 0xc6 <__bad_interrupt>
42: 00 00 nop
44: 40 c0 rjmp .+128 ; 0xc6 <__bad_interrupt>
46: 00 00 nop
48: 3e c0 rjmp .+124 ; 0xc6 <__bad_interrupt>
4a: 00 00 nop
4c: 3c c0 rjmp .+120 ; 0xc6 <__bad_interrupt>
4e: 00 00 nop
50: 3a c0 rjmp .+116 ; 0xc6 <__bad_interrupt>
52: 00 00 nop
54: 38 c0 rjmp .+112 ; 0xc6 <__bad_interrupt>
56: 00 00 nop
58: 36 c0 rjmp .+108 ; 0xc6 <__bad_interrupt>
5a: 00 00 nop
5c: 34 c0 rjmp .+104 ; 0xc6 <__bad_interrupt>
5e: 00 00 nop
60: 32 c0 rjmp .+100 ; 0xc6 <__bad_interrupt>
62: 00 00 nop
64: 30 c0 rjmp .+96 ; 0xc6 <__bad_interrupt>
66: 00 00 nop
68: 2e c0 rjmp .+92 ; 0xc6 <__bad_interrupt>
6a: 00 00 nop
6c: 2c c0 rjmp .+88 ; 0xc6 <__bad_interrupt>
6e: 00 00 nop
70: 2a c0 rjmp .+84 ; 0xc6 <__bad_interrupt>
72: 00 00 nop
74: 28 c0 rjmp .+80 ; 0xc6 <__bad_interrupt>
76: 00 00 nop
78: 26 c0 rjmp .+76 ; 0xc6 <__bad_interrupt>
7a: 00 00 nop
7c: 24 c0 rjmp .+72 ; 0xc6 <__bad_interrupt>
7e: 00 00 nop
80: 22 c0 rjmp .+68 ; 0xc6 <__bad_interrupt>
82: 00 00 nop
84: 20 c0 rjmp .+64 ; 0xc6 <__bad_interrupt>
86: 00 00 nop
88: 1e c0 rjmp .+60 ; 0xc6 <__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_copy_data>:
98: 11 e0 ldi r17, 0x01 ; 1
9a: a0 e0 ldi r26, 0x00 ; 0
9c: b1 e0 ldi r27, 0x01 ; 1
9e: e2 e4 ldi r30, 0x42 ; 66
a0: f1 e0 ldi r31, 0x01 ; 1
a2: 00 e0 ldi r16, 0x00 ; 0
a4: 0b bf out 0x3b, r16 ; 59
a6: 02 c0 rjmp .+4 ; 0xac <__do_copy_data+0x14>
a8: 07 90 elpm r0, Z+
aa: 0d 92 st X+, r0
ac: a0 30 cpi r26, 0x00 ; 0
ae: b1 07 cpc r27, r17
b0: d9 f7 brne .-10 ; 0xa8 <__do_copy_data+0x10>
000000b2 <__do_clear_bss>:
b2: 21 e0 ldi r18, 0x01 ; 1
b4: a0 e0 ldi r26, 0x00 ; 0
b6: b1 e0 ldi r27, 0x01 ; 1
b8: 01 c0 rjmp .+2 ; 0xbc <.do_clear_bss_start>
000000ba <.do_clear_bss_loop>:
ba: 1d 92 st X+, r1
000000bc <.do_clear_bss_start>:
bc: a0 30 cpi r26, 0x00 ; 0
be: b2 07 cpc r27, r18
c0: e1 f7 brne .-8 ; 0xba <.do_clear_bss_loop>
c2: 34 d0 rcall .+104 ; 0x12c <main>
c4: 3c c0 rjmp .+120 ; 0x13e <_exit>
000000c6 <__bad_interrupt>:
c6: 9c cf rjmp .-200 ; 0x0 <__vectors>
000000c8 <wait>:
#define BIT(x) (1 << (x))
// wait(): busy waiting for 'ms' millisecond
// Used library: util/delay.h
void wait( int ms ) {
for (int tms=0; tms<ms; tms++) {
c8: 20 e0 ldi r18, 0x00 ; 0
ca: 30 e0 ldi r19, 0x00 ; 0
cc: 08 c0 rjmp .+16 ; 0xde <wait+0x16>
#else
//round up by default
__ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
#endif
__builtin_avr_delay_cycles(__ticks_dc);
ce: e3 ec ldi r30, 0xC3 ; 195
d0: f9 e0 ldi r31, 0x09 ; 9
d2: 31 97 sbiw r30, 0x01 ; 1
d4: f1 f7 brne .-4 ; 0xd2 <wait+0xa>
d6: 00 c0 rjmp .+0 ; 0xd8 <wait+0x10>
d8: 00 00 nop
da: 2f 5f subi r18, 0xFF ; 255
dc: 3f 4f sbci r19, 0xFF ; 255
de: 28 17 cp r18, r24
e0: 39 07 cpc r19, r25
e2: ac f3 brlt .-22 ; 0xce <wait+0x6>
_delay_ms( 1 ); // library function (max 30 ms at 8MHz)
}
}
e4: 08 95 ret
000000e6 <timer2Init>:
volatile int msCount = 0;
void timer2Init( void ) {
OCR2 = 150; //155 // Compare value of counter 2
e6: 86 e9 ldi r24, 0x96 ; 150
e8: 83 bd out 0x23, r24 ; 35
TIMSK |= BIT(7); // T2 compare match interrupt enable
ea: 87 b7 in r24, 0x37 ; 55
ec: 80 68 ori r24, 0x80 ; 128
ee: 87 bf out 0x37, r24 ; 55
sei(); // turn_on intr all
f0: 78 94 sei
TCCR2 = 0b00001101; // Initialize T2: timer, prescaler=32, compare output disconnected,CTC,RUN
f2: 8d e0 ldi r24, 0x0D ; 13
f4: 85 bd out 0x25, r24 ; 37
f6: 08 95 ret
000000f8 <__vector_9>:
}
unsigned int msThersh = 15;
ISR( TIMER2_COMP_vect ) {
f8: 1f 92 push r1
fa: 0f 92 push r0
fc: 0f b6 in r0, 0x3f ; 63
fe: 0f 92 push r0
100: 11 24 eor r1, r1
102: 8f 93 push r24
104: 9f 93 push r25
PORTC ^= BIT(0);
106: 95 b3 in r25, 0x15 ; 21
108: 81 e0 ldi r24, 0x01 ; 1
10a: 89 27 eor r24, r25
10c: 85 bb out 0x15, r24 ; 21
if(OCR2 == 250){
10e: 83 b5 in r24, 0x23 ; 35
110: 8a 3f cpi r24, 0xFA ; 250
112: 19 f4 brne .+6 ; 0x11a <__vector_9+0x22>
OCR2 = 150;
114: 86 e9 ldi r24, 0x96 ; 150
116: 83 bd out 0x23, r24 ; 35
118: 02 c0 rjmp .+4 ; 0x11e <__vector_9+0x26>
} else {
OCR2 = 250;
11a: 8a ef ldi r24, 0xFA ; 250
11c: 83 bd out 0x23, r24 ; 35
}
}
11e: 9f 91 pop r25
120: 8f 91 pop r24
122: 0f 90 pop r0
124: 0f be out 0x3f, r0 ; 63
126: 0f 90 pop r0
128: 1f 90 pop r1
12a: 18 95 reti
0000012c <main>:
int main( void ) {
DDRC = 0xFF;
12c: 8f ef ldi r24, 0xFF ; 255
12e: 84 bb out 0x14, r24 ; 20
PORTC = BIT(0); // set PORTC for output (toggle PC0)
130: 81 e0 ldi r24, 0x01 ; 1
132: 85 bb out 0x15, r24 ; 21
timer2Init();
134: d8 df rcall .-80 ; 0xe6 <timer2Init>
while (1) {
// do something else
wait(10); // every 10 ms (busy waiting
136: 8a e0 ldi r24, 0x0A ; 10
138: 90 e0 ldi r25, 0x00 ; 0
13a: c6 df rcall .-116 ; 0xc8 <wait>
13c: fc cf rjmp .-8 ; 0x136 <main+0xa>
0000013e <_exit>:
13e: f8 94 cli
00000140 <__stop_program>:
140: ff cf rjmp .-2 ; 0x140 <__stop_program>

View File

@@ -0,0 +1,23 @@
S01400006F7064726163687420332E332E7372656307
S113000045C0000060C000005EC000005CC000008D
S11300105AC0000058C0000056C0000054C0000080
S113002052C0000069C000004EC000004CC0000077
S11300304AC0000048C0000046C0000044C00000A0
S113004042C0000040C000003EC000003CC00000B0
S11300503AC0000038C0000036C0000034C00000C0
S113006032C0000030C000002EC000002CC00000D0
S11300702AC0000028C0000026C0000024C00000E0
S113008022C0000020C000001EC0000011241FBEBA
S1130090CFEFD0E1DEBFCDBF11E0A0E0B1E0E2E4FC
S11300A0F1E000E00BBF02C007900D92A030B10751
S11300B0D9F721E0A0E0B1E001C01D92A030B20761
S11300C0E1F734D03CC09CCF20E030E008C0E3EC42
S11300D0F9E03197F1F700C000002F5F3F4F281778
S11300E03907ACF3089586E983BD87B7806887BF75
S11300F078948DE085BD08951F920F920FB60F92EC
S113010011248F939F9395B381E0892785BB83B591
S11301108A3F19F486E983BD02C08AEF83BD9F91AB
S11301208F910F900FBE0F901F9018958FEF84BB87
S113013081E085BBD8DF8AE090E0C6DFFCCFF8948D
S1050140FFCFEB
S9030000FC

View File

@@ -0,0 +1,52 @@
/*
* timer_t2_ms.c
*
* Created: 21/02/2021 13:20:32
* Author : Etienne
*/
#define F_CPU 10e6
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#define BIT(x) (1 << (x))
// 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)
}
}
volatile int msCount = 0;
void timer2Init( void ) {
OCR2 = 150; //155 // Compare value of counter 2
TIMSK |= BIT(7); // T2 compare match interrupt enable
sei(); // turn_on intr all
TCCR2 = 0b00001101; // Initialize T2: timer, prescaler=32, compare output disconnected,CTC,RUN
}
unsigned int msThersh = 15;
ISR( TIMER2_COMP_vect ) {
PORTC ^= BIT(0);
if(OCR2 == 250){
OCR2 = 150;
} else {
OCR2 = 250;
}
}
int main( void ) {
DDRC = 0xFF;
PORTC = BIT(0); // set PORTC for output (toggle PC0)
timer2Init();
while (1) {
// do something else
wait(10); // every 10 ms (busy waiting
}
}

View File

@@ -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.6.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.6.364\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.6.364\include\avr\iom128.h</AbsolutePath>
<Attribute></Attribute>
<Category>header</Category>
<Condition>C</Condition>
<FileContentHash>JdJ7J9I/SJh965SEyyyVYw==</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.6.364\templates\main.c</AbsolutePath>
<Attribute>template</Attribute>
<Category>source</Category>
<Condition>C Exe</Condition>
<FileContentHash>rR6mgUtO8q2QLIRcSnx1LA==</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.6.364\templates\main.cpp</AbsolutePath>
<Attribute>template</Attribute>
<Category>source</Category>
<Condition>C Exe</Condition>
<FileContentHash>mkKaE95TOoATsuBGv6jmxg==</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.6.364\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.6.364/Atmel.ATmega_DFP.pdsc</PackPath>
<PackVersion>1.6.364</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>

View File

@@ -0,0 +1,130 @@
<?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>{985d5c75-f61e-49f1-a532-66a1e6141552}</ProjectGuid>
<avrdevice>ATmega128</avrdevice>
<avrdeviceseries>none</avrdeviceseries>
<OutputType>Executable</OutputType>
<Language>C</Language>
<OutputFileName>$(MSBuildProjectName)</OutputFileName>
<OutputFileExtension>.elf</OutputFileExtension>
<OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
<AssemblyName>opdracht 3.3</AssemblyName>
<Name>opdracht 3.3</Name>
<RootNamespace>opdracht 3.3</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>
<ResetRule>0</ResetRule>
<eraseonlaunchrule>0</eraseonlaunchrule>
<EraseKey />
<AsfFrameworkConfig>
<framework-data xmlns="">
<options />
<configurations />
<files />
<documentation help="" />
<offline-documentation help="" />
<dependencies>
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.49.1" />
</dependencies>
</framework-data>
</AsfFrameworkConfig>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<ToolchainSettings>
<AvrGcc>
<avrgcc.common.Device>-mmcu=atmega128 -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\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.6.364\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.assembler.general.IncludePaths>
<ListValues>
<Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\include\</Value>
</ListValues>
</avrgcc.assembler.general.IncludePaths>
</AvrGcc>
</ToolchainSettings>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<ToolchainSettings>
<AvrGcc>
<avrgcc.common.Device>-mmcu=atmega128 -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\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.6.364\include\</Value>
</ListValues>
</avrgcc.compiler.directories.IncludePaths>
<avrgcc.compiler.optimization.level>Optimize debugging experience (-Og)</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.general.IncludePaths>
<ListValues>
<Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\include\</Value>
</ListValues>
</avrgcc.assembler.general.IncludePaths>
<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>

View File

@@ -0,0 +1,67 @@
/*
* opdracht 4.b1.c
*
* Created: 3-3-2021 10:54:49
* Author : Sem
*/
/************************************************************************/
/* Verander het programma (voor kanaal 3 en voor 8 bits) zodat het alleen een AD-conversie uitvoert
als jij dat wilt, dus op aanvraag. Maak daarvoor in main() een eindeloze lus met een wachtfunctie
en een start voor de ADC (Zie ook code in de repository). */
/************************************************************************/
#define F_CPU 10e6
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#define BIT(x) (1 << (x))
// 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 ADC: 10-bits (left justified), no free running
void adcInit( void )
{
sei(); // enable interrupts
ADMUX = 0b01100011; // AREF=VCC, result left adjusted, channel3 at pin PF3
ADCSRA = 0b10001110; // ADC-enable, start conversion mode, no free running, interrupt enable
}
/************************************************************************/
/* starts AD converstion by setting bit 6 in ADCSRA to 1 */
/************************************************************************/
void startConversion(void) {
ADCSRA |= BIT(6);
}
// Main program: ADC at PF1
int main( void )
{
DDRF = 0x00; // set PORTF for input (ADC)
DDRA = 0xFF; // set PORTA for output
DDRB = 0xFF; // set PORTB for output
adcInit(); // initialize ADC
while (1)
{
PORTB = ADCL; // Show MSB/LSB (bit 10:0) of ADC
PORTA = ADCH;
startConversion();
wait(100); // every 100 ms (busy waiting)
}
}

View File

@@ -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.6.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.6.364\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.6.364\include\avr\iom128.h</AbsolutePath>
<Attribute></Attribute>
<Category>header</Category>
<Condition>C</Condition>
<FileContentHash>JdJ7J9I/SJh965SEyyyVYw==</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.6.364\templates\main.c</AbsolutePath>
<Attribute>template</Attribute>
<Category>source</Category>
<Condition>C Exe</Condition>
<FileContentHash>LGMXRdW4vmSlRGAAGvj3wQ==</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.6.364\templates\main.cpp</AbsolutePath>
<Attribute>template</Attribute>
<Category>source</Category>
<Condition>C Exe</Condition>
<FileContentHash>mkKaE95TOoATsuBGv6jmxg==</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.6.364\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.6.364/Atmel.ATmega_DFP.pdsc</PackPath>
<PackVersion>1.6.364</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>

View File

@@ -0,0 +1,28 @@
<?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>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
<avrdevice>ATmega128</avrdevice>
<avrdeviceseries>none</avrdeviceseries>
<OutputType>Executable</OutputType>
<Language>C</Language>
<OutputFileName>$(MSBuildProjectName)</OutputFileName>
<OutputFileExtension>.elf</OutputFileExtension>
<OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
<AssemblyName>opdracht 4.b1</AssemblyName>
<Name>opdracht 4.b1</Name>
<RootNamespace>opdracht 4.b1</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<ToolchainSettings>
</ToolchainSettings>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<ToolchainSettings>
</ToolchainSettings>
</PropertyGroup>
<Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
</Project>

View File

@@ -0,0 +1,139 @@
################################################################################
# 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 += \
../lcd_control.c \
../main.c
PREPROCESSING_SRCS +=
ASM_SRCS +=
OBJS += \
lcd_control.o \
main.o
OBJS_AS_ARGS += \
lcd_control.o \
main.o
C_DEPS += \
lcd_control.d \
main.d
C_DEPS_AS_ARGS += \
lcd_control.d \
main.d
OUTPUT_FILE_PATH +=testlcd.elf
OUTPUT_FILE_PATH_AS_ARGS +=testlcd.elf
ADDITIONAL_DEPENDENCIES:=
OUTPUT_FILE_DEP:= ./makedep.mk
LIB_DEP+=
LINKER_SCRIPT_DEP+=
# AVR32/GNU C Compiler
./lcd_control.o: .././lcd_control.c
@echo Building file: $<
@echo Invoking: AVR/GNU C Compiler : 5.4.0
$(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.6.364\include" -Og -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.6.364\gcc\dev\atmega128" -c -std=gnu99 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<"
@echo Finished building: $<
./main.o: .././main.c
@echo Building file: $<
@echo Invoking: AVR/GNU C Compiler : 5.4.0
$(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.6.364\include" -Og -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.6.364\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 : 5.4.0
$(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="testlcd.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.6.364\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 "testlcd.elf" "testlcd.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 "testlcd.elf" "testlcd.eep" || exit 0
"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objdump.exe" -h -S "testlcd.elf" > "testlcd.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 "testlcd.elf" "testlcd.srec"
"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-size.exe" "testlcd.elf"
# Other Targets
clean:
-$(RM) $(OBJS_AS_ARGS) $(EXECUTABLES)
-$(RM) $(C_DEPS_AS_ARGS)
rm -rf "testlcd.elf" "testlcd.a" "testlcd.hex" "testlcd.lss" "testlcd.eep" "testlcd.map" "testlcd.srec" "testlcd.usersignatures"

View File

@@ -0,0 +1,8 @@
################################################################################
# Automatically-generated file. Do not edit or delete the file
################################################################################
lcd_control.c
main.c

View File

@@ -0,0 +1 @@
:00000001FF

View File

@@ -0,0 +1,430 @@
testlcd.elf: file format elf32-avr
Sections:
Idx Name Size VMA LMA File off Algn
0 .data 0000000e 00800100 000001ce 00000242 2**0
CONTENTS, ALLOC, LOAD, DATA
1 .text 000001ce 00000000 00000000 00000074 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
2 .comment 00000030 00000000 00000000 00000250 2**0
CONTENTS, READONLY
3 .note.gnu.avr.deviceinfo 0000003c 00000000 00000000 00000280 2**2
CONTENTS, READONLY
4 .debug_aranges 00000058 00000000 00000000 000002bc 2**0
CONTENTS, READONLY, DEBUGGING
5 .debug_info 00000b5a 00000000 00000000 00000314 2**0
CONTENTS, READONLY, DEBUGGING
6 .debug_abbrev 0000088d 00000000 00000000 00000e6e 2**0
CONTENTS, READONLY, DEBUGGING
7 .debug_line 00000470 00000000 00000000 000016fb 2**0
CONTENTS, READONLY, DEBUGGING
8 .debug_frame 000000b8 00000000 00000000 00001b6c 2**2
CONTENTS, READONLY, DEBUGGING
9 .debug_str 00000479 00000000 00000000 00001c24 2**0
CONTENTS, READONLY, DEBUGGING
10 .debug_loc 00000299 00000000 00000000 0000209d 2**0
CONTENTS, READONLY, DEBUGGING
11 .debug_ranges 00000048 00000000 00000000 00002336 2**0
CONTENTS, READONLY, DEBUGGING
Disassembly of section .text:
00000000 <__vectors>:
0: 45 c0 rjmp .+138 ; 0x8c <__ctors_end>
2: 00 00 nop
4: 58 c0 rjmp .+176 ; 0xb6 <__bad_interrupt>
6: 00 00 nop
8: 56 c0 rjmp .+172 ; 0xb6 <__bad_interrupt>
a: 00 00 nop
c: 54 c0 rjmp .+168 ; 0xb6 <__bad_interrupt>
e: 00 00 nop
10: 52 c0 rjmp .+164 ; 0xb6 <__bad_interrupt>
12: 00 00 nop
14: 50 c0 rjmp .+160 ; 0xb6 <__bad_interrupt>
16: 00 00 nop
18: 4e c0 rjmp .+156 ; 0xb6 <__bad_interrupt>
1a: 00 00 nop
1c: 4c c0 rjmp .+152 ; 0xb6 <__bad_interrupt>
1e: 00 00 nop
20: 4a c0 rjmp .+148 ; 0xb6 <__bad_interrupt>
22: 00 00 nop
24: 48 c0 rjmp .+144 ; 0xb6 <__bad_interrupt>
26: 00 00 nop
28: 46 c0 rjmp .+140 ; 0xb6 <__bad_interrupt>
2a: 00 00 nop
2c: 44 c0 rjmp .+136 ; 0xb6 <__bad_interrupt>
2e: 00 00 nop
30: 42 c0 rjmp .+132 ; 0xb6 <__bad_interrupt>
32: 00 00 nop
34: 40 c0 rjmp .+128 ; 0xb6 <__bad_interrupt>
36: 00 00 nop
38: 3e c0 rjmp .+124 ; 0xb6 <__bad_interrupt>
3a: 00 00 nop
3c: 3c c0 rjmp .+120 ; 0xb6 <__bad_interrupt>
3e: 00 00 nop
40: 3a c0 rjmp .+116 ; 0xb6 <__bad_interrupt>
42: 00 00 nop
44: 38 c0 rjmp .+112 ; 0xb6 <__bad_interrupt>
46: 00 00 nop
48: 36 c0 rjmp .+108 ; 0xb6 <__bad_interrupt>
4a: 00 00 nop
4c: 34 c0 rjmp .+104 ; 0xb6 <__bad_interrupt>
4e: 00 00 nop
50: 32 c0 rjmp .+100 ; 0xb6 <__bad_interrupt>
52: 00 00 nop
54: 30 c0 rjmp .+96 ; 0xb6 <__bad_interrupt>
56: 00 00 nop
58: 2e c0 rjmp .+92 ; 0xb6 <__bad_interrupt>
5a: 00 00 nop
5c: 2c c0 rjmp .+88 ; 0xb6 <__bad_interrupt>
5e: 00 00 nop
60: 2a c0 rjmp .+84 ; 0xb6 <__bad_interrupt>
62: 00 00 nop
64: 28 c0 rjmp .+80 ; 0xb6 <__bad_interrupt>
66: 00 00 nop
68: 26 c0 rjmp .+76 ; 0xb6 <__bad_interrupt>
6a: 00 00 nop
6c: 24 c0 rjmp .+72 ; 0xb6 <__bad_interrupt>
6e: 00 00 nop
70: 22 c0 rjmp .+68 ; 0xb6 <__bad_interrupt>
72: 00 00 nop
74: 20 c0 rjmp .+64 ; 0xb6 <__bad_interrupt>
76: 00 00 nop
78: 1e c0 rjmp .+60 ; 0xb6 <__bad_interrupt>
7a: 00 00 nop
7c: 1c c0 rjmp .+56 ; 0xb6 <__bad_interrupt>
7e: 00 00 nop
80: 1a c0 rjmp .+52 ; 0xb6 <__bad_interrupt>
82: 00 00 nop
84: 18 c0 rjmp .+48 ; 0xb6 <__bad_interrupt>
86: 00 00 nop
88: 16 c0 rjmp .+44 ; 0xb6 <__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_copy_data>:
98: 11 e0 ldi r17, 0x01 ; 1
9a: a0 e0 ldi r26, 0x00 ; 0
9c: b1 e0 ldi r27, 0x01 ; 1
9e: ee ec ldi r30, 0xCE ; 206
a0: f1 e0 ldi r31, 0x01 ; 1
a2: 00 e0 ldi r16, 0x00 ; 0
a4: 0b bf out 0x3b, r16 ; 59
a6: 02 c0 rjmp .+4 ; 0xac <__do_copy_data+0x14>
a8: 07 90 elpm r0, Z+
aa: 0d 92 st X+, r0
ac: ae 30 cpi r26, 0x0E ; 14
ae: b1 07 cpc r27, r17
b0: d9 f7 brne .-10 ; 0xa8 <__do_copy_data+0x10>
b2: 75 d0 rcall .+234 ; 0x19e <main>
b4: 8a c0 rjmp .+276 ; 0x1ca <_exit>
000000b6 <__bad_interrupt>:
b6: a4 cf rjmp .-184 ; 0x0 <__vectors>
000000b8 <wait>:
clock value is set. This is used by _delay_ms inside
util/delay.h
Version : DMK, Initial code
*******************************************************************/
void wait( int ms ) {
for (int i=0; i<ms; i++) {
b8: 20 e0 ldi r18, 0x00 ; 0
ba: 30 e0 ldi r19, 0x00 ; 0
bc: 08 c0 rjmp .+16 ; 0xce <wait+0x16>
#else
//round up by default
__ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
#endif
__builtin_avr_delay_cycles(__ticks_dc);
be: ef ec ldi r30, 0xCF ; 207
c0: f7 e0 ldi r31, 0x07 ; 7
c2: 31 97 sbiw r30, 0x01 ; 1
c4: f1 f7 brne .-4 ; 0xc2 <wait+0xa>
c6: 00 c0 rjmp .+0 ; 0xc8 <wait+0x10>
c8: 00 00 nop
ca: 2f 5f subi r18, 0xFF ; 255
cc: 3f 4f sbci r19, 0xFF ; 255
ce: 28 17 cp r18, r24
d0: 39 07 cpc r19, r25
d2: ac f3 brlt .-22 ; 0xbe <wait+0x6>
_delay_ms( 1 ); // library function (max 30 ms at 8MHz)
}
}
d4: 08 95 ret
000000d6 <lcd_strobe_lcd_e>:
outputs:
notes: According datasheet HD44780
Version : DMK, Initial code
*******************************************************************/
void lcd_strobe_lcd_e(void) {
PORTA |= (1<<LCD_E); // E high
d6: 8b b3 in r24, 0x1b ; 27
d8: 80 64 ori r24, 0x40 ; 64
da: 8b bb out 0x1b, r24 ; 27
dc: 8f ec ldi r24, 0xCF ; 207
de: 97 e0 ldi r25, 0x07 ; 7
e0: 01 97 sbiw r24, 0x01 ; 1
e2: f1 f7 brne .-4 ; 0xe0 <lcd_strobe_lcd_e+0xa>
e4: 00 c0 rjmp .+0 ; 0xe6 <lcd_strobe_lcd_e+0x10>
e6: 00 00 nop
_delay_ms(1); // nodig
PORTA &= ~(1<<LCD_E); // E low
e8: 8b b3 in r24, 0x1b ; 27
ea: 8f 7b andi r24, 0xBF ; 191
ec: 8b bb out 0x1b, r24 ; 27
ee: 8f ec ldi r24, 0xCF ; 207
f0: 97 e0 ldi r25, 0x07 ; 7
f2: 01 97 sbiw r24, 0x01 ; 1
f4: f1 f7 brne .-4 ; 0xf2 <lcd_strobe_lcd_e+0x1c>
f6: 00 c0 rjmp .+0 ; 0xf8 <lcd_strobe_lcd_e+0x22>
f8: 00 00 nop
fa: 08 95 ret
000000fc <init_4bits_mode>:
inputs:
outputs:
notes: According datasheet HD44780 table 12
Version : DMK, Initial code
*******************************************************************/
void init_4bits_mode(void) {
fc: cf 93 push r28
// PORTC output mode and all low (also E and RS pin)
DDRD = 0xFF;
fe: 8f ef ldi r24, 0xFF ; 255
100: 81 bb out 0x11, r24 ; 17
DDRA = 0xFF;
102: 8a bb out 0x1a, r24 ; 26
PORTC = 0x00;
104: 15 ba out 0x15, r1 ; 21
PORTA = 0x00;
106: 1b ba out 0x1b, r1 ; 27
//PORTA = 0xFF;
// Step 2 (table 12)
PORTC = 0x20; // function set
108: c0 e2 ldi r28, 0x20 ; 32
10a: c5 bb out 0x15, r28 ; 21
lcd_strobe_lcd_e();
10c: e4 df rcall .-56 ; 0xd6 <lcd_strobe_lcd_e>
// Step 3 (table 12)
PORTC = 0x20; // function set
lcd_strobe_lcd_e();
10e: c5 bb out 0x15, r28 ; 21
110: e2 df rcall .-60 ; 0xd6 <lcd_strobe_lcd_e>
PORTC = 0x80;
112: 80 e8 ldi r24, 0x80 ; 128
lcd_strobe_lcd_e();
114: 85 bb out 0x15, r24 ; 21
// Step 4 (table 12)
PORTC = 0x00; // Display on/off control
116: df df rcall .-66 ; 0xd6 <lcd_strobe_lcd_e>
lcd_strobe_lcd_e();
118: 15 ba out 0x15, r1 ; 21
PORTC = 0xF0;
11a: dd df rcall .-70 ; 0xd6 <lcd_strobe_lcd_e>
lcd_strobe_lcd_e();
11c: 80 ef ldi r24, 0xF0 ; 240
// Step 4 (table 12)
PORTC = 0x00; // Entry mode set
11e: 85 bb out 0x15, r24 ; 21
lcd_strobe_lcd_e();
120: da df rcall .-76 ; 0xd6 <lcd_strobe_lcd_e>
122: 15 ba out 0x15, r1 ; 21
PORTC = 0x60;
124: d8 df rcall .-80 ; 0xd6 <lcd_strobe_lcd_e>
126: 80 e6 ldi r24, 0x60 ; 96
lcd_strobe_lcd_e();
128: 85 bb out 0x15, r24 ; 21
12a: d5 df rcall .-86 ; 0xd6 <lcd_strobe_lcd_e>
}
12c: cf 91 pop r28
12e: 08 95 ret
00000130 <lcd_write_data>:
inputs: byte - written to LCD
outputs:
notes: According datasheet HD44780 table 12
Version : DMK, Initial code
*******************************************************************/
void lcd_write_data(unsigned char byte) {
130: cf 93 push r28
132: c8 2f mov r28, r24
// First nibble.
PORTC = byte;
134: 85 bb out 0x15, r24 ; 21
PORTA |= (1<<LCD_RS);
136: 8b b3 in r24, 0x1b ; 27
138: 80 61 ori r24, 0x10 ; 16
13a: 8b bb out 0x1b, r24 ; 27
lcd_strobe_lcd_e();
13c: cc df rcall .-104 ; 0xd6 <lcd_strobe_lcd_e>
// Second nibble
PORTC = (byte<<4);
13e: c2 95 swap r28
140: c0 7f andi r28, 0xF0 ; 240
142: c5 bb out 0x15, r28 ; 21
PORTA |= (1<<LCD_RS);
144: 8b b3 in r24, 0x1b ; 27
146: 80 61 ori r24, 0x10 ; 16
lcd_strobe_lcd_e();
148: 8b bb out 0x1b, r24 ; 27
14a: c5 df rcall .-118 ; 0xd6 <lcd_strobe_lcd_e>
}
14c: cf 91 pop r28
14e: 08 95 ret
00000150 <lcd_write_string>:
inputs:
outputs:
notes: According datasheet HD44780 table 12
Version : DMK, Initial code
*******************************************************************/
void lcd_write_string(char *str) {
150: cf 93 push r28
152: df 93 push r29
154: ec 01 movw r28, r24
// while(*str) {
// lcd_write_data(*str++);
// }
// of met een for:
for(;*str; str++){
156: 02 c0 rjmp .+4 ; 0x15c <lcd_write_string+0xc>
lcd_write_data(*str);
158: eb df rcall .-42 ; 0x130 <lcd_write_data>
// while(*str) {
// lcd_write_data(*str++);
// }
// of met een for:
for(;*str; str++){
15a: 21 96 adiw r28, 0x01 ; 1
15c: 88 81 ld r24, Y
15e: 81 11 cpse r24, r1
160: fb cf rjmp .-10 ; 0x158 <lcd_write_string+0x8>
lcd_write_data(*str);
}
}
162: df 91 pop r29
164: cf 91 pop r28
166: 08 95 ret
00000168 <lcd_write_command>:
inputs: byte - written to LCD
outputs:
notes: According datasheet HD44780 table 12
Version : DMK, Initial code
*******************************************************************/
void lcd_write_command(unsigned char byte) {
168: cf 93 push r28
16a: c8 2f mov r28, r24
// First nibble.
PORTC = byte;
16c: 85 bb out 0x15, r24 ; 21
PORTA &= ~(1<<LCD_RS);
16e: 8b b3 in r24, 0x1b ; 27
170: 8f 7e andi r24, 0xEF ; 239
172: 8b bb out 0x1b, r24 ; 27
lcd_strobe_lcd_e();
174: b0 df rcall .-160 ; 0xd6 <lcd_strobe_lcd_e>
// Second nibble
PORTC = (byte<<4);
176: c2 95 swap r28
178: c0 7f andi r28, 0xF0 ; 240
17a: c5 bb out 0x15, r28 ; 21
PORTA &= ~(1<<LCD_RS);
17c: 8b b3 in r24, 0x1b ; 27
17e: 8f 7e andi r24, 0xEF ; 239
lcd_strobe_lcd_e();
180: 8b bb out 0x1b, r24 ; 27
182: a9 df rcall .-174 ; 0xd6 <lcd_strobe_lcd_e>
}
184: cf 91 pop r28
186: 08 95 ret
00000188 <lcd_clear>:
void lcd_clear() {
lcd_write_command (0x01); //Leeg display
188: 81 e0 ldi r24, 0x01 ; 1
18a: ee df rcall .-36 ; 0x168 <lcd_write_command>
18c: 8f e9 ldi r24, 0x9F ; 159
18e: 9f e0 ldi r25, 0x0F ; 15
190: 01 97 sbiw r24, 0x01 ; 1
192: f1 f7 brne .-4 ; 0x190 <lcd_clear+0x8>
194: 00 c0 rjmp .+0 ; 0x196 <lcd_clear+0xe>
196: 00 00 nop
_delay_ms(2);
lcd_write_command (0x80); //Cursor terug naar start
198: 80 e8 ldi r24, 0x80 ; 128
19a: e6 cf rjmp .-52 ; 0x168 <lcd_write_command>
19c: 08 95 ret
0000019e <main>:
notes: Slow background task after init ISR
Version : DMK, Initial code
*******************************************************************/
int main( void ) {
// Init I/O
DDRC = 0xFF; // PORTD(7) output, PORTD(6:0) input
19e: 8f ef ldi r24, 0xFF ; 255
1a0: 84 bb out 0x14, r24 ; 20
PORTC = 0xFF;
1a2: 85 bb out 0x15, r24 ; 21
// Init LCD
init_4bits_mode();
1a4: ab df rcall .-170 ; 0xfc <init_4bits_mode>
1a6: 8f e1 ldi r24, 0x1F ; 31
1a8: 9e e4 ldi r25, 0x4E ; 78
1aa: 01 97 sbiw r24, 0x01 ; 1
1ac: f1 f7 brne .-4 ; 0x1aa <main+0xc>
1ae: 00 c0 rjmp .+0 ; 0x1b0 <main+0x12>
_delay_ms(10);
lcd_clear();
1b0: 00 00 nop
1b2: ea df rcall .-44 ; 0x188 <lcd_clear>
// Write sample string
lcd_write_string("Hello world!");
1b4: 80 e0 ldi r24, 0x00 ; 0
1b6: 91 e0 ldi r25, 0x01 ; 1
1b8: cb df rcall .-106 ; 0x150 <lcd_write_string>
// Loop forever
while (1) {
PORTC ^= (1<<0); // Toggle PORTD.7
1ba: 95 b3 in r25, 0x15 ; 21
1bc: 81 e0 ldi r24, 0x01 ; 1
1be: 89 27 eor r24, r25
wait( 250 );
1c0: 85 bb out 0x15, r24 ; 21
1c2: 8a ef ldi r24, 0xFA ; 250
1c4: 90 e0 ldi r25, 0x00 ; 0
1c6: 78 df rcall .-272 ; 0xb8 <wait>
1c8: f8 cf rjmp .-16 ; 0x1ba <main+0x1c>
000001ca <_exit>:
1ca: f8 94 cli
000001cc <__stop_program>:
1cc: ff cf rjmp .-2 ; 0x1cc <__stop_program>

View File

@@ -0,0 +1,32 @@
S00F0000746573746C63642E7372656322
S113000045C0000058C0000056C0000054C00000A5
S113001052C0000050C000004EC000004CC00000A0
S11300204AC0000048C0000046C0000044C00000B0
S113003042C0000040C000003EC000003CC00000C0
S11300403AC0000038C0000036C0000034C00000D0
S113005032C0000030C000002EC000002CC00000E0
S11300602AC0000028C0000026C0000024C00000F0
S113007022C0000020C000001EC000001CC0000000
S11300801AC0000018C0000016C0000011241FBED2
S1130090CFEFD0E1DEBFCDBF11E0A0E0B1E0EEECE8
S11300A0F1E000E00BBF02C007900D92AE30B10743
S11300B0D9F775D08AC0A4CF20E030E008C0EFECB7
S11300C0F7E03197F1F700C000002F5F3F4F28178A
S11300D03907ACF308958BB380648BBB8FEC97E046
S11300E00197F1F700C000008BB38F7B8BBB8FECC3
S11300F097E00197F1F700C000000895CF938FEFC8
S113010081BB8ABB15BA1BBAC0E2C5BBE4DFC5BB61
S1130110E2DF80E885BBDFDF15BADDDF80EF85BB7A
S1130120DADF15BAD8DF80E685BBD5DFCF91089535
S1130130CF93C82F85BB8BB380618BBBCCDFC295BB
S1130140C07FC5BB8BB380618BBBC5DFCF910895E6
S1130150CF93DF93EC0102C0EBDF219688818111FC
S1130160FBCFDF91CF910895CF93C82F85BB8BB37D
S11301708F7E8BBBB0DFC295C07FC5BB8BB38F7E38
S11301808BBBA9DFCF91089581E0EEDF8FE99FE07B
S11301900197F1F700C0000080E8E6CF08958FEFE3
S11301A084BB85BBABDF8FE19EE40197F1F700C010
S11301B00000EADF80E091E0CBDF95B381E089279E
S11101C085BB8AEF90E078DFF8CFF894FFCF8C
S11101CE48656C6C6F20776F726C64210000C2
S9030000FC

View File

@@ -0,0 +1,200 @@
/* ---------------------------------------------------------------------------
** This software is in the public domain, furnished "as is", without technical
** support, and with no warranty, express or implied, as to its usefulness for
** any purpose.
**
** ioisr.c
**
** Beschrijving: BigAVR LCD module
** Target: AVR mcu
** Build: avr-gcc -std=c99 -Wall -O3 -mmcu=atmega128 -D F_CPU=8000000UL -c lcd.c
** avr-gcc -g -mmcu=atmega128 -o lcd.elf lcd.o
** avr-objcopy -O ihex lcd.elf lcd.hex
** or type 'make'
** Author: dkroeske@gmail.com
** -------------------------------------------------------------------------*/
#define F_CPU 8e6
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#define LCD_E 6 // RA6 UNI-6
#define LCD_RS 4 // RA4 UNI-6
void lcd_strobe_lcd_e(void);
void init_4bits_mode(void);
void lcd_write_string(char *str);
void lcd_write_data(unsigned char byte);
void lcd_write_cmd(unsigned char byte);
void lcd_clear(void);
/******************************************************************
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
*******************************************************************/
void wait( int ms ) {
for (int i=0; i<ms; i++) {
_delay_ms( 1 ); // library function (max 30 ms at 8MHz)
}
}
/******************************************************************
short: Strobe LCD module E pin --__
inputs:
outputs:
notes: According datasheet HD44780
Version : DMK, Initial code
*******************************************************************/
void lcd_strobe_lcd_e(void) {
PORTA |= (1<<LCD_E); // E high
_delay_ms(1); // nodig
PORTA &= ~(1<<LCD_E); // E low
_delay_ms(1); // nodig?
}
/******************************************************************
short: Init LCD module in 4 bits mode.
inputs:
outputs:
notes: According datasheet HD44780 table 12
Version : DMK, Initial code
*******************************************************************/
void init_4bits_mode(void) {
// PORTC output mode and all low (also E and RS pin)
DDRD = 0xFF;
DDRA = 0xFF;
PORTC = 0x00;
PORTA = 0x00;
//PORTA = 0xFF;
// Step 2 (table 12)
PORTC = 0x20; // function set
lcd_strobe_lcd_e();
// Step 3 (table 12)
PORTC = 0x20; // function set
lcd_strobe_lcd_e();
PORTC = 0x80;
lcd_strobe_lcd_e();
// Step 4 (table 12)
PORTC = 0x00; // Display on/off control
lcd_strobe_lcd_e();
PORTC = 0xF0;
lcd_strobe_lcd_e();
// Step 4 (table 12)
PORTC = 0x00; // Entry mode set
lcd_strobe_lcd_e();
PORTC = 0x60;
lcd_strobe_lcd_e();
}
/******************************************************************
short: Writes string to LCD at cursor position
inputs:
outputs:
notes: According datasheet HD44780 table 12
Version : DMK, Initial code
*******************************************************************/
void lcd_write_string(char *str) {
// Het kan met een while:
// while(*str) {
// lcd_write_data(*str++);
// }
// of met een for:
for(;*str; str++){
lcd_write_data(*str);
}
}
/******************************************************************
short: Writes 8 bits DATA to lcd
inputs: byte - written to LCD
outputs:
notes: According datasheet HD44780 table 12
Version : DMK, Initial code
*******************************************************************/
void lcd_write_data(unsigned char byte) {
// First nibble.
PORTC = byte;
PORTA |= (1<<LCD_RS);
lcd_strobe_lcd_e();
// Second nibble
PORTC = (byte<<4);
PORTA |= (1<<LCD_RS);
lcd_strobe_lcd_e();
}
/******************************************************************
short: Writes 8 bits COMMAND to lcd
inputs: byte - written to LCD
outputs:
notes: According datasheet HD44780 table 12
Version : DMK, Initial code
*******************************************************************/
void lcd_write_command(unsigned char byte) {
// First nibble.
PORTC = byte;
PORTA &= ~(1<<LCD_RS);
lcd_strobe_lcd_e();
// Second nibble
PORTC = (byte<<4);
PORTA &= ~(1<<LCD_RS);
lcd_strobe_lcd_e();
}
void lcd_clear() {
lcd_write_command (0x01); //Leeg display
_delay_ms(2);
lcd_write_command (0x80); //Cursor terug naar start
}
/******************************************************************
short: main() loop, entry point of executable
inputs:
outputs:
notes: Slow background task after init ISR
Version : DMK, Initial code
*******************************************************************/
int main( void ) {
// Init I/O
DDRC = 0xFF; // PORTD(7) output, PORTD(6:0) input
PORTC = 0xFF;
// Init LCD
init_4bits_mode();
_delay_ms(10);
lcd_clear();
// Write sample string
lcd_write_string("Hello world!");
// Loop forever
while (1) {
PORTC ^= (1<<0); // Toggle PORTD.7
wait( 250 );
}
return 1;
}

View File

@@ -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.6.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.6.364\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.6.364\include\avr\iom128.h</AbsolutePath>
<Attribute></Attribute>
<Category>header</Category>
<Condition>C</Condition>
<FileContentHash>JdJ7J9I/SJh965SEyyyVYw==</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.6.364\templates\main.c</AbsolutePath>
<Attribute>template</Attribute>
<Category>source</Category>
<Condition>C Exe</Condition>
<FileContentHash>acTgQvo2LQZomOc3SBvMjw==</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.6.364\templates\main.cpp</AbsolutePath>
<Attribute>template</Attribute>
<Category>source</Category>
<Condition>C Exe</Condition>
<FileContentHash>mkKaE95TOoATsuBGv6jmxg==</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.6.364\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.6.364/Atmel.ATmega_DFP.pdsc</PackPath>
<PackVersion>1.6.364</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>

View File

@@ -0,0 +1,146 @@
<?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>{b964892d-a92f-44d4-af99-3adc61820917}</ProjectGuid>
<avrdevice>ATmega128</avrdevice>
<avrdeviceseries>none</avrdeviceseries>
<OutputType>Executable</OutputType>
<Language>C</Language>
<OutputFileName>$(MSBuildProjectName)</OutputFileName>
<OutputFileExtension>.elf</OutputFileExtension>
<OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
<AssemblyName>testlcd</AssemblyName>
<Name>testlcd</Name>
<RootNamespace>testlcd</RootNamespace>
<ToolchainFlavour>Native</ToolchainFlavour>
<KeepTimersRunning>true</KeepTimersRunning>
<OverrideVtor>false</OverrideVtor>
<CacheFlash>true</CacheFlash>
<ProgFlashFromRam>true</ProgFlashFromRam>
<RamSnippetAddress>0x20000000</RamSnippetAddress>
<UncachedRange />
<preserveEEPROM>true</preserveEEPROM>
<OverrideVtorValue>exception_table</OverrideVtorValue>
<BootSegment>2</BootSegment>
<ResetRule>0</ResetRule>
<eraseonlaunchrule>0</eraseonlaunchrule>
<EraseKey />
<AsfFrameworkConfig>
<framework-data xmlns="">
<options />
<configurations />
<files />
<documentation help="" />
<offline-documentation help="" />
<dependencies>
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.49.1" />
</dependencies>
</framework-data>
</AsfFrameworkConfig>
<avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
<avrtoolserialnumber>J42700011096</avrtoolserialnumber>
<avrdeviceexpectedsignature>0x1E9702</avrdeviceexpectedsignature>
<com_atmel_avrdbg_tool_atmelice>
<ToolOptions>
<InterfaceProperties>
<JtagDbgClock>2000000</JtagDbgClock>
</InterfaceProperties>
<InterfaceName>JTAG</InterfaceName>
</ToolOptions>
<ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
<ToolNumber>J42700011096</ToolNumber>
<ToolName>Atmel-ICE</ToolName>
</com_atmel_avrdbg_tool_atmelice>
<avrtoolinterface>JTAG</avrtoolinterface>
<avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<ToolchainSettings>
<AvrGcc>
<avrgcc.common.Device>-mmcu=atmega128 -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\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.6.364\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.assembler.general.IncludePaths>
<ListValues>
<Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\include\</Value>
</ListValues>
</avrgcc.assembler.general.IncludePaths>
</AvrGcc>
</ToolchainSettings>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<ToolchainSettings>
<AvrGcc>
<avrgcc.common.Device>-mmcu=atmega128 -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\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.6.364\include\</Value>
</ListValues>
</avrgcc.compiler.directories.IncludePaths>
<avrgcc.compiler.optimization.level>Optimize debugging experience (-Og)</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.general.IncludePaths>
<ListValues>
<Value>%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\include\</Value>
</ListValues>
</avrgcc.assembler.general.IncludePaths>
<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>