<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.8.0-dev (info@mypapit.net)" -->
<rss version="2.0" >
    <channel>
        <title>Forum der FSI Mechatronik News</title>
        <description></description>
        <link>http://www.fsi-mechatronik.de/unb/</link>
        <lastBuildDate>Wed, 08 Sep 2010 11:38:36 GMT</lastBuildDate>
        <generator>FeedCreator 1.8.0-dev (info@mypapit.net)</generator>
        <item>
            <title>Die Klausurumfrage™</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1326</link>
            <description><![CDATA[
Hier fehlt noch was!<br />
<br />
Und zwar die gute alte Tradition aus dem Informatik-Forum, zu jeder Klausur eine sinnfreie Umfrage zu erstellen, in der man darüber abstimmt, wie für einen die Prüfung gelaufen ist. Ich mach euch mal vor, wie es geht. <img src="http://www.fsi-mechatronik.de/unb/unb_lib/designs/_smile/unb/grin.png" title=":-D" alt=":-D" style="vertical-align:middle;width:15px;height:15px;" class="smilie" />
]]></description>
            <author> no_email@example.com (Airhardt)</author>
            <pubDate>Fri, 30 Jul 2010 20:54:24 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1326</guid>
        </item>
        <item>
            <title>Live von der Korrektur</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1325</link>
            <description><![CDATA[
Sitzen inzwischen im Aquarium und korrigieren fleißig die Programmieraufgabe. Jetzt wird erst mal Pizza bestellt.
]]></description>
            <author> no_email@example.com (morty)</author>
            <pubDate>Fri, 30 Jul 2010 09:50:29 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1325</guid>
        </item>
        <item>
            <title>Interrupt während wait()</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1324</link>
            <description><![CDATA[
Ich hab ne Schleife<br />
<br />
<tt>while(1) {<br />
cli();<br />
uint16_t inter = interval;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /*interval ist volatile*/<br />
sei();<br />
wait(inter);<br />
}<br />
</tt>
nen Interrupthandler:<br />
<br />
<tt>ISR(INT0_vect) {<br />
interval -= 1000;<br />
}<br />
</tt>
und ne wait-Funktion<br />
<tt>void wait(unsigend int interval) {<br />
volatile usigned int i;<br />
for(i=0; i&lt;interval; i++) {}<br />
}<br />
</tt>
<br />
Frage: Wenn der Interrupt kommt, wenn Ich gerade in der wait-Funktion bin: <br />
Verändert mir der Interrupt noch interval als Bedingung in der for-Schleife oder erst beim nächsten Aufruf von wait?
]]></description>
            <author> no_email@example.com (Toni)</author>
            <pubDate>Thu, 29 Jul 2010 15:07:43 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1324</guid>
        </item>
        <item>
            <title>Oktober 2008 3c</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1323</link>
            <description><![CDATA[
Servus,<br />
<br />
ich komm einfach nicht auf die vier Schritte.<br />
<br />
Ist damit gemeint : Kompilieren, Binden, und Flashen??? Was wäre dann der 4. Schritt?? <br />
<br />
Gruß <br />
<br />
Zerotan
]]></description>
            <author> no_email@example.com (Zerotan)</author>
            <pubDate>Thu, 29 Jul 2010 14:36:27 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1323</guid>
        </item>
        <item>
            <title>Interrupts</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1322</link>
            <description><![CDATA[
Hallo,<br />
<br />
ich hab jetzt mal zum Testen von Interrupts ein kleines Programm geschrieben, aber es funktioniert nicht <img src="http://www.fsi-mechatronik.de/unb/unb_lib/designs/_smile/unb/wink.png" title=";-)" alt=";-)" style="vertical-align:middle;width:15px;height:15px;" class="smilie" /><br />
<br />
<span style="color:blue">#include &lt;led.h&gt;<br />
#include &lt;button.h&gt;<br />
#include &lt;avr/interrupt.h&gt;<br />
#include &lt;avr/io.h&gt;<br />
<br />
static volatile int x;<br />
<br />
ISR(INT0_vect){<br />
x++;<br />
<br />
}<br />
<br />
void init(){<br />
<br />
DDRD &amp;= ~(1&lt;&lt;PD2);&nbsp; /* Button 0 als Eingang */<br />
PORTD |= (1&lt;&lt;PD2); /* pull-up*/<br />
GICR |= (1&lt;&lt;INT0); /* INT0 - Interrupt anschalten */<br />
MCUCR |= (1&lt;&lt;ISC01)|(1&lt;&lt;ISC00); /*steigende Flanke*/<br />
<br />
<br />
}<br />
void main(void){<br />
<br />
init();<br />
<br />
while(1){<br />
sb_led_on(x);<br />
}<br />
}<br />
</span><br />
<br />
Was ist daran falsch, es macht mir die 1. Led an, und dann passiert nix bei Tastendruck. <br />
<br />
Gruß<br />
Zerotan
]]></description>
            <author> no_email@example.com (Zerotan)</author>
            <pubDate>Wed, 28 Jul 2010 19:50:24 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1322</guid>
        </item>
        <item>
            <title>Oktober 2006 MC d)</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1321</link>
            <description><![CDATA[
Sorry aber bei dem Ding steh ich grade total auf dem schlauch welche Antwort richtig sein könnte<br />
<br />
Was passiert wenn man folgendes Programmstück übersetzen und ausführen möchte:<br />
char *string;<br />
string = "SPiC ist toll";<br />
<br />
1.Der Compiler wird beim Übersetzen einen Fehler melden, weil diese Art von Zugriff auf einen Zeiger nicht erlaubt ist<br />
<span style="color:orange">Hm wieso wäre hier der Zugriff nicht erlaubt?</span><br />
<br />
2.Der Variable string wird der Zeiger auf die konstante Zeichenkette "SPiC ist toll" zugeordnet<br />
<span style="color:orange">Ist string eine Variable?? Ich würde sagen string soll doch ein zeiger sein oder?</span><br />
<br />
3.Unter Betriebssystemen wie Unix oder Windows wird zur Laufzeit eine Schutzverletzung bzw SIGSEGV ausgelöst, da dem Zeiger ein Wert zugeordnet wird, der Zeiger jedoch nicht initialisiert wird<br />
<span style="color:orange">Also ich halte es für unwahrscheinlich dass es zu Laufzeiten einen Fehler mit sowas gibt... ich benutze den Zeiger ja fast zu nichts</span><br />
<br />
4.Die Zeichenkette "SPiC ist toll" ist konstant und darf daher keinem nicht-konstanten Zeiger zugewiesen werden.<br />
<span style="color:orange">Das hab ich schonmal ausgeschlosse weil es meiner Meinung nach Wurscht is ob ich was konstantes etwas nicht konstantem zuweise</span>
]]></description>
            <author> no_email@example.com (Maggy)</author>
            <pubDate>Wed, 28 Jul 2010 19:03:27 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1321</guid>
        </item>
        <item>
            <title>Fragen zu Betriebssystemkern</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1320</link>
            <description><![CDATA[
Gab ja in einigen Klausuren schon Fragen zu dem Thema.<br />
Bin mir bei den Lösungen nicht ganz sicher.<br />
Wäre nett wenn jemand kurz drüberschauen könnte ob das stimmt.<br />
<br />
August06<br />
1d) Welcher der folgenden Mechanismen gehört nicht zu den Funktionen<br />
eines Betriebssystemkerns wie z. B. UNIX oder Windows?<br />
<span style="color:crimson"><b>X</b></span> Entgegennehmen von Kommandos (Shell / Eingabeaufforderung)<br />
❏ Verwaltung des Hauptspeichers<br />
❏ Dateisystem<br />
❏ Interrupt-Behandlung<br />
<br />
<br />
April07<br />
1c) Welcher der folgenden Mechanismen gehört zu den Funktionen eines<br />
Betriebssystemkerns wie z. B. UNIX oder Windows?<br />
❏ Entgegennehmen von Kommandos (Shell / Eingabeaufforderung)<br />
❏ Verwaltung von Druckaufträgen<br />
<span style="color:crimson"><b>X</b></span> Interrupt-Behandlung<br />
❏ Compiler zum Übersetzen von Programmen<br />
<br />
<br />
April08<br />
1f) Welcher der folgenden Mechanismen gehört nicht zu den Funktionen<br />
eines Betriebssystemkerns wie z. B. UNIX oder Windows?<br />
❏ Verwaltung des Hauptspeichers<br />
❏ Dateisystem<br />
❏ Interrupt-Behandlung<br />
<span style="color:crimson"><b>X</b></span> Compiler
]]></description>
            <author> no_email@example.com (qwl)</author>
            <pubDate>Tue, 27 Jul 2010 11:23:00 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1320</guid>
        </item>
        <item>
            <title>2b April 2009</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1319</link>
            <description><![CDATA[
Hi,<br />
hab hier mal die Aufgabe 2b vom April 2009 bearbeitet.<br />
Es handelt sich hierbei um die Ausgabe von Größe und Name aller Files eines Verzeichnisses.<br />
Vielleicht könnte mal jemand drüber schauen und auf fehler überprüfen.<br />
Insbesondere Ausgabe der Größe.<br />
Vielen Dank<br />
lg Dani =)<br />
<br />
<tt>int main(int argc, char *argv[])<br />
{<br />
&nbsp;&nbsp;&nbsp; DIR *dirp;<br />
&nbsp;&nbsp;&nbsp; struct dirent *entry;<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; // Fehlerabfrage auf Argumentenanzahl (2)<br />
&nbsp;&nbsp;&nbsp; if(argc != 2)<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; fprintf(stderr, "Argument counter failed\n"); // Ausgabe auf StandardErrorKanel<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; exit(EXIT_FAILURE);<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; dirp = opendir(argv[1]); // Open dir übergebener Pfad<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; if(dirp == NULL)<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; fprintf(stderr, "Fehler beim Oeffnen\n");<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; exit(EXIT_FAILURE);<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; while(errno == 0, entry = readdir(dirp)) // Beenden bei error oder bei Ende der Files<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if(entry-&gt;d_name[0] != '.')<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; fprintf(stdout, "%s\n", entry-&gt;off_t); // ist off_t die richtige Eigenschaft für die Größe ?? Oder welche nimmt man!<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; fprintf(stdout, "%s\n", entry-&gt;d_Name);<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; // Fehlerabfrage auf Errno<br />
&nbsp;&nbsp;&nbsp; if(errno != 0)<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; fprintf(stderr, "Fehler innerhalb readdir\n");<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; exit(EXIT_FAILURE);<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; return 1;<br />
}<br />
</tt>

]]></description>
            <author> no_email@example.com (Dani)</author>
            <pubDate>Mon, 26 Jul 2010 20:16:42 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1319</guid>
        </item>
        <item>
            <title>Diverse Fragen</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1318</link>
            <description><![CDATA[
So ich hab da mal ein paar Fragen zu diversen Aufgaben <img src="http://www.fsi-mechatronik.de/unb/unb_lib/designs/_smile/unb/smile.png" title=":)" alt=":)" style="vertical-align:middle;width:15px;height:15px;" class="smilie" /><br />
Leider bin ich mir oft nicht sicher ob das stimmt was ich mir denke...<br />
<br />
Oktober 2008:<br />
1.c) Welche Aussage ztu virtuellen Adressräumen ist richtig? -Umrechnung zur Laufzeit<br />
3.b) Wie wird ein Interrupt typischerweise bearbeitet (auch April 2009 3 b) hat diese Fragstellung)<br />
-Haubtprogram wird ausgeführt -&gt; Interrupt trifft ein-&gt; Rücksprungadresse sichern-&gt;Interruptquelle wird bestimmt-&gt;Interruptfunktion wird ausgeführt(währenddessen werden Interrupts gesperrt und max einer gepuffert)-&gt;Rückkehr ins Haubtprogramm über Rücksprungadresse<br />
<br />
April 2009:<br />
1.d) Was passiert wenn das folgende Programmstück übersetzt und ausgeführt wird:<br />
unsigned char *p=(unisgned char *) 0x3B;<br />
*p=0x01<br />
<br />
-3.Antwort: Es würde ein Bit im I/O Register gesetzt<br />
<br />
Juli 2009:<br />
1.a) Welche Angaben enthält ein Eintrag eines Katalogs? -Inode NUmmer und Dateiname<br />
3.c)Welche vier Kategorien im Bezug auf Gültigkeit von Variablen unterscheidet man bei C? Beschreiben sie, wie bzw wo man eine Variable dafür jeweils anlegen muss.<br />
<br />
&nbsp;Bin mir bei den Kathegrorien nicht sicher... ich glaub es sind: Global, Lokal, Extern und Static sein bin mir aber nicht ganz sicher. Zudem frage ich mich auf was das Wo bezogen ist... wo im Programmcode oder wo im Speicher? Weil die lokalen ja im Stack sein können oder?
]]></description>
            <author> no_email@example.com (Maggy)</author>
            <pubDate>Mon, 26 Jul 2010 15:08:33 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1318</guid>
        </item>
        <item>
            <title>Gspic 2. Aufgabe (Juli 2009)</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1317</link>
            <description><![CDATA[
Ich habe die die 2. Klausuraufgabe (Juli 2009) programmiert, bin mir aber beim Zufluss Überwachen nicht so sicher ob das richtig ist. Wenn jemand Fehler findet, bitte melden. Danke.<br />
<br />
<tt><br />
/*Funktionsdeklarationen, globale Variablen, etc. */<br />
<br />
static void init(void);<br />
static volatile unsigned int tank = 0;<br />
static volatile uint8_t event = 0; <br />
<br />
<br />
/*Unterbrechungsbehandlungsfunktionen */<br />
<br />
ISR (INT0_vect) {<br />
&nbsp;&nbsp;&nbsp; if(event ==&nbsp; 0) {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; event = 1;<br />
&nbsp;&nbsp;&nbsp; else {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; event = 0;<br />
&nbsp;&nbsp;&nbsp; <br />
<br />
&nbsp;&nbsp;&nbsp; }<br />
<br />
}<br />
<br />
ISR (INT1_vect) {<br />
&nbsp;&nbsp;&nbsp; tank--;<br />
&nbsp;&nbsp;&nbsp; PORTD&amp; = ~1;<br />
&nbsp;&nbsp; <br />
}<br />
<br />
<br />
/* Funktion main */<br />
<br />
void main(void) {<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; /*Initialisierung */<br />
&nbsp;&nbsp;&nbsp; init();<br />
&nbsp;&nbsp;&nbsp; PORTD &amp;= ~1;<br />
<br />
<br />
&nbsp;&nbsp;&nbsp; /*Warten auf Ereignisse */<br />
&nbsp;&nbsp;&nbsp; while(1){<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; <br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; while(event == 0){<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; sleep_enable();<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; sei();<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; sleep_cpu();<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; sleep_disable();<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; cli();<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; /*Zufluss überwachen */<br />
<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; while(tank&lt;FILL_MAX &amp;&amp; event == 1){<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; tank++;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; sei();<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; event == 1;&nbsp; /* event == 1 hat keine Auswirkung auf das Programm. sei() und der nächste Befehl werden atomar ausgeführt. Damit an der Stelle Interrupts bearbeitet werden können, darf nach sei() nicht cli() stehen. */<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; cli();<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if(tank == FILL_MAX) {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; PORTD|= 1;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; event = 0;<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; <br />
<br />
&nbsp;&nbsp;&nbsp; }<br />
<br />
<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; <br />
<br />
}<br />
<br />
/*Ende der Funktion main */<br />
<br />
/*Funktion init */<br />
<br />
static void init(void){<br />
&nbsp;&nbsp;&nbsp; DDRD &amp;= ~(1&lt;&lt;2);<br />
&nbsp;&nbsp;&nbsp; PORTD|=(1&lt;&lt;2);<br />
&nbsp;&nbsp;&nbsp; DDRD|= 1;<br />
&nbsp;&nbsp;&nbsp; DDRD &amp;= ~(1&lt;&lt;3);<br />
&nbsp;&nbsp;&nbsp; PORTD|=(1&lt;&lt;3);<br />
&nbsp;&nbsp;&nbsp; GICR|= (1&lt;&lt;INT0)|(1&lt;&lt;INT1);<br />
&nbsp;&nbsp;&nbsp; MCUCR &amp;= ~(1&lt;&lt;ISC01);<br />
&nbsp;&nbsp;&nbsp; MCUCR |= (1&lt;&lt;ISC00);<br />
&nbsp;&nbsp;&nbsp; MCUCR &amp;= ~(1&lt;&lt;ISC10);<br />
&nbsp;&nbsp;&nbsp; MCUCR |= (1&lt;&lt;ISC11);<br />
&nbsp;&nbsp;&nbsp; <br />
}<br />
<br />
<br />
<br />
<br />
</tt>

]]></description>
            <author> no_email@example.com (Panos)</author>
            <pubDate>Mon, 26 Jul 2010 14:33:16 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1317</guid>
        </item>
        <item>
            <title>Frage zu Betriebssystemen</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1316</link>
            <description><![CDATA[
Ein Betriebssystem verwaltet ja die ganzen Betriebsmittel.<br />
Sind dann die Betriebssystemkomponenten eine genauere Spezifizierung der der Betriebsmittel,<br />
die verwaltet werden?
]]></description>
            <author> no_email@example.com (Stefan)</author>
            <pubDate>Mon, 26 Jul 2010 09:06:52 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1316</guid>
        </item>
        <item>
            <title>Klausur Oktober 2008</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1315</link>
            <description><![CDATA[
Ich habe versucht die Programmieraufgabe zu lösen und diese über den Mikrokontroller laufen zu lassen.<br />
Natürlich musste ich einige Änderungen vornehmen.<br />
Meiner Meinung nach sollte das so laufen.<br />
Es treten aber zwei Fehler auf:<br />
1.Wenn der Mikrokontroller aus der Schlafphase erwacht, dann setzt er speed nur 5000, wenn ich vorher z.B.<br />
noch eine Warteschleife laufen lass.(In den Kommentaren Versuch mit der Warteschleife) <br />
2.Bei Knopfdruck hat man das Gefühl, dass der Mikrokontroller sofort auf Vollspeed schaltet.<br />
<br />
Was ist also falsch am Programm? <br />
<br />
<tt>#include &lt;avr/io.h&gt;<br />
#include &lt;avr/interrupt.h&gt;<br />
#include &lt;avr/sleep.h&gt;<br />
#include &lt;led.h&gt;<br />
<br />
static volatile unsigned int speed = 5000;<br />
void init();<br />
void wait(unsigned int);<br />
<br />
ISR(INT0_vect){<br />
&nbsp;&nbsp;&nbsp; if(speed&gt;1000){<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; speed -= 1000;<br />
&nbsp;&nbsp;&nbsp; }<br />
}<br />
<br />
void main(){<br />
&nbsp;&nbsp;&nbsp; /*volatile unsigned int z;*/<br />
&nbsp;&nbsp;&nbsp; int i = 0;<br />
&nbsp;&nbsp;&nbsp; init();<br />
&nbsp;&nbsp;&nbsp; sei();<br />
<br />
&nbsp;&nbsp;&nbsp; while(1){<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; <br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; for(i=0;i&lt;8;i++){<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; int pin;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; PORTD &amp;=~ (1&lt;&lt;7);<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; PORTC &amp;=~ (1&lt;&lt;0);<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; PORTC &amp;=~ (1&lt;&lt;1);<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; PORTC &amp;=~ (1&lt;&lt;6);<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; PORTC &amp;=~ (1&lt;&lt;7);<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; PORTA &amp;=~ (1&lt;&lt;7);<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; PORTA &amp;=~ (1&lt;&lt;6);<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; PORTA &amp;=~ (1&lt;&lt;5);<br />
<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; switch(i) {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; case 0:<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; pin = 7;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; break;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; case 1:<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; pin = 0;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; break;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; case 2:<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; pin = 1;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; break;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; case 3:<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; pin = 6;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; break;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; case 4:<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; pin = 7;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; break;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; case 5:<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; pin = 7;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; break;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; case 6:<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; pin = 6;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; break;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; case 7:<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; pin = 5;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; break;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; switch(i) {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; case 0:<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; PORTD |=&nbsp; (1&lt;&lt;pin);<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; break;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; case 1:<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; PORTC |=&nbsp; (1&lt;&lt;pin);<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; break;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; case 2:<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; PORTC |=&nbsp; (1&lt;&lt;pin);<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; break;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; case 3:<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; PORTC |=&nbsp; (1&lt;&lt;pin);<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; break;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; case 4:<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; PORTC |=&nbsp; (1&lt;&lt;pin);<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; break;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; case 5:<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; PORTA |=&nbsp; (1&lt;&lt;pin);<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; break;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; case 6:<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; PORTA |=&nbsp; (1&lt;&lt;pin);<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; break;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; case 7:<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; PORTA |=&nbsp; (1&lt;&lt;pin);<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; break;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; cli();<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; wait(speed);<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; sei();<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; cli();<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if(speed&lt;10000){<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; speed += 1000;<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; } else {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; sleep_enable();<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; sei();<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; sleep_cpu();<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; sleep_disable();<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; /*z = 0;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; while(z&lt;50000){<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; z++;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }*/<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; cli();<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; speed = 5000;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; sei();<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
<br />
&nbsp;&nbsp;&nbsp; }<br />
}<br />
&nbsp;&nbsp;&nbsp; <br />
void init(){<br />
&nbsp;&nbsp;&nbsp; DDRD |= (1&lt;&lt;7);<br />
&nbsp;&nbsp;&nbsp; DDRC |= (1&lt;&lt;0);<br />
&nbsp;&nbsp;&nbsp; DDRC |= (1&lt;&lt;1);<br />
&nbsp;&nbsp;&nbsp; DDRC |= (1&lt;&lt;6);<br />
&nbsp;&nbsp;&nbsp; DDRC |= (1&lt;&lt;7);<br />
&nbsp;&nbsp;&nbsp; DDRA |= (1&lt;&lt;7);<br />
&nbsp;&nbsp;&nbsp; DDRA |= (1&lt;&lt;6);<br />
&nbsp;&nbsp;&nbsp; DDRA |= (1&lt;&lt;5);<br />
<br />
&nbsp;&nbsp;&nbsp; PORTD |= (1&lt;&lt;7);<br />
&nbsp;&nbsp;&nbsp; PORTC &amp;=~ (1&lt;&lt;0);<br />
&nbsp;&nbsp;&nbsp; PORTC &amp;=~ (1&lt;&lt;1);<br />
&nbsp;&nbsp;&nbsp; PORTC &amp;=~ (1&lt;&lt;6);<br />
&nbsp;&nbsp;&nbsp; PORTC &amp;=~ (1&lt;&lt;7);<br />
&nbsp;&nbsp;&nbsp; PORTA &amp;=~ (1&lt;&lt;7);<br />
&nbsp;&nbsp;&nbsp; PORTA &amp;=~ (1&lt;&lt;6);<br />
&nbsp;&nbsp;&nbsp; PORTA &amp;=~ (1&lt;&lt;5);<br />
<br />
&nbsp;&nbsp;&nbsp; DDRD &amp;= ~0x04;<br />
&nbsp;&nbsp;&nbsp; PORTD|= 0x04;<br />
&nbsp;&nbsp;&nbsp; MCUCSR |= (1&lt;&lt;ISC00);<br />
&nbsp;&nbsp;&nbsp; MCUCSR |= (1&lt;&lt;ISC01);<br />
&nbsp;&nbsp;&nbsp; /*MCUCSR |= (1&lt;&lt;(ISC00|ISC01));*/<br />
&nbsp;&nbsp;&nbsp; GICR |= (1&lt;&lt;INT0);<br />
}<br />
<br />
void wait (unsigned int interval){<br />
&nbsp;&nbsp;&nbsp; volatile unsigned int i = 0;<br />
&nbsp;&nbsp;&nbsp; while(i&lt;interval){<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; i++;<br />
&nbsp;&nbsp;&nbsp; }<br />
}<br />
</tt>

]]></description>
            <author> no_email@example.com (Stefan)</author>
            <pubDate>Sun, 25 Jul 2010 16:50:39 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1315</guid>
        </item>
        <item>
            <title>Fragen zum Vorlesungsskript und den Übungsfolien</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1314</link>
            <description><![CDATA[
1) Folie D.33: Bei den Vorrangregeln bei Operatoren steht in der Spalte Assoziativität: von rechts nach links bzw. von links nach rechts. Was ist damit gemeint?<br />
<br />
2) Folie E.3: Beim Programmadressraum steht 2 Byte pro Adresse und beim Datenadressraum steht 1 Byte pro Adresse. Heißt das, dass der Inhalt eines Zeigers mit einer Adresse aus dem Programmspeicher 2 Byte groß ist und einer aus dem Datenspeicher 1 Byte groß ist?<br />
<br />
3) Folie E.12: Der Interrupt-Vektor enthält Informationen zur Bearbeitung des Interrupts. Laut Skript, einen Maschinenbefehl oder eine Adresse einer Bearbeitungsfunktion. Wo ist da der Unterschied?<br />
<br />
4) Folie F.14 : Ein Feld kann durch eine Liste von konstanten Ausdrücken, die durch Komma getrennt sind, initialisiert werden. Wieso müssen das konstante Ausdrücke sein? Kann ich nicht mit Variablen initialisieren?<br />
<br />
5) Folie F.26: Wieso sind die Parameter-Deklarationen int p2[] und int *p2 äquivalent? int p2[] ist doch ein <u>konstanter</u> Zeiger auf das erste Element des Feldes und int *p2 ein Zeiger der veränderbar ist.<br />
<br />
6) Folie G.13: Wenn vor sleep_cpu() ein Interrupt auftritt, wieso ensteht dann das Lost-wakeup-Problem?<br />
<br />
7) Übungsskript Folie 5.28: Da die Variable event 8 bit ist (atomar) und in der while Schleifenbedingung nur gelesen wird, wäre die while-Schleife dann auch so richtig?<br />
<br />
<tt>while(event==0) {<br />
&nbsp;&nbsp;&nbsp; cli();<br />
&nbsp;&nbsp;&nbsp; sleep_enable();<br />
&nbsp;&nbsp;&nbsp; sei();<br />
&nbsp;&nbsp;&nbsp; sleep_cpu();<br />
&nbsp;&nbsp;&nbsp; sleep_disable();<br />
}<br />
</tt>

]]></description>
            <author> no_email@example.com (Panos)</author>
            <pubDate>Sat, 24 Jul 2010 13:53:11 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1314</guid>
        </item>
        <item>
            <title>Juli 2009 2b</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1313</link>
            <description><![CDATA[
Hi,<br />
mal die Aufgabe 2b aus der Klausur vom Juli 2009 durchgearbeitet.<br />
Wär nett wenn jemand meine Lösung mal überprüft.<br />
Vor allem bei dem Warten auf ein Signal vom Kindprozess bin ich mir noch unsicher.<br />
Danke<br />
lg Dani =)<br />
<br />
<tt>#include &lt;stdio.h&gt;<br />
#include &lt;unistd.h&gt;<br />
#include &lt;stdlib.h&gt;<br />
#include &lt;errno.h&gt;<br />
#include &lt;sys/types.h&gt;<br />
#include &lt;dirent.h&gt;<br />
<br />
int main(int argc, char *argv[]) {<br />
<br />
<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; DIR *dirp; <br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; struct dirent *entry;<br />
<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; dirp = Opendir(".");//Zeiger dirp kriegt die Adresse vom aktuellen Verzeichnis<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if(dirp == NULL){&nbsp; &nbsp; // Fehlerabfrage<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; perror("opendir");<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; exit(EXIT_FAILURE);<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; while (errno=0, (entry = readdir(dirp))!=NULL){&nbsp; &nbsp; //entry zeigt auf die nächste Datei in dirp<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; pid_t pid;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; pid = fork();&nbsp; &nbsp; //erzeugt Kind-Prozess und speichert dessen ID in pid<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if (pid == -1) { //Fehlerabfrage<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; perror("fork failed");<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; exit(EXIT_FAILURE);<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; } <br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; else if (pid == 0) {&nbsp; &nbsp; //im Kindprozess<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if(entry--&gt;d_name[0] != '.')&nbsp; &nbsp; // Verzeichnis mit . ausschließen<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; {<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; execl("/usr/bin/backup/", entry--&gt;d_name);&nbsp; &nbsp;&nbsp; //Backup wird mit name der Datei gestartet&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; exit(); //beenden vom Kindprozess<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; else {&nbsp; &nbsp;&nbsp; //im Vaterprozess<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; sigsuspend(); // warten auf den Kind Prozess<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp;&nbsp; <br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; if (errno != 0){&nbsp; &nbsp;&nbsp; //bei veränderung von errno Fehlerbahandlung<br />
&nbsp;<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; perror("readdir");<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; exit(EXIT_FAILURE);<br />
<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; if(closedir(dirp)==-1){// Schließt das Verzeichnis und macht bei Rückgabewert -1Fehlerbehandlung<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; perror("closedir");<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; exit(EXIT_FAILURE);<br />
<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; }<br />
<br />
}<br />
</tt>

]]></description>
            <author> no_email@example.com (Dani)</author>
            <pubDate>Sat, 24 Jul 2010 12:44:21 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1313</guid>
        </item>
        <item>
            <title>Klausur Juli 2009</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1312</link>
            <description><![CDATA[
Es geht um die Ankreuzaufgabe:<br />
<br />
b) Ein Hauptprogramm und eine Interruptbehandlung greifen nebenläufig<br />
auf die Variable uint16_t foo zu. Das Hauptprogramm verwendet foo<br />
in der Anweisung uint16_t bar = foo; der Interrupthandler verwendet<br />
foo im Vergleich if(foo == 5). Welches Nebenläufigkeitsproblem kann<br />
auftreten?<br />
❏ Lost-Update<br />
❏ Lost-Wakeup<br />
❏ keines<br />
❏ Das Hauptprogramm könnte einen inkonsistenten Wert lesen, da foo aus 2 Bytes<br />
besteht und nicht mit einer Instruktion geladen werden kann.<br />
<br />
Ich denke ja, dass die ersten beiden Antworten hier nicht möglich sind.<br />
Eigentlich wird doch die Variable foo im Interrupthandler gar nicht verändert.<br />
Deswegen sollte doch dann auch kein Problem auftreten?<br />
<br />
Weiterin wollte ich fragen, ob eine derartige globale Variable, wie foo, volatile gesetzt werden muss.<br />
Im Prinzip verändert der Handler ja nichts an der Variablen. <br />
<br />
Danke für eine Antwort
]]></description>
            <author> no_email@example.com (Stefan)</author>
            <pubDate>Thu, 22 Jul 2010 22:11:14 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1312</guid>
        </item>
        <item>
            <title>Frage zur GSPIC-Klausur  Juli09 - Theorieaufgabe</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1311</link>
            <description><![CDATA[
Hi <br />
es geht um die Aufgabe 3b) der Klausur vom Juli 2009<br />
<br />
<br />
Die Aufgabenstellung lautet:<br />
"Wie wird die Parameterübergabe über den Stack (z. B. auf einer Intel-Prozessorarchitektur)<br />
realisiert. Beschreiben Sie, wie die aktuellen Parameter abgelegt werden<br />
und wie der Zugriff über die formalen Parameter erfolgt (ggf. durch Skizze<br />
veranschaulichen!)"<br />
<br />
Meine Frage wäre jetzt was genau da als Antwort erwartet wird?<br />
Im Skript wären das ja die Folien H.5-H.19 denke ich. Aber was genau davon sollte jetzt in der Antwort stehen?<br />
<br />
<br />
<br />
Vielen Dank
]]></description>
            <author> no_email@example.com (qwl)</author>
            <pubDate>Thu, 22 Jul 2010 07:29:46 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1311</guid>
        </item>
        <item>
            <title>April-2009-Aufgabe 2a</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1310</link>
            <description><![CDATA[
Hi,<br />
ich habe mal die Klausuraufgabe 2a vom April 2009 durchgearbeitet.<br />
Wär echt super wenn sich jemand mal meine Lösung durchschaut und auf Fehlern überprüft <img src="http://www.fsi-mechatronik.de/unb/unb_lib/designs/_smile/unb/smile.png" title=":)" alt=":)" style="vertical-align:middle;width:15px;height:15px;" class="smilie" /><br />
Vielen Dank schonmal<br />
lg Dani <img src="http://www.fsi-mechatronik.de/unb/unb_lib/designs/_smile/unb/smile.png" title=":)" alt=":)" style="vertical-align:middle;width:15px;height:15px;" class="smilie" /><br />
<br />
<tt>#include &lt;avr/io.h&gt;<br />
#include &lt;avr/interrupt.h&gt;<br />
#include &lt;avr/sleep.h&gt;<br />
<br />
#define NUMLED 6<br />
<br />
<br />
/*Funktionsdeklarationen, globale Variablen, tec. */<br />
<br />
volatile static in laenge;&nbsp; &nbsp; /*länge der Schlange*/<br />
volatile static in running;&nbsp; &nbsp; /*Findet gerade eine Umrandung statt?*/<br />
volatile static in interrupt;&nbsp; &nbsp; /*gab es schon einen Interrupt?*/<br />
<br />
<br />
/*Unterbrechungsbehandlungsfunktion*/<br />
<br />
ISR (INT0_vect){<br />
&nbsp;&nbsp;&nbsp; if(interrupt == 0){<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if (running == 0){<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if (laenge &lt; NUMLED)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; lange++;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; else if (running == 1 &amp;&amp; laenge &gt; 1)<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; lange --;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; }<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; interrupt = 1;<br />
}<br />
<br />
<br />
<br />
/*Funktion main*/<br />
<br />
void main (){<br />
&nbsp;&nbsp;&nbsp; init();<br />
<br />
/* Initialisierung */<br />
<br />
laenge = 1;<br />
running = 0;<br />
interrupt= 0;<br />
<br />
sei();<br />
<br />
<br />
/* Hauptschleife */<br />
while(1){<br />
&nbsp;&nbsp;&nbsp; int i = 0;<br />
&nbsp;&nbsp;&nbsp; cli();<br />
&nbsp;&nbsp;&nbsp; running = 1;<br />
&nbsp;&nbsp;&nbsp; for (i; i &lt; NUMLED; i++){<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; ShowSnake(i;laenge);<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; active_wait(5000);<br />
&nbsp;&nbsp;&nbsp; }<br />
interrupt = 0;<br />
sei();<br />
cli();<br />
running = 0;<br />
sei();<br />
<br />
<br />
<br />
/* Vorbereitung des naechsten Umlaufsbzw. Schlafen */<br />
<br />
cli();<br />
if (interrupt == 0 &amp;&amp; laenge ==6){<br />
&nbsp;&nbsp;&nbsp; laenge = 1; <br />
&nbsp;&nbsp;&nbsp; sei();<br />
&nbsp;&nbsp;&nbsp; cli();<br />
}<br />
while(interrut == 0){<br />
&nbsp;&nbsp;&nbsp; sei();<br />
&nbsp;&nbsp;&nbsp; sleep_cpu;<br />
&nbsp;&nbsp;&nbsp; cli();<br />
&nbsp;&nbsp;&nbsp; interrupt = 0;<br />
&nbsp;&nbsp;&nbsp; sei();<br />
}<br />
<br />
<br />
<br />
/*Funktion init*/<br />
<br />
void init(){<br />
&nbsp;&nbsp;&nbsp; DDRB = 0xFF;<br />
&nbsp;&nbsp;&nbsp; DDRD = 0x00;<br />
&nbsp;&nbsp;&nbsp; PORTD |= (1&lt;&lt;PD2);<br />
&nbsp;&nbsp;&nbsp; MCUCR |= (1&lt;&lt;1) | (1&lt;&lt;0);<br />
&nbsp;&nbsp;&nbsp; GICR |= (1&lt;&lt;6);<br />
}<br />
<br />
<br />
<br />
/*Funktion active_wait()*/<br />
<br />
void active_wait (volatile unsigned int len){<br />
&nbsp;&nbsp;&nbsp; int i = o;<br />
&nbsp;&nbsp;&nbsp; for (i; i &lt;= len; i++)<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; sleep_cpu;<br />
}<br />
</tt>

]]></description>
            <author> no_email@example.com (Dani)</author>
            <pubDate>Tue, 20 Jul 2010 08:18:16 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1310</guid>
        </item>
        <item>
            <title>Handler</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1309</link>
            <description><![CDATA[
Hallo,<br />
<br />
mich würde mal noch genauer interessieren wie das mit dem Handler funktioniert.Wir schreiben ja immer:<br />
<br />
ISR(Int_vect){<br />
<br />
tut irgendwas....<br />
<br />
}<br />
<br />
Im mom nehm ichs halt so hin das beim jeweiligen Interrupt den man durch den Int_vect angibt dann das ausgeführt wird was halt in den klammern steht. Nur wie funktioniert des genau, was macht des ISR. Was macht der Compiler damit?<br />
<br />
Vom Aufbau her isses ja wie ne Funktion sag ich mal, fehlt halt n Rückgabetyp davor.<br />
<br />
So genau hatten wird des in der Übung bzw Vorlesung nich aber die Frage ist letztendlich was ist ein Handler???<br />
<br />
Mfg<br />
Matze
]]></description>
            <author> no_email@example.com (Matthias Völkel)</author>
            <pubDate>Sat, 17 Jul 2010 15:32:49 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1309</guid>
        </item>
        <item>
            <title>Hilfe zur zweite Aufgabe</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1308</link>
            <description><![CDATA[
Hi,<br />
<br />
hier habe ich die zweite Aufgabe von Juli 2009 bearbeitet <img src="http://www.fsi-mechatronik.de/unb/unb_lib/designs/_smile/unb/smile.png" title=":)" alt=":)" style="vertical-align:middle;width:15px;height:15px;" class="smilie" /> ob jemand Fehler findet oder was Kommentiert&nbsp; <img src="http://www.fsi-mechatronik.de/unb/unb_lib/designs/_smile/unb/wink.png" title=";)" alt=";)" style="vertical-align:middle;width:15px;height:15px;" class="smilie" /> <br />
<br />
Vielen Dank
]]></description>
            <author> no_email@example.com (mohamed.th)</author>
            <pubDate>Wed, 14 Jul 2010 09:54:35 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1308</guid>
        </item>
        <item>
            <title>Setzen von Registern Steigende/Fallende Flanke (Wiederhergestellt)</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1307</link>
            <description><![CDATA[
Hallo,<br />
<br />
kann irgendjemand mir helfen?<br />
<br />
wenn die Flanke eines Interrupts sich ändert wie zb: steigende Flanke = oeffnen und fallende Flanke = schließen. wie programiert man das? in der init()-Methode muss irgendwas mit MCUCR konfigiriert werden: entweder Interrupts bei fallender, steigender oder beliebiger Flanke!!!! was kann man machen?<br />
<br />
kann ich zb so schreiben?<br />
in der init(): schreibe ich einfach MCURC |=(1&lt;&lt;ISC00) | (1&lt;&lt;ISC00); /*beliebige Flanke*/<br />
danach in meinem Interrupts-Handler: ISR (INT0_vect) { if (... /*wie schreib ich hier damit ich sage if es eine steigende Flanke ist?*/) schliessen = 0;<br />
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; else if (... /*wie schreib ich hier damit ich sage if es eine fallende Flanke ist?*/) schliessen =1;&nbsp;&nbsp; }<br />
<br />
Ich hoffe Ihre Hilfe. Danke
]]></description>
            <author> no_email@example.com (GSPIC-Student)</author>
            <pubDate>Sun, 11 Jul 2010 00:48:36 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1307</guid>
        </item>
        <item>
            <title>Kritik (Wiederhergestellt)</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1306</link>
            <description><![CDATA[
Gibts keine Moderatoren, Adminstratoren, Betreuer oder irgendwelche Leute die antworten können??? das ist ech komisch!!!! wieso gibts dann diese Forum? Ich dachte wenn man fragen stellt dann müssen die Leute, die verantwortlich sind schnell antowrten MAXIMAL 24 Std!!! Das ist zumindest in den anderen Forume so! Alle sagen und empfehlem dass wir in diesm scheiß Forum Fragen stellen und ... Aber keine von euch antwortet! das ist ja blödddd. und jetzt antwortet ihr oder was? fragen wir hier oder hauen wir ab und suchen wir uns was anderes?
]]></description>
            <author> no_email@example.com (GSPIC-Student)</author>
            <pubDate>Sun, 11 Jul 2010 00:39:09 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1306</guid>
        </item>
        <item>
            <title>Fragen zu alten Klausuren (Wiederhergestellt)</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1304</link>
            <description><![CDATA[
&nbsp;hi,<br />
<br />
ich hab ein paar Fragen:<br />
<br />
1* in einer Funktion ist die Variable x so deklariert: static x; heißt das dass der Speicherplatz von ProgrammSTART bis -ENDE vergüber ist oder ab irgendwann (nicht unbedingt vom Anfang) bis ende?<br />
2* wenn ich in einer Funktion static x = 152; dann wird x bei jedem Aufruf der Funktion mit dem Wert 152 initialisiert oder nut einmal?<br />
3* was heißt die Übergabesemantik für Zeiger?<br />
4* Wie kann man ein Interrupt definieren? reicht in der Klausur: ein Interrupt ist ein Unterbrechungsprogramm das aktiv wird wenn die Schnittstelle sich von sich aus dem Prozessor meldet? gibts noch was damit man 100% ein Interrupt definiert?<br />
5* immer noch beim Interrupt: was heißt Interrupts der gleichen Quelle? und währen der Bearbeitung eines Interrupts darf keine Andere Interrupts eintreffen oder? und wenn sie eintreffen dann was passiert?<br />
6* immer noch beim Interrupt: bearbeitung des Interrupts: im Punkt 4) steht Eintrag im Interrupt-Vektor ermitteln. was heißt das?<br />
7* immer noch beim Interrupt: Pegelgesteurte Interrupts heißt wenn der Pegel ändert sich dann meldet sich das Interrupt (d.h Wechsel des Pegels = Interrupt auslösen) oder wie? und wie funktioniert ein Flanken-gesteuertes Interrupt?<br />
8* was ist überhaupt ein Adressraum? und in welche Berieche ist diese Adressraum im Prozessor untergliedert? (die 2te Frage steht irgendwo in einer Klausuraufgabe)<br />
9* was ist der Unterschied zwichen Programm und Prozess?<br />
10<br />
<br />
&nbsp;&nbsp;&nbsp; * was ist ein Stack-Farme?<br />
<br />
11* irgendwo in einer Klausuraufgabe steht:<br />
unsigned char *p = (unsigned char *) 0x3B;<br />
*p = 0x01;<br />
unsigned char gibts nicht oder? wenn es gibt dann sollte die zeile *p = 0x01 den PORT mit der Adresse 0x3B mit dem Wert 0x01 ändern oder muss ich so schreiben unsigned char *p = (*(unsigned char *)) 0x3B;?<br />
<br />
<br />
Ich hoffe Ihre Hilfe. Tausend Danke <img src="http://www.fsi-mechatronik.de/unb/unb_lib/designs/_smile/unb/smile.png" title=":)" alt=":)" style="vertical-align:middle;width:15px;height:15px;" class="smilie" />
]]></description>
            <author> no_email@example.com (GSPIC-Student)</author>
            <pubDate>Wed, 07 Jul 2010 22:45:59 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1304</guid>
        </item>
        <item>
            <title>SPiC Klausuraufgabe 10-2008 EEI</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1302</link>
            <description><![CDATA[
Hi,<br />
&nbsp;<br />
habe gestern mal eine Klasuraufgabe (Aufgabe 2 Okt 2008 eei) "gelöst" und wollte mal fragen, ob jemand noch Fehler findet.<br />
<br />
Gruß, t
]]></description>
            <author> no_email@example.com (verstra)</author>
            <pubDate>Tue, 30 Mar 2010 09:08:41 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1302</guid>
        </item>
        <item>
            <title>Fragen zu SPiC Klausur am 31.3.2010</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1301</link>
            <description><![CDATA[
Hallo,<br />
<br />
weiß jemand sicher die Antworten auf die MC Aufgaben: Klausur: Juli 2009: 1)g; April 1)d, e und f&nbsp; ?<br />
<br />
Gruß
]]></description>
            <author> no_email@example.com (Don Corleone)</author>
            <pubDate>Mon, 29 Mar 2010 19:35:28 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1301</guid>
        </item>
        <item>
            <title>Bonuspunkte</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1271</link>
            <description><![CDATA[
Mich interessiert eure Meinung zu den Bonuspunkten.<br />
<br />
Sicherlich ist der Grundgedanke richtig, aber findet ihr es nicht komisch, dass somit Leistungen bewertet werden, welche außerhalb der Klausur erbracht wurden? Das kann schnell sehr unfair und unkontrollierbar werden.<br />
<br />
Gruß<br />
Franz Winter
]]></description>
            <author> no_email@example.com (Chacal)</author>
            <pubDate>Mon, 01 Dec 2008 23:17:24 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1271</guid>
        </item>
        <item>
            <title>Ablauf GDI II SS08</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1218</link>
            <description><![CDATA[
Hi,<br />
wann beginnen die Übungen (r-üb/normale üb) und ab wann sind die Aufgaben dazu verfügbar?<br />
Konnte leider nicht in die 1. Vorlesung -.-<br />
<br />
Ciao Matze
]]></description>
            <author> no_email@example.com (dermatze)</author>
            <pubDate>Sun, 20 Apr 2008 18:57:16 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1218</guid>
        </item>
        <item>
            <title>Klausurenergebnisse</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1214</link>
            <description><![CDATA[
Hat jmd die Zugangsdaten für die Klausurenergebnisse? Erfahrungsgemäß sind die SPiC Ergebnisse immer zieml schnell online...
]]></description>
            <author> no_email@example.com (2beerz)</author>
            <pubDate>Mon, 14 Apr 2008 09:00:33 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1214</guid>
        </item>
        <item>
            <title>Klausurfragen vom 9.4.2008</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1213</link>
            <description><![CDATA[
Hallo,<br />
<br />
ich schreib hier einfach mal rein was mir vom Digitaltechnik-Teil noch einfällt:<br />
<br />
1. Zahlensysteme<br />
- dezimal 2046 und 10001 in binär umwandeln und dann in hex umwandeln<br />
- dezimal 106 - 56: Umwandeln in binär, dann Subtraktion mit Zweierkomplement; Rückwandlung nach Dezimal<br />
- dezimal 17 * 8: umwandeln in binär, multiplizieren, rückwandeln nach dezimal<br />
<br />
2. Schaltfunktionen<br />
- schaltung mit AND und OR Gattern gegeben, Schaltfunktion dazu angeben (ca. 5 eingänge)<br />
<br />
- Schaltfunktion gegeben, Funktionstabelle dazu ausfüllen (Vier Eingänge waren schon ausgefüllt, Spalte für Ausgang musste mit 0, 1 "aufgefüllt werden")<br />
c) Symmetriediagramm dazu aufstellen und KMF oder DMF bilden (nur eine davon, bin mir nicht mehr sicher, welche)<br />
Das Diagramm sah dann so aus:<tt>0110<br />
0110<br />
1100<br />
1100<br />
</tt>
<br />
- Frage sinngemäß: "Wofür ist das Petrick-Verfahren gedacht?"<br />
- Frage sinngemäß: "Kann das Petrick-Verfahren hier verwendet werden um die KMF(siehe Teilaufgabe c)) aufzustellen?"<br />
<br />
3. Und dann kam noch eine Automatenaufgabe. <img src="http://www.fsi-mechatronik.de/unb/unb_lib/designs/_smile/unb/smile.png" title=":-)" alt=":-)" style="vertical-align:middle;width:15px;height:15px;" class="smilie" /><br />
<br />
Viele Grüße
]]></description>
            <author> no_email@example.com (daniel_d)</author>
            <pubDate>Wed, 09 Apr 2008 08:45:36 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1213</guid>
        </item>
        <item>
            <title>Klausur am 9.4. Werschreibt mit?</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1210</link>
            <description><![CDATA[
hallo miteinander,<br />
muss am mittwoch zu gdi2 ran - gibts vlt noch jemand der das schreiben muss? bin hier grad am lernen und es tun sich doch einige probleme in digitaltechnik auf, wo ich nicht mehr weiter weiss....<br />
wie wärs wenn man sich einfach mal in der uni trifft um das mal gemeinsam anzuschaun? <br />
<br />
gruss chr
]]></description>
            <author> no_email@example.com (humesit)</author>
            <pubDate>Sun, 06 Apr 2008 10:33:24 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1210</guid>
        </item>
        <item>
            <title>Lösungen zur April 07-Klausur gesucht</title>
            <link>http://www.fsi-mechatronik.de/unb/forum.php?req=thread&amp;id=1124</link>
            <description><![CDATA[
Hallo,<br />
Kann mir jemand die Lösungen zu Aufgabe 2 schicken, oder nen Link dazu?<br />
<br />
Danke und Gruß
]]></description>
            <author> no_email@example.com (Tom)</author>
            <pubDate>Mon, 08 Oct 2007 21:55:13 GMT</pubDate>
            <guid isPermaLink="false">http://www.fsi-mechatronik.de/unb/1124</guid>
        </item>
    </channel>
</rss>
