diff options
| author | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
|---|---|---|
| committer | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
| commit | 33613a85afc4b1481367fbe92a17ee59c240250b (patch) | |
| tree | 670b842326116b376b505ec2263878912fca97e2 /Bachelor/Mikroprozessorsysteme2/mi2/Termin2/Loesung/Termin2Aufgabe1.c | |
| download | Studium-master.tar.gz Studium-master.tar.bz2 | |
Diffstat (limited to 'Bachelor/Mikroprozessorsysteme2/mi2/Termin2/Loesung/Termin2Aufgabe1.c')
| -rw-r--r-- | Bachelor/Mikroprozessorsysteme2/mi2/Termin2/Loesung/Termin2Aufgabe1.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Bachelor/Mikroprozessorsysteme2/mi2/Termin2/Loesung/Termin2Aufgabe1.c b/Bachelor/Mikroprozessorsysteme2/mi2/Termin2/Loesung/Termin2Aufgabe1.c new file mode 100644 index 0000000..355bb20 --- /dev/null +++ b/Bachelor/Mikroprozessorsysteme2/mi2/Termin2/Loesung/Termin2Aufgabe1.c @@ -0,0 +1,21 @@ +#include "defines.h"
+
+int main(void)
+{
+ *PMC_PCER = 0x4000; // Power Enable für Parallel I/O Controller B
+ *PIOB_PER = 0x100; // Pin 8: Enabled (Initialisiert) (Lämpchen)
+ *PIOB_OER = 0x100; // Pin 8: Pin als Ausgabe verwenden
+ // Lämpchen ist initialisiert und auf Output gesetzt.
+
+ int i;
+
+ while (1)
+ {
+ *PIOB_SODR = 0x100; // Pin 8: Lampe an
+ for (i=0; i<125000; i++); // Pause
+ *PIOB_CODR = 0x100; // Pin 8: Lampe aus
+ for (i=0; i<125000; i++); // Pause
+ }
+ return 0;
+}
+
|
