<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
		<id>https://rn-wissen.de/wiki/index.php?action=history&amp;feed=atom&amp;title=C-Tutorial%2FInterrupt-Programmierung</id>
		<title>C-Tutorial/Interrupt-Programmierung - Versionsgeschichte</title>
		<link rel="self" type="application/atom+xml" href="https://rn-wissen.de/wiki/index.php?action=history&amp;feed=atom&amp;title=C-Tutorial%2FInterrupt-Programmierung"/>
		<link rel="alternate" type="text/html" href="https://rn-wissen.de/wiki/index.php?title=C-Tutorial/Interrupt-Programmierung&amp;action=history"/>
		<updated>2026-04-11T17:39:58Z</updated>
		<subtitle>Versionsgeschichte dieser Seite in RN-Wissen.de</subtitle>
		<generator>MediaWiki 1.25.1</generator>

	<entry>
		<id>https://rn-wissen.de/wiki/index.php?title=C-Tutorial/Interrupt-Programmierung&amp;diff=23897&amp;oldid=prev</id>
		<title>Frank: /* avr-gcc */</title>
		<link rel="alternate" type="text/html" href="https://rn-wissen.de/wiki/index.php?title=C-Tutorial/Interrupt-Programmierung&amp;diff=23897&amp;oldid=prev"/>
				<updated>2014-04-08T13:37:57Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;avr-gcc&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Version vom 8. April 2014, 13:37 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L31&quot; &gt;Zeile 31:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 31:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[avr-gcc#Bit 7 bei SFR-Zugriff]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[avr-gcc#Bit 7 bei SFR-Zugriff]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [http://www.mikrocontroller.net/articles/AVR-GCC-Tutorial#Programmieren_mit_Interrupts GCC Tutorial von Mikrocontroller.net]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [http://www.mikrocontroller.net/articles/AVR-GCC-Tutorial#Programmieren_mit_Interrupts GCC Tutorial von Mikrocontroller.net]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* [http://roboternetz.de/download/c_tutorial.zip Download umfangreiches C-Tutorial mit Beispielen für RN-Control und andere AVR-Boards im ZIP-Archiv]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Kategorie:Quellcode C]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Kategorie:Quellcode C]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Kategorie:Software]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Kategorie:Software]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Frank</name></author>	</entry>

	<entry>
		<id>https://rn-wissen.de/wiki/index.php?title=C-Tutorial/Interrupt-Programmierung&amp;diff=23896&amp;oldid=prev</id>
		<title>Frank: /* C für PIC18 */</title>
		<link rel="alternate" type="text/html" href="https://rn-wissen.de/wiki/index.php?title=C-Tutorial/Interrupt-Programmierung&amp;diff=23896&amp;oldid=prev"/>
				<updated>2014-04-08T13:37:45Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;C für PIC18&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Version vom 8. April 2014, 13:37 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L23&quot; &gt;Zeile 23:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 23:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;!-- {{Baustelle|SprinterSB}}--&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;!-- {{Baustelle|SprinterSB}}--&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;=C für PIC18=&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* [http://pic-projekte.de/pic_c.html PIC C Tutorial von PIC-Projekte.de]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=avr-gcc=&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=avr-gcc=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Frank</name></author>	</entry>

	<entry>
		<id>https://rn-wissen.de/wiki/index.php?title=C-Tutorial/Interrupt-Programmierung&amp;diff=18311&amp;oldid=prev</id>
		<title>Besserwessi: /* Aufgabenstellungen */</title>
		<link rel="alternate" type="text/html" href="https://rn-wissen.de/wiki/index.php?title=C-Tutorial/Interrupt-Programmierung&amp;diff=18311&amp;oldid=prev"/>
				<updated>2011-08-08T17:47:09Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Aufgabenstellungen&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Version vom 8. August 2011, 17:47 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L9&quot; &gt;Zeile 9:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 9:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Bei der [[Interrupt]]programmierung sieht man sich verschiedenen Aufgaben gegenüber&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Bei der [[Interrupt]]programmierung sieht man sich verschiedenen Aufgaben gegenüber&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Interrupts aktivieren/deaktivieren:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Interrupts aktivieren/deaktivieren:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:;Global: Damit überhaupt Interrupts von der Hardware ausgelöst werden, müssen Interrupts global aktiviert werden. Dies sieht ja nach Hardware und Compiler sehr verschieden aus, und teilweise ist diese Operation nur Benutzern mit Sonderrechten (Supervisor) erlaubt&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;. &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:;Global: Damit überhaupt Interrupts von der Hardware ausgelöst werden, müssen Interrupts global aktiviert werden. Dies sieht ja nach Hardware und Compiler sehr verschieden aus, und teilweise ist diese Operation nur Benutzern mit Sonderrechten (Supervisor) erlaubt. Dies trifft zu für die so genannten ''&amp;quot;maskierbaren Interrupts&amp;quot;''. ''Maskierbar'' bedeutet dabei, daß man im Programm einstellen kann, ob man eine gewisse IRQ auslösen lassen will oder nicht. Das Gegenstück dazu sind die ''nicht-maskierbaren'' Interrupts, gegen deren Auftreten man sich nicht wehren kann. Ein Beispiel für einen nicht-maskierbaren Interrupt ist der RESET, wie er zum Beispiel nach Einschalten der Spannungsversorgung ausgelöst wird&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;:;Spezielle [[IRQ]]s: Damit eine spezielle IRQ ausgelöst wird, muss diese zudem erlaubt worden sein. Dazu gibt es in der Regel spezielle Register, in denen dazu ein Bit gesetzt/gelöscht werden muss&lt;/del&gt;. Dies trifft zu für die so genannten ''&amp;quot;maskierbaren Interrupts&amp;quot;''. ''Maskierbar'' bedeutet dabei, daß man im Programm einstellen kann, ob man eine gewisse IRQ auslösen lassen will oder nicht. Das Gegenstück dazu sind die ''nicht-maskierbaren'' Interrupts, gegen deren Auftreten man sich nicht wehren kann. Ein Beispiel für einen nicht-maskierbaren Interrupt ist der RESET, wie er zum Beispiel nach Einschalten der Spannungsversorgung ausgelöst wird.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;:;Spezielle [[IRQ]]s: Damit eine spezielle IRQ ausgelöst wird, muss diese zudem erlaubt worden sein. Dazu gibt es in der Regel spezielle Register, in denen dazu ein Bit gesetzt/gelöscht werden muss. Damit lassen ich die IRQs einzeln an- bzw. ab-stellen&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Interrupt-Service-Routine ([[ISR]]) implementieren/deklarieren: Nachdem ein Ereignis eine Interrupt-Anforderung (IRQ) ausgelöst hat, wird ein bestimmtes Codestück (ISR) ausgeführt &amp;amp;ndash; natürlich unter der Voraussetzung, daß dieser IRQ wie oben beschrieben zugelassen wurde. Dazu wird nach Auftreten des Ereignisses der normale Programmfluss unterbrochen und der Code der ISR ausgeführt. Nach Beenden der ISR wird der Programmfluss entweder an der unterbrochenen Stelle fortgesetzt oder es werden weitere IRQs ausgelöst, die sich die Hardware gemerkt hat und deren ISR noch nicht ausgeführt wurden. Wie dieser Ablauf genau von statten geht ist stark von der Hardware anhängig, ebenso wie die Art und Weise wie mitgeteilt wird, daß es sich bei einem Codestück &amp;amp;ndash; üblicherweise eine C-Funktion &amp;amp;ndash; um eine ISR handelt. Dementsprechend verschieden sieht die Umschreibung dafür in unterschiedlichen C-Compilern aus.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Interrupt-Service-Routine ([[ISR]]) implementieren/deklarieren: Nachdem ein Ereignis eine Interrupt-Anforderung (IRQ) ausgelöst hat, wird ein bestimmtes Codestück (ISR) ausgeführt &amp;amp;ndash; natürlich unter der Voraussetzung, daß dieser IRQ wie oben beschrieben zugelassen wurde. Dazu wird nach Auftreten des Ereignisses der normale Programmfluss unterbrochen und der Code der ISR ausgeführt. Nach Beenden der ISR wird der Programmfluss entweder an der unterbrochenen Stelle fortgesetzt oder es werden weitere IRQs ausgelöst, die sich die Hardware gemerkt hat und deren ISR noch nicht ausgeführt wurden. Wie dieser Ablauf genau von statten geht ist stark von der Hardware anhängig, ebenso wie die Art und Weise wie mitgeteilt wird, daß es sich bei einem Codestück &amp;amp;ndash; üblicherweise eine C-Funktion &amp;amp;ndash; um eine ISR handelt. Dementsprechend verschieden sieht die Umschreibung dafür in unterschiedlichen C-Compilern aus.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Interrupt-Prioritäten festlegen: Manche &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Archiketuren &lt;/del&gt;erlauben es, einer IRQ eine bestimmte Priorität zuzuordnen. Dadurch wird es möglich eine niederpriore IRQ von einer höherprioren IRQ unterbrechen zu lassen, während eine IRQ nicht von einer nieder- oder gleichprioren IRQ unterbrochen werden kann. Die Zuordnung der Prioritäten geschieht über spezielle, dafür vorgesehene [[SFR]]s. Zum Teil (z.B. AVR) bezieht sich die Priorität auch nur darauf welche ISR zuerst ausgeführt wird, wenn mehrere Interrupts anfordert werden. Ein &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Unterbrenchen &lt;/del&gt;anderer Interrupts ist dabei nicht &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;vorgesehn &lt;/del&gt;und &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;müßte &lt;/del&gt;von Hand &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Implementiert &lt;/del&gt;werden.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Interrupt-Prioritäten festlegen: Manche &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Architekturen &lt;/ins&gt;erlauben es, einer IRQ eine bestimmte Priorität zuzuordnen. Dadurch wird es möglich eine niederpriore IRQ von einer höherprioren IRQ unterbrechen zu lassen, während eine IRQ nicht von einer nieder- oder gleichprioren IRQ unterbrochen werden kann. Die Zuordnung der Prioritäten geschieht über spezielle, dafür vorgesehene [[SFR]]s. Zum Teil (z.B. AVR) bezieht sich die Priorität auch nur darauf welche ISR zuerst ausgeführt wird, wenn mehrere Interrupts anfordert werden. Ein &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Unterbrechen &lt;/ins&gt;anderer Interrupts ist dabei nicht &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;vorgesehen &lt;/ins&gt;und &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;müsste &lt;/ins&gt;von Hand &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;implementiert &lt;/ins&gt;werden.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Daten-Integrität sicherstellen: Durch Interrupts wird der normale Programmfluss verändert. Dadurch ergeben sich ein paar Schwierigkeiten.&amp;#160; Der Zugriff auf einige Variablen oder Hardwareteile kann durch einen Interrupt unterbrochen werden, der gerade an diesen etwas verändert. Im ungünstigsten &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;fall &lt;/del&gt;werden dann alte und neue Daten, z.B. oberes und &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;unters &lt;/del&gt;Byte einer Integervariabel vermischt. Eine Tücke bei derartigen Fehlern ist, dass sie selten reproduzierbar auftreten und damit schwer zu finden sind. Um diese Art der Fehler zu vermeiden sollte man verhindern das an den falschen Stellen eine Interrupt auftreten kann. In der Regel &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;geschiet &lt;/del&gt;das durch ein kurzzeitiges globales sperren von Interrupts.&amp;#160; Eine Alternative wären Semaphoren, die aber bei µCs nur sehr selten genutzt werden. Siehe: [[Fallstricke bei der C-Programmierung#Nicht-atomarer Code]].&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Daten-Integrität sicherstellen: Durch Interrupts wird der normale Programmfluss verändert. Dadurch ergeben sich ein paar Schwierigkeiten.&amp;#160; Der Zugriff auf einige Variablen oder Hardwareteile kann durch einen Interrupt unterbrochen werden, der gerade an diesen etwas verändert. Im ungünstigsten &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Fall &lt;/ins&gt;werden dann alte und neue Daten, z.B. oberes und &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;unteres &lt;/ins&gt;Byte einer Integervariabel vermischt. Eine Tücke bei derartigen Fehlern ist, dass sie selten reproduzierbar auftreten und damit schwer zu finden sind. Um diese Art der Fehler zu vermeiden sollte man verhindern das an den falschen Stellen eine Interrupt auftreten kann. In der Regel &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;geschieht &lt;/ins&gt;das durch ein kurzzeitiges globales sperren von Interrupts.&amp;#160; Eine Alternative wären Semaphoren, die aber bei µCs nur sehr selten genutzt werden. Siehe: [[Fallstricke bei der C-Programmierung#Nicht-atomarer Code]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;: &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;: &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:Eine zweite Schwierigkeit ergibt sich, wenn der Compiler den Code optimiert. Bei normalem Programmfluss kann der Compiler ausnutzen das einige Ausdrücke &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;constant &lt;/del&gt;bleiben, oder Variablen nicht ins SRAM schreiben, sondern nur in den Registern belassen. Durch die Interrupts gehen diese &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Vorraussetzungen &lt;/del&gt;verloren und viele Optimierungen können nicht mehr durchgeführt werden, oder liefern nicht mehr lauffähigen Code. Um den Compiler darauf hinzuweisen gibt es das Schlüsselwort volatile. Damit werden Variablen gekennzeichnet die sich anders als &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;duch &lt;/del&gt;den normalen Programmfluss verändern können. Das sind typischerweise Variablen die im Hauptprogramm und in einer ISR benutzt werden. Wenn ein Programm nur ohne Optimierung lauffähig ist, ist oft ein fehlendes volatile die Ursache.&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:Eine zweite Schwierigkeit ergibt sich, wenn der Compiler den Code optimiert. Bei normalem Programmfluss kann der Compiler ausnutzen das einige Ausdrücke &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;konstant &lt;/ins&gt;bleiben, oder Variablen nicht ins SRAM schreiben, sondern nur in den Registern belassen. Durch die Interrupts gehen diese &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Voraussetzungen &lt;/ins&gt;verloren und viele Optimierungen können nicht mehr durchgeführt werden, oder liefern nicht mehr lauffähigen Code. Um den Compiler darauf hinzuweisen gibt es das Schlüsselwort volatile. Damit werden Variablen gekennzeichnet die sich anders als &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;durch &lt;/ins&gt;den normalen Programmfluss verändern können. Das sind typischerweise Variablen die im Hauptprogramm und in einer ISR benutzt werden. Wenn ein Programm nur ohne Optimierung lauffähig ist, ist oft ein fehlendes volatile die Ursache.&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Besserwessi</name></author>	</entry>

	<entry>
		<id>https://rn-wissen.de/wiki/index.php?title=C-Tutorial/Interrupt-Programmierung&amp;diff=18303&amp;oldid=prev</id>
		<title>PIC-Nico_alt: /* avr-gcc */</title>
		<link rel="alternate" type="text/html" href="https://rn-wissen.de/wiki/index.php?title=C-Tutorial/Interrupt-Programmierung&amp;diff=18303&amp;oldid=prev"/>
				<updated>2011-08-07T19:43:29Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;avr-gcc&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Version vom 7. August 2011, 19:43 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L22&quot; &gt;Zeile 22:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 22:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;!-- {{Baustelle|SprinterSB}}--&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;!-- {{Baustelle|SprinterSB}}--&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=C für PIC18=&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* [http://pic-projekte.de/pic_c.html PIC C Tutorial von PIC-Projekte.de]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=avr-gcc=&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=avr-gcc=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>PIC-Nico_alt</name></author>	</entry>

	<entry>
		<id>https://rn-wissen.de/wiki/index.php?title=C-Tutorial/Interrupt-Programmierung&amp;diff=15176&amp;oldid=prev</id>
		<title>Besserwessi: /* Aufgabenstellungen */</title>
		<link rel="alternate" type="text/html" href="https://rn-wissen.de/wiki/index.php?title=C-Tutorial/Interrupt-Programmierung&amp;diff=15176&amp;oldid=prev"/>
				<updated>2009-07-17T16:22:58Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Aufgabenstellungen&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Version vom 17. Juli 2009, 16:22 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L9&quot; &gt;Zeile 9:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 9:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Bei der [[Interrupt]]programmierung sieht man sich verschiedenen Aufgaben gegenüber&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Bei der [[Interrupt]]programmierung sieht man sich verschiedenen Aufgaben gegenüber&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Interrupts aktivieren/deaktivieren:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Interrupts aktivieren/deaktivieren:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:;Global: Damit überhaupt Interrupts von der Hardware ausgelöst werden, müssen Interrupts global aktiviert werden. Dies sieht ja nach Hardware und Compiler sehr verschieden aus, und teilweise ist diese Operation nur Benutzern mit Sonderrechten (Supervisor) erlaubt.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:;Global: Damit überhaupt Interrupts von der Hardware ausgelöst werden, müssen Interrupts global aktiviert werden. Dies sieht ja nach Hardware und Compiler sehr verschieden aus, und teilweise ist diese Operation nur Benutzern mit Sonderrechten (Supervisor) erlaubt. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:;Spezielle [[IRQ]]s: Damit eine spezielle IRQ ausgelöst wird, muss diese zudem erlaubt worden sein. Dazu gibt es in der Regel spezielle Register, in denen dazu ein Bit gesetzt/gelöscht werden muss. Dies trifft zu für die so genannten ''&amp;quot;maskierbaren Interrupts&amp;quot;''. ''Maskierbar'' bedeutet dabei, daß man im Programm einstellen kann, ob man eine gewisse IRQ auslösen lassen will oder nicht. Das Gegenstück dazu sind die ''nicht-maskierbaren'' Interrupts, gegen deren Auftreten man sich nicht wehren kann. Ein Beispiel für einen nicht-maskierbaren Interrupt ist der RESET, wie er zum Beispiel nach Einschalten der Spannungsversorgung ausgelöst wird.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:;Spezielle [[IRQ]]s: Damit eine spezielle IRQ ausgelöst wird, muss diese zudem erlaubt worden sein. Dazu gibt es in der Regel spezielle Register, in denen dazu ein Bit gesetzt/gelöscht werden muss. Dies trifft zu für die so genannten ''&amp;quot;maskierbaren Interrupts&amp;quot;''. ''Maskierbar'' bedeutet dabei, daß man im Programm einstellen kann, ob man eine gewisse IRQ auslösen lassen will oder nicht. Das Gegenstück dazu sind die ''nicht-maskierbaren'' Interrupts, gegen deren Auftreten man sich nicht wehren kann. Ein Beispiel für einen nicht-maskierbaren Interrupt ist der RESET, wie er zum Beispiel nach Einschalten der Spannungsversorgung ausgelöst wird.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L16&quot; &gt;Zeile 16:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 16:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Interrupt-Prioritäten festlegen: Manche Archiketuren erlauben es, einer IRQ eine bestimmte Priorität zuzuordnen. Dadurch wird es möglich eine niederpriore IRQ von einer höherprioren IRQ unterbrechen zu lassen, während eine IRQ nicht von einer nieder- oder gleichprioren IRQ unterbrochen werden kann. Die Zuordnung der Prioritäten geschieht über spezielle, dafür vorgesehene [[SFR]]s. Zum Teil (z.B. AVR) bezieht sich die Priorität auch nur darauf welche ISR zuerst ausgeführt wird, wenn mehrere Interrupts anfordert werden. Ein Unterbrenchen anderer Interrupts ist dabei nicht vorgesehn und müßte von Hand Implementiert werden.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Interrupt-Prioritäten festlegen: Manche Archiketuren erlauben es, einer IRQ eine bestimmte Priorität zuzuordnen. Dadurch wird es möglich eine niederpriore IRQ von einer höherprioren IRQ unterbrechen zu lassen, während eine IRQ nicht von einer nieder- oder gleichprioren IRQ unterbrochen werden kann. Die Zuordnung der Prioritäten geschieht über spezielle, dafür vorgesehene [[SFR]]s. Zum Teil (z.B. AVR) bezieht sich die Priorität auch nur darauf welche ISR zuerst ausgeführt wird, wenn mehrere Interrupts anfordert werden. Ein Unterbrenchen anderer Interrupts ist dabei nicht vorgesehn und müßte von Hand Implementiert werden.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Daten-Integrität sicherstellen:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Daten-Integrität sicherstellen: Durch Interrupts wird der normale &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Programmfluss &lt;/ins&gt;verändert. Dadurch ergeben sich ein paar &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Schwierigkeiten&lt;/ins&gt;.&amp;#160; Der Zugriff auf einige Variablen oder Hardwareteile kann durch einen Interrupt unterbrochen werden, der gerade an diesen etwas verändert. Im &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ungünstigsten &lt;/ins&gt;fall werden dann alte und neue Daten, z.B. oberes und unters Byte einer Integervariabel vermischt. Eine Tücke bei derartigen Fehlern ist, dass sie selten reproduzierbar auftreten und damit schwer zu finden sind. Um diese Art der Fehler zu vermeiden sollte man verhindern das an den falschen Stellen eine Interrupt auftreten kann. In der Regel geschiet das durch ein &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;kurzzeitiges &lt;/ins&gt;globales sperren von Interrupts.&amp;#160; Eine Alternative wären Semaphoren, die aber bei µCs nur sehr selten genutzt werden. Siehe: [[Fallstricke bei der C-Programmierung#Nicht-atomarer Code]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Durch Interrupts wird der normale &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Programmfluß &lt;/del&gt;verändert. Dadurch ergeben sich ein paar &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Schweirigkeiten und mögliche Probleme&lt;/del&gt;.&amp;#160; Der Zugriff auf einige Variablen oder Hardwareteile kann durch einen Interrupt unterbrochen werden, der gerade an diesen etwas verändert. Im &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Ungünstigsten &lt;/del&gt;fall werden dann alte und neue Daten, z.B. oberes und unters Byte einer Integervariabel vermischt. Eine Tücke bei derartigen Fehlern ist, dass sie selten reproduzierbar auftreten und damit schwer zu finden sind. Um diese Art der Fehler zu vermeiden sollte man verhindern das an den falschen Stellen eine Interrupt auftreten kann. In der Regel geschiet das durch ein &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Kurzzeitiges &lt;/del&gt;globales sperren von Interrupts.&amp;#160; Eine Alternative wären Semaphoren, die aber bei µCs nur sehr selten genutzt werden. Siehe: [[Fallstricke bei der C-Programmierung#Nicht-atomarer Code]].&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;;: &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;:&lt;/ins&gt;Eine zweite Schwierigkeit ergibt &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;sich, &lt;/ins&gt;wenn der Compiler den Code optimiert. Bei &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;normalem &lt;/ins&gt;Programmfluss kann der Compiler ausnutzen das einige Ausdrücke constant bleiben, oder Variablen nicht &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ins &lt;/ins&gt;SRAM schreiben, sondern nur in den Registern belassen. Durch die Interrupts gehen diese Vorraussetzungen verloren und viele Optimierungen können nicht mehr durchgeführt werden, oder liefern nicht mehr lauffähigen Code. Um den Compiler darauf hinzuweisen gibt es das Schlüsselwort volatile. Damit werden Variablen gekennzeichnet die sich anders als duch den normalen Programmfluss verändern können. Das sind typischerweise Variablen die im Hauptprogramm und in einer ISR benutzt werden. Wenn ein Programm nur ohne Optimierung lauffähig ist, ist oft ein fehlendes volatile die Ursache.&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Eine zweite Schwierigkeit ergibt wenn der Compiler den Code optimiert. Bei &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;normalerm &lt;/del&gt;Programmfluss kann der Compiler ausnutzen das einige Ausdrücke constant bleiben, oder Variablen nicht &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;is &lt;/del&gt;SRAM schreiben, sondern nur in den Registern belassen. Durch die Interrupts gehen diese Vorraussetzungen verloren und viele Optimierungen können nicht mehr durchgeführt werden, oder liefern nicht mehr lauffähigen Code. Um den Compiler darauf hinzuweisen gibt es das Schlüsselwort volatile. Damit werden Variablen gekennzeichnet die sich anders als duch den normalen Programmfluss verändern können. Das sind typischerweise Variablen die im Hauptprogramm und in einer ISR benutzt werden. Wenn ein Programm nur ohne Optimierung lauffähig ist, ist oft ein fehlendes volatile die Ursache.&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;!-- {{Baustelle|SprinterSB}}--&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;!-- {{Baustelle|SprinterSB}}--&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* [[Fallstricke bei der C-Programmierung#Nicht-atomarer Code]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=avr-gcc=&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=avr-gcc=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Besserwessi</name></author>	</entry>

	<entry>
		<id>https://rn-wissen.de/wiki/index.php?title=C-Tutorial/Interrupt-Programmierung&amp;diff=15175&amp;oldid=prev</id>
		<title>Besserwessi: /* avr-gcc */</title>
		<link rel="alternate" type="text/html" href="https://rn-wissen.de/wiki/index.php?title=C-Tutorial/Interrupt-Programmierung&amp;diff=15175&amp;oldid=prev"/>
				<updated>2009-07-17T16:08:58Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;avr-gcc&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Version vom 17. Juli 2009, 16:08 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L31&quot; &gt;Zeile 31:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 31:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[avr-gcc#Inkompatibilität]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[avr-gcc#Inkompatibilität]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[avr-gcc#Bit 7 bei SFR-Zugriff]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[avr-gcc#Bit 7 bei SFR-Zugriff]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* [http://www.mikrocontroller.net/articles/AVR-GCC-Tutorial#Programmieren_mit_Interrupts GCC Tutorial von Mikrocontroller.net]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Kategorie:Quellcode C]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Kategorie:Quellcode C]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Kategorie:Software]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Kategorie:Software]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Besserwessi</name></author>	</entry>

	<entry>
		<id>https://rn-wissen.de/wiki/index.php?title=C-Tutorial/Interrupt-Programmierung&amp;diff=15173&amp;oldid=prev</id>
		<title>Besserwessi: /* Aufgabenstellungen */</title>
		<link rel="alternate" type="text/html" href="https://rn-wissen.de/wiki/index.php?title=C-Tutorial/Interrupt-Programmierung&amp;diff=15173&amp;oldid=prev"/>
				<updated>2009-07-11T23:02:10Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Aufgabenstellungen&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Version vom 11. Juli 2009, 23:02 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L17&quot; &gt;Zeile 17:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 17:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Daten-Integrität sicherstellen:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Daten-Integrität sicherstellen:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Durch Interrupts wird der normale Programmfluß verändert. Dadurch ergeben sich ein paar Schweirigkeiten und mögliche Probleme.&amp;#160; Der Zugriff auf einige Variablen oder Hardwareteile kann durch einen Interrupt unterbrochen werden, der gerade an diesen etwas verändert. Im Ungünstigsten fall werden dann alte und neue Daten, z.B. oberes und unters Byte einer Integervariabel vermischt. Eine Tücke bei derartigen Fehlern ist, dass sie selten reproduzierbar auftreten und damit schwer zu finden sind. Um diese Art der Fehler zu vermeiden sollte man verhindern das an den falschen Stellen eine Interrupt auftreten kann. In der Regel geschiet das durch ein Kurzzeitiges globales sperren von Interrupts.&amp;#160; Eine Alternative wären Semaphoren, die aber bei µCs nur sehr selten genutzt werden. Siehe: [[Fallstricke bei der C-Programmierung#Nicht-atomarer Code]].&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Eine zweite Schwierigkeit ergibt wenn der Compiler den Code optimiert. Bei normalerm Programmfluss kann der Compiler ausnutzen das einige Ausdrücke constant bleiben, oder Variablen nicht is SRAM schreiben, sondern nur in den Registern belassen. Durch die Interrupts gehen diese Vorraussetzungen verloren und viele Optimierungen können nicht mehr durchgeführt werden, oder liefern nicht mehr lauffähigen Code. Um den Compiler darauf hinzuweisen gibt es das Schlüsselwort volatile. Damit werden Variablen gekennzeichnet die sich anders als duch den normalen Programmfluss verändern können. Das sind typischerweise Variablen die im Hauptprogramm und in einer ISR benutzt werden. Wenn ein Programm nur ohne Optimierung lauffähig ist, ist oft ein fehlendes volatile die Ursache.&amp;#160; &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;!-- {{Baustelle|SprinterSB}}--&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;!-- {{Baustelle|SprinterSB}}--&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Besserwessi</name></author>	</entry>

	<entry>
		<id>https://rn-wissen.de/wiki/index.php?title=C-Tutorial/Interrupt-Programmierung&amp;diff=13928&amp;oldid=prev</id>
		<title>Besserwessi: /* Aufgabenstellungen */</title>
		<link rel="alternate" type="text/html" href="https://rn-wissen.de/wiki/index.php?title=C-Tutorial/Interrupt-Programmierung&amp;diff=13928&amp;oldid=prev"/>
				<updated>2008-08-26T19:03:27Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Aufgabenstellungen&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Version vom 26. August 2008, 19:03 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L14&quot; &gt;Zeile 14:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 14:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Interrupt-Service-Routine ([[ISR]]) implementieren/deklarieren: Nachdem ein Ereignis eine Interrupt-Anforderung (IRQ) ausgelöst hat, wird ein bestimmtes Codestück (ISR) ausgeführt &amp;amp;ndash; natürlich unter der Voraussetzung, daß dieser IRQ wie oben beschrieben zugelassen wurde. Dazu wird nach Auftreten des Ereignisses der normale Programmfluss unterbrochen und der Code der ISR ausgeführt. Nach Beenden der ISR wird der Programmfluss entweder an der unterbrochenen Stelle fortgesetzt oder es werden weitere IRQs ausgelöst, die sich die Hardware gemerkt hat und deren ISR noch nicht ausgeführt wurden. Wie dieser Ablauf genau von statten geht ist stark von der Hardware anhängig, ebenso wie die Art und Weise wie mitgeteilt wird, daß es sich bei einem Codestück &amp;amp;ndash; üblicherweise eine C-Funktion &amp;amp;ndash; um eine ISR handelt. Dementsprechend verschieden sieht die Umschreibung dafür in unterschiedlichen C-Compilern aus.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Interrupt-Service-Routine ([[ISR]]) implementieren/deklarieren: Nachdem ein Ereignis eine Interrupt-Anforderung (IRQ) ausgelöst hat, wird ein bestimmtes Codestück (ISR) ausgeführt &amp;amp;ndash; natürlich unter der Voraussetzung, daß dieser IRQ wie oben beschrieben zugelassen wurde. Dazu wird nach Auftreten des Ereignisses der normale Programmfluss unterbrochen und der Code der ISR ausgeführt. Nach Beenden der ISR wird der Programmfluss entweder an der unterbrochenen Stelle fortgesetzt oder es werden weitere IRQs ausgelöst, die sich die Hardware gemerkt hat und deren ISR noch nicht ausgeführt wurden. Wie dieser Ablauf genau von statten geht ist stark von der Hardware anhängig, ebenso wie die Art und Weise wie mitgeteilt wird, daß es sich bei einem Codestück &amp;amp;ndash; üblicherweise eine C-Funktion &amp;amp;ndash; um eine ISR handelt. Dementsprechend verschieden sieht die Umschreibung dafür in unterschiedlichen C-Compilern aus.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Interrupt-Prioritäten festlegen: Manche Archiketuren erlauben es, einer IRQ eine bestimmte Priorität zuzuordnen. Dadurch wird es möglich eine niederpriore IRQ von einer höherprioren IRQ unterbrechen zu lassen, während eine IRQ nicht von einer nieder- oder gleichprioren IRQ unterbrochen werden kann. Die Zuordnung der Prioritäten geschieht über spezielle, dafür vorgesehene [[SFR]]s.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Interrupt-Prioritäten festlegen: Manche Archiketuren erlauben es, einer IRQ eine bestimmte Priorität zuzuordnen. Dadurch wird es möglich eine niederpriore IRQ von einer höherprioren IRQ unterbrechen zu lassen, während eine IRQ nicht von einer nieder- oder gleichprioren IRQ unterbrochen werden kann. Die Zuordnung der Prioritäten geschieht über spezielle, dafür vorgesehene [[SFR]]s&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;. Zum Teil (z.B. AVR) bezieht sich die Priorität auch nur darauf welche ISR zuerst ausgeführt wird, wenn mehrere Interrupts anfordert werden. Ein Unterbrenchen anderer Interrupts ist dabei nicht vorgesehn und müßte von Hand Implementiert werden&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Daten-Integrität sicherstellen:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Daten-Integrität sicherstellen:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Besserwessi</name></author>	</entry>

	<entry>
		<id>https://rn-wissen.de/wiki/index.php?title=C-Tutorial/Interrupt-Programmierung&amp;diff=11075&amp;oldid=prev</id>
		<title>SprinterSB_alt am 10. April 2007 um 10:21 Uhr</title>
		<link rel="alternate" type="text/html" href="https://rn-wissen.de/wiki/index.php?title=C-Tutorial/Interrupt-Programmierung&amp;diff=11075&amp;oldid=prev"/>
				<updated>2007-04-10T10:21:22Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Version vom 10. April 2007, 10:21 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L1&quot; &gt;Zeile 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Da bei der [[Interrupt]]-Programmierung einige Besonderheiten zu beachten sind, soll dies in einem eigenen Artikel zusammengefasst werden.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Da bei der [[Interrupt]]-Programmierung einige Besonderheiten zu beachten sind, soll dies in einem eigenen Artikel zusammengefasst werden.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Weil die Interrupt-Programmierung sehr stark von der zugrundeliegenden Hardware abhängt, ist allerdings &lt;del class=&quot;diffchange diffchange-inline&quot;&gt; ist &lt;/del&gt;in keiner C-Spezifikation festgehalten, wie etwa &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;der &lt;/del&gt;Definition einer [[Interrupt Service Routine]] auszusehen hat oder wie Interrupts aktiviert oder deaktiviert werden.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Weil die Interrupt-Programmierung sehr stark von der zugrundeliegenden Hardware abhängt, ist allerdings in keiner C-Spezifikation festgehalten, wie etwa &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;die &lt;/ins&gt;Definition einer [[Interrupt Service Routine]] auszusehen hat oder wie Interrupts aktiviert oder deaktiviert werden.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Dies führt dazu, daß &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;etwa &lt;/del&gt;die Definition einer [[ISR]] nicht nur von der Hardware abhängig ist, sondern &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;auch &lt;/del&gt;vom verwendeten C/C++-[[Compiler]].&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Dies führt dazu, daß &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;zum Beispiel &lt;/ins&gt;die Definition einer [[ISR]] nicht nur von der Hardware abhängig ist, sondern &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;zusätzlich noch &lt;/ins&gt;vom verwendeten C/C++-[[Compiler]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Aufgabenstellungen=&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Aufgabenstellungen=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Bei der [[Interrupt]]programmierung sieht man sich verschiedenen &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Ausgaben &lt;/del&gt;gegenüber&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Bei der [[Interrupt]]programmierung sieht man sich verschiedenen &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Aufgaben &lt;/ins&gt;gegenüber&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Interrupts aktivieren/deaktivieren:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Interrupts aktivieren/deaktivieren:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:;Global: Damit überhaupt Interrupts von der Hardware ausgelöst werden, müssen Interrupts global aktiviert werden. Dies sieht ja nach Hardware und Compiler sehr verschieden aus, und teilweise ist diese Operation nur Benutzern mit Sonderrechten erlaubt.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:;Global: Damit überhaupt Interrupts von der Hardware ausgelöst werden, müssen Interrupts global aktiviert werden. Dies sieht ja nach Hardware und Compiler sehr verschieden aus, und teilweise ist diese Operation nur Benutzern mit Sonderrechten &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(Supervisor) &lt;/ins&gt;erlaubt.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:;Spezielle [[IRQ]]s: Damit eine spezielle IRQ ausgelöst wird, muss diese zudem erlaubt worden sein. Dazu gibt es in der Regel spezielle Register, in denen dazu ein Bit gesetzt/gelöscht werden muss. Dies trifft zu für die so genannten ''&amp;quot;maskierbaren Interrupts&amp;quot;''. ''Maskierbar'' bedeutet dabei, daß man im Programm einstellen kann, ob man eine gewisse IRQ auslösen lassen will oder nicht. Das Gegenstück dazu sind die ''nicht-maskierbaren'' Interrupts, gegen deren Auftreten man sich nicht wehren kann. Ein Beispiel für einen nicht-maskierbaren Interrupt ist der RESET wie er zum Beispiel nach Einschalten der Spannungsversorgung ausgelöst wird.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:;Spezielle [[IRQ]]s: Damit eine spezielle IRQ ausgelöst wird, muss diese zudem erlaubt worden sein. Dazu gibt es in der Regel spezielle Register, in denen dazu ein Bit gesetzt/gelöscht werden muss. Dies trifft zu für die so genannten ''&amp;quot;maskierbaren Interrupts&amp;quot;''. ''Maskierbar'' bedeutet dabei, daß man im Programm einstellen kann, ob man eine gewisse IRQ auslösen lassen will oder nicht. Das Gegenstück dazu sind die ''nicht-maskierbaren'' Interrupts, gegen deren Auftreten man sich nicht wehren kann. Ein Beispiel für einen nicht-maskierbaren Interrupt ist der RESET&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;, &lt;/ins&gt;wie er zum Beispiel nach Einschalten der Spannungsversorgung ausgelöst wird.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Interrupt-Service-Routine ([[ISR]]) implementieren/deklarieren: Nachdem ein Ereignis eine Interrupt-Anforderung (IRQ) ausgelöst hat, wird ein bestimmtes Codestück (ISR) ausgeführt &amp;amp;ndash; natürlich unter der Voraussetzung, daß dieser IRQ wie oben beschrieben zugelassen wurde. Dazu wird nach Auftreten des Ereignisses der normale Programmfluss unterbrochen und der Code der ISR ausgeführt. Nach Beenden der ISR wird der Programmfluss entweder an der unterbrochenen Stelle fortgesetzt oder es werden weitere IRQs ausgelöst, die sich die Hardware gemerkt hat und deren ISR noch nicht ausgeführt wurden. Wie dieser Ablauf genau von statten geht ist stark von der Hardware anhängig, ebenso wie die Art und Weise wie mitgeteilt wird, daß es sich bei einem Codestück &amp;amp;ndash; üblicherweise eine C-Funktion &amp;amp;ndash; um eine ISR handelt. Dementsprechend verschieden sieht die Umschreibung dafür in unterschiedlichen C-Compilern aus.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Interrupt-Service-Routine ([[ISR]]) implementieren/deklarieren: Nachdem ein Ereignis eine Interrupt-Anforderung (IRQ) ausgelöst hat, wird ein bestimmtes Codestück (ISR) ausgeführt &amp;amp;ndash; natürlich unter der Voraussetzung, daß dieser IRQ wie oben beschrieben zugelassen wurde. Dazu wird nach Auftreten des Ereignisses der normale Programmfluss unterbrochen und der Code der ISR ausgeführt. Nach Beenden der ISR wird der Programmfluss entweder an der unterbrochenen Stelle fortgesetzt oder es werden weitere IRQs ausgelöst, die sich die Hardware gemerkt hat und deren ISR noch nicht ausgeführt wurden. Wie dieser Ablauf genau von statten geht ist stark von der Hardware anhängig, ebenso wie die Art und Weise wie mitgeteilt wird, daß es sich bei einem Codestück &amp;amp;ndash; üblicherweise eine C-Funktion &amp;amp;ndash; um eine ISR handelt. Dementsprechend verschieden sieht die Umschreibung dafür in unterschiedlichen C-Compilern aus.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Interrupt-Prioritäten festlegen:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Interrupt-Prioritäten festlegen: &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Manche Archiketuren erlauben es, einer IRQ eine bestimmte Priorität zuzuordnen. Dadurch wird es möglich eine niederpriore IRQ von einer höherprioren IRQ unterbrechen zu lassen, während eine IRQ nicht von einer nieder- oder gleichprioren IRQ unterbrochen werden kann. Die Zuordnung der Prioritäten geschieht über spezielle, dafür vorgesehene [[SFR]]s.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Daten-Integrität sicherstellen:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Daten-Integrität sicherstellen:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>SprinterSB_alt</name></author>	</entry>

	<entry>
		<id>https://rn-wissen.de/wiki/index.php?title=C-Tutorial/Interrupt-Programmierung&amp;diff=10416&amp;oldid=prev</id>
		<title>Ghost22_alt: /* Aufgabenstellungen */</title>
		<link rel="alternate" type="text/html" href="https://rn-wissen.de/wiki/index.php?title=C-Tutorial/Interrupt-Programmierung&amp;diff=10416&amp;oldid=prev"/>
				<updated>2007-03-15T23:01:03Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Aufgabenstellungen&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Version vom 15. März 2007, 23:01 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L10&quot; &gt;Zeile 10:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 10:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Interrupts aktivieren/deaktivieren:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Interrupts aktivieren/deaktivieren:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:;Global: Damit überhaupt Interrupts von der Hardware ausgelöst werden, müssen Interrupts global aktiviert werden. Dies sieht ja nach Hardware und Compiler sehr verschieden aus, und teilweise ist diese Operation nur Benutzern mit Sonderrechten erlaubt.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:;Global: Damit überhaupt Interrupts von der Hardware ausgelöst werden, müssen Interrupts global aktiviert werden. Dies sieht ja nach Hardware und Compiler sehr verschieden aus, und teilweise ist diese Operation nur Benutzern mit Sonderrechten erlaubt.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:;Spezielle [[IRQ]]s: Damit eine spezielle IRQ ausgelöst wird, muss diese zudem erlaubt worden sein. Dazu gibt es in der Regel &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;spezelle &lt;/del&gt;Register, in denen dazu ein Bit gesetzt/gelöscht werden muss. Dies trifft zu für die so genannten ''&amp;quot;maskierbaren Interrupts&amp;quot;''. ''Maskierbar'' bedeutet dabei, daß man im Programm einstellen kann, ob man eine gewisse IRQ auslösen lassen will oder nicht. Das Gegenstück dazu sind die ''nicht-maskierbaren'' Interrupts, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;degen &lt;/del&gt;deren Auftreten man sich nicht wehren kann. Ein Beispiel für einen nicht-maskierbaren &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Interrupts &lt;/del&gt;ist der RESET wie er zum Beispiel nach Einschalten der Spannungsversorgung ausgelöst wird.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:;Spezielle [[IRQ]]s: Damit eine spezielle IRQ ausgelöst wird, muss diese zudem erlaubt worden sein. Dazu gibt es in der Regel &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;spezielle &lt;/ins&gt;Register, in denen dazu ein Bit gesetzt/gelöscht werden muss. Dies trifft zu für die so genannten ''&amp;quot;maskierbaren Interrupts&amp;quot;''. ''Maskierbar'' bedeutet dabei, daß man im Programm einstellen kann, ob man eine gewisse IRQ auslösen lassen will oder nicht. Das Gegenstück dazu sind die ''nicht-maskierbaren'' Interrupts, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;gegen &lt;/ins&gt;deren Auftreten man sich nicht wehren kann. Ein Beispiel für einen nicht-maskierbaren &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Interrupt &lt;/ins&gt;ist der RESET wie er zum Beispiel nach Einschalten der Spannungsversorgung ausgelöst wird.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Interrupt-Service-Routine ([[ISR]]) implementieren/deklarieren: Nachdem ein Ereignis eine Interrupt-Anforderung (IRQ) ausgelöst hat, wird ein bestimmtes Codestück (ISR) ausgeführt &amp;amp;ndash; natürlich unter der Voraussetzung, daß &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;diese &lt;/del&gt;IRQ wie oben beschrieben zugelassen wurde. Dazu wird nach Auftreten des Ereignisses der normale Programmfluss unterbrochen und der Code der ISR ausgeführt. Nach Beenden der ISR wird der Programmfluss entweder an der unterbrochenen Stelle fortgesetzt oder es werden weitere IRQs ausgelöst, die sich die Hardware &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;gemwerkt &lt;/del&gt;hat und deren ISR noch nicht ausgeführt wurden. Wie dieser Ablauf genau von statten geht ist stark von der Hardware anhängig, ebenso wie die Art und Weise wie mitgeteilt wird, daß es sich bei einem Codestück &amp;amp;ndash; üblicherweise eine C-Funktion &amp;amp;ndash; um eine ISR handelt. Dementsprechend verschieden sieht die Umschreibung dafür in unterschiedlichen C-Compilern aus.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Interrupt-Service-Routine ([[ISR]]) implementieren/deklarieren: Nachdem ein Ereignis eine Interrupt-Anforderung (IRQ) ausgelöst hat, wird ein bestimmtes Codestück (ISR) ausgeführt &amp;amp;ndash; natürlich unter der Voraussetzung, daß &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;dieser &lt;/ins&gt;IRQ wie oben beschrieben zugelassen wurde. Dazu wird nach Auftreten des Ereignisses der normale Programmfluss unterbrochen und der Code der ISR ausgeführt. Nach Beenden der ISR wird der Programmfluss entweder an der unterbrochenen Stelle fortgesetzt oder es werden weitere IRQs ausgelöst, die sich die Hardware &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;gemerkt &lt;/ins&gt;hat und deren ISR noch nicht ausgeführt wurden. Wie dieser Ablauf genau von statten geht ist stark von der Hardware anhängig, ebenso wie die Art und Weise wie mitgeteilt wird, daß es sich bei einem Codestück &amp;amp;ndash; üblicherweise eine C-Funktion &amp;amp;ndash; um eine ISR handelt. Dementsprechend verschieden sieht die Umschreibung dafür in unterschiedlichen C-Compilern aus.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Interrupt-Prioritäten festlegen:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Interrupt-Prioritäten festlegen:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ghost22_alt</name></author>	</entry>

	</feed>