added 3.2

This commit is contained in:
Sem van der Hoeven
2021-02-24 12:50:50 +01:00
parent 0625ca1ccb
commit 0a1a3fd47f
22 changed files with 2666 additions and 305 deletions

View File

@@ -23,6 +23,8 @@ Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "opdracht 2.5", "opdracht 2.
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
Debug|AVR = Debug|AVR
@@ -69,6 +71,10 @@ Global
{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

@@ -64,42 +64,3 @@ int main(void)
}
}
void lcd_strobe_lcd_e(void) {
PORTC |= (1<<LCD_E); // E high
_delay_ms(1);
PORTC &= ~(1<<LCD_E); // E low
}
void init_4bits_mode(void) {
// PORTC output mode and all low (also E and RS pin)
DDRC = 0xFF;
PORTC = 0x00;
PORTC = 0x20; // (0x28 for 2 lines)
lcd_strobe_lcd_e();
}
void init_4bits_mode(void) {
// PORTC output mode and all low (also E and RS pin)
DDRC = 0xFF;
PORTC = 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();
}

View File

@@ -37,6 +37,7 @@ SUBDIRS :=
# Add inputs and outputs from these tool invocations to the build variables
C_SRCS += \
../lcd_control.c \
../main.c
@@ -47,15 +48,19 @@ 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
@@ -72,6 +77,13 @@ 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

View File

@@ -2,5 +2,7 @@
# Automatically-generated file. Do not edit or delete the file
################################################################################
lcd_control.c
main.c

View File

@@ -9,25 +9,25 @@ Idx Name Size VMA LMA File off Algn
CONTENTS, ALLOC, LOAD, READONLY, CODE
2 .comment 0000002f 00000000 00000000 00000274 2**0
CONTENTS, READONLY
3 .debug_aranges 00000078 00000000 00000000 000002a3 2**0
3 .debug_aranges 00000090 00000000 00000000 000002a3 2**0
CONTENTS, READONLY, DEBUGGING
4 .debug_info 00000ed8 00000000 00000000 0000031b 2**0
4 .debug_info 000011bb 00000000 00000000 00000333 2**0
CONTENTS, READONLY, DEBUGGING
5 .debug_abbrev 00000890 00000000 00000000 000011f3 2**0
5 .debug_abbrev 0000095a 00000000 00000000 000014ee 2**0
CONTENTS, READONLY, DEBUGGING
6 .debug_line 00000463 00000000 00000000 00001a83 2**0
6 .debug_line 00000526 00000000 00000000 00001e48 2**0
CONTENTS, READONLY, DEBUGGING
7 .debug_frame 000000fc 00000000 00000000 00001ee8 2**2
7 .debug_frame 00000110 00000000 00000000 00002370 2**2
CONTENTS, READONLY, DEBUGGING
8 .debug_str 00000283 00000000 00000000 00001fe4 2**0
8 .debug_str 000002ae 00000000 00000000 00002480 2**0
CONTENTS, READONLY, DEBUGGING
9 .debug_loc 00000242 00000000 00000000 00002267 2**0
9 .debug_loc 00000242 00000000 00000000 0000272e 2**0
CONTENTS, READONLY, DEBUGGING
10 .debug_ranges 00000068 00000000 00000000 000024a9 2**0
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 00002514 2**2
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
@@ -110,7 +110,7 @@ Disassembly of section .text:
Disassembly of section .text:
0000021c <__bad_interrupt>:
21c: 0c 94 00 00 jmp 0 ; 0x0 <__TEXT_REGION_ORIGIN__>
21c: 0c 94 00 00 jmp 0 ; 0x0 <__vectors>
Disassembly of section .text.sbi_porta:
@@ -161,8 +161,8 @@ Disassembly of section .text.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
134: 89 ef ldi r24, 0xF9 ; 249
136: 90 e0 ldi r25, 0x00 ; 0
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>
@@ -170,8 +170,8 @@ Disassembly of section .text.lcd_strobe_lcd_e:
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
148: 89 ef ldi r24, 0xF9 ; 249
14a: 90 e0 ldi r25, 0x00 ; 0
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>
@@ -223,8 +223,8 @@ 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
1cc: 83 ef ldi r24, 0xF3 ; 243
1ce: 91 e0 ldi r25, 0x01 ; 1
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>
@@ -296,14 +296,33 @@ Disassembly of section .text.lcd_write_string:
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

