<?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>blog.world3.net &#187; avr</title>
	<atom:link href="http://blog.world3.net/category/avr/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.world3.net</link>
	<description>たとえ溺れても梦はゆめでしかない</description>
	<lastBuildDate>Tue, 27 Jul 2010 23:06:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>The MSF signal is a bit of a mess</title>
		<link>http://blog.world3.net/2010/07/the-msf-signal-is-a-bit-of-a-mess/</link>
		<comments>http://blog.world3.net/2010/07/the-msf-signal-is-a-bit-of-a-mess/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 23:06:26 +0000</pubDate>
		<dc:creator>mojo</dc:creator>
				<category><![CDATA[avr]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[microcontrollers]]></category>

		<guid isPermaLink="false">http://blog.world3.net/?p=331</guid>
		<description><![CDATA[I am working on another clock, this time with MSF (Rugby/The time from NPL)  radio time setting. I know, I need to document the last one&#8230; Anyway, I finished the decoder today. The MSF signal is frankly a mess. Things seem to have been added and then removed over the years. There are four different [...]]]></description>
			<content:encoded><![CDATA[<p>I am working on another clock, this time with MSF (Rugby/The time from NPL)  radio time setting. I know, I need to document the last one&#8230; Anyway, I finished the decoder today.</p>
<p>The MSF signal is frankly a mess. Things seem to have been added and then removed over the years. There are four different length pulses and various additions. Compared to the nice clean DCF77 signal it&#8217;s horrible, but unfortunately I can&#8217;t get DCF77 to work reliably here. In fact I bought a DCF77 clock but it has never been able to receive a good enough signal to set itself.</p>
<p>As others have discovered the MSF signal is much cleaner at night, but filtering out the noise during the day isn&#8217;t too hard. I wrote the decoder in assembler and it basically waits for a valid bit and then locks on to that, ignoring everything until 950ms have passed from it&#8217;s start. It also filters out too short and too long pulses and does some debouncing.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.world3.net/2010/07/the-msf-signal-is-a-bit-of-a-mess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AVR / electronics quick reference sheet</title>
		<link>http://blog.world3.net/2010/04/avr-electronics-quick-reference-sheet/</link>
		<comments>http://blog.world3.net/2010/04/avr-electronics-quick-reference-sheet/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 17:31:45 +0000</pubDate>
		<dc:creator>mojo</dc:creator>
				<category><![CDATA[avr]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://blog.world3.net/?p=281</guid>
		<description><![CDATA[I am working on a quick reference chart (cheat sheet). It&#8217;s by no means done but a post over at Adafruit made me think to post it: quickref.pdf]]></description>
			<content:encoded><![CDATA[<p>I am working on a quick reference chart (cheat sheet). It&#8217;s by no means done but <a href="http://www.adafruit.com/blog/2010/04/23/arduino-cheatsheet-pdf/">a post over at Adafruit</a> made me think to post it: <a href="http://blog.world3.net/wp-content/uploads/quickref01.pdf">quickref.pdf</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.world3.net/2010/04/avr-electronics-quick-reference-sheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Playstation controller protocol quirks</title>
		<link>http://blog.world3.net/2010/02/playstation-controller-protocol-quirks/</link>
		<comments>http://blog.world3.net/2010/02/playstation-controller-protocol-quirks/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 01:29:33 +0000</pubDate>
		<dc:creator>mojo</dc:creator>
				<category><![CDATA[avr]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[microcontrollers]]></category>

		<guid isPermaLink="false">http://blog.world3.net/2010/02/playstation-controller-protocol-quirks/</guid>
		<description><![CDATA[Today I discovered why I have been having a few compatibility problems with my Playstation interface code. The PSX uses a SPI bus. The device is supposed to put data on the bus when there is a high to low transition, then read the command on the low to high change. Sure enough the official [...]]]></description>
			<content:encoded><![CDATA[<p>Today I discovered why I have been having a few compatibility problems with my Playstation interface code.</p>
<p>The PSX uses a SPI bus. The device is supposed to put data on the bus when there is a high to low transition, then read the command on the low to high change. Sure enough the official controller sets the data line within 0.3us of the clock transition.</p>
<p>The problem is that some revisions of the PSX hardware don&#8217;t wait for the low to high transition to read the data line. They read at some random point during the clock cycle.</p>
<p>It seems to be some kind of bug because Sony fixed it in later revisions. That is of course assuming that the information on the net about the controller protocol is correct. It may be that the controller is supposed to assert the data line within a few hundred nanoseconds but that seems somewhat unlikely. It would force you to use a hardware SPI bus and thus limit the choice of microcontroller. Maybe Sony don&#8217;t care about the needs of third party developers&#8230;</p>
<p>I saw a PSX dev-kit for sale last year and wish I had it now. Oh well, it&#8217;s sorted now. Make sure the data is there before the transition, just like the PSX does with the command line, and it works.</p>
<p>Anyway,</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.world3.net/2010/02/playstation-controller-protocol-quirks/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>2nd DB9 Connector in the works</title>
		<link>http://blog.world3.net/2009/10/2nd-db9-connector-in-the-works/</link>
		<comments>http://blog.world3.net/2009/10/2nd-db9-connector-in-the-works/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 19:24:43 +0000</pubDate>
		<dc:creator>mojo</dc:creator>
				<category><![CDATA[Retro Adapter]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://blog.world3.net/?p=214</guid>
		<description><![CDATA[I am doing the code for a 2nd DB9 Connector for the Retro Adapter. It converts the DB15 into another DB9 so you can connect two controllers simultaneously for 2 players. Atari/Commodore/Sega controllers are working and I will add support for NES and SNES too. I will probably do N64 as well. The button mapping [...]]]></description>
			<content:encoded><![CDATA[<p>I am doing the code for a 2nd DB9 Connector for the Retro Adapter. It converts the DB15 into another DB9 so you can connect two controllers simultaneously for 2 players.</p>
<p>Atari/Commodore/Sega controllers are working and I will add support for NES and SNES too. I will probably do N64 as well. The button mapping is not ideal but is usable. I experimented with having the RA re-enumerate as two separate controllers but it is not ideal to do on the fly. The current system is a good compromise.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.world3.net/2009/10/2nd-db9-connector-in-the-works/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Retro Adapter on sale soon and Retro Adapter Wii</title>
		<link>http://blog.world3.net/2009/09/retro-adapter-on-sale-soon-and-retro-adapter-wii/</link>
		<comments>http://blog.world3.net/2009/09/retro-adapter-on-sale-soon-and-retro-adapter-wii/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 16:45:18 +0000</pubDate>
		<dc:creator>mojo</dc:creator>
				<category><![CDATA[avr]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[hardware]]></category>

		<guid isPermaLink="false">http://blog.world3.net/?p=185</guid>
		<description><![CDATA[I will be opening the online shop for sales of the Retro Adapter soon (just waiting for the final parts to come in). Both finished adapters and kits will be available, as well as  a selection of connectors. It occurred to me that I can use the same PCB for a Wii/Gamecube version, so I [...]]]></description>
			<content:encoded><![CDATA[<p>I will be opening the online shop for sales of the Retro Adapter soon (just waiting for the final parts to come in). Both finished adapters and kits will be available, as well as  a selection of connectors.</p>
<p>It occurred to me that I can use the same PCB for a Wii/Gamecube version, so I am now working on the Retro Adapter Wii. It will support all the same controllers as the Retro Adapter, and will in fact use the same code where possible. One thing I&#8217;m not sure about is firmware updates, I need to look into the options.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.world3.net/2009/09/retro-adapter-on-sale-soon-and-retro-adapter-wii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Final Retro Adapter PCBs arrived!</title>
		<link>http://blog.world3.net/2009/08/final-retro-adapter-pcbs-arrived/</link>
		<comments>http://blog.world3.net/2009/08/final-retro-adapter-pcbs-arrived/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 22:36:26 +0000</pubDate>
		<dc:creator>mojo</dc:creator>
				<category><![CDATA[avr]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[hardware]]></category>

		<guid isPermaLink="false">http://blog.world3.net/?p=177</guid>
		<description><![CDATA[The final production Retro Adapter PCBs arrived yesterday. I made one up and it works perfectly. I am very happy with the world Seeed Studio did on them, especially considering they are cheap and accept files in Eagle format (so they do all the conversion or Gerber and any panelization etc). I will put together [...]]]></description>
			<content:encoded><![CDATA[<p>The final production Retro Adapter PCBs arrived yesterday. I made one up and it works perfectly. I am very happy with the world <a href="http://www.seeedstudio.com/">Seeed Studio</a> did on them, especially considering they are cheap and accept files in <a href="http://www.cadsoft.de/">Eagle</a> format (so they do all the conversion or Gerber and any panelization etc).</p>
<p style="text-align: center;"><a href="http://denki.world3.net/retroadapter/production01.jpg"><img class="alignnone" title="Production PCB" src="http://denki.world3.net/retroadapter/production01_t.jpg" alt="" width="313" height="235" /></a> <a href="http://denki.world3.net/retroadapter/production02.jpg"><img class="alignnone" title="Production PCB" src="http://denki.world3.net/retroadapter/production02_t.jpg" alt="" width="313" height="235" /></a> <a href="http://denki.world3.net/retroadapter/rev312.jpg"><img class="alignnone" title="Completed Adapter" src="http://denki.world3.net/retroadapter/rev312_t.jpg" alt="" width="313" height="234" /></a> <a href="http://denki.world3.net/retroadapter/rev313.jpg"><img class="alignnone" title="Completed Adapter" src="http://denki.world3.net/retroadapter/rev313_t.jpg" alt="" width="313" height="234" /></a></p>
<p style="text-align: left;">I will put together a complete assembly guide with photos at some point in the next week or two, as well as releasing V1.0 of the firmware complete with USB update facility. I am still considering options for the update facility as it needs to be triggered somehow. At the moment the best option looks like holding a fire button on the controller, but the problem is that due to very limited space in the bootloader section it will have to be a simple controller like an Atari/Amiga joystick, Neo Geo joystick/pad or maybe a Sega Saturn pad. In case you don&#8217;t have one, a very simple update &#8220;plug&#8221; made from a DB9 and 1 wire to simulate the fire button being held could be used.</p>
<p style="text-align: left;">With a bit of luck the Retro Adapter will be on sale soon in time for xmas :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.world3.net/2009/08/final-retro-adapter-pcbs-arrived/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Retro Adapter prototype PCBs arrived</title>
		<link>http://blog.world3.net/2009/07/new-retro-adapter-prototype-pcbs-arrived/</link>
		<comments>http://blog.world3.net/2009/07/new-retro-adapter-prototype-pcbs-arrived/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 23:41:58 +0000</pubDate>
		<dc:creator>mojo</dc:creator>
				<category><![CDATA[avr]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[hardware]]></category>

		<guid isPermaLink="false">http://blog.world3.net/?p=164</guid>
		<description><![CDATA[Just been updating the &#60;a href=&#8221;test&#8221;&#62;main site&#60;/a&#62; with details of the prototype PCBs that arrived yesterday. The good news is that apart from a couple of minor issues, all is well. I just need to finish a few things off with the code before doing the first small run of boards, One issue I have [...]]]></description>
			<content:encoded><![CDATA[<p>Just been updating the &lt;a href=&#8221;test&#8221;&gt;main site&lt;/a&gt; with details of the prototype PCBs that arrived yesterday. The good news is that apart from a couple of minor issues, all is well.</p>
<p><a href="http://denki.world3.net/retroadapter/rev301.jpg"><img class="aligncenter" src="http://denki.world3.net/retroadapter/rev301_t.jpg" alt="" width="313" height="235" /></a><a href="http://denki.world3.net/retroadapter/rev303.jpg"><img class="aligncenter" src="http://denki.world3.net/retroadapter/rev303_t.jpg" alt="" width="313" height="235" /></a><a href="http://denki.world3.net/retroadapter/rev309.jpg"><img class="aligncenter" src="http://denki.world3.net/retroadapter/rev309_t.jpg" alt="" width="313" height="235" /></a><a href="http://denki.world3.net/retroadapter/rev312.jpg"><img class="aligncenter" src="http://denki.world3.net/retroadapter/rev312_t.jpg" alt="" width="313" height="235" /></a></p>
<p>I just need to finish a few things off with the code before doing the first small run of boards,</p>
<p>One issue I have found is that it takes a little while to assemble these things. I think it should get quicker if I do them in batches. A good PCB holder is going to be essential I think &#8211; the &#8220;helping hands&#8221; thing with crocodile clips I have now is not really up to the task. Heat-proof soldering gloves make things a lot easier too, as you can hold components in place with a finger while soldering them.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.world3.net/2009/07/new-retro-adapter-prototype-pcbs-arrived/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Saleae Logic review</title>
		<link>http://blog.world3.net/2009/07/saleae-logic-review/</link>
		<comments>http://blog.world3.net/2009/07/saleae-logic-review/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 22:01:15 +0000</pubDate>
		<dc:creator>mojo</dc:creator>
				<category><![CDATA[avr]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[microcontrollers]]></category>

		<guid isPermaLink="false">http://blog.world3.net/?p=157</guid>
		<description><![CDATA[After a lot of consideration, I decided to get a Saleae Logic logic analyser to help debug my AVR code. There are a few reviews already floating around but little detail on people&#8217;s experiences of actually using the thing, so here are mine. The package is quite nice. You get the Logic, which is tiny, [...]]]></description>
			<content:encoded><![CDATA[<p>After a lot of consideration, I decided to get a <a href="http://www.saleae.com/logic/">Saleae Logic logic analyser</a> to help debug my AVR code. There are a few reviews already floating around but little detail on people&#8217;s experiences of actually using the thing, so here are mine.</p>
<p>The package is quite nice. You get the Logic, which is tiny, probes and carry case. The probes are in the forum of a header with 9 wires (8 data + GND, so you have to have a common ground) and individual &#8220;E-Z-Hook&#8221; clips. The wires are very flexible and easy to work with, and the clips are the best I have come across. They have little pincers which fit nicely on to component legs, breadboard, DIP IC pins etc. They even clip on to trimmed component leads which have been soldered to a PCB, such as the underside of pin headers.</p>
<p>The pincers retract into the clip&#8217;s plastic body so they do not short with each other, even on neighbouring pins of a DIP IC. Saleae also sell replacements at reasonable prices, although so far they seem very robust.</p>
<p>The software provided (simply called Logic) is a bit of a mixed bag, but overall not bad. One attractive feature is that it includes decoders for RS232, SPI, I2C and 1 wire protocols at no additional cost. Future updates and new protocols will be free too, and there is an SDK which I have yet to experiment with. You can download the software from the <a href="http://www.saleae.com/downloads/">Saleae web site</a> to try out with some demo data.</p>
<p>Logic is written in .NET so takes about 10 seconds to load on my XP x64 system with 6GB RAM and a 3.1GHz Core 2 Quad CPU. Once it&#8217;s loaded though it is very quick and responsive. Not all companies bother to support XP x64 (Vista x64 is mandatory for all signed Vista drivers), so it&#8217;s nice that Saleae made the effort.</p>
<p><center><img alt="Logic software user interface" src="http://blog.world3.net/images/logic.png" title="Logic software" width="934" height="454" /></center></p>
<p>The Logic interface is non-standard, being skinned. Normally that&#8217;s a Very Bad Thing as it can break all the familiar UI elements, but fortunately the developers have stuck to the standards here. Navigation via the mouse is pretty fast, with the mouse wheel used for zooming and simple dragging used to scroll. Hovering the mouse over the recorded data gives you various bits of useful information, such as width of bit, period, binary decoding and more via configurable options.</p>
<p>On my system I can reliably run the Logic at 24MHz without issue. In fact, there is little reason to go any lower since 24MHz, the maximum, gives the most accurate timings. Using a lower frequency allows for longer sampling periods, although even at 24MHz several seconds of recording are possible. I was able to capture complete hardware detection, handshake and polling cycles of various games consoles without any problems. The software handles massive amounts of data with little effort.</p>
<p>Triggering is configurable for each data line individually, and sampling starts when any line is triggered. The Logic also gives you up to a few ms before the trigger which is handy. Trigger can be set on either a logic 1 or logic 0, but not on transitions (e.g. low to high, high to low) explicitly. In practice since most buses are held in one state until communication is started it&#8217;s not a major issue, and the Logic does not sync it&#8217;s clock to the transition edge anyway.</p>
<p>There are a few things missing that would be helpful, such as being able to compare two data sets side by side. You can take screenshots but it&#8217;s not quite the same. You are also limited to only two markers which you can place anywhere, but more would be helpful. The view parameters are reset every time you take a reading, so you have to re-position the display and zoom every time. Luckily the defaults are not that bad.</p>
<p>Saleae are quite helpful and were happy to receive my comments. A new version of the software is in the works which promises to address these issues.</p>
<p>Overall I am very impressed. At $150 the price is pretty good. There are seemingly higher spec&#8217;ed and cheaper USB logic analysers available from Chinese companies, but when you look closely at them they tend to have either poor software or arbitrary limitations such as the protocols you can decode (with more available at a price). The openness of the Logic via the SDK is quite attractive too.</p>
<p>The usefulness of the device more than justifies the expense if you do much protocol based work. The ability to see exactly what is going on is invaluable, and makes it easy to get all the timing perfect. It&#8217;s also very helpful for debugging, since you can use unused pins on your microcontroller as debug outputs that take only one instruction cycle to access. I have found that some protocols I had working already could be made much more compatible just by checking the timings instead of trying to estimate them based on instruction cycle counts.</p>
<p>I hope Saleae are successful with this project, as they deserve to be.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.world3.net/2009/07/saleae-logic-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Retro Adapter re-design</title>
		<link>http://blog.world3.net/2009/07/retro-adapter-re-design/</link>
		<comments>http://blog.world3.net/2009/07/retro-adapter-re-design/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 23:47:05 +0000</pubDate>
		<dc:creator>mojo</dc:creator>
				<category><![CDATA[avr]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://blog.world3.net/?p=154</guid>
		<description><![CDATA[I changed the design again >_]]></description>
			<content:encoded><![CDATA[<p>I changed the design again >_<</p>
<p><center><a href="http://img36.imageshack.us/img36/820/pcb.png"><img alt="" src="http://img36.imageshack.us/img36/820/pcb.th.png" title="New PCB design" class="aligncenter" width="150" height="115" /></a></center></p>
<p>The main reasons for the change are not wanting to have to drill lots of holes in the cases and wanting to reduce the amount of external components required to support certain controllers. You can now plug Neo Geo pads in directly thanks to having both 9 pin and 15 pin connectors. Having a 15 pin connector makes supporting things like PC Gameport devices easier too.</p>
<p>The AVR has been upgraded to an ATmega168. 16k flash ROM and room for a boot loader, so firmware updates are possible over USB. There are also more I/O pins available.</p>
<p>Finally, the USB port has been done away with in favour of a captured cable. The USB spec says you must have a captured cable for USB 1 devices anyway, and now a USB port won&#8217;t easily fit. Since the cable is flexible it also means drilling holes is a lot easier as they don&#8217;t have to be exact. The only potential issue I can foresee is strain relief.</p>
<p>Seeed Studio is doing a special offer with 30% off, so I&#8217;m getting prototypes made up.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.world3.net/2009/07/retro-adapter-re-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Retro Adapter V2 PCBs arrived!</title>
		<link>http://blog.world3.net/2009/05/retro-adapter-v2-pcbs-arrived/</link>
		<comments>http://blog.world3.net/2009/05/retro-adapter-v2-pcbs-arrived/#comments</comments>
		<pubDate>Tue, 19 May 2009 19:41:41 +0000</pubDate>
		<dc:creator>mojo</dc:creator>
				<category><![CDATA[avr]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[microcontrollers]]></category>

		<guid isPermaLink="false">http://blog.world3.net/?p=128</guid>
		<description><![CDATA[The first batch of PCBs is here, and looking good! Spot the deliberate mistake :) It&#8217;s not a problem though, you can easily read the backwards text.]]></description>
			<content:encoded><![CDATA[<p>The first batch of PCBs is here, and looking good!</p>
<p><a href="http://denki.world3.net/retro_v2/pcb1.jpg"><img src="http://denki.world3.net/retro_v2/pcb1_t.jpg" alt="PCB 1" /></a> <a href="http://denki.world3.net/retro_v2/pcb2.jpg"><img src="http://denki.world3.net/retro_v2/pcb2_t.jpg" alt="PCB 2" /></a></p>
<p>Spot the deliberate mistake :) It&#8217;s not a problem though, you can easily read the backwards text.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.world3.net/2009/05/retro-adapter-v2-pcbs-arrived/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
