<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>peterkevindavis.com &#187; Electronics</title>
	<atom:link href="http://peterkevindavis.com/archives/category/electronics/feed" rel="self" type="application/rss+xml" />
	<link>http://peterkevindavis.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sun, 08 Aug 2010 12:06:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Building A Guitar Amp &#8211; Part 2</title>
		<link>http://peterkevindavis.com/archives/103</link>
		<comments>http://peterkevindavis.com/archives/103#comments</comments>
		<pubDate>Sun, 22 Mar 2009 10:20:46 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Electronics]]></category>

		<guid isPermaLink="false">http://peterkevindavis.com/?p=103</guid>
		<description><![CDATA[Finally, after breathing in too many solder fumes, i have finished building these two kits. Not much to say, it was pretty easy. Here are a couple of photos Next thing is to buy the transformer, and set this thing up. Hopefully i don&#8217;t have to spend hours debugging!]]></description>
			<content:encoded><![CDATA[<p>Finally, after breathing in too many solder fumes, i have finished building these two kits. Not much to say, it was pretty easy. Here are a couple of photos</p>

<div class="ngg-galleryoverview" id="ngg-gallery-4-103">


	<!-- Piclense link -->
	<div class="piclenselink">
		<a class="piclenselink" href="javascript:PicLensLite.start({feedUrl:'http://peterkevindavis.com/blog/wp-content/plugins/nextgen-gallery/xml/media-rss.php?gid=4&amp;mode=gallery'});">
			[View with PicLens]		</a>
	</div>
	
	<!-- Thumbnails -->
		
	<div id="ngg-image-79" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://peterkevindavis.com/blog/wp-content/gallery/amp70w/dsc00095.jpg" title=" " class="shutterset_set_4" >
								<img title="dsc00095.jpg" alt="dsc00095.jpg" src="http://peterkevindavis.com/blog/wp-content/gallery/amp70w/thumbs/thumbs_dsc00095.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-76" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://peterkevindavis.com/blog/wp-content/gallery/amp70w/dsc00101.jpg" title=" " class="shutterset_set_4" >
								<img title="dsc00101.jpg" alt="dsc00101.jpg" src="http://peterkevindavis.com/blog/wp-content/gallery/amp70w/thumbs/thumbs_dsc00101.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-78" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://peterkevindavis.com/blog/wp-content/gallery/amp70w/dsc00098.jpg" title=" " class="shutterset_set_4" >
								<img title="dsc00098.jpg" alt="dsc00098.jpg" src="http://peterkevindavis.com/blog/wp-content/gallery/amp70w/thumbs/thumbs_dsc00098.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-77" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://peterkevindavis.com/blog/wp-content/gallery/amp70w/dsc00100.jpg" title=" " class="shutterset_set_4" >
								<img title="dsc00100.jpg" alt="dsc00100.jpg" src="http://peterkevindavis.com/blog/wp-content/gallery/amp70w/thumbs/thumbs_dsc00100.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-75" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://peterkevindavis.com/blog/wp-content/gallery/amp70w/dsc00102.jpg" title=" " class="shutterset_set_4" >
								<img title="dsc00102.jpg" alt="dsc00102.jpg" src="http://peterkevindavis.com/blog/wp-content/gallery/amp70w/thumbs/thumbs_dsc00102.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 	 	
	<!-- Pagination -->
 	<div class='ngg-clear'></div>
 	
</div>


<p>Next thing is to buy the transformer, and set this thing up. Hopefully i don&#8217;t have to spend hours debugging!</p>
]]></content:encoded>
			<wfw:commentRss>http://peterkevindavis.com/archives/103/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building A Guitar Amp &#8211; Part 1</title>
		<link>http://peterkevindavis.com/archives/92</link>
		<comments>http://peterkevindavis.com/archives/92#comments</comments>
		<pubDate>Sat, 28 Feb 2009 12:20:35 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Electronics]]></category>

		<guid isPermaLink="false">http://peterkevindavis.com/blog/?p=92</guid>
		<description><![CDATA[The aim of this project was to build a simple, cheap guitar amplifier. I wanted to build an amp for around $200 without having to spend months designing it. Given these constraints i still wanted to build an amp that would shake the walls, oh and have atleast one or more tubes. Just for fun. [...]]]></description>
			<content:encoded><![CDATA[<p>The aim of this project was to build a simple, cheap guitar amplifier. I wanted to build an amp for around $200 without having to spend months designing it. Given these constraints i still wanted to build an amp that would shake the walls, oh and have atleast one or more tubes. Just for fun.</p>
<p>First was a trip to the local electronics store to see what i could get. Ended up coming out with a couple of kits and a heatsink.</p>
<p><strong>Power Supply</strong></p>
<p>The power supply is a simple kit from Jaycar &#8211; <a href="http://www.jaycar.com.au/productView.asp?ID=KC5347&amp;keywords=power+supply+kit&amp;form=KEYWORD" target="_blank">Power Supply Kit to suit SC-480</a>. What i liked about this was that not only did it have +/- 40V rails for the power amp, it also has +/- 15V for powering a preamp. Perfect.</p>
<p style="text-align: center;"><img class="aligncenter" title="Power Supply" src="http://www.jaycar.com.au/products_uploaded/productLarge_6499.jpg" alt="" width="200" height="200" /></p>
<p>The only downside to this supply was the massive transformer it needs &#8211;      <a href="http://www.jaycar.com.au/productView.asp?ID=MM1095&amp;keywords=MM-1095&amp;form=KEYWORD" target="_blank"><span class="type">56V CT 134VA TRANSFORMER &#8211; 2.4A CENTRE TAPPED </span></a></p>
<p style="text-align: center;"><strong><span class="type"><img class="aligncenter" title="transformer" src="http://www.jaycar.com.au/products_uploaded/productLarge_6468.jpg" alt="" width="200" height="200" /></span></strong></p>
<p><strong>Power Amp</strong></p>
<p>The power amp i went for was the &#8211; <a href="http://www.jaycar.com.au/productView.asp?ID=KC5345&amp;keywords=sc+480&amp;form=KEYWORD" target="_blank">SC-480 50W Amplifier</a></p>
<p>It just so hapened that the power supply was specifically designed for this amp. Bonus. The amp specs state that this is a 50W amp into 8ohms, but 70W into 4ohms which is how i will be running it, i think 70W is more than enough to shake the walls. I decided on a solid state power amp for ease of building and the fact that it was cheap.</p>
<p>The amp has low distortion and a good frequency range. Although all this means nothing to a guitar amp, so the desired sound will hopefully come from a well designed pre amp.</p>
<p>Again, the only downside i could see was that it needed a massive heatsink &#8211; <a href="http://www.jaycar.com.au/productView.asp?ID=HH8555&amp;keywords=8555&amp;form=KEYWORD" target="_blank">Black Heatsink &#8211; DIECAST</a></p>
<p style="text-align: center;"><strong></strong><strong><img class="aligncenter" title="heatsink" src="http://www.jaycar.com.au/products_uploaded/productLarge_6496.jpg" alt="" width="200" height="200" /></strong></p>
<p style="text-align: left;"><strong>Assembly</strong></p>
<p style="text-align: left;">This is as far as i have come with the amp so far. Been thinking about cabinet and speaker design aswel as pre amp design. But for the time being i am assembling these two kits and researching the rest. More details will be posted soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://peterkevindavis.com/archives/92/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino Synth &#8211; Part 2</title>
		<link>http://peterkevindavis.com/archives/79</link>
		<comments>http://peterkevindavis.com/archives/79#comments</comments>
		<pubDate>Sat, 22 Nov 2008 05:15:18 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Electronics]]></category>

		<guid isPermaLink="false">http://peterkevindavis.com/blog/?p=79</guid>
		<description><![CDATA[I have recieved my board in the mail and after a few hours testing the code out i almost have it working as i would like. You can see the updated code below, hopefully it is cleaner, tried to tidy it up as much as possible. Also now use a pointer in the output (table) [...]]]></description>
			<content:encoded><![CDATA[<p>I have recieved my board in the mail and after a few hours testing the code out i almost have it working as i would like. You can see the updated code below, hopefully it is cleaner, tried to tidy it up as much as possible. Also now use a pointer in the output (table) rather than testing the shape of the wave every time a sample is outputted, this should speed up the Timer_ISR  quite a lot</p>
<p>Read more for code</p>
<p><span id="more-79"></span></p>
<blockquote><p>/*<br />
COMAND STRUCTURE<br />
Single byte commands are received by the arduino</p>
<p>byte structure: xxyy zzzz</p>
<p>: xx bits &#8211; octave<br />
: yy bits &#8211; wave shape<br />
: zz bits &#8211; note</p>
<p>*/<br />
#include &#8220;TimerOne.h&#8221;<br />
#include &lt;avr/pgmspace.h&gt;</p>
<p>prog_uchar SINE_TABLE[] PROGMEM=<br />
{<br />
0&#215;80,0&#215;83,0&#215;86,0&#215;89,0x8c,0x8f,0&#215;92,0&#215;95,0&#215;98,0x9c,0x9f,0xa2,0xa5,0xa8,0xab,0xae,<br />
0xb0,0xb3,0xb6,0xb9,0xbc,0xbf,0xc1,0xc4,0xc7,0xc9,0xcc,0xce,0xd1,0xd3,0xd5,0xd8,<br />
0xda,0xdc,0xde,0xe0,0xe2,0xe4,0xe6,0xe8,0xea,0xec,0xed,0xef,0xf0,0xf2,0xf3,0xf5,<br />
0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,0xfc,0xfc,0xfd,0xfe,0xfe,0xff,0xff,0xff,0xff,0xff,<br />
0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xfe,0xfd,0xfc,0xfc,0xfb,0xfa,0xf9,0xf8,0xf7,<br />
0xf6,0xf5,0xf3,0xf2,0xf0,0xef,0xed,0xec,0xea,0xe8,0xe6,0xe4,0xe2,0xe0,0xde,0xdc,<br />
0xda,0xd8,0xd5,0xd3,0xd1,0xce,0xcc,0xc9,0xc7,0xc4,0xc1,0xbf,0xbc,0xb9,0xb6,0xb3,<br />
0xb0,0xae,0xab,0xa8,0xa5,0xa2,0x9f,0x9c,0&#215;98,0&#215;95,0&#215;92,0x8f,0x8c,0&#215;89,0&#215;86,0&#215;83,<br />
0&#215;80,0x7c,0&#215;79,0&#215;76,0&#215;73,0&#215;70,0x6d,0x6a,0&#215;67,0&#215;63,0&#215;60,0x5d,0x5a,0&#215;57,0&#215;54,0&#215;51,<br />
0x4f,0x4c,0&#215;49,0&#215;46,0&#215;43,0&#215;40,0x3e,0x3b,0&#215;38,0&#215;36,0&#215;33,0&#215;31,0x2e,0x2c,0x2a,0&#215;27,<br />
0&#215;25,0&#215;23,0&#215;21,0x1f,0x1d,0x1b,0&#215;19,0&#215;17,0&#215;15,0&#215;13,0&#215;12,0&#215;10,0x0f,0x0d,0x0c,0x0a,<br />
0&#215;09,0&#215;08,0&#215;07,0&#215;06,0&#215;05,0&#215;04,0&#215;03,0&#215;03,0&#215;02,0&#215;01,0&#215;01,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,<br />
0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;01,0&#215;01,0&#215;02,0&#215;03,0&#215;03,0&#215;04,0&#215;05,0&#215;06,0&#215;07,0&#215;08,<br />
0&#215;09,0x0a,0x0c,0x0d,0x0f,0&#215;10,0&#215;12,0&#215;13,0&#215;15,0&#215;17,0&#215;19,0x1b,0x1d,0x1f,0&#215;21,0&#215;23,<br />
0&#215;25,0&#215;27,0x2a,0x2c,0x2e,0&#215;31,0&#215;33,0&#215;36,0&#215;38,0x3b,0x3e,0&#215;40,0&#215;43,0&#215;46,0&#215;49,0x4c,<br />
0x4f,0&#215;51,0&#215;54,0&#215;57,0x5a,0x5d,0&#215;60,0&#215;63,0&#215;67,0x6a,0x6d,0&#215;70,0&#215;73,0&#215;76,0&#215;79,0x7c<br />
};</p>
<p>prog_uchar SAW_TABLE[] PROGMEM=<br />
{<br />
0&#215;00,0&#215;01,0&#215;02,0&#215;03,0&#215;04,0&#215;05,0&#215;06,0&#215;07,0&#215;08,0&#215;09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,<br />
0&#215;10,0&#215;11,0&#215;12,0&#215;13,0&#215;14,0&#215;15,0&#215;16,0&#215;17,0&#215;18,0&#215;19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,<br />
0&#215;20,0&#215;21,0&#215;22,0&#215;23,0&#215;24,0&#215;25,0&#215;26,0&#215;27,0&#215;28,0&#215;29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,<br />
0&#215;30,0&#215;31,0&#215;32,0&#215;33,0&#215;34,0&#215;35,0&#215;36,0&#215;37,0&#215;38,0&#215;39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,<br />
0&#215;40,0&#215;41,0&#215;42,0&#215;43,0&#215;44,0&#215;45,0&#215;46,0&#215;47,0&#215;48,0&#215;49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,<br />
0&#215;50,0&#215;51,0&#215;52,0&#215;53,0&#215;54,0&#215;55,0&#215;56,0&#215;57,0&#215;58,0&#215;59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f,<br />
0&#215;60,0&#215;61,0&#215;62,0&#215;63,0&#215;64,0&#215;65,0&#215;66,0&#215;67,0&#215;68,0&#215;69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,<br />
0&#215;70,0&#215;71,0&#215;72,0&#215;73,0&#215;74,0&#215;75,0&#215;76,0&#215;77,0&#215;78,0&#215;79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f,<br />
0&#215;80,0&#215;81,0&#215;82,0&#215;83,0&#215;84,0&#215;85,0&#215;86,0&#215;87,0&#215;88,0&#215;89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,<br />
0&#215;90,0&#215;91,0&#215;92,0&#215;93,0&#215;94,0&#215;95,0&#215;96,0&#215;97,0&#215;98,0&#215;99,0x9a,0x9b,0x9c,0x9d,0x9e,0x9f,<br />
0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,<br />
0xb0,0xb1,0xb2,0xb3,0xb4,0xb5,0xb6,0xb7,0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0xbe,0xbf,<br />
0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,<br />
0xd0,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda,0xdb,0xdc,0xdd,0xde,0xdf,<br />
0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,0xeb,0xec,0xed,0xee,0xef,<br />
0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff<br />
};</p>
<p>prog_uchar SQUARE_TABLE[] PROGMEM=<br />
{<br />
0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,<br />
0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,<br />
0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,<br />
0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,<br />
0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,<br />
0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,<br />
0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,<br />
0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,<br />
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,<br />
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,<br />
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,<br />
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,<br />
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,<br />
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,<br />
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,<br />
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff<br />
};</p>
<p>prog_uchar TRIANGLE_TABLE[] PROGMEM=<br />
{<br />
0&#215;00,0&#215;02,0&#215;04,0&#215;06,0&#215;08,0x0a,0x0c,0x0e,0&#215;10,0&#215;12,0&#215;14,0&#215;16,0&#215;18,0x1a,0x1c,0x1e,<br />
0&#215;20,0&#215;22,0&#215;24,0&#215;26,0&#215;28,0x2a,0x2c,0x2e,0&#215;30,0&#215;32,0&#215;34,0&#215;36,0&#215;38,0x3a,0x3c,0x3e,<br />
0&#215;40,0&#215;42,0&#215;44,0&#215;46,0&#215;48,0x4a,0x4c,0x4e,0&#215;50,0&#215;52,0&#215;54,0&#215;56,0&#215;58,0x5a,0x5c,0x5e,<br />
0&#215;60,0&#215;62,0&#215;64,0&#215;66,0&#215;68,0x6a,0x6c,0x6e,0&#215;70,0&#215;72,0&#215;74,0&#215;76,0&#215;78,0x7a,0x7c,0x7e,<br />
0&#215;80,0&#215;82,0&#215;84,0&#215;86,0&#215;88,0x8a,0x8c,0x8e,0&#215;90,0&#215;92,0&#215;94,0&#215;96,0&#215;98,0x9a,0x9c,0x9e,<br />
0xa0,0xa2,0xa4,0xa6,0xa8,0xaa,0xac,0xae,0xb0,0xb2,0xb4,0xb6,0xb8,0xba,0xbc,0xbe,<br />
0xc0,0xc2,0xc4,0xc6,0xc8,0xca,0xcc,0xce,0xd0,0xd2,0xd4,0xd6,0xd8,0xda,0xdc,0xde,<br />
0xe0,0xe2,0xe4,0xe6,0xe8,0xea,0xec,0xee,0xf0,0xf2,0xf4,0xf6,0xf8,0xfa,0xfc,0xfe,<br />
0xff,0xfd,0xfb,0xf9,0xf7,0xf5,0xf3,0xf1,0xef,0xef,0xeb,0xe9,0xe7,0xe5,0xe3,0xe1,<br />
0xdf,0xdd,0xdb,0xd9,0xd7,0xd5,0xd3,0xd1,0xcf,0xcf,0xcb,0xc9,0xc7,0xc5,0xc3,0xc1,<br />
0xbf,0xbd,0xbb,0xb9,0xb7,0xb5,0xb3,0xb1,0xaf,0xaf,0xab,0xa9,0xa7,0xa5,0xa3,0xa1,<br />
0x9f,0x9d,0x9b,0&#215;99,0&#215;97,0&#215;95,0&#215;93,0&#215;91,0x8f,0x8f,0x8b,0&#215;89,0&#215;87,0&#215;85,0&#215;83,0&#215;81,<br />
0x7f,0x7d,0x7b,0&#215;79,0&#215;77,0&#215;75,0&#215;73,0&#215;71,0x6f,0x6f,0x6b,0&#215;69,0&#215;67,0&#215;65,0&#215;63,0&#215;61,<br />
0x5f,0x5d,0x5b,0&#215;59,0&#215;57,0&#215;55,0&#215;53,0&#215;51,0x4f,0x4f,0x4b,0&#215;49,0&#215;47,0&#215;45,0&#215;43,0&#215;41,<br />
0x3f,0x3d,0x3b,0&#215;39,0&#215;37,0&#215;35,0&#215;33,0&#215;31,0x2f,0x2f,0x2b,0&#215;29,0&#215;27,0&#215;25,0&#215;23,0&#215;21,<br />
0x1f,0x1d,0x1b,0&#215;19,0&#215;17,0&#215;15,0&#215;13,0&#215;11,0x0f,0x0f,0x0b,0&#215;09,0&#215;07,0&#215;05,0&#215;03,0&#215;01<br />
};</p>
<p>byte *table;<br />
byte key;<br />
byte x1;<br />
//byte y0;<br />
//byte y1;<br />
//byte m;<br />
volatile unsigned int phase;<br />
volatile unsigned int phaseDelta;<br />
//unsigned int note[] = {<br />
//  0, 264,275,293.33,309.37,330,352,366.67,396,412.5,440.00,469.34,495};<br />
unsigned int note[] = {<br />
0, 131, 139, 147, 156, 165, 175, 185, 196, 208, 220, 233, 247 };</p>
<p>void setup()<br />
{<br />
//setup</p>
<p>//portd (dac) setup<br />
//portd uses digital pins 0 &#8211; 7<br />
DDRD = DDRD | B11111100; //bits 2 &#8211; 7<br />
DDRB = DDRB | B00000011; //bits 0 and 1</p>
<p>//timer setup for 16.384khz (61us)<br />
Timer1.initialize(61);<br />
Timer1.attachInterrupt(Timer_ISR);</p>
<p>//serial setup<br />
Serial.begin(9600);<br />
}</p>
<p>void loop()<br />
{<br />
byte xx;<br />
byte yy;<br />
byte zzzz;<br />
//main loop</p>
<p>if (Serial.available() &gt; 0)<br />
{<br />
key = Serial.read();    //get byte<br />
Serial.print(key,DEC);    //acknowledge byte</p>
<p>zzzz = key &amp; 0x0F;        //break byte into command<br />
key &gt;&gt;= 4;            //and its params<br />
yy = key &amp; 0&#215;03;<br />
key &gt;&gt;= 2;<br />
xx = key &amp;  0&#215;03;<br />
key = 0;</p>
<p>//delta = (SAMP / FREQ) * note<br />
//SAMP/FREQ = 4 which is the same as shift left 2 bits<br />
phaseDelta = (note[zzzz] &lt;&lt; 2) &lt;&lt; xx;</p>
<p>if (yy == 0)              //sine wave<br />
{<br />
table = SINE_TABLE;<br />
}<br />
else if (yy == 1)         //saw tooth<br />
{<br />
table = SAW_TABLE;<br />
}<br />
else if (yy == 2)         //square<br />
{<br />
table = SQUARE_TABLE;<br />
}<br />
else if (yy == 3)         //triangle<br />
{<br />
table = TRIANGLE_TABLE;<br />
}<br />
}<br />
}</p>
<p>void Timer_ISR()<br />
{<br />
//<br />
phase += phaseDelta;</p>
<p>x1 = pgm_read_byte_near(table+(phase&gt;&gt;8));</p>
<p>PORTD &amp;= 0&#215;03;<br />
PORTD |= x1 &amp; 0xFC;<br />
PORTB &amp;= 0xFC;<br />
PORTB |= x1 &amp; 0&#215;03;<br />
}</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://peterkevindavis.com/archives/79/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino Synth &#8211; Part 1</title>
		<link>http://peterkevindavis.com/archives/73</link>
		<comments>http://peterkevindavis.com/archives/73#comments</comments>
		<pubDate>Wed, 19 Nov 2008 11:21:26 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Electronics]]></category>

		<guid isPermaLink="false">http://peterkevindavis.com/blog/?p=73</guid>
		<description><![CDATA[I am currently in the process of writing a synth for the Arduino development board. The project started as a school project on an 8051 development board but i soon figured out that this was way to slow. I am building the synth from an Arduino board and an 8bit R-2R DAC (plenty of circuits [...]]]></description>
			<content:encoded><![CDATA[<p>I am currently in the process of writing a synth for the <a href="http://www.arduino.cc/" target="_blank">Arduino</a> development board. The project started as a school project on an 8051 development board but i soon figured out that this was way to slow. I am building the synth from an Arduino board and an 8bit R-2R DAC (plenty of circuits can be found at <a href="http://images.google.com.au/images?q=r2r%20ladder&amp;ie=UTF-8&amp;oe=utf-8&amp;rls=com.ubuntu:en-US:unofficial&amp;client=firefox-a&amp;um=1&amp;sa=N&amp;tab=wi" target="_blank">google</a>).</p>
<p><img src="file:///tmp/moz-screenshot.jpg" alt="" /><img src="file:///tmp/moz-screenshot-1.jpg" alt="" /><a href="http://www.arduino.cc/"><img class="alignright" title="arduino" src="http://static0.shopify.com/s/files/1/0001/7292/products/arduino_ng_medium.jpg" alt="" width="192" height="192" /></a></p>
<p>The synth is based on the <a href="http://en.wikipedia.org/wiki/Direct_digital_synthesis" target="_blank">Direct Digital Synthesis </a>method of producing waveforms digitally. I aim to get around 100Hz to ~4kHz operation out of it but im sure it is capable of frequencies up to around 50kHz. But this can be determined when the source has been verified and is working.</p>
<p>The source code for the Arduino has been written and attached below, but i have not verified it yet (my board is still in the mail). The DAC is intended to be connected to the Arduino board as follows:</p>
<p>Bit 0 (LSB)  : Digital Pin 8</p>
<p>Bit 1          : Digital Pin 9</p>
<p>Bit 2          : Digital Pin 2</p>
<p>Bit 3          : Digital Pin 3</p>
<p>Bit 4          : Digital Pin 4</p>
<p>Bit 5          : Digital Pin 5</p>
<p>Bit 6          : Digital Pin 6</p>
<p>Bit 7 (MSB) : Digital Pin 7</p>
<p>I will provide more information and results when my board arrives</p>
<p>The source can be found by reading more</p>
<p><span id="more-73"></span></p>
<blockquote><p>const byte SINE_TABLE[]=<br />
{<br />
0&#215;80,0&#215;83,0&#215;86,0&#215;89,0x8c,0x8f,0&#215;92,0&#215;95,0&#215;98,0x9c,0x9f,0xa2,0xa5,0xa8,0xab,0xae,<br />
0xb0,0xb3,0xb6,0xb9,0xbc,0xbf,0xc1,0xc4,0xc7,0xc9,0xcc,0xce,0xd1,0xd3,0xd5,0xd8,<br />
0xda,0xdc,0xde,0xe0,0xe2,0xe4,0xe6,0xe8,0xea,0xec,0xed,0xef,0xf0,0xf2,0xf3,0xf5,<br />
0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,0xfc,0xfc,0xfd,0xfe,0xfe,0xff,0xff,0xff,0xff,0xff,<br />
0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xfe,0xfd,0xfc,0xfc,0xfb,0xfa,0xf9,0xf8,0xf7,<br />
0xf6,0xf5,0xf3,0xf2,0xf0,0xef,0xed,0xec,0xea,0xe8,0xe6,0xe4,0xe2,0xe0,0xde,0xdc,<br />
0xda,0xd8,0xd5,0xd3,0xd1,0xce,0xcc,0xc9,0xc7,0xc4,0xc1,0xbf,0xbc,0xb9,0xb6,0xb3,<br />
0xb0,0xae,0xab,0xa8,0xa5,0xa2,0x9f,0x9c,0&#215;98,0&#215;95,0&#215;92,0x8f,0x8c,0&#215;89,0&#215;86,0&#215;83,<br />
0&#215;80,0x7c,0&#215;79,0&#215;76,0&#215;73,0&#215;70,0x6d,0x6a,0&#215;67,0&#215;63,0&#215;60,0x5d,0x5a,0&#215;57,0&#215;54,0&#215;51,<br />
0x4f,0x4c,0&#215;49,0&#215;46,0&#215;43,0&#215;40,0x3e,0x3b,0&#215;38,0&#215;36,0&#215;33,0&#215;31,0x2e,0x2c,0x2a,0&#215;27,<br />
0&#215;25,0&#215;23,0&#215;21,0x1f,0x1d,0x1b,0&#215;19,0&#215;17,0&#215;15,0&#215;13,0&#215;12,0&#215;10,0x0f,0x0d,0x0c,0x0a,<br />
0&#215;09,0&#215;08,0&#215;07,0&#215;06,0&#215;05,0&#215;04,0&#215;03,0&#215;03,0&#215;02,0&#215;01,0&#215;01,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,<br />
0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;01,0&#215;01,0&#215;02,0&#215;03,0&#215;03,0&#215;04,0&#215;05,0&#215;06,0&#215;07,0&#215;08,<br />
0&#215;09,0x0a,0x0c,0x0d,0x0f,0&#215;10,0&#215;12,0&#215;13,0&#215;15,0&#215;17,0&#215;19,0x1b,0x1d,0x1f,0&#215;21,0&#215;23,<br />
0&#215;25,0&#215;27,0x2a,0x2c,0x2e,0&#215;31,0&#215;33,0&#215;36,0&#215;38,0x3b,0x3e,0&#215;40,0&#215;43,0&#215;46,0&#215;49,0x4c,<br />
0x4f,0&#215;51,0&#215;54,0&#215;57,0x5a,0x5d,0&#215;60,0&#215;63,0&#215;67,0x6a,0x6d,0&#215;70,0&#215;73,0&#215;76,0&#215;79,0x7c<br />
};</p>
<p>const byte SAW_TABLE[]=<br />
{<br />
0&#215;00,0&#215;01,0&#215;02,0&#215;03,0&#215;04,0&#215;05,0&#215;06,0&#215;07,0&#215;08,0&#215;09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,<br />
0&#215;10,0&#215;11,0&#215;12,0&#215;13,0&#215;14,0&#215;15,0&#215;16,0&#215;17,0&#215;18,0&#215;19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,<br />
0&#215;20,0&#215;21,0&#215;22,0&#215;23,0&#215;24,0&#215;25,0&#215;26,0&#215;27,0&#215;28,0&#215;29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,<br />
0&#215;30,0&#215;31,0&#215;32,0&#215;33,0&#215;34,0&#215;35,0&#215;36,0&#215;37,0&#215;38,0&#215;39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,<br />
0&#215;40,0&#215;41,0&#215;42,0&#215;43,0&#215;44,0&#215;45,0&#215;46,0&#215;47,0&#215;48,0&#215;49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,<br />
0&#215;50,0&#215;51,0&#215;52,0&#215;53,0&#215;54,0&#215;55,0&#215;56,0&#215;57,0&#215;58,0&#215;59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f,<br />
0&#215;60,0&#215;61,0&#215;62,0&#215;63,0&#215;64,0&#215;65,0&#215;66,0&#215;67,0&#215;68,0&#215;69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,<br />
0&#215;70,0&#215;71,0&#215;72,0&#215;73,0&#215;74,0&#215;75,0&#215;76,0&#215;77,0&#215;78,0&#215;79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f,<br />
0&#215;80,0&#215;81,0&#215;82,0&#215;83,0&#215;84,0&#215;85,0&#215;86,0&#215;87,0&#215;88,0&#215;89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,<br />
0&#215;90,0&#215;91,0&#215;92,0&#215;93,0&#215;94,0&#215;95,0&#215;96,0&#215;97,0&#215;98,0&#215;99,0x9a,0x9b,0x9c,0x9d,0x9e,0x9f,<br />
0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,<br />
0xb0,0xb1,0xb2,0xb3,0xb4,0xb5,0xb6,0xb7,0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0xbe,0xbf,<br />
0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,<br />
0xd0,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda,0xdb,0xdc,0xdd,0xde,0xdf,<br />
0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,0xeb,0xec,0xed,0xee,0xef,<br />
0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff<br />
};</p>
<p>const byte SQUARE_TABLE[]=<br />
{<br />
0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,<br />
0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,<br />
0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,<br />
0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,<br />
0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,<br />
0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,<br />
0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,<br />
0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,0&#215;00,<br />
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,<br />
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,<br />
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,<br />
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,<br />
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,<br />
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,<br />
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,<br />
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff<br />
};</p>
<p>const byte TRIANGLE_TABLE[]=<br />
{<br />
0&#215;00,0&#215;02,0&#215;04,0&#215;06,0&#215;08,0x0a,0x0c,0x0e,0&#215;10,0&#215;12,0&#215;14,0&#215;16,0&#215;18,0x1a,0x1c,0x1e,<br />
0&#215;20,0&#215;22,0&#215;24,0&#215;26,0&#215;28,0x2a,0x2c,0x2e,0&#215;30,0&#215;32,0&#215;34,0&#215;36,0&#215;38,0x3a,0x3c,0x3e,<br />
0&#215;40,0&#215;42,0&#215;44,0&#215;46,0&#215;48,0x4a,0x4c,0x4e,0&#215;50,0&#215;52,0&#215;54,0&#215;56,0&#215;58,0x5a,0x5c,0x5e,<br />
0&#215;60,0&#215;62,0&#215;64,0&#215;66,0&#215;68,0x6a,0x6c,0x6e,0&#215;70,0&#215;72,0&#215;74,0&#215;76,0&#215;78,0x7a,0x7c,0x7e,<br />
0&#215;80,0&#215;82,0&#215;84,0&#215;86,0&#215;88,0x8a,0x8c,0x8e,0&#215;90,0&#215;92,0&#215;94,0&#215;96,0&#215;98,0x9a,0x9c,0x9e,<br />
0xa0,0xa2,0xa4,0xa6,0xa8,0xaa,0xac,0xae,0xb0,0xb2,0xb4,0xb6,0xb8,0xba,0xbc,0xbe,<br />
0xc0,0xc2,0xc4,0xc6,0xc8,0xca,0xcc,0xce,0xd0,0xd2,0xd4,0xd6,0xd8,0xda,0xdc,0xde,<br />
0xe0,0xe2,0xe4,0xe6,0xe8,0xea,0xec,0xee,0xf0,0xf2,0xf4,0xf6,0xf8,0xfa,0xfc,0xfe,<br />
0xff,0xfd,0xfb,0xf9,0xf7,0xf5,0xf3,0xf1,0xef,0xef,0xeb,0xe9,0xe7,0xe5,0xe3,0xe1,<br />
0xdf,0xdd,0xdb,0xd9,0xd7,0xd5,0xd3,0xd1,0xcf,0xcf,0xcb,0xc9,0xc7,0xc5,0xc3,0xc1,<br />
0xbf,0xbd,0xbb,0xb9,0xb7,0xb5,0xb3,0xb1,0xaf,0xaf,0xab,0xa9,0xa7,0xa5,0xa3,0xa1,<br />
0x9f,0x9d,0x9b,0&#215;99,0&#215;97,0&#215;95,0&#215;93,0&#215;91,0x8f,0x8f,0x8b,0&#215;89,0&#215;87,0&#215;85,0&#215;83,0&#215;81,<br />
0x7f,0x7d,0x7b,0&#215;79,0&#215;77,0&#215;75,0&#215;73,0&#215;71,0x6f,0x6f,0x6b,0&#215;69,0&#215;67,0&#215;65,0&#215;63,0&#215;61,<br />
0x5f,0x5d,0x5b,0&#215;59,0&#215;57,0&#215;55,0&#215;53,0&#215;51,0x4f,0x4f,0x4b,0&#215;49,0&#215;47,0&#215;45,0&#215;43,0&#215;41,<br />
0x3f,0x3d,0x3b,0&#215;39,0&#215;37,0&#215;35,0&#215;33,0&#215;31,0x2f,0x2f,0x2b,0&#215;29,0&#215;27,0&#215;25,0&#215;23,0&#215;21,<br />
0x1f,0x1d,0x1b,0&#215;19,0&#215;17,0&#215;15,0&#215;13,0&#215;11,0x0f,0x0f,0x0b,0&#215;09,0&#215;07,0&#215;05,0&#215;03,0&#215;01<br />
};</p>
<p>#define FREQ    2400<br />
#define SAMP    65536 //2^16</p>
<p>#include &#8220;TimerOne.h&#8221;</p>
<p>byte key;<br />
byte wave;<br />
byte x1;<br />
byte y0;<br />
byte y1;<br />
byte m;<br />
unsigned int phase;<br />
unsigned int phaseDelta;<br />
unsigned int note[] = {<br />
0, 264,275,293.33,309.37,330,352,366.67,396,412.5,440.00,469.34,495};</p>
<p>void setup()<br />
{<br />
//setup</p>
<p>//portd (dac) setup<br />
//portd uses digital pins 0 &#8211; 7<br />
DDRD = DDRD | B11111100; //bits 2 &#8211; 7<br />
DDRB = DDRB | B00000011; //bits 0 and 1</p>
<p>//timer setup for 8khz (125us)<br />
Timer1.initialize(125);<br />
Timer1.attachInterrupt(Timer_ISR);</p>
<p>//serial setup<br />
Serial.begin(9600);<br />
}</p>
<p>void loop()<br />
{<br />
//main loop<br />
if (Serial.available() &gt; 0)<br />
{<br />
key = Serial.read();<br />
}</p>
<p>/*<br />
COMAND STRUCTURE<br />
Single byte commands are received my the uC</p>
<p>byte structure: xxyy zzzz</p>
<p>xx bits &#8211; command<br />
- 00: note<br />
: yy bits &#8211; octave<br />
: zz bits &#8211; note<br />
- 01: wave shape<br />
: yy bits &#8211; wave shape<br />
: zz bits &#8211; not used<br />
- 10:<br />
- 11:<br />
*/</p>
<p>//note command<br />
if(((key &gt;&gt; 6) &amp;  0&#215;03) == 0)<br />
{<br />
phaseDelta = calcPhaseDelta(note[key &amp; 0x0F],(key &gt;&gt; 4) &amp; 0&#215;03);<br />
}<br />
if(((key &gt;&gt; 6) &amp;  0&#215;03) == 1)<br />
{<br />
wave = (key &gt;&gt; 4) &amp; 0&#215;03;<br />
}</p>
<p>}</p>
<p>void Timer_ISR()<br />
{<br />
//<br />
byte index;</p>
<p>phase += phaseDelta;<br />
index = (byte)(phase&gt;&gt;8);</p>
<p>if (wave == 0)                      //sine wave<br />
{<br />
x1 = SINE_TABLE[index];<br />
}<br />
else if (wave == 1)                 //saw tooth<br />
{<br />
x1 = SAW_TABLE[index];<br />
}<br />
else if (wave == 2)                 //square<br />
{<br />
x1 = SQUARE_TABLE[index];<br />
}<br />
else if (wave == 3)                 //triangle<br />
{<br />
x1 = TRIANGLE_TABLE[index];<br />
}</p>
<p>PORTD &amp;= 0&#215;03;<br />
PORTD |= x1 &amp; 0xFC;<br />
PORTB &amp;= 0xFC;<br />
PORTB |= x1 &amp; 0&#215;03;<br />
}</p>
<p>unsigned int calcPhaseDelta(int note, byte oct)<br />
{<br />
//<br />
unsigned int delta = 0;</p>
<p>delta = (SAMP / FREQ) * note;<br />
return delta;<br />
}</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://peterkevindavis.com/archives/73/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