View File

@@ -0,0 +1,123 @@
/*
* lcd_controlc.c
*
* Created: 24-2-2021 11:55:12
* Author: Sem
*/
#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

@@ -11,21 +11,8 @@
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#include "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();
int main(void)
{
@@ -46,112 +33,3 @@ int main(void)
}
}
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

@@ -30,67 +30,73 @@
<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="lcd_control.c">
<SubType>compile</SubType>
</Compile>
<Compile Include="lcd_control.h">
<SubType>compile</SubType>
</Compile>
<Compile Include="main.c">
<SubType>compile</SubType>
</Compile>

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

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,166 @@
S01400006F7064726163687420332E322E7372656308
S113000072C000008DC000008BC0000089C00000D9
S113001087C0000085C0000083C0000081C00000CC
S11300207FC000007DC0000034C1000079C0000022
S113003077C0000075C0000073C0000071C00000EC
S11300406FC000006DC000006BC0000069C00000FC
S113005067C0000065C0000063C0000061C000000C
S11300605FC000005DC000005BC0000059C000001C
S113007057C0000055C0000053C0000051C000002C
S11300804FC000004DC000004BC00000080000003D
S1130090BE922449123EABAAAA2ABECDCCCC4C3E79
S11300A000000080BEABAAAAAA3E00000000BF0068
S11300B00000803F0000000000084178D3BB438764
S11300C0D1133D190E3CC3BD4282AD2B3E68EC8278
S11300D076BED98FE1A93E4C80EFFFBE01C4FF7FFD
S11300E03F000000000011241FBECFEFD0E1DEBFAF
S11300F0CDBF11E0A0E0B1E0E6E2FAE000E00BBF22
S113010002C007900D92A830B107D9F721E0A8E00A
S1130110B1E001C01D92AE30B207E1F701D181C454
S11301206FCF9BB321E030E002C0220F331F8A95CA
S1130130E2F7292B2BBB08959BB321E030E002C0EA
S1130140220F331F8A95E2F7209529232BBB0895AC
S113015086E090E0E6DF89EF90E00197F1F700C0D8
S1130160000086E090E0E8DF89EF90E00197F1F786
S113017000C000000895CF93C82F85BB84E090E0B1
S1130180D0DFE6DFC295C07FC5BB84E090E0C9DF65
S1130190DFDFCF910895CF93C82F85BB84E090E033
S11301A0CBDFD6DFC295C07FC5BB84E090E0C4DF5F
S11301B0CFDFCF91089581E0EEDF83EF91E00197E7
S11301C0F1F700C0000080E8E6CF0895CF938FEFE9
S11301D084BB85BB8ABB15BA1BBAC0E2C5BBB8DFFA
S11301E0C5BBB6DF80E885BBB3DF15BAB1DF80EFEE
S11301F085BBAEDF15BAACDF80E685BBA9DF82E044
S1130200CADFA6DFCF91089520E030E008C0EFEC0C
S1130210F7E03197F1F700C000002F5F3F4F281738
S11302203907ACF30895CF92DF92EF92FF92CF9308
S1130230DF93EC01BC01990F880B990B1CD1A7D15A
S113024020E030E040E85FE37FD0E2D06B017C0146
S113025061E070E0C601A3D29C0181E0C81AD10814
S11302600EC0F901EC0DFD1DCE016AE070E070D204
S1130270805D808381E0C81AD108C62FD72FDD2086
S113028084F7C901DF91CF91FF90EF90DF90CF9079
S113029008951F920F920FB60F9211240BB60F926E
S11302A02F933F934F935F936F937F938F939F937A
S11302B0AF93BF93EF93FF93809106019091070151
S11302C084BD8091080190910901019690930901E0
S11302D08093080170DF8091080190910901A3DFE8
S11302E04ADFFF91EF91BF91AF919F918F917F91E1
S11302F06F915F914F913F912F910F900BBE0F9093
S11303000FBE0F901F9018958091060190910701E0
S113031084BD87B7806487BF789487E085BD0895DE
S113032081B38F7781BB8FEF8ABB87BB4FDFECDF55
S113033084B58BBB809108019091090188BB8AE048
S113034090E062DFF5CF5058BB27AA270ED0E5C056
S1130350D6D030F0DBD020F031F49F3F11F41EF4FE
S1130360CBC00EF4E095E7FBC1C0E92FE7D080F3E2
S1130370BA17620773078407950718F071F49EF59E
S1130380FFC00EF4E0950B2EBA2FA02D0B01B9017E
S113039090010C01CA01A0011124FF27591B99F0F7
S11303A0593F50F4503E68F11A16F040A22F232F03
S11303B0342F4427585FF3CF469537952795A79553
S11303C0F0405395C9F77EF41F16BA0B620B730BFA
S11303D0840BBAF09150A1F0FF0FBB1F661F771F6B
S11303E0881FC2F70EC0BA0F621F731F841F48F420
S11303F0879577956795B795F7959E3F08F0B3CFA6
S11304009395880F08F09927EE0F9795879508958F
S113041004D06894B111B5C0089598D088F09F575E
S113042090F0B92F9927B751A0F0D1F0660F771F3C
S1130430881F991F1AF0BA95C9F712C0B13081F01C
S11304409FD0B1E008959CC0672F782F8827B85FAC
S113045039F0B93FCCF3869577956795B395D9F77D
S11304603EF490958095709561957F4F8F4F9F4F87
S11304700895E89409C097FB3EF490958095709593
S113048061957F4F8F4F9F4F9923A9F0F92F96E9DC
S1130490BB279395F695879577956795B795F11151
S11304A0F8CFFAF4BB0F11F460FF1BC06F5F7F4FEE
S11304B08F4F9F4F16C0882311F096E911C0772300
S11304C021F09EE8872F762F05C0662371F096E809
S11304D0862F70E060E02AF09A95660F771F881FD8
S11304E0DAF7880F9695879597F9089597F99F6796
S11304F080E870E060E008959FEF80EC08950024A8
S11305000A941616170618060906089500240A9474
S113051012161306140605060895092E0394000CFA
S113052011F4882352F0BB0F40F4BF2B11F460FF89
S113053004C06F5F7F4F8F4F9F4F089557FD9058B2
S1130540440F551F59F05F3F71F04795880F97FB93
S1130550991F61F09F3F79F087950895121613064D
S11305601406551FF2CF4695F1DF08C0161617067C
S11305701806991FF1CF86957105610508940895B1
S1130580E894BB2766277727CB0197F908950AD00B
S113059029ED3BE54EED5EE345C00EF0A6C0ACCFC1
S11305A06894A4CFD3DFC8F39923D1F3C6F3DF93C0
S11305B0CF931F930F93FF92C92FDD2788232AF02F
S11305C02197660F771F881FDAF720E030E040E8B4
S11305D05FEB9FE3883920F0803E30F021968F77DF
S11305E0B3DEECE8F0E003C0AFDEE9EBF0E08BD083
S11305F08B01BE01EC01FB2E6F5771097595771FB6
S1130600880B990B38DF28E132E741E35FE316D02A
S1130610AF2D9801AE01FF900F911F91CF91DF9103
S1130620A4DE7BCF0BD079CF6ADF28F06FDF18F020
S1130630952309F05BCF60CF1124A3CF7FDFA0F314
S1130640959FD1F3950F50E0551F629FF001729F63
S1130650BB27F00DB11D639FAA27F00DB11DAA1F82
S1130660649F6627B00DA11D661F829F2227B00DCF
S1130670A11D621F739FB00DA11D621F839FA00D5A
S1130680611D221F749F3327A00D611D231F849FAA
S1130690600D211D822F762F6A2F11249F57504001
S11306A08AF0E1F088234AF0EE0FFF1FBB1F661F9C
S11306B0771F881F91505040A9F79E3F510570F055
S11306C015CF5FCF5F3FECF3983EDCF386957795CB
S11306D06795B795F795E7959F5FC1F7FE2B880F50
S11306E0911D9695879597F908959F3F31F0915004
S11306F020F4879577956795B795880F911D969502
S1130700879597F90895DF93CF931F930F93FF92E3
S1130710EF92DF927B018C01689405C0DA2EEF0121
S11307208DDFFE01E894A591259135914591559170
S1130730AEF3EF011ADEFE019701A801DA9479F70E
S1130740DF90EF90FF900F911F91CF91DF9108956B
S113075097FB072E16F4009406D077FD08D00BD033
S113076007FC05D03EF4909581959F4F08957095B0
S113077061957F4F0895AA1BBB1B51E107C0AA1FB7
S1130780BB1FA617B70710F0A61BB70B881F991F2E
S11307905A95A9F780959095BC01CD0108950F93C2
S11307A01F93CF93DF93869F8001879F100D969FA1
S11307B0100D1124C8010DD0EC01009721F0A801FF
S11307C060E070E027D1CE01DF91CF911F910F91AE
S11307D008950F931F93CF93DF938230910510F404
S11307E082E090E0E0910C01F0910D0120E030E016
S11307F0A0E0B0E0309719F140815181028113816A
S113080048175907C8F08417950769F4109731F011
S113081012960C93129713961C9327C000930C0105
S113082010930D0122C02115310519F04217530709
S113083018F49A01BD01EF01DF01F801DBCF2115A6
S11308403105F9F0281B390B2430310580F48A81F5
S11308509B816115710521F0FB019383828304C0A0
S113086090930D0180930C01FE01329644C0FE0169
S1130870E20FF31F81939193225031093983288326
S11308803AC020910A0130910B01232B41F42091AD
S113089002013091030130930B0120930A0120914E
S11308A00001309101012115310541F42DB73EB706
S11308B04091040150910501241B350BE0910A017C
S11308C0F0910B01E217F307A0F42E1B3F0B28173E
S11308D0390778F0AC014E5F5F4F2417350748F0B5
S11308E04E0F5F1F50930B0140930A018193919324
S11308F002C0E0E0F0E0CF01DF91CF911F910F91B2
S11309000895CF93DF93009709F481C0FC013297D7
S113091013821282A0910C01B0910D01109781F401
S113092020813181820F931F20910A0130910B01A4
S11309302817390751F5F0930B01E0930A0167C0BA
S1130940ED0120E030E0CE17DF0740F44A815B81FF
S11309509E0141155105F1F0EA01F5CFD383C2831D
S113096040815181840F951FC817D90759F4888194
S11309709981840F951F0296918380838A819B813C
S1130980938382832115310529F4F0930D01E093BB
S11309900C013DC0E901FB83EA8349915991C40FDD
S11309A0D51FEC17FD0761F480819181840F951F99
S11309B00296E90199838883828193819B838A8348
S11309C0E0E0F0E012968D919C911397009719F056
S11309D0FD01DC01F7CF8D919C9111979D012E5F54
S11309E03F4F820F931F20910A0130910B0128176A
S11309F0390769F4309729F410920D0110920C0113
S1130A0002C013821282B0930B01A0930A01DF91FA
S1130A10CF910895DC0101C06D9341505040E0F73F
S1090A200895F894FFCFD5
S10B0A2600000E012000FFFF97
S9030000FC

