<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://www.sequencer.de/synth/index.php?action=history&amp;feed=atom&amp;title=MCV876_Controller_Update%3A_Source_Code</id>
	<title>MCV876 Controller Update: Source Code - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://www.sequencer.de/synth/index.php?action=history&amp;feed=atom&amp;title=MCV876_Controller_Update%3A_Source_Code"/>
	<link rel="alternate" type="text/html" href="https://www.sequencer.de/synth/index.php?title=MCV876_Controller_Update:_Source_Code&amp;action=history"/>
	<updated>2026-10-29T00:04:13Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in Synthesizer Wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://www.sequencer.de/synth/index.php?title=MCV876_Controller_Update:_Source_Code&amp;diff=7323&amp;oldid=prev</id>
		<title>Fetz: /* Übersetzen */</title>
		<link rel="alternate" type="text/html" href="https://www.sequencer.de/synth/index.php?title=MCV876_Controller_Update:_Source_Code&amp;diff=7323&amp;oldid=prev"/>
		<updated>2011-06-27T20:03:01Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Übersetzen&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 27. Juni 2011, 21:03 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l12&quot;&gt;Zeile 12:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 12:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;Zu den Atmel Controllern findet man eine Menge Info mit Tante Google, [http://www.mikrocontroller.net http://www.mikrocontroller.net] kommt häufig vor, und hat ein ergiebiges Forum und gute Artikel. Auf der Atmel Webseite gibt es auch einige Info, das [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATMega 88 Datenblatt] ist spätestens dann nötig, wenn es um die Hardware geht.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;Zu den Atmel Controllern findet man eine Menge Info mit Tante Google, [http://www.mikrocontroller.net http://www.mikrocontroller.net] kommt häufig vor, und hat ein ergiebiges Forum und gute Artikel. Auf der Atmel Webseite gibt es auch &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[http://www.atmel.com/dyn/products/product_card.asp?part_id=3302&amp;amp;category_id=163&amp;amp;family_id=607&amp;amp;subfamily_id=760 &lt;/ins&gt;einige Info&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]&lt;/ins&gt;, das [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATMega 88 Datenblatt] ist spätestens dann nötig, wenn es um die Hardware geht.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Quelltext=&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Quelltext=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Fetz</name></author>
	</entry>
	<entry>
		<id>https://www.sequencer.de/synth/index.php?title=MCV876_Controller_Update:_Source_Code&amp;diff=7318&amp;oldid=prev</id>
		<title>Fetz: Übersetzen-Abschnitt um die Projekteinstellungen erweitert</title>
		<link rel="alternate" type="text/html" href="https://www.sequencer.de/synth/index.php?title=MCV876_Controller_Update:_Source_Code&amp;diff=7318&amp;oldid=prev"/>
		<updated>2011-06-27T18:47:10Z</updated>

		<summary type="html">&lt;p&gt;Übersetzen-Abschnitt um die Projekteinstellungen erweitert&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 27. Juni 2011, 19:47 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-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=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Übersetzen=  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Übersetzen=  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Der Code für den ATMega 88 wird mit dem AVR-Studio 4 erstellt. Das kann man auf der Atmel Webseite (kostenlos) runter laden.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Der Code für den ATMega 88 wird mit dem AVR-Studio 4 erstellt. Das kann man auf der Atmel Webseite (kostenlos) runter laden.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;Im Studio ein neues, leeres Projekt mit Standard-Einstellungen, einem sinnvollen Namen und an einem Ort, wo man es wiederfindet erstellen&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/del&gt;Quelltext in das (automatisch erzeugte, leere) C-File kopieren, auf Build-&amp;gt;Build klicken, fertig.  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;Im Studio ein neues, leeres Projekt mit Standard-Einstellungen, einem sinnvollen Namen und an einem Ort, wo man es wiederfindet erstellen&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; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;In den Projekteinstellungen die passenden CPU wählen und die Taktfrequenz einstellen. Project-&amp;gt;Configuration-Options:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;[[File:ProjectSettings.gif]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;Dann &lt;/ins&gt;Quelltext in das (automatisch erzeugte, leere) C-File kopieren, auf Build-&amp;gt;Build klicken, fertig.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Das resultierende HEX File kann man mit einem üblichen Programmieradapter in der Chip flashen, für uns zweckmäßiger ist allerdings, das in ein Sys-Ex File zu Konvertieren ( [[MCV876_Controller_Update:_File_Converter]]), und das über Midi an den Controller zu schicken. Dann programmiert der sich selber um. Dazu muss er allerdings einmalig mit dem Bootlader ([[MCV876_Controller_Update:_Bootloader]]) programmiert worden sein.  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Das resultierende HEX File kann man mit einem üblichen Programmieradapter in der Chip flashen, für uns zweckmäßiger ist allerdings, das in ein Sys-Ex File zu Konvertieren ( [[MCV876_Controller_Update:_File_Converter]]), und das über Midi an den Controller zu schicken. Dann programmiert der sich selber um. Dazu muss er allerdings einmalig mit dem Bootlader ([[MCV876_Controller_Update:_Bootloader]]) programmiert worden sein.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Fetz</name></author>
	</entry>
	<entry>
		<id>https://www.sequencer.de/synth/index.php?title=MCV876_Controller_Update:_Source_Code&amp;diff=7300&amp;oldid=prev</id>
		<title>Fetz: /* Übersetzen */</title>
		<link rel="alternate" type="text/html" href="https://www.sequencer.de/synth/index.php?title=MCV876_Controller_Update:_Source_Code&amp;diff=7300&amp;oldid=prev"/>
		<updated>2011-06-26T19:56:43Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Übersetzen&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 26. Juni 2011, 20:56 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l2&quot;&gt;Zeile 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Der Code für den ATMega 88 wird mit dem AVR-Studio 4 erstellt. Das kann man auf der Atmel Webseite (kostenlos) runter laden.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Der Code für den ATMega 88 wird mit dem AVR-Studio 4 erstellt. Das kann man auf der Atmel Webseite (kostenlos) runter laden.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Im Studio ein neues, leeres Projekt mit Standard-Einstellungen, einem sinnvollen Namen und an einem Ort, wo man es wiederfindet erstellen, Quelltext in das (automatisch erzeugte, leere) C-File kopieren, auf Build-&amp;gt;Build klicken, fertig.  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Im Studio ein neues, leeres Projekt mit Standard-Einstellungen, einem sinnvollen Namen und an einem Ort, wo man es wiederfindet erstellen, Quelltext in das (automatisch erzeugte, leere) C-File kopieren, auf Build-&amp;gt;Build klicken, fertig.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;Das resultierende HEX File kann man mit einem üblichen Programmieradapter in der Chip flashen, für uns zweckmäßiger ist allerdings, das in ein Sys-Ex File zu Konvertieren ( [[MCV876_Controller_Update:_File_Converter]]), und das über Midi an den Controller zu schicken. Dann programmiert der sich selber um. Dazu muss er allerdings einmalig mit dem Bootlader [&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;hier Link auf Bootlader imaginieren.. &lt;/del&gt;] programmiert worden sein.  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;Das resultierende HEX File kann man mit einem üblichen Programmieradapter in der Chip flashen, für uns zweckmäßiger ist allerdings, das in ein Sys-Ex File zu Konvertieren ( [[MCV876_Controller_Update:_File_Converter]]), und das über Midi an den Controller zu schicken. Dann programmiert der sich selber um. Dazu muss er allerdings einmalig mit dem Bootlader &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;(&lt;/ins&gt;[&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[MCV876_Controller_Update:_Bootloader]&lt;/ins&gt;]&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;) &lt;/ins&gt;programmiert worden sein.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Fetz</name></author>
	</entry>
	<entry>
		<id>https://www.sequencer.de/synth/index.php?title=MCV876_Controller_Update:_Source_Code&amp;diff=7299&amp;oldid=prev</id>
		<title>Fetz: /* Quelltext */</title>
		<link rel="alternate" type="text/html" href="https://www.sequencer.de/synth/index.php?title=MCV876_Controller_Update:_Source_Code&amp;diff=7299&amp;oldid=prev"/>
		<updated>2011-06-26T19:54:01Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Quelltext&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 26. Juni 2011, 20:54 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-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=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	Preliminary  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	Preliminary  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;	Version 0.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;21 &lt;/del&gt;2011-06-26  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;	Version 0.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;22 &lt;/ins&gt;2011-06-26  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l476&quot;&gt;Zeile 476:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 476:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;				val+=cvo-&amp;gt;pb;			 		//     add it (bipolar)  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;				val+=cvo-&amp;gt;pb;			 		//     add it (bipolar)  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; 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 colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;		if( (config.ifMode1 &amp;amp; bm) &amp;amp;&amp;amp; cvo-&amp;gt;on==0) // if Trig Flag and note off &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;			gated=1; 								// than gate CV output (to zero) &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;/*&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; 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=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		if( (config.ifMode3 &amp;amp; bm) &amp;amp;&amp;amp; cvo-&amp;gt;on==0)	// 5V-Flag, abused as Gated-Mode-CV Flag  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		if( (config.ifMode3 &amp;amp; bm) &amp;amp;&amp;amp; cvo-&amp;gt;on==0)	// 5V-Flag, abused as Gated-Mode-CV Flag  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Fetz</name></author>
	</entry>
	<entry>
		<id>https://www.sequencer.de/synth/index.php?title=MCV876_Controller_Update:_Source_Code&amp;diff=7291&amp;oldid=prev</id>
		<title>Fetz: /* Quelltext */</title>
		<link rel="alternate" type="text/html" href="https://www.sequencer.de/synth/index.php?title=MCV876_Controller_Update:_Source_Code&amp;diff=7291&amp;oldid=prev"/>
		<updated>2011-06-26T17:25:31Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Quelltext&lt;/span&gt;&lt;/p&gt;
&lt;a href=&quot;https://www.sequencer.de/synth/index.php?title=MCV876_Controller_Update:_Source_Code&amp;amp;diff=7291&amp;amp;oldid=7284&quot;&gt;Änderungen zeigen&lt;/a&gt;</summary>
		<author><name>Fetz</name></author>
	</entry>
	<entry>
		<id>https://www.sequencer.de/synth/index.php?title=MCV876_Controller_Update:_Source_Code&amp;diff=7284&amp;oldid=prev</id>
		<title>Fetz: /* Übersetzen */</title>
		<link rel="alternate" type="text/html" href="https://www.sequencer.de/synth/index.php?title=MCV876_Controller_Update:_Source_Code&amp;diff=7284&amp;oldid=prev"/>
		<updated>2011-06-23T19:18:36Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Übersetzen&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 23. Juni 2011, 20:18 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l2&quot;&gt;Zeile 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Der Code für den ATMega 88 wird mit dem AVR-Studio 4 erstellt. Das kann man auf der Atmel Webseite (kostenlos) runter laden.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Der Code für den ATMega 88 wird mit dem AVR-Studio 4 erstellt. Das kann man auf der Atmel Webseite (kostenlos) runter laden.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Im Studio ein neues, leeres Projekt mit Standard-Einstellungen, einem sinnvollen Namen und an einem Ort, wo man es wiederfindet erstellen, Quelltext in das (automatisch erzeugte, leere) C-File kopieren, auf Build-&amp;gt;Build klicken, fertig.  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Im Studio ein neues, leeres Projekt mit Standard-Einstellungen, einem sinnvollen Namen und an einem Ort, wo man es wiederfindet erstellen, Quelltext in das (automatisch erzeugte, leere) C-File kopieren, auf Build-&amp;gt;Build klicken, fertig.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;Das resultierende HEX File kann man mit einem üblichen Programmieradapter in der Chip flashen, für uns zweckmäßiger ist allerdings, das in ein Sys-Ex File zu Konvertieren [&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;-&amp;gt;Link auf Konverter folgt...&lt;/del&gt;], und das an den Controller zu schicken. Dann programmiert der sich selber um. Dazu muss er allerdings einmalig mit dem Bootlader [hier Link auf Bootlader imaginieren.. ] programmiert worden sein.  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;Das resultierende HEX File kann man mit einem üblichen Programmieradapter in der Chip flashen, für uns zweckmäßiger ist allerdings, das in ein Sys-Ex File zu Konvertieren &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;( &lt;/ins&gt;[&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[MCV876_Controller_Update:_File_Converter]&lt;/ins&gt;]&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;)&lt;/ins&gt;, und das &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;über Midi &lt;/ins&gt;an den Controller zu schicken. Dann programmiert der sich selber um. Dazu muss er allerdings einmalig mit dem Bootlader [hier Link auf Bootlader imaginieren.. ] programmiert worden sein.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;Zu den Atmel Controllern findet man eine Menge Info mit Tante Google, [http://www.mikrocontroller.net http://www.mikrocontroller.net] kommt häufig vor, und hat ein ergiebiges Forum und gute Artikel. Auf der Atmel Webseite gibt es auch einige Info, das [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATMega 88 Datenblatt] ist spätestens dann nötig, wenn es um die Hardware geht.  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;Zu den Atmel Controllern findet man eine Menge Info mit Tante Google, [http://www.mikrocontroller.net http://www.mikrocontroller.net] kommt häufig vor, und hat ein ergiebiges Forum und gute Artikel. Auf der Atmel Webseite gibt es auch einige Info, das [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATMega 88 Datenblatt] ist spätestens dann nötig, wenn es um die Hardware geht.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Quelltext=&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Quelltext=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Fetz</name></author>
	</entry>
	<entry>
		<id>https://www.sequencer.de/synth/index.php?title=MCV876_Controller_Update:_Source_Code&amp;diff=7280&amp;oldid=prev</id>
		<title>Fetz: /* Quelltext */</title>
		<link rel="alternate" type="text/html" href="https://www.sequencer.de/synth/index.php?title=MCV876_Controller_Update:_Source_Code&amp;diff=7280&amp;oldid=prev"/>
		<updated>2011-06-23T07:27:24Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Quelltext&lt;/span&gt;&lt;/p&gt;
&lt;a href=&quot;https://www.sequencer.de/synth/index.php?title=MCV876_Controller_Update:_Source_Code&amp;amp;diff=7280&amp;amp;oldid=7278&quot;&gt;Änderungen zeigen&lt;/a&gt;</summary>
		<author><name>Fetz</name></author>
	</entry>
	<entry>
		<id>https://www.sequencer.de/synth/index.php?title=MCV876_Controller_Update:_Source_Code&amp;diff=7278&amp;oldid=prev</id>
		<title>Fetz: Created page with &#039;=Übersetzen=  Der Code für den ATMega 88 wird mit dem AVR-Studio 4 erstellt. Das kann man auf der Atmel Webseite (kostenlos) runter laden. Im Studio ein neues, leeres Projekt m…&#039;</title>
		<link rel="alternate" type="text/html" href="https://www.sequencer.de/synth/index.php?title=MCV876_Controller_Update:_Source_Code&amp;diff=7278&amp;oldid=prev"/>
		<updated>2011-06-22T22:26:25Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;#039;=Übersetzen=  Der Code für den ATMega 88 wird mit dem AVR-Studio 4 erstellt. Das kann man auf der Atmel Webseite (kostenlos) runter laden. Im Studio ein neues, leeres Projekt m…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Übersetzen= &lt;br /&gt;
Der Code für den ATMega 88 wird mit dem AVR-Studio 4 erstellt. Das kann man auf der Atmel Webseite (kostenlos) runter laden.&lt;br /&gt;
Im Studio ein neues, leeres Projekt mit Standard-Einstellungen, einem sinnvollen Namen und an einem Ort, wo man es wiederfindet erstellen, Quelltext in das (automatisch erzeugte, leere) C-File kopieren, auf Build-&amp;gt;Build klicken, fertig. &lt;br /&gt;
Das resultierende HEX File kann man mit einem üblichen Programmieradapter in der Chip flashen, für uns zweckmäßiger ist allerdings, das in ein Sys-Ex File zu Konvertieren [-&amp;gt;Link auf Konverter folgt...], und das an den Controller zu schicken. Dann programmiert der sich selber um. Dazu muss er allerdings einmalig mit dem Bootlader [hier Link auf Bootlader imaginieren.. ] programmiert worden sein. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Zu den Atmel Controllern findet man eine Menge Info mit Tante Google, [http://www.mikrocontroller.net http://www.mikrocontroller.net] kommt häufig vor, und hat ein ergiebiges Forum und gute Artikel. Auf der Atmel Webseite gibt es auch einige Info, das [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATMega 88 Datenblatt] ist spätestens dann nötig, wenn es um die Hardware geht. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Quelltext=&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
	MCV876 with ATMega 88 &lt;br /&gt;
&lt;br /&gt;
	Midi to 4 Channel Control Voltage and six Gates Interface &lt;br /&gt;
&lt;br /&gt;
	Preliminary &lt;br /&gt;
	Version 0.20 2011-06-22 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    This program is free software: you can redistribute it and/or modify&lt;br /&gt;
    it under the terms of the GNU General Public License as published by&lt;br /&gt;
    the Free Software Foundation, either version 3 of the License, or&lt;br /&gt;
    (at your option) any later version.&lt;br /&gt;
&lt;br /&gt;
    This program is distributed in the hope that it will be useful,&lt;br /&gt;
    but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
    GNU General Public License for more details.&lt;br /&gt;
&lt;br /&gt;
    You should have received a copy of the GNU General Public License&lt;br /&gt;
    along with this program.  If not, see &amp;lt;http://www.gnu.org/licenses/&amp;gt;.&lt;br /&gt;
			&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
#include &amp;lt;avr/io.h&amp;gt;			// yes, we want to talk to the port pins by name&lt;br /&gt;
#include &amp;lt;avr/eeprom.h&amp;gt;		// ... oh.. and some eeprom access would be nice&lt;br /&gt;
#include &amp;lt;avr/interrupt.h&amp;gt;	// ... and w/o the interupts it wouldn&amp;#039;t do anything... &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/*	===================ZERO LINE=================================&lt;br /&gt;
	WARNING: everthing below the zero line counts from zero! &lt;br /&gt;
	e.g. whats Gate 6 in manual is GATE5 here, CVs are CV0 to 3 &lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
	where should the LED output be &lt;br /&gt;
*/&lt;br /&gt;
#define LEDLED   6  // LED at Reset-Pin, standard for series, but no debugging possible. &lt;br /&gt;
#define LEDGATE0 0	// Led at Gate 0, no LED (Test I: no LED ) &lt;br /&gt;
#define LEDGATE4 4	// LED at Gate 5, Test II: no Gate 5 Function (Midi Start/Stop) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#define LEDOUT LEDGATE4 // select your evil... &lt;br /&gt;
&lt;br /&gt;
#define BUTTON (!(PIND &amp;amp; (1&amp;lt;&amp;lt;4))) // True if Button pressed &lt;br /&gt;
&lt;br /&gt;
#define NUM_CV 4&lt;br /&gt;
&lt;br /&gt;
#define PARAMETEROFFSET 0x23 // First paramter has adress 0x23&lt;br /&gt;
#define NUM_PARAMTERS 17	 // and there are 17 parameters &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
struct CONFIG {&lt;br /&gt;
	unsigned char midiChannel;&lt;br /&gt;
	unsigned char noteOffset;&lt;br /&gt;
&lt;br /&gt;
	unsigned char cvMidiCC[NUM_CV];&lt;br /&gt;
	unsigned char gateMidiCC[NUM_CV];&lt;br /&gt;
	&lt;br /&gt;
	unsigned char gateTreshhold;&lt;br /&gt;
	unsigned char clockDivider;&lt;br /&gt;
	unsigned char clockTime; &lt;br /&gt;
	unsigned char ifMode0; 	// 	bit 0 ... bit 3 = CV0 .. CV3, 0=Pitch, 1=CC (if pitch, CC assignement is ignored) &lt;br /&gt;
							//	bit 5: voices: 0=2; 1=4 &lt;br /&gt;
							//  bit 7:6= 00 Mono; 01:Multi-Channel; 10: Poly (not supported); &lt;br /&gt;
	&lt;br /&gt;
	unsigned char ifMode1;  // Gate Trigger Mode Bits (0=Re-Trigger, 1=TriggerControl)  &lt;br /&gt;
	unsigned char ifMode2;  // bit0: Velo0=&amp;gt;CV0; bit1:Velo0=&amp;gt;CV1; bit2:Velo-Poly2=&amp;gt;CV2; bit3:Velo1=&amp;gt;CV3&lt;br /&gt;
							// bit4: PB=&amp;gt;CV0; bit5:PB=&amp;gt;CV1; bit6:PB=&amp;gt;CV2; bit7:PB=&amp;gt;CV3&lt;br /&gt;
	unsigned char ifMode3; 	// bit0..bit3 = CV0... CV3; 0=10V, 1=5V Mode &lt;br /&gt;
&lt;br /&gt;
//  internal evaluated configuration &lt;br /&gt;
	unsigned char numMidiChannels;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
} shadow_config, // her goes a copy, when config should be written, because that might take a while &lt;br /&gt;
&lt;br /&gt;
config 	// current configuration, mostly direct evaluated troughout the program&lt;br /&gt;
= {		// default values (Mono-Mode, Midi-Ch 1, CV1=Pitch, CV2=Velocity CV3=ModWheel CV4=Pitch Bend&lt;br /&gt;
			0,  	// Midi Channel &lt;br /&gt;
			24, 	// Note Offset (2 Oktaves) &lt;br /&gt;
		{	255,255,1,255, },  	// CV - assigned Midi Controllers (used if not pitch output) 255=none&lt;br /&gt;
		{   255,18,19,20, }, 	// Gate - asigned Controllers (if not pitch) 255=none &lt;br /&gt;
			63, 	// Treshold&lt;br /&gt;
			6,  	// Divider 6 (1/16 Note) &lt;br /&gt;
			1,  	// clock time (unused) &lt;br /&gt;
			0x0e, 	// mode 1 Low nibble CC-Bits, high: interface mode &lt;br /&gt;
			0x82, 	// mode 2 High Nibble: PB-bits, Low: Velo-Bits&lt;br /&gt;
			0,    	// mode 3 (5V-Bits) &lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#define EE_MAGIC 17&lt;br /&gt;
unsigned char ee_magic EEMEM;&lt;br /&gt;
unsigned char config_eeprom[NUM_PARAMTERS] EEMEM; // Config in EEPROM, saves it during power down. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#define MODE_MONO 0x00		// monophon, all assigned to last note on a single channel &lt;br /&gt;
#define MODE_MULTI2 0x40	// two channel, 1/2 for midiChannel, 2/3 for midiChannel+1 &lt;br /&gt;
#define MODE_MULTI4 0x60	// for channel midiChannel to midiChannel+3 &lt;br /&gt;
#define MODE_POLY2  0x80	// not supported &lt;br /&gt;
#define MODE_POLY4  0xA0	// not supported&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// to have the clock synced to &amp;quot;beat 1&amp;quot; of a bar ... &lt;br /&gt;
volatile unsigned int spp; 	// song position pointer (from midi message) &lt;br /&gt;
unsigned char ticksPerBar=96; // How many ticks per bar (is not tx-ed: guess 96 for 4/4 ...  ) &lt;br /&gt;
volatile unsigned char barTick; // where are we inside the bar (counted, because calculation from spp takes some cpu-cycles ) &lt;br /&gt;
&lt;br /&gt;
volatile unsigned char  eepromWriteFlag;	// set to one, if main-loop should write eeprom &lt;br /&gt;
&lt;br /&gt;
volatile unsigned char button; 	// debounced button status &lt;br /&gt;
volatile unsigned char learn; 	// (channel/base note/cc) &amp;quot;do learn&amp;quot; status &lt;br /&gt;
volatile unsigned char blinker; // some count for blinkenlights &lt;br /&gt;
&lt;br /&gt;
volatile unsigned char clocker;	 // timer counter for half a midi-clock (which is needed for divider 1)&lt;br /&gt;
volatile unsigned char gate5off; // timer counter for when clock gate output should go low again. &lt;br /&gt;
&lt;br /&gt;
volatile unsigned char watchTicker;	// midi active sense counter &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
void setConfig(void); 		&lt;br /&gt;
void setLed(unsigned char on);&lt;br /&gt;
void resetAll(void);&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
	main() &lt;br /&gt;
	Main does initialization, than runs a loop, which does nearly nothing: &lt;br /&gt;
&lt;br /&gt;
	Programming the EEPROM (because its slow) &lt;br /&gt;
	Blinking &lt;br /&gt;
	Button evaluation &lt;br /&gt;
&lt;br /&gt;
	All the important things are done by the interupts. (Thanks to the &lt;br /&gt;
	20MHZ RISC power everything can be done in less than 320µs=one Midi-Character) &lt;br /&gt;
*/&lt;br /&gt;
int main(void)&lt;br /&gt;
{&lt;br /&gt;
	unsigned char blink=6;&lt;br /&gt;
&lt;br /&gt;
	unsigned char i,x; &lt;br /&gt;
	unsigned char *cp;&lt;br /&gt;
	static unsigned char lastButton; &lt;br /&gt;
&lt;br /&gt;
/* &lt;br /&gt;
&lt;br /&gt;
		HARDWARE INIT &lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
   // Input/Output Ports initialization&lt;br /&gt;
    // DDRx  = Define I/O direction for each pins&lt;br /&gt;
    // PORTx = If pin is Output then `0&amp;#039; = lo, `1&amp;#039; = hi&lt;br /&gt;
    //         If pin is input then `0&amp;#039; = no pullup, `1&amp;#039; = pullup enabled&lt;br /&gt;
    // `0&amp;#039; = Input `1&amp;#039; = Output&lt;br /&gt;
    // Port B initialization&lt;br /&gt;
    DDRB  = 0x3f;                 // PB0=G4; PB1=G5 (Opt. LED); PB2=G6 ; PB3=WR1; PB4=D0; PB5=D1 (all output)&lt;br /&gt;
    PORTB = 0x04;                 // WR1 High, Rest Low &lt;br /&gt;
&lt;br /&gt;
    // Port C initialization&lt;br /&gt;
    DDRC  = 0x7F;                 // PC0=D2; PC1=D3; PC2=D4; PC3=D5; PC4=D6; PC5=D7; PC6=LED (opt.) (all output)&lt;br /&gt;
	PORTC = 0x00;                 // all Low&lt;br /&gt;
&lt;br /&gt;
    // Port D initialization&lt;br /&gt;
    DDRD  = 0xee;                 // [PD0=RX]; PD1=WR2; PD2=WR3; PD3=WR4; PD4=Button; PD5=G1; PD6=G2; PD7=G3 &lt;br /&gt;
    PORTD = 0x1F;                 // Pullup on RX &amp;amp; Button, all WR High, Gates Low &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    // Timer/Counter 1 initialization&lt;br /&gt;
    // Clock source: System Clock&lt;br /&gt;
    // Clock value: 20Mhz /64&lt;br /&gt;
    // Mode: CTC &lt;br /&gt;
    // OC0 output: Disconnected&lt;br /&gt;
	OCR1A= 625; // 2 ms  &lt;br /&gt;
	TCCR1A =0; &lt;br /&gt;
	TCCR1B =8+3; // CTC Mode, TOP from OCR1A + Clock/64 &lt;br /&gt;
	TIMSK1 =2; // OCF1A Interupt &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    // USART initialization&lt;br /&gt;
    // Communication Parameters: 8 Data, 1 Stop, No Parity&lt;br /&gt;
    // USART Receiver: On&lt;br /&gt;
    // USART Transmitter: OFF&lt;br /&gt;
    // USART Mode: Asynchronous&lt;br /&gt;
    UCSR0A = 0x00;&lt;br /&gt;
	/* Set frame format: 8data, 1stop bit */&lt;br /&gt;
	UCSR0C = 6;&lt;br /&gt;
&lt;br /&gt;
    // USART Baud rate: 31250;  20E6/16/31250 - 1&lt;br /&gt;
   	UBRR0H = 0;&lt;br /&gt;
    UBRR0L = 39;&lt;br /&gt;
&lt;br /&gt;
    /*Enable receiver , Enable Rx-int  */&lt;br /&gt;
	UCSR0B = ((1&amp;lt;&amp;lt;RXEN0)|(1&amp;lt;&amp;lt;RXCIE0) ) ;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
	HARDWARE READY &lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
	// Read Configuration &lt;br /&gt;
	if( eeprom_read_byte(ee_magic) == EE_MAGIC  &amp;amp;&amp;amp; !BUTTON) // if eeprom valid AND Button not pressed &lt;br /&gt;
	{&lt;br /&gt;
		cp=(unsigned char* )&amp;amp;config; &lt;br /&gt;
		for(i=0;i&amp;lt;NUM_PARAMTERS;++i)&lt;br /&gt;
		{&lt;br /&gt;
			x=eeprom_read_byte(config_eeprom+i);			// read config from eeprom &lt;br /&gt;
			*cp=x;	&lt;br /&gt;
			cp++;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	setConfig();&lt;br /&gt;
&lt;br /&gt;
	// enable interrupts&lt;br /&gt;
	sei(); &lt;br /&gt;
&lt;br /&gt;
	while(1)&lt;br /&gt;
	{&lt;br /&gt;
		if(eepromWriteFlag)&lt;br /&gt;
		{	// save configuration &lt;br /&gt;
			cp=(unsigned char* )&amp;amp;shadow_config; &lt;br /&gt;
			for(i=0;i&amp;lt;NUM_PARAMTERS;++i)&lt;br /&gt;
			{&lt;br /&gt;
				x=*cp;&lt;br /&gt;
				eeprom_write_byte(config_eeprom+i,x);&lt;br /&gt;
				cp++;&lt;br /&gt;
			}&lt;br /&gt;
			eeprom_write_byte(ee_magic,EE_MAGIC); &lt;br /&gt;
&lt;br /&gt;
			setLed(1);&lt;br /&gt;
			blink=6;&lt;br /&gt;
			blinker=0;&lt;br /&gt;
			eepromWriteFlag=0;	&lt;br /&gt;
		}&lt;br /&gt;
		if(blink &amp;amp;&amp;amp; blinker&amp;gt;2)  // blink after power up and after storing in nv-memory &lt;br /&gt;
		{&lt;br /&gt;
			blink--;&lt;br /&gt;
			setLed(blink&amp;amp;1);&lt;br /&gt;
			blinker=0; &lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if(button != lastButton)&lt;br /&gt;
		{&lt;br /&gt;
			if(button==1 )&lt;br /&gt;
			{&lt;br /&gt;
				resetAll();&lt;br /&gt;
				if(learn==1)&lt;br /&gt;
				{&lt;br /&gt;
					learn=0;&lt;br /&gt;
					setLed(0);&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			if(button==6) &lt;br /&gt;
			{&lt;br /&gt;
				if(learn ==0)&lt;br /&gt;
				{&lt;br /&gt;
					learn=1;&lt;br /&gt;
					setLed(1);&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			lastButton=button; &lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	return 0; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* ***********************************************************************************&lt;br /&gt;
&lt;br /&gt;
	Hardware Interface&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
/*  Pin assignment &lt;br /&gt;
   Atmel Fkt 	[Orig] &lt;br /&gt;
1  Reset LED 	[MCLR] &lt;br /&gt;
2  RX    Midi-Rx[WR1]&lt;br /&gt;
3  PD1   WR2&lt;br /&gt;
4  PD2   WR3&lt;br /&gt;
5  PD3   WR4&lt;br /&gt;
6  PD4   Button&lt;br /&gt;
7  VCC   +5  	[LED] (Either from Atmel-1(Series) or Atmel-15(w/Debug))&lt;br /&gt;
8  GND   GND&lt;br /&gt;
9  OSC   OSC&lt;br /&gt;
10 OSC   OSC &lt;br /&gt;
11 PD5   G1&lt;br /&gt;
12 PD6   G2&lt;br /&gt;
13 PD7   G3&lt;br /&gt;
14 PB0   G4&lt;br /&gt;
&lt;br /&gt;
15 PB1   G5 (Optional + LED) &lt;br /&gt;
16 PB2   G6 &lt;br /&gt;
17 PB3   WR1    [---] &lt;br /&gt;
18 PB4   D0     [RX]&lt;br /&gt;
19 PB5   D1		[GND]&lt;br /&gt;
20 AVCC  +5&lt;br /&gt;
21 ARef  +5 	[D0]&lt;br /&gt;
22 GND   GND	[D1] &lt;br /&gt;
23 PC0   D2&lt;br /&gt;
24 PC1   D3&lt;br /&gt;
25 PC2   D4&lt;br /&gt;
26 PC3   D5&lt;br /&gt;
27 PC4   D6&lt;br /&gt;
28 PC5   D7&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
// put &amp;quot;val&amp;quot; to the right port bits for the DA-Converter &lt;br /&gt;
// ... better program than solder *that*... &lt;br /&gt;
void adByteOut(unsigned char val)&lt;br /&gt;
{&lt;br /&gt;
	unsigned char b;&lt;br /&gt;
	b=val;&lt;br /&gt;
	b&amp;gt;&amp;gt;=2;&lt;br /&gt;
	PORTC=b;&lt;br /&gt;
	b=val&amp;amp;3;&lt;br /&gt;
	b&amp;lt;&amp;lt;=4;&lt;br /&gt;
	val=PORTB;&lt;br /&gt;
	val &amp;amp;=0xCF;&lt;br /&gt;
	val|=b;&lt;br /&gt;
	PORTB=val;&lt;br /&gt;
}&lt;br /&gt;
// set DA-Output voltage of one CV Channel  &lt;br /&gt;
void set_cv(unsigned char val, unsigned char channel)&lt;br /&gt;
{&lt;br /&gt;
	adByteOut(val); 	// set D0..D7 converter data bits &lt;br /&gt;
	switch (channel)	// pulse with write pin &lt;br /&gt;
	{&lt;br /&gt;
		case 0: //PB3&lt;br /&gt;
			PORTB  &amp;amp;= ~(1&amp;lt;&amp;lt;3);&lt;br /&gt;
			PORTB  |=  (1&amp;lt;&amp;lt;3);&lt;br /&gt;
			break;&lt;br /&gt;
		case 1:	// PD1&lt;br /&gt;
			PORTD &amp;amp;= ~(1&amp;lt;&amp;lt;1);&lt;br /&gt;
			PORTD |=  (1&amp;lt;&amp;lt;1);&lt;br /&gt;
			break;&lt;br /&gt;
		case 2:	// PD2&lt;br /&gt;
			PORTD &amp;amp;= ~(1&amp;lt;&amp;lt;2);&lt;br /&gt;
			PORTD |=  (1&amp;lt;&amp;lt;2);&lt;br /&gt;
			break;&lt;br /&gt;
		case 3:	// PD3&lt;br /&gt;
			PORTD &amp;amp;= ~(1&amp;lt;&amp;lt;3);&lt;br /&gt;
			PORTD |=  (1&amp;lt;&amp;lt;3);&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
// set on of the gate outputs active &lt;br /&gt;
void gate_on(unsigned char channel)&lt;br /&gt;
{&lt;br /&gt;
	switch (channel)&lt;br /&gt;
	{&lt;br /&gt;
		case 0:	// PD5&lt;br /&gt;
			PORTD |= (1&amp;lt;&amp;lt; 5);&lt;br /&gt;
			break;&lt;br /&gt;
		case 1:	// PD6&lt;br /&gt;
			PORTD |= (1&amp;lt;&amp;lt; 6);&lt;br /&gt;
			break;&lt;br /&gt;
		case 2:	// PD7&lt;br /&gt;
			PORTD |= (1&amp;lt;&amp;lt; 7);&lt;br /&gt;
			break;&lt;br /&gt;
		case 3:	// PB0&lt;br /&gt;
			PORTB |= (1&amp;lt;&amp;lt; 0);&lt;br /&gt;
			break;&lt;br /&gt;
		case 4:	// PB1&lt;br /&gt;
#if LEDOUT != LEDGATE4&lt;br /&gt;
			PORTB |= (1&amp;lt;&amp;lt; 1);&lt;br /&gt;
#endif &lt;br /&gt;
			break;&lt;br /&gt;
		case 5:	// PB2&lt;br /&gt;
			PORTB |= (1&amp;lt;&amp;lt; 2);&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
// clear one of the gate outputs &lt;br /&gt;
void gate_off(unsigned char channel)&lt;br /&gt;
{&lt;br /&gt;
	switch (channel)&lt;br /&gt;
	{&lt;br /&gt;
		case 0:	// PD5&lt;br /&gt;
			PORTD &amp;amp;=~(1&amp;lt;&amp;lt; 5);&lt;br /&gt;
			break;&lt;br /&gt;
		case 1:	// PD6&lt;br /&gt;
			PORTD &amp;amp;=~(1&amp;lt;&amp;lt; 6);&lt;br /&gt;
			break;&lt;br /&gt;
		case 2:	// PD7&lt;br /&gt;
			PORTD &amp;amp;=~(1&amp;lt;&amp;lt; 7);&lt;br /&gt;
			break;&lt;br /&gt;
		case 3:	// PB0&lt;br /&gt;
			PORTB &amp;amp;=~(1&amp;lt;&amp;lt; 0);&lt;br /&gt;
			break;&lt;br /&gt;
		case 4:	// PB1&lt;br /&gt;
#if LEDOUT != LEDGATE4&lt;br /&gt;
			PORTB &amp;amp;=~(1&amp;lt;&amp;lt; 1);&lt;br /&gt;
#endif&lt;br /&gt;
			break;&lt;br /&gt;
		case 5:	// PB2&lt;br /&gt;
			PORTB &amp;amp;=~(1&amp;lt;&amp;lt; 2);&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
/* ***********************************************************************************&lt;br /&gt;
&lt;br /&gt;
	LED&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
void setLed(unsigned char on)&lt;br /&gt;
{&lt;br /&gt;
#if LEDOUT == LEDLED&lt;br /&gt;
	if (on)	// PC6&lt;br /&gt;
		PORTC |= (1&amp;lt;&amp;lt; 6);&lt;br /&gt;
	else &lt;br /&gt;
		PORTC &amp;amp;=~(1&amp;lt;&amp;lt; 6);&lt;br /&gt;
#endif &lt;br /&gt;
#if LEDOUT == LEDGATE4&lt;br /&gt;
	if (on)	// PB1&lt;br /&gt;
		PORTB |= (1&amp;lt;&amp;lt; 1);&lt;br /&gt;
	else &lt;br /&gt;
		PORTB &amp;amp;=~(1&amp;lt;&amp;lt; 1);&lt;br /&gt;
#endif &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* ***********************************************************************************&lt;br /&gt;
&lt;br /&gt;
	Data Handling&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
typedef struct {&lt;br /&gt;
	unsigned char channel;  // (relative) Midi channel (0..3) Mode dependant &lt;br /&gt;
	unsigned char cvOut;	// for which CV-Ouput (0..3) fixed &lt;br /&gt;
	unsigned char ccVal;	// current CC Value &lt;br /&gt;
	unsigned char note;		// current Note &lt;br /&gt;
	unsigned char velo;		// current Velocity &lt;br /&gt;
	unsigned char on;		// if Note is on &lt;br /&gt;
	signed char   pb;		// current Pitch Bend Value &lt;br /&gt;
	unsigned char gateDipper;&lt;br /&gt;
} cvoutput;  &lt;br /&gt;
&lt;br /&gt;
cvoutput cv_out[NUM_CV];	// current state for each cv out&lt;br /&gt;
&lt;br /&gt;
unsigned char gates; // which gates are on =&amp;gt; used for LED setting &lt;br /&gt;
&lt;br /&gt;
// set cv output (and assigned gate, if pitch output)&lt;br /&gt;
// called after anything that changes the cv_out structure  &lt;br /&gt;
void updateCv(cvoutput *cvo)&lt;br /&gt;
{&lt;br /&gt;
	unsigned char bm;&lt;br /&gt;
	unsigned char gated=0;&lt;br /&gt;
	int val=0;&lt;br /&gt;
&lt;br /&gt;
	bm=1&amp;lt;&amp;lt;cvo-&amp;gt;cvOut;	// bit mask for configuration flags &lt;br /&gt;
&lt;br /&gt;
	if(config.ifMode0 &amp;amp; bm)	// 1=CC-Mode&lt;br /&gt;
	{&lt;br /&gt;
		val=cvo-&amp;gt;ccVal; // &amp;lt;&amp;lt;1;&lt;br /&gt;
/*&lt;br /&gt;
		if( (config.ifMode3 &amp;amp; bm) &amp;amp;&amp;amp; cvo-&amp;gt;on==0)	// 5V-Flag, abused as Gated-Mode-CV Flag &lt;br /&gt;
			gated=1;&lt;br /&gt;
*/&lt;br /&gt;
	}&lt;br /&gt;
	else // Note&lt;br /&gt;
	{&lt;br /&gt;
		val=cvo-&amp;gt;note;&lt;br /&gt;
		val -= config.noteOffset;&lt;br /&gt;
&lt;br /&gt;
		if(config.ifMode3 &amp;amp; bm)	// 5V&lt;br /&gt;
			val &amp;lt;&amp;lt;= 2;&lt;br /&gt;
		else&lt;br /&gt;
			val &amp;lt;&amp;lt;= 1;&lt;br /&gt;
	}&lt;br /&gt;
	if(config.ifMode2 &amp;amp; bm) // Velocity &lt;br /&gt;
		val+=cvo-&amp;gt;velo;&lt;br /&gt;
	if(config.ifMode2 &amp;amp; (bm&amp;lt;&amp;lt;4)) // PB &lt;br /&gt;
		val+=cvo-&amp;gt;pb;&lt;br /&gt;
&lt;br /&gt;
	if(val&amp;lt;0 || gated)	// clip values to converter range &lt;br /&gt;
		val=0;&lt;br /&gt;
	if(val&amp;gt;255)&lt;br /&gt;
		val=255;&lt;br /&gt;
&lt;br /&gt;
	set_cv((unsigned char)val, cvo-&amp;gt;cvOut);&lt;br /&gt;
	if((config.ifMode0 &amp;amp; bm)==0)&lt;br /&gt;
	{&lt;br /&gt;
		if(cvo-&amp;gt;on)&lt;br /&gt;
		{&lt;br /&gt;
			if(cvo-&amp;gt;gateDipper==0) // no retrigger required&lt;br /&gt;
				gate_on(cvo-&amp;gt;cvOut);&lt;br /&gt;
			else				   // dip gate for a few milliseconds 	&lt;br /&gt;
				gate_off(cvo-&amp;gt;cvOut);&lt;br /&gt;
			gates |=bm;&lt;br /&gt;
		}&lt;br /&gt;
		else &lt;br /&gt;
		{&lt;br /&gt;
			gate_off(cvo-&amp;gt;cvOut);&lt;br /&gt;
			gates &amp;amp;=~bm;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// calculate/initialize control variables after &lt;br /&gt;
// mode-configuration change &lt;br /&gt;
void setConfig()&lt;br /&gt;
{&lt;br /&gt;
	unsigned char i; &lt;br /&gt;
	cvoutput *cvo;&lt;br /&gt;
&lt;br /&gt;
	cvo=cv_out;&lt;br /&gt;
&lt;br /&gt;
	for(i=0;i&amp;lt;NUM_CV;++i)&lt;br /&gt;
	{&lt;br /&gt;
		cvo-&amp;gt;cvOut=i;&lt;br /&gt;
		cvo-&amp;gt;pb=0x80;&lt;br /&gt;
		cvo++;&lt;br /&gt;
	} &lt;br /&gt;
&lt;br /&gt;
	cvo=cv_out;&lt;br /&gt;
	switch(config.ifMode0 &amp;amp; 0xf0 )&lt;br /&gt;
	{	&lt;br /&gt;
		default:&lt;br /&gt;
		case MODE_MONO:&lt;br /&gt;
			for(i=0;i&amp;lt;NUM_CV;++i)&lt;br /&gt;
			{&lt;br /&gt;
				cvo-&amp;gt;channel=0;&lt;br /&gt;
				cvo++;&lt;br /&gt;
			} &lt;br /&gt;
			config.numMidiChannels=1;&lt;br /&gt;
			break;&lt;br /&gt;
		case MODE_MULTI2:&lt;br /&gt;
			for(i=0;i&amp;lt;NUM_CV/2;++i)&lt;br /&gt;
			{&lt;br /&gt;
				cvo-&amp;gt;channel=0;&lt;br /&gt;
				cvo++;&lt;br /&gt;
			} &lt;br /&gt;
			for(;i&amp;lt;NUM_CV;++i)&lt;br /&gt;
			{&lt;br /&gt;
				cvo-&amp;gt;channel=1;&lt;br /&gt;
				cvo++;&lt;br /&gt;
			} &lt;br /&gt;
			config.numMidiChannels=2;&lt;br /&gt;
			break;&lt;br /&gt;
		case MODE_MULTI4:&lt;br /&gt;
			for(i=0;i&amp;lt;NUM_CV;++i)&lt;br /&gt;
			{&lt;br /&gt;
				cvo-&amp;gt;channel=i;&lt;br /&gt;
				cvo++;&lt;br /&gt;
			} &lt;br /&gt;
			config.numMidiChannels=NUM_CV;&lt;br /&gt;
			break;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// assign new note state to cv outputs &lt;br /&gt;
void setNote(unsigned char note, unsigned char velo, unsigned char onOff, unsigned char channel)&lt;br /&gt;
{&lt;br /&gt;
	unsigned char i;&lt;br /&gt;
	cvoutput *cvo;&lt;br /&gt;
	&lt;br /&gt;
	cvo=cv_out;&lt;br /&gt;
	for(i=0;i&amp;lt;NUM_CV;i++)&lt;br /&gt;
	{&lt;br /&gt;
		if(cvo-&amp;gt;channel==channel)&lt;br /&gt;
		{&lt;br /&gt;
			cvo-&amp;gt;note=note;&lt;br /&gt;
			cvo-&amp;gt;velo=velo;&lt;br /&gt;
			if(onOff==2 &amp;amp;&amp;amp; cvo-&amp;gt;on &amp;amp;&amp;amp; (config.ifMode1 &amp;amp; (1&amp;lt;&amp;lt;i)))&lt;br /&gt;
				cvo-&amp;gt;gateDipper=4;&lt;br /&gt;
			cvo-&amp;gt;on=onOff;&lt;br /&gt;
			updateCv(cvo);&lt;br /&gt;
		}&lt;br /&gt;
		cvo++;&lt;br /&gt;
	}&lt;br /&gt;
	setLed(gates);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// process new continous controller value &lt;br /&gt;
void setCC(unsigned char cc, unsigned char value, unsigned char channel)&lt;br /&gt;
{&lt;br /&gt;
	unsigned char i;&lt;br /&gt;
	cvoutput *cvo;&lt;br /&gt;
&lt;br /&gt;
	cvo=cv_out;&lt;br /&gt;
&lt;br /&gt;
	for(i=0;i&amp;lt;NUM_CV;++i)&lt;br /&gt;
	{&lt;br /&gt;
		if(channel== cvo-&amp;gt;channel )&lt;br /&gt;
		{&lt;br /&gt;
			if(config.ifMode0 &amp;amp;(1&amp;lt;&amp;lt;i))&lt;br /&gt;
			{&lt;br /&gt;
				if(config.cvMidiCC[i]==cc)&lt;br /&gt;
				{&lt;br /&gt;
					cvo-&amp;gt;ccVal=value; &lt;br /&gt;
					updateCv(cvo);&lt;br /&gt;
				}&lt;br /&gt;
				if(config.gateMidiCC[i]==cc  )&lt;br /&gt;
				{&lt;br /&gt;
					if(value&amp;gt;config.gateTreshhold)&lt;br /&gt;
						gate_on(channel);&lt;br /&gt;
					else &lt;br /&gt;
						gate_off(channel);&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		cvo++;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
// process new pitch bend value &lt;br /&gt;
void setPb(signed int value, unsigned char channel)&lt;br /&gt;
{&lt;br /&gt;
	unsigned char i;&lt;br /&gt;
	cvoutput *cvo;&lt;br /&gt;
&lt;br /&gt;
	cvo=cv_out;&lt;br /&gt;
&lt;br /&gt;
	for(i=0;i&amp;lt;NUM_CV;++i)&lt;br /&gt;
	{&lt;br /&gt;
		if(channel==cvo-&amp;gt;channel &amp;amp;&amp;amp; (config.ifMode2 &amp;amp; (16&amp;lt;&amp;lt;i)) )&lt;br /&gt;
		{&lt;br /&gt;
			cvo-&amp;gt;pb	=(signed char) (value&amp;gt;&amp;gt;6);	&lt;br /&gt;
			updateCv(cvo);	&lt;br /&gt;
		}&lt;br /&gt;
		cvo++;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// prepare for (asynchronous) configuration write to eeprom &lt;br /&gt;
void setEeWrite(void)&lt;br /&gt;
{&lt;br /&gt;
	shadow_config=config; &lt;br /&gt;
	learn=0;&lt;br /&gt;
	eepromWriteFlag=1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
void (*bootloader)(void) = (void*)0x1800;	// Bootloader sits at adress 0x1800 ... &lt;br /&gt;
&lt;br /&gt;
// process sys ex command &lt;br /&gt;
void setSyx(unsigned char adr, unsigned char val)&lt;br /&gt;
{&lt;br /&gt;
	unsigned char *cp;&lt;br /&gt;
&lt;br /&gt;
	cp=(unsigned char *) &amp;amp;config; &lt;br /&gt;
&lt;br /&gt;
	if(adr==0x14 &amp;amp;&amp;amp; val ==0x7b) &lt;br /&gt;
	{	// write eeprom&lt;br /&gt;
		if(eepromWriteFlag==0)&lt;br /&gt;
		{&lt;br /&gt;
			setEeWrite();&lt;br /&gt;
		}&lt;br /&gt;
		return; &lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// 0xF0, 0x70, 0x7D,0x00,0x16,0x04, 0x02, 0xF7&lt;br /&gt;
	if(adr==0x16 &amp;amp;&amp;amp; val ==0x42)	// Software update  &lt;br /&gt;
	{&lt;br /&gt;
		cli();			// interupts off &lt;br /&gt;
		resetAll();		// outputs off &lt;br /&gt;
		GPIOR1 = 0xAB;	// tell bootloader it&amp;#039;s an application boot request &lt;br /&gt;
						// (hardware reset sets GPIOR1 to zero, 0xab == magic value for bootloader )&lt;br /&gt;
		bootloader();	// bye bye! &lt;br /&gt;
		return; 	// &amp;lt;-- never! &lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	adr-=PARAMETEROFFSET; &lt;br /&gt;
	if(adr &amp;lt; NUM_PARAMTERS)	// if valid parameter &lt;br /&gt;
	{&lt;br /&gt;
		*(cp+adr)=val; 		// set in &lt;br /&gt;
		if(adr==0x30-PARAMETEROFFSET) // if Mode Byte 0, &lt;br /&gt;
			setConfig();			  // .. cv assignement must be recalculated &lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* ***********************************************************************************&lt;br /&gt;
&lt;br /&gt;
	Note Puffer Handling&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
#define MAX_NOTES 0x10  	// one for each finger of a real programmer &lt;br /&gt;
#define MAX_CHANNELS 4&lt;br /&gt;
unsigned char notes[MAX_CHANNELS][MAX_NOTES];&lt;br /&gt;
unsigned char velocities[MAX_CHANNELS][MAX_NOTES];&lt;br /&gt;
unsigned char playedNote[MAX_CHANNELS]; // number of currently pressed notes &lt;br /&gt;
// update note puffer for a midi note-on message &lt;br /&gt;
void note_on(unsigned char note ,unsigned char velocity, unsigned char channel)&lt;br /&gt;
{&lt;br /&gt;
	unsigned char n;&lt;br /&gt;
	n=playedNote[channel];&lt;br /&gt;
&lt;br /&gt;
	if(n&amp;lt;MAX_NOTES)&lt;br /&gt;
	{&lt;br /&gt;
		playedNote[channel]++;&lt;br /&gt;
	}&lt;br /&gt;
	else &lt;br /&gt;
	{&lt;br /&gt;
		for (n=MAX_NOTES-1;n&amp;gt;0;--n)&lt;br /&gt;
		{&lt;br /&gt;
			notes[channel][n-1]=notes[channel][n];&lt;br /&gt;
			velocities[channel][n-1]=velocities[channel][n];&lt;br /&gt;
		}&lt;br /&gt;
		n=MAX_NOTES-1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	notes[channel][n]=note; 		&lt;br /&gt;
	velocities[channel][n]=velocity;&lt;br /&gt;
	setNote(note, velocity, 2, channel);&lt;br /&gt;
}&lt;br /&gt;
// update note puffer for a new midi note-off message &lt;br /&gt;
void note_off(unsigned char note ,unsigned char velocity, unsigned char channel)&lt;br /&gt;
{&lt;br /&gt;
	unsigned char i;&lt;br /&gt;
	signed char n; &lt;br /&gt;
&lt;br /&gt;
	n=playedNote[channel];&lt;br /&gt;
&lt;br /&gt;
	--n; &lt;br /&gt;
	for (i=0;i&amp;lt;=n;i++)&lt;br /&gt;
	{&lt;br /&gt;
		if(notes[channel][i]==note)&lt;br /&gt;
		{&lt;br /&gt;
			if(i==n) // last pressed (== the on which playes) note released &lt;br /&gt;
			{&lt;br /&gt;
				if(n==0) // it was the only pressed note &lt;br /&gt;
				{&lt;br /&gt;
					setNote(note, velocities[channel][n], 0, channel);&lt;br /&gt;
					playedNote[channel]--;&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{	&lt;br /&gt;
					--n;&lt;br /&gt;
					setNote(notes[channel][n], velocities[channel][n], 1, channel);&lt;br /&gt;
					playedNote[channel]--;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			else // non playing note released &lt;br /&gt;
			{	// =&amp;gt;  just remove it from list &lt;br /&gt;
				int j;&lt;br /&gt;
				for(j=i+1;j&amp;lt;=n;++j)&lt;br /&gt;
				{&lt;br /&gt;
					notes[channel][j-1]=notes[channel][j];&lt;br /&gt;
					velocities[channel][j-1]=velocities[channel][j];&lt;br /&gt;
				}&lt;br /&gt;
				playedNote[channel]--;&lt;br /&gt;
			}&lt;br /&gt;
			break;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* ***********************************************************************************&lt;br /&gt;
&lt;br /&gt;
	All Notes off, empty Note Buffer, All Controllers Reset&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
void resetAll(void)&lt;br /&gt;
{&lt;br /&gt;
	unsigned char i;&lt;br /&gt;
	cvoutput *cvo;&lt;br /&gt;
	cvo=cv_out;&lt;br /&gt;
&lt;br /&gt;
	cli(); // this might be called asynchronous to midi stream &lt;br /&gt;
	for(i=0;i&amp;lt;MAX_CHANNELS;++i)&lt;br /&gt;
		playedNote[i]=0;&lt;br /&gt;
	&lt;br /&gt;
	for(i=0;i&amp;lt;NUM_CV;++i)&lt;br /&gt;
	{&lt;br /&gt;
		cvo-&amp;gt;cvOut=i;&lt;br /&gt;
		cvo-&amp;gt;ccVal=0;&lt;br /&gt;
		cvo-&amp;gt;on=0;&lt;br /&gt;
		cvo-&amp;gt;pb=0x80;&lt;br /&gt;
		updateCv(cvo);&lt;br /&gt;
		cvo++;&lt;br /&gt;
	} &lt;br /&gt;
	sei();&lt;br /&gt;
&lt;br /&gt;
	setLed(0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/* ***********************************************************************************&lt;br /&gt;
&lt;br /&gt;
	2ms Timer Interupt&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
ISR(TIMER1_COMPA_vect)&lt;br /&gt;
{&lt;br /&gt;
	unsigned char i;&lt;br /&gt;
	static unsigned char buttonCount;&lt;br /&gt;
	static signed char blinkCount; &lt;br /&gt;
&lt;br /&gt;
	// LED blinker &lt;br /&gt;
	if(--blinkCount&amp;lt;=0)&lt;br /&gt;
	{	&lt;br /&gt;
		blinkCount=40;&lt;br /&gt;
		blinker++;&lt;br /&gt;
		if(button)&lt;br /&gt;
		{&lt;br /&gt;
			if(button&amp;lt;10)&lt;br /&gt;
				button++;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Button debouncer &lt;br /&gt;
	if(BUTTON)&lt;br /&gt;
	{	// down &lt;br /&gt;
		if(buttonCount &amp;lt; 10)&lt;br /&gt;
		{&lt;br /&gt;
			buttonCount++;&lt;br /&gt;
			if(buttonCount==10)&lt;br /&gt;
			{&lt;br /&gt;
				button=1;&lt;br /&gt;
				blinkCount=40;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	else &lt;br /&gt;
	{	// up &lt;br /&gt;
		if(buttonCount &amp;gt; 0)&lt;br /&gt;
		{&lt;br /&gt;
			buttonCount--;&lt;br /&gt;
			if(buttonCount==0)&lt;br /&gt;
				button=0;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	// Gate 5 timing (clock output) &lt;br /&gt;
	clocker++;&lt;br /&gt;
	if(gate5off)&lt;br /&gt;
	{&lt;br /&gt;
		--gate5off;&lt;br /&gt;
		if(gate5off==0)&lt;br /&gt;
			gate_off(5);	&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// activ sense &lt;br /&gt;
	if(watchTicker)&lt;br /&gt;
	{&lt;br /&gt;
		watchTicker--;&lt;br /&gt;
		if(watchTicker==0)&lt;br /&gt;
			resetAll(); &lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// retrigger timing &lt;br /&gt;
	for(i=0;i&amp;lt;NUM_CV;i++)&lt;br /&gt;
	{&lt;br /&gt;
		if(cv_out[i].gateDipper)&lt;br /&gt;
		{&lt;br /&gt;
			--cv_out[i].gateDipper;&lt;br /&gt;
			if(cv_out[i].gateDipper==0)&lt;br /&gt;
				gate_on(i);&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/* ***********************************************************************************&lt;br /&gt;
&lt;br /&gt;
	Eval Midi Data&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
#define NOTE_ON         0x90		// Midi note on message &lt;br /&gt;
#define NOTE_OFF        0x80		// Midi note off message &lt;br /&gt;
#define PITCH           0xE0		// pitch bender&lt;br /&gt;
#define AFTERTOUCH      0xD0        // after touch command (unused) &lt;br /&gt;
#define CC		        0xB0        // Continuous Controller&lt;br /&gt;
#define CHAN_PRES	    0xD0        // Channel Pressure (unused)&lt;br /&gt;
#define SONG_POSITION_POINTER 0xF2	// used for clock synchronization (first beat) &lt;br /&gt;
#define SYSEX 			0xF0		// System exclusive beginn&lt;br /&gt;
#define SYSEND			0xF7		// System exclusive end&lt;br /&gt;
&lt;br /&gt;
struct {&lt;br /&gt;
	unsigned char runningStatus;	// Midi runnig status (*)&lt;br /&gt;
	unsigned char msgByteCnt;    	// number of current midi-message byte received &lt;br /&gt;
	unsigned char byte1;			// first data byte &lt;br /&gt;
	unsigned char syxAdr; 			// Sys-Ex Adress Byte&lt;br /&gt;
	unsigned char startStop;		// current  Midi Start/Stop Status&lt;br /&gt;
	unsigned char startFlag;		// Start on next clock&lt;br /&gt;
	unsigned char clockTick;		// counter for clock division&lt;br /&gt;
	unsigned char channel;			// channel of current midi-command (relative, e.g. 0..3 ) &lt;br /&gt;
	unsigned char syncStartFlag;	// start on next 1 &lt;br /&gt;
}midi; &lt;br /&gt;
// 	(*) running status is also used as &amp;#039;current status&amp;#039; - it remembers allways, what next data byte is for. Or its zero, than data is ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#define FRAMING_ERROR (1&amp;lt;&amp;lt;FE0)&lt;br /&gt;
#define PARITY_ERROR (1&amp;lt;&amp;lt;UPE0)&lt;br /&gt;
#define DATA_OVERRUN (1&amp;lt;&amp;lt;DOR0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// USART Receiver interrupt service routine, &lt;br /&gt;
// complete midi processing is done here, as the CPU is fast enough to &lt;br /&gt;
// do everything before next midi byte can come in. &lt;br /&gt;
ISR(USART_RX_vect) &lt;br /&gt;
{&lt;br /&gt;
	unsigned char status,byte;&lt;br /&gt;
&lt;br /&gt;
    status = UCSR0A;&lt;br /&gt;
    byte   = UDR0;&lt;br /&gt;
&lt;br /&gt;
    if ((status &amp;amp; (FRAMING_ERROR | PARITY_ERROR | DATA_OVERRUN))==0 )&lt;br /&gt;
	{&lt;br /&gt;
		if(watchTicker)			// if there had been an active sense &lt;br /&gt;
			watchTicker=160;	// every byte is ok, to see that cable is still plugged in &lt;br /&gt;
&lt;br /&gt;
		if (byte &amp;gt; 0x7F)	                // if command byte (MSB set)&lt;br /&gt;
		{&lt;br /&gt;
			if(byte&amp;gt;= 0xF8)  				// if real-time msg &lt;br /&gt;
			{&lt;br /&gt;
				switch (byte)&lt;br /&gt;
				{&lt;br /&gt;
					case 0xF8: 	// Clock &lt;br /&gt;
					{&lt;br /&gt;
						if(midi.startFlag)  // synchronized start &lt;br /&gt;
						{&lt;br /&gt;
							midi.startStop=1;&lt;br /&gt;
							midi.startFlag=0;&lt;br /&gt;
							midi.syncStartFlag=1;&lt;br /&gt;
							midi.clockTick=0;&lt;br /&gt;
							gate_on(4);&lt;br /&gt;
						}&lt;br /&gt;
						else if(midi.startStop)	// running &lt;br /&gt;
						{&lt;br /&gt;
							++spp;&lt;br /&gt;
							++barTick;&lt;br /&gt;
							if(barTick &amp;gt;= ticksPerBar)&lt;br /&gt;
								barTick=0; &lt;br /&gt;
						}&lt;br /&gt;
						++midi.clockTick; &lt;br /&gt;
						if(midi.clockTick &amp;gt;= config.clockDivider)	// clock output &lt;br /&gt;
						{&lt;br /&gt;
							midi.clockTick=0;&lt;br /&gt;
							gate_on(5);&lt;br /&gt;
							gate5off=clocker&amp;gt;&amp;gt;1; // pulse-width == half of a midi clock &lt;br /&gt;
						}&lt;br /&gt;
&lt;br /&gt;
						if(midi.syncStartFlag &amp;amp;&amp;amp; barTick==0 &amp;amp;&amp;amp; midi.startStop ) // synchronize clock out to bars   &lt;br /&gt;
						{	&lt;br /&gt;
							midi.clockTick=0;&lt;br /&gt;
							gate_on(5);&lt;br /&gt;
							gate5off=clocker&amp;gt;&amp;gt;1;&lt;br /&gt;
							midi.syncStartFlag=0;&lt;br /&gt;
						}&lt;br /&gt;
						clocker=0;  // restart midi clock pulse width counter. &lt;br /&gt;
						break;&lt;br /&gt;
					}&lt;br /&gt;
					case 0xF9:	// Tick&lt;br /&gt;
						break; &lt;br /&gt;
					case 0xFA: 	// Start &lt;br /&gt;
						spp=0;&lt;br /&gt;
						barTick=0;&lt;br /&gt;
						midi.startFlag=1;&lt;br /&gt;
						break;&lt;br /&gt;
					case 0xFB:	// Continue&lt;br /&gt;
						midi.startFlag=1;&lt;br /&gt;
						break; &lt;br /&gt;
					case 0xFC:	// Stop&lt;br /&gt;
						midi.startStop=0;&lt;br /&gt;
						gate_off(4);&lt;br /&gt;
						break;&lt;br /&gt;
					case 0xFD:	// unassigned &lt;br /&gt;
						break; &lt;br /&gt;
					case 0xFE:	//  Active Sense&lt;br /&gt;
						watchTicker=160;&lt;br /&gt;
						break;&lt;br /&gt;
					case 0xFF:	// Reset&lt;br /&gt;
						break; &lt;br /&gt;
				}&lt;br /&gt;
				return ; &lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
			if(byte &amp;gt;= 0xF0) 					// if System Common Category message&lt;br /&gt;
			{&lt;br /&gt;
				if(byte == SYSEX)&lt;br /&gt;
				{&lt;br /&gt;
					midi.runningStatus=byte;&lt;br /&gt;
					midi.msgByteCnt = 0;&lt;br /&gt;
					return;&lt;br /&gt;
				}&lt;br /&gt;
				else if(byte==SYSEND)&lt;br /&gt;
				{&lt;br /&gt;
					if(midi.runningStatus==SYSEX &amp;amp;&amp;amp; midi.msgByteCnt==6) 	&lt;br /&gt;
						setSyx(midi.syxAdr, midi.byte1); &lt;br /&gt;
					midi.msgByteCnt = 0;&lt;br /&gt;
				}&lt;br /&gt;
				else if(byte ==SONG_POSITION_POINTER)&lt;br /&gt;
				{&lt;br /&gt;
					midi.runningStatus=byte;  &lt;br /&gt;
					midi.msgByteCnt = 0;&lt;br /&gt;
					return ; &lt;br /&gt;
				}	&lt;br /&gt;
				midi.runningStatus = 0;&lt;br /&gt;
				return ; &lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			midi.runningStatus = 0;				// just new status messages left, so running status is lost&lt;br /&gt;
&lt;br /&gt;
			// only channel messages left here ... &lt;br /&gt;
			if(learn)&lt;br /&gt;
			{&lt;br /&gt;
				if(config.midiChannel != (byte&amp;amp;0xf)) // if message channel not current channel&lt;br /&gt;
				{&lt;br /&gt;
					config.midiChannel=byte&amp;amp;0xf;	// assign channel &lt;br /&gt;
					setEeWrite(); 					// and store it &lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			midi.channel=(byte &amp;amp; 0xf)-config.midiChannel ;&lt;br /&gt;
			if ( midi.channel&amp;lt;config.numMidiChannels)   // if MIDI channel matches,&lt;br /&gt;
			{&lt;br /&gt;
				midi.runningStatus = byte &amp;amp; 0xF0 ;		// set running status (==Midi command w/o channel)&lt;br /&gt;
				midi.msgByteCnt = 0;&lt;br /&gt;
				return ; &lt;br /&gt;
			}&lt;br /&gt;
			return ; &lt;br /&gt;
		}&lt;br /&gt;
		else&lt;br /&gt;
		{&lt;br /&gt;
			switch (midi.runningStatus)		    // last command byte (or zero, if data is not for us) &lt;br /&gt;
			{&lt;br /&gt;
			case SONG_POSITION_POINTER:&lt;br /&gt;
				if(midi.msgByteCnt)	// 2nd Byte&lt;br /&gt;
				{&lt;br /&gt;
					spp= (((int)byte &amp;lt;&amp;lt; 7 ) | midi.byte1) * 6;&lt;br /&gt;
					barTick = spp % (unsigned int) ticksPerBar; &lt;br /&gt;
					midi.runningStatus=0;&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					midi.byte1 = byte;&lt;br /&gt;
					midi.msgByteCnt=1;&lt;br /&gt;
				}&lt;br /&gt;
				break;&lt;br /&gt;
			case (NOTE_ON):					// if we&amp;#039;ve had a note on byte&lt;br /&gt;
				if (midi.msgByteCnt)		// if counter = 1&lt;br /&gt;
				{ 			   				// then we&amp;#039;ve just received a velocity byte&lt;br /&gt;
					midi.msgByteCnt = 0;	// msg complete - clear byte count &lt;br /&gt;
					if (byte == 0)			// is it a note off (velo = 0) ?&lt;br /&gt;
						note_off(midi.byte1,byte,midi.channel);  &lt;br /&gt;
					else 					// NOTE ON&lt;br /&gt;
					{&lt;br /&gt;
						if(learn)&lt;br /&gt;
						{&lt;br /&gt;
							config.noteOffset=midi.byte1;&lt;br /&gt;
							setEeWrite();&lt;br /&gt;
						}&lt;br /&gt;
						&lt;br /&gt;
						note_on(midi.byte1, byte,midi.channel);  // ... and do what the note on has told us &lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
				else						// first data byte &lt;br /&gt;
				{&lt;br /&gt;
					midi.byte1 = byte;		// save it &lt;br /&gt;
					midi.msgByteCnt = 1;    // set counter to get 2nd data byte&lt;br /&gt;
				}&lt;br /&gt;
				break;&lt;br /&gt;
			case (NOTE_OFF): 	        	// if we&amp;#039;ve had a note off byte&lt;br /&gt;
				if (midi.msgByteCnt)	 	// is second data byte ? &lt;br /&gt;
				{ 					 	&lt;br /&gt;
					midi.msgByteCnt = 0;	// clear byte count&lt;br /&gt;
					note_off(midi.byte1,byte,midi.channel); // switch note off&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					midi.byte1 = byte;&lt;br /&gt;
					midi.msgByteCnt = 1; 	// set counter to get 2nd byte&lt;br /&gt;
				}&lt;br /&gt;
				break;&lt;br /&gt;
			case (PITCH):		        	// PITCH BEND command&lt;br /&gt;
				if (midi.msgByteCnt)   	 	// second data byte (MSB) &lt;br /&gt;
				{ 						&lt;br /&gt;
					int v;&lt;br /&gt;
					v=byte;&lt;br /&gt;
					v&amp;lt;&amp;lt;=6;&lt;br /&gt;
					v|=midi.byte1;&lt;br /&gt;
					v-=0x2000;&lt;br /&gt;
					setPb(v,midi.channel);&lt;br /&gt;
&lt;br /&gt;
					midi.msgByteCnt = 0;	 // clear byte count&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					midi.byte1 = byte;&lt;br /&gt;
					midi.msgByteCnt = 1;  	// set counter to get next byte&lt;br /&gt;
					return;&lt;br /&gt;
				}&lt;br /&gt;
				break;&lt;br /&gt;
			case (CC):	             		// Continuous Controller Message &lt;br /&gt;
				if (midi.msgByteCnt)		// if we&amp;#039;ve had first byte&lt;br /&gt;
				{&lt;br /&gt;
					midi.msgByteCnt = 0;	// clear byte count&lt;br /&gt;
&lt;br /&gt;
					if(learn)&lt;br /&gt;
					{&lt;br /&gt;
						config.cvMidiCC[3]=midi.byte1;&lt;br /&gt;
						setEeWrite();&lt;br /&gt;
					}&lt;br /&gt;
&lt;br /&gt;
					setCC(midi.byte1, byte,midi.channel);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
				  midi.byte1 = byte;&lt;br /&gt;
				  midi.msgByteCnt = 1; 	 // set counter ready to get 3rd byte&lt;br /&gt;
				  return; &lt;br /&gt;
				}&lt;br /&gt;
				break;&lt;br /&gt;
	//		case (CHAN_PRES):	         // if channel pressure command&lt;br /&gt;
	//			channel_pressure (byte); // set Aftertouch &lt;br /&gt;
			case SYSEX:&lt;br /&gt;
				midi.msgByteCnt++;&lt;br /&gt;
				switch(midi.msgByteCnt)&lt;br /&gt;
				{&lt;br /&gt;
					case 1:	// Manufactorer &lt;br /&gt;
						if(byte==0x70)&lt;br /&gt;
							;&lt;br /&gt;
						else &lt;br /&gt;
							midi.msgByteCnt=0;&lt;br /&gt;
						break; &lt;br /&gt;
					case 2:	// Unit - ID &lt;br /&gt;
						if(byte==0x7D)&lt;br /&gt;
							;&lt;br /&gt;
						else &lt;br /&gt;
							midi.msgByteCnt=0;&lt;br /&gt;
						break; &lt;br /&gt;
					case 3:	// Midi-Adress (ignored!)&lt;br /&gt;
						if(byte&amp;lt;0x10)&lt;br /&gt;
							;&lt;br /&gt;
						else &lt;br /&gt;
							midi.msgByteCnt=0;				&lt;br /&gt;
						break;&lt;br /&gt;
					case 4:	// adress byte&lt;br /&gt;
						midi.syxAdr=byte;&lt;br /&gt;
						break;&lt;br /&gt;
					case 5:	// high data nibble &lt;br /&gt;
						if(byte&amp;lt;0x10)&lt;br /&gt;
						{&lt;br /&gt;
							midi.byte1=(byte&amp;lt;&amp;lt;4);&lt;br /&gt;
						}&lt;br /&gt;
						else &lt;br /&gt;
							midi.msgByteCnt=0;				&lt;br /&gt;
						break;&lt;br /&gt;
					case 6: // low data nibble &lt;br /&gt;
						if(byte&amp;lt;0x10)&lt;br /&gt;
						{&lt;br /&gt;
							midi.byte1 |= byte;&lt;br /&gt;
						}&lt;br /&gt;
						else &lt;br /&gt;
							midi.msgByteCnt=0;				&lt;br /&gt;
						break;&lt;br /&gt;
					default:	// not our framing &lt;br /&gt;
						midi.msgByteCnt=0;&lt;br /&gt;
						break;&lt;br /&gt;
				}&lt;br /&gt;
				if(midi.msgByteCnt==0)	// something did not fit &lt;br /&gt;
					midi.runningStatus=0;&lt;br /&gt;
				break;&lt;br /&gt;
			case 0: // bnwtko (bytes no one wants to know off ) &lt;br /&gt;
				return ;&lt;br /&gt;
			default:&lt;br /&gt;
				break;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fetz</name></author>
	</entry>
</feed>