From ea68478e46804071b875d308a3d9f8c6c89c0225 Mon Sep 17 00:00:00 2001 From: stijn Date: Wed, 10 Feb 2021 09:23:50 +0100 Subject: [PATCH] add opdracht 1.6 --- Microcontrollers/Microcontrollers.atsln | 8 +- Microcontrollers/opdracht 1.6/main.c | 104 ++++++++++++++++++ .../opdracht 1.6.componentinfo.xml} | 0 .../opdracht 1.6.cproj} | 8 +- .../opdracht 1.7a.componentinfo.xml | 42 +++++++ .../opdracht 2.7a/opdracht 1.7a.cproj | 99 +++++++++++++++++ 6 files changed, 256 insertions(+), 5 deletions(-) create mode 100644 Microcontrollers/opdracht 1.6/main.c rename Microcontrollers/{opdracht 2.7a/opdracht 2.7a.componentinfo.xml => opdracht 1.6/opdracht 1.6.componentinfo.xml} (100%) rename Microcontrollers/{opdracht 2.7a/opdracht 2.7a.cproj => opdracht 1.6/opdracht 1.6.cproj} (96%) create mode 100644 Microcontrollers/opdracht 2.7a/opdracht 1.7a.componentinfo.xml create mode 100644 Microcontrollers/opdracht 2.7a/opdracht 1.7a.cproj diff --git a/Microcontrollers/Microcontrollers.atsln b/Microcontrollers/Microcontrollers.atsln index 52693ab..5ddded8 100644 --- a/Microcontrollers/Microcontrollers.atsln +++ b/Microcontrollers/Microcontrollers.atsln @@ -5,7 +5,9 @@ VisualStudioVersion = 14.0.23107.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "Microcontrollers", "Microcontrollers\Microcontrollers.cproj", "{2285C48D-296E-43FD-A7B6-69885F64CFFD}" EndProject -Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "opdracht 2.7a", "opdracht 2.7a\opdracht 2.7a.cproj", "{B7ED8D27-9387-4A45-A238-923F89602FB5}" +Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "opdracht 1.7a", "opdracht 2.7a\opdracht 1.7a.cproj", "{B7ED8D27-9387-4A45-A238-923F89602FB5}" +EndProject +Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "opdracht 1.6", "opdracht 1.6\opdracht 1.6.cproj", "{2C44E92F-6D48-45BD-810A-AD501EC081FE}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -21,6 +23,10 @@ Global {B7ED8D27-9387-4A45-A238-923F89602FB5}.Debug|AVR.Build.0 = Debug|AVR {B7ED8D27-9387-4A45-A238-923F89602FB5}.Release|AVR.ActiveCfg = Release|AVR {B7ED8D27-9387-4A45-A238-923F89602FB5}.Release|AVR.Build.0 = Release|AVR + {2C44E92F-6D48-45BD-810A-AD501EC081FE}.Debug|AVR.ActiveCfg = Debug|AVR + {2C44E92F-6D48-45BD-810A-AD501EC081FE}.Debug|AVR.Build.0 = Debug|AVR + {2C44E92F-6D48-45BD-810A-AD501EC081FE}.Release|AVR.ActiveCfg = Release|AVR + {2C44E92F-6D48-45BD-810A-AD501EC081FE}.Release|AVR.Build.0 = Release|AVR EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Microcontrollers/opdracht 1.6/main.c b/Microcontrollers/opdracht 1.6/main.c new file mode 100644 index 0000000..74f91f4 --- /dev/null +++ b/Microcontrollers/opdracht 1.6/main.c @@ -0,0 +1,104 @@ +/* + * main.c + * + * Created: 03-Feb-21 9:17:12 AM + * Author: lemms + */ +# define F_CPU 10000000UL + +#include +#include + +typedef enum { + false = 0, + true = 1 +} bool; + +/******************************************************************/ +void wait( int ms ) +/* +short: Busy wait number of milliseconds +inputs: int ms (Number of milliseconds to busy wait) +outputs: +notes: Busy wait, not very accurate. Make sure (external) + clock value is set. This is used by _delay_ms inside + util/delay.h +Version : DMK, Initial code +*******************************************************************/ +{ + for (int i=0; i= setTime){ + PORTD = tbi(PORTD, 0); + ms = 0; + } + + wait(1); + + ms++; + } + + return 1; +} + diff --git a/Microcontrollers/opdracht 2.7a/opdracht 2.7a.componentinfo.xml b/Microcontrollers/opdracht 1.6/opdracht 1.6.componentinfo.xml similarity index 100% rename from Microcontrollers/opdracht 2.7a/opdracht 2.7a.componentinfo.xml rename to Microcontrollers/opdracht 1.6/opdracht 1.6.componentinfo.xml diff --git a/Microcontrollers/opdracht 2.7a/opdracht 2.7a.cproj b/Microcontrollers/opdracht 1.6/opdracht 1.6.cproj similarity index 96% rename from Microcontrollers/opdracht 2.7a/opdracht 2.7a.cproj rename to Microcontrollers/opdracht 1.6/opdracht 1.6.cproj index e883d7a..614a1dc 100644 --- a/Microcontrollers/opdracht 2.7a/opdracht 2.7a.cproj +++ b/Microcontrollers/opdracht 1.6/opdracht 1.6.cproj @@ -4,7 +4,7 @@ 2.0 7.0 com.microchip.xc8 - {b7ed8d27-9387-4a45-a238-923f89602fb5} + {2c44e92f-6d48-45bd-810a-ad501ec081fe} ATmega128 none Executable @@ -12,9 +12,9 @@ $(MSBuildProjectName) .elf $(MSBuildProjectDirectory)\$(Configuration) - opdracht 2.7a - opdracht 2.7a - opdracht 2.7a + opdracht 1.6 + opdracht 1.6 + opdracht 1.6 XC8_2.31 true false diff --git a/Microcontrollers/opdracht 2.7a/opdracht 1.7a.componentinfo.xml b/Microcontrollers/opdracht 2.7a/opdracht 1.7a.componentinfo.xml new file mode 100644 index 0000000..bbcc667 --- /dev/null +++ b/Microcontrollers/opdracht 2.7a/opdracht 1.7a.componentinfo.xml @@ -0,0 +1,42 @@ + + + + + + + Device + Startup + + + Atmel + 1.6.0 + C:/Program Files (x86)\Atmel\Studio\7.0\Packs + + + + + C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\xc8\avr\include\avr\iom128.h + + header + XC + JdJ7J9I/SJh965SEyyyVYw== + + xc8/avr/include/avr/iom128.h + + + + + ATmega_DFP + C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/Atmel.ATmega_DFP.pdsc + 1.6.364 + true + ATmega128 + + + + Resolved + Fixed + true + + + \ No newline at end of file diff --git a/Microcontrollers/opdracht 2.7a/opdracht 1.7a.cproj b/Microcontrollers/opdracht 2.7a/opdracht 1.7a.cproj new file mode 100644 index 0000000..4e539d3 --- /dev/null +++ b/Microcontrollers/opdracht 2.7a/opdracht 1.7a.cproj @@ -0,0 +1,99 @@ + + + + 2.0 + 7.0 + com.microchip.xc8 + {b7ed8d27-9387-4a45-a238-923f89602fb5} + ATmega128 + none + Executable + C + $(MSBuildProjectName) + .elf + $(MSBuildProjectDirectory)\$(Configuration) + opdracht 2.7a + opdracht 1.7a + opdracht 2.7a + XC8_2.31 + true + false + true + true + + + true + + 2 + 0 + 0 + + + + + + + + + + + + + + + + + + True + True + True + + + (%24DeviceMacro) + NDEBUG + + + Optimize for size (-Os) + True + True + True + + + libm + + + + + + + + + True + True + + + (%24DeviceMacro) + DEBUG + + + Optimize debugging experience (-Og) + True + True + Default (-g2) + True + + + libm + + + Default (-Wa,-g) + + + + + + compile + + + + \ No newline at end of file