View File

@@ -0,0 +1,122 @@
/*
* lcd_controlc.c
*
* Created: 24-2-2021 11:55:12
* Author: Sem
*/
#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,70 @@
/*
* counter_t2_interrupt.c
*
* Created: 21/02/2021 13:00:25
* Author : Etienne
*/
#define F_CPU 8e6
#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;
}
volatile int TimerPreset = -1; // 0xF6, 10 till overflow
volatile int number = 0;
// Interrupt routine timer2 overflow
ISR( TIMER2_OVF_vect ) {
TCNT2 = TimerPreset; // Preset value
number++; // Increment counter
lcd_clear();
lcd_write_character(toArray(number));
}
// 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();
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,124 @@
<?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 />
</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

@@ -37,6 +37,7 @@ SUBDIRS :=
# Add inputs and outputs from these tool invocations to the build variables
C_SRCS += \
../lcd_control.c \
../main.c
@@ -47,15 +48,19 @@ 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
@@ -72,6 +77,13 @@ 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

View File

@@ -2,5 +2,7 @@
# Automatically-generated file. Do not edit or delete the file
################################################################################
lcd_control.c
main.c

View File

@@ -30,15 +30,15 @@
<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>
<avrtool>com.atmel.avrdbg.tool.atmelice</avrtool>
<avrtoolserialnumber>J42700011096</avrtoolserialnumber>
@@ -60,81 +60,81 @@
<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>
<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>
<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>