<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Hack a Day &#187; uart</title>
	<atom:link href="http://hackaday.com/tag/uart/feed/" rel="self" type="application/rss+xml" />
	<link>http://hackaday.com</link>
	<description>Fresh hacks every day</description>
	<lastBuildDate>Fri, 10 Feb 2012 06:18:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='hackaday.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/5560f98f805877b0e332f191cb9e0af3?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Hack a Day &#187; uart</title>
		<link>http://hackaday.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://hackaday.com/osd.xml" title="Hack a Day" />
	<atom:link rel='hub' href='http://hackaday.com/?pushpress=hub'/>
		<item>
		<title>Throw together a temperature logger in minutes</title>
		<link>http://hackaday.com/2011/10/18/throw-together-a-temperature-logger-in-minutes/</link>
		<comments>http://hackaday.com/2011/10/18/throw-together-a-temperature-logger-in-minutes/#comments</comments>
		<pubDate>Tue, 18 Oct 2011 17:01:26 +0000</pubDate>
		<dc:creator>Mike Szczys</dc:creator>
				<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[12f1822]]></category>
		<category><![CDATA[logger]]></category>
		<category><![CDATA[MCP9701A]]></category>
		<category><![CDATA[pic]]></category>
		<category><![CDATA[temperature]]></category>
		<category><![CDATA[uart]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=58804</guid>
		<description><![CDATA[[Rajendra] found an easy way to make a USB temperature logger. He already had a USB to UART adapter that takes care of the heavy lifting. On one end it&#8217;s got the USB plug, on the other a set of pins provide a ground connection, 3.3V and 5V feed, as well as RX/TX lines. To [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=58804&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-58805" title="usb-temperature-logger" src="http://hackadaycom.files.wordpress.com/2011/10/usb-temperature-logger-e1318859421663.jpg" alt="" width="470" height="326" /></p>
<p>[Rajendra] found <a href="http://embedded-lab.com/blog/?p=3770">an easy way to make a USB temperature logger</a>. He already had a USB to UART adapter that takes care of the heavy lifting. On one end it&#8217;s got the USB plug, on the other a set of pins provide a ground connection, 3.3V and 5V feed, as well as RX/TX lines.</p>
<p>To get the hardware up and running all he needed was something to read a temperature sensor and push that data over the serial connection. An 8-pin microcontroller in the form of a PIC 12F1822 does the trick. It runs off of the 5V pin on the USB-UART, and uses the ADC to get temperature data from an MCP9701A sensor.</p>
<p>The sample rate is hard-coded into to the PIC&#8217;s firmware, but adding a button, or coding some serial monitoring could easily make that configurable. [Rajendra] used Processing to write an app which displays the incoming temperature info and uses the computer to time-stamp and log the inputs. We could see this as a quick solution to tracking wort temperature during fermentation to make sure your beer comes out just right.</p>
<br />Filed under: <a href='http://hackaday.com/category/microcontrollers/'>Microcontrollers</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/58804/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/58804/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/58804/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/58804/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/58804/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/58804/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/58804/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/58804/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/58804/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/58804/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/58804/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/58804/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/58804/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/58804/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=58804&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2011/10/18/throw-together-a-temperature-logger-in-minutes/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Mike Szczys</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/10/usb-temperature-logger-e1318859421663.jpg" medium="image">
			<media:title type="html">usb-temperature-logger</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting more information from your battery charger</title>
		<link>http://hackaday.com/2011/07/18/getting-more-information-from-your-battery-charger/</link>
		<comments>http://hackaday.com/2011/07/18/getting-more-information-from-your-battery-charger/#comments</comments>
		<pubDate>Mon, 18 Jul 2011 15:58:23 +0000</pubDate>
		<dc:creator>Mike Nathan</dc:creator>
				<category><![CDATA[misc hacks]]></category>
		<category><![CDATA[atmega]]></category>
		<category><![CDATA[battery charger]]></category>
		<category><![CDATA[uart]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=49294</guid>
		<description><![CDATA[[Dane] bought a reasonably cheap ($17) Hobbyking Echo-6 battery charger and wanted to see what sort of information he could pull from the unit. Since the charger is designed for a variety of battery chemistries and sports an LCD screen, he figured that it contained a fairly decent microcontroller which he could tap into for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=49294&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-49295" title="echo_6_battery_charger_serial_hacking" src="http://hackadaycom.files.wordpress.com/2011/07/echo_6_battery_charger_serial_hacking.jpg" alt="echo_6_battery_charger_serial_hacking" width="470" height="353" /></p>
<p>[Dane] bought a reasonably cheap ($17) Hobbyking Echo-6 battery charger and wanted to see <a href="http://transistor-man.com/echo-6.html" target="_blank">what sort of information he could pull from the unit</a>. Since the charger is designed for a variety of battery chemistries and sports an LCD screen, he figured that it contained a fairly decent microcontroller which he could tap into for some useful data.</p>
<p>He disassembled the unit and started looking around for any useful items. He discovered that it used an ATMega32 microcontroller and had quite a few unpopulated areas on the PCB, which led [Dane] to believe that the Echo-6 shared its main board with a more robust charger. He tapped into the ATMega’s UART and began seeing data immediately. Once he figured out what was coming over the serial line, he piped the data into LogView, resulting in some nice graphs showing off the charge/discharge processes in detail.</p>
<p>Tapping into the Echo-6 seems easy enough for any skill level, and we assume that just about anyone would benefit from getting kind of information out of their battery charger.</p>
<br />Filed under: <a href='http://hackaday.com/category/misc-hacks/'>misc hacks</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/49294/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/49294/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/49294/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/49294/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/49294/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/49294/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/49294/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/49294/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/49294/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/49294/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/49294/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/49294/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/49294/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/49294/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=49294&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2011/07/18/getting-more-information-from-your-battery-charger/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mikenathanathackaday</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/07/echo_6_battery_charger_serial_hacking.jpg" medium="image">
			<media:title type="html">echo_6_battery_charger_serial_hacking</media:title>
		</media:content>
	</item>
		<item>
		<title>Circuit design for multiple UART connections</title>
		<link>http://hackaday.com/2011/06/28/circuit-design-for-multiple-uart-connections/</link>
		<comments>http://hackaday.com/2011/06/28/circuit-design-for-multiple-uart-connections/#comments</comments>
		<pubDate>Tue, 28 Jun 2011 12:05:14 +0000</pubDate>
		<dc:creator>Mike Szczys</dc:creator>
				<category><![CDATA[arduino hacks]]></category>
		<category><![CDATA[bootloader]]></category>
		<category><![CDATA[fdti]]></category>
		<category><![CDATA[uart]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=47303</guid>
		<description><![CDATA[[Bill Porter] has a tip for designing circuits that have multiple connections to a single microcontroller UART. This stemmed from a review of a friend&#8217;s circuit design that used the UART in the project, but also called for an FTDI chip in order to reprogram via USB and a bootloader. Unlike the schematic above, the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=47303&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-47304" title="multiple-uart-connections" src="http://hackadaycom.files.wordpress.com/2011/06/multiple-uart-connections-e1309211764690.png" alt="" width="470" height="254" /></p>
<p>[Bill Porter] has a tip for <a href="http://www.billporter.info/how-to-add-multiple-uart-connections/">designing circuits that have multiple connections to a single microcontroller UART</a>. This stemmed from a review of a friend&#8217;s circuit design that used the UART in the project, but also called for an FTDI chip in order to reprogram via USB and a bootloader. Unlike the schematic above, the circuit called for straight connections without any resistors. With that design, a conflict will occur if two devices are connected and attempting to communicate at the same time.</p>
<p>The fix is easy. [Bill] discusses how to prioritize the connection by adding the pair of current limiting resistors seen above. This helps to ensure that damage will not occur, and that the FTDI chip will take precedence. Now the external hardware will not preclude the FTDI chip from accessing and programming via the bootloader. The tutorial is intended for those rolling their own boards out of an Arduino-based prototype, but it will work in any situation where you need multiple connections to a single set of UART pins.</p>
<br />Filed under: <a href='http://hackaday.com/category/arduino-hacks/'>arduino hacks</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/47303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/47303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/47303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/47303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/47303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/47303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/47303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/47303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/47303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/47303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/47303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/47303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/47303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/47303/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=47303&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2011/06/28/circuit-design-for-multiple-uart-connections/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Mike Szczys</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/06/multiple-uart-connections-e1309211764690.png" medium="image">
			<media:title type="html">multiple-uart-connections</media:title>
		</media:content>
	</item>
		<item>
		<title>Touch screen for graphing calculator</title>
		<link>http://hackaday.com/2010/04/03/touch-screen-for-graphing-calculator/</link>
		<comments>http://hackaday.com/2010/04/03/touch-screen-for-graphing-calculator/#comments</comments>
		<pubDate>Sat, 03 Apr 2010 20:12:57 +0000</pubDate>
		<dc:creator>Mike Szczys</dc:creator>
				<category><![CDATA[classic hacks]]></category>
		<category><![CDATA[linkport]]></category>
		<category><![CDATA[ti-84]]></category>
		<category><![CDATA[touch screen]]></category>
		<category><![CDATA[uart]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=22961</guid>
		<description><![CDATA[[Owen] got down and dirty by adding a touchscreen to his TI-84 graphing calculator. The dirty part is the z80 assembly code he wrote to use the linkport as a UART (assembly always makes us feel queasy). Once that was working he implemented some commands using an Arduino and then hooked up an Nintendo DS [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=22961&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<span style="text-align:center; display: block;"><a href="http://hackaday.com/2010/04/03/touch-screen-for-graphing-calculator/"><img src="http://img.youtube.com/vi/pyWIJFLbJZ0/2.jpg" alt="" /></a></span>
<p>[Owen] got down and dirty by <a href="http://www.hackniac.com/pages/show_project.php?title=ti_touch">adding a touchscreen to his TI-84</a> graphing calculator. The dirty part is the z80 assembly code he wrote to use the linkport as a UART (assembly always makes us feel queasy). Once that was working he implemented some commands using an Arduino and then hooked up an Nintendo DS touch screen. Now he&#8217;s got this proof of concept video where he draws on the screen, that input is interpreted by the Arduino, commands are sent through the UART, and the calculator program draws on the screen. <a href="http://hackaday.com/2009/12/18/make-an-apple-tablet-before-apple-does/">Adding a touch screen to something</a> is a lot more impressive when you have to go to these lengths to get it working. Nice job!</p>
<br />Filed under: <a href='http://hackaday.com/category/classic-hacks/'>classic hacks</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/22961/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/22961/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/22961/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/22961/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/22961/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/22961/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/22961/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/22961/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/22961/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/22961/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/22961/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/22961/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/22961/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/22961/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=22961&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2010/04/03/touch-screen-for-graphing-calculator/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Mike Szczys</media:title>
		</media:content>
	</item>
		<item>
		<title>Modular systems using SPI</title>
		<link>http://hackaday.com/2009/12/22/modular-systems-using-spi/</link>
		<comments>http://hackaday.com/2009/12/22/modular-systems-using-spi/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 17:00:43 +0000</pubDate>
		<dc:creator>Mike Szczys</dc:creator>
				<category><![CDATA[led hacks]]></category>
		<category><![CDATA[ATmega168]]></category>
		<category><![CDATA[led]]></category>
		<category><![CDATA[marquee]]></category>
		<category><![CDATA[nerdkits]]></category>
		<category><![CDATA[spi]]></category>
		<category><![CDATA[uart]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=19580</guid>
		<description><![CDATA[[Humberto] is at it again with a NerdKits video detailing the use of an SPI bus to communicate between microcontrollers. He started with a previous LED marquee project which was limited to a 5&#215;24 LED Matrix and developed a modular solution to increase the size limitation. The writeup and video embedded after the break do [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=19580&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-19581" title="modular-led-marquee" src="http://hackadaycom.files.wordpress.com/2009/12/modular-led-marquee.jpg" alt="" width="470" height="264" /></p>
<p>[Humberto] is at it again with a NerdKits video detailing the <a href="http://www.nerdkits.com/videos/multipanel_spi_ledarray/">use of an SPI bus to communicate between microcontrollers</a>. He started with a previous LED marquee project which was limited to a 5&#215;24 LED Matrix and developed a modular solution to increase the size limitation.</p>
<p>The writeup and video embedded after the break do a great job of detailing the important differences between a stand-alone and a modular system. The good news is that the ATmega168 chips being used have a built-in interrupt based SPI protocol. Once wired correctly, a master control chip addresses each module separately, adding data to their buffer until a full frame has been transferred, then moves onto the next module.</p>
<p>Some of the caveats to this system such as digital transmission over long distances are discussed. We do wonder about power limitations if all LED&#8217;s in the marquee are illuminated at once. But that concern aside, if you&#8217;re thinking of <a href="http://hackaday.com/2008/11/14/overhauling-led-marquees/">playing around with an LED display</a> don&#8217;t forget that there&#8217;s usually a huge price break for orders of 500 or 1000 LEDs!</p>
<p><span id="more-19580"></span><span style="text-align:center; display: block;"><a href="http://hackaday.com/2009/12/22/modular-systems-using-spi/"><img src="http://img.youtube.com/vi/FvsXcpM2qA4/2.jpg" alt="" /></a></span></p>
<br />Posted in led hacks  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/19580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/19580/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/19580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/19580/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/19580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/19580/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/19580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/19580/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/19580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/19580/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/19580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/19580/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/19580/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/19580/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=19580&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2009/12/22/modular-systems-using-spi/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Mike Szczys</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/12/modular-led-marquee.jpg" medium="image">
			<media:title type="html">modular-led-marquee</media:title>
		</media:content>
	</item>
		<item>
		<title>How-to: The Bus Pirate V2 with USB</title>
		<link>http://hackaday.com/2009/06/25/how-to-the-bus-pirate-v2-with-usb/</link>
		<comments>http://hackaday.com/2009/06/25/how-to-the-bus-pirate-v2-with-usb/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 00:15:21 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[hardware]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[tool hacks]]></category>
		<category><![CDATA[1-wire]]></category>
		<category><![CDATA[bus pirate]]></category>
		<category><![CDATA[i2c]]></category>
		<category><![CDATA[jtag]]></category>
		<category><![CDATA[midi]]></category>
		<category><![CDATA[pc keyboard]]></category>
		<category><![CDATA[spi]]></category>
		<category><![CDATA[the bus pirate]]></category>
		<category><![CDATA[uart]]></category>
		<category><![CDATA[universal serial interface]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=10041</guid>
		<description><![CDATA[Update, Saturday July 4th, 2009: All preorders are closed. The Bus Pirate is a universal serial interface tool, we use it to test new chips without writing any code. It currently supports most serial protocols, including 1-Wire, I2C, SPI, JTAG, asynchronous serial, MIDI, and more. We added some other features we frequently need, like pulse-width [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=10041&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-10467" title="buspiratev2goii450" src="http://hackadaycom.files.wordpress.com/2009/04/buspiratev2goii450.jpg" alt="buspiratev2goii450" width="450" height="314" /></p>
<p><strong>Update, Saturday July 4th, 2009: </strong>All preorders are closed.</p>
<p>The <a href="http://www.buspirate.com">Bus Pirate</a> is a universal serial interface tool, we use it to <a href="http://hackaday.com/category/parts/">test new chips</a> without writing any code. It currently supports most serial protocols, including 1-Wire, I2C, SPI, JTAG, asynchronous serial, MIDI, and more. We added some other features we frequently need, like pulse-width modulation, frequency measurement, voltage measurement, bus sniffers, pull-up resistors, and switchable 3.3volt and 5volt power supplies.</p>
<p>The new v2 family adds USB power and connectivity to the best Bus Pirate design yet.  We also reduced the part count and cost wherever possible. If you want to get your hands on some Bus Pirate USB goodness, Seeed Studio has assembled hardware for $30 (including worldwide shipping).</p>
<p>Read about the new design after the break.</p>
<p><span id="more-10041"></span></p>
<p><strong>Concept overview</strong></p>
<p><img class="alignnone size-full wp-image-10458" title="overview450" src="http://hackadaycom.files.wordpress.com/2009/04/overview450.png" alt="overview450" width="450" height="212" /></p>
<p>The Bus Pirate connects to a PC USB port. The user send commands to the Bus Pirate from a serial terminal on the PC. Commands are translated to the bus protocols that control microchips. See our <a href="http://www.buspirate.com">Bus Pirate page</a> for full documentation.</p>
<p>The latest firmware supports 1-Wire, I2C, SPI, JTAG, asynchronous serial, MIDI, and PC keyboards. Bit-wise 2- and 3-wire libraries can interface most proprietary serial protocols.  More protocols are being added all the time, check out the source code on our <a href="http://code.google.com/p/the-bus-pirate/">Google Code SVN page</a>.</p>
<p><strong>Hardware</strong></p>
<p><strong><img class="alignnone size-full wp-image-10048" title="cct25450" src="http://hackadaycom.files.wordpress.com/2009/04/cct25450.jpg" alt="cct25450" width="450" height="209" /></strong></p>
<p><a href="http://hackadaycom.files.wordpress.com/2009/05/cct25a.png">Click for a large image of the schematic</a> (PNG). The schematic and board layout were made with the freeware version of <a href="http://www.cadsoft.de">Cadsoft Eagle</a>. Download the latest files from our <a href="http://code.google.com/p/the-bus-pirate/downloads/list">Google Code</a> page.</p>
<p><em>PIC24F</em></p>
<p><em><img class="alignnone size-full wp-image-10480" title="pic24f-highlight" src="http://hackadaycom.files.wordpress.com/2009/04/pic24f-highlight.jpg" alt="pic24f-highlight" width="450" height="329" /><br />
</em></p>
<p>A Microchip <a href="http://hackaday.com/2008/09/18/web-server-on-a-business-card-part-1/">PIC24F series</a> microcontroller generates the user interface and translates input into bus communications. V2 uses the same <a href="http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en026374">24FJ64GA002</a> as the previous Bus Pirate versions. It&#8217;s cheap, has a ton of memory,  a couple 5volt tolerant input pins, and the peripheral pin select feature lets us assign hardware modules anywhere we want.</p>
<p>The PIC (IC1) is powered by a 3.3volt regulator (VR2, C23). Each PIC power pin gets a 0.1uF bypass capacitor (C1,2). The internal 2.5volt regulator requires a 10uF tantalum capacitor (C20). The programming pins are brought to a five pin header (ICSP) on the edge of the PCB.</p>
<p><em>USB interface<br />
</em></p>
<p><em><img class="alignnone size-full wp-image-10471" title="ftdi-450ii1" src="http://hackadaycom.files.wordpress.com/2009/04/ftdi-450ii1.jpg" alt="ftdi-450ii1" width="450" height="229" /></em></p>
<p>The Bus Pirate is powered from the USB 5volt supply, which is first filtered with a ferrite bead (L1) and 10uF tantalum capacitor (C21). We used the small, still-not-quite-common, <a href="http://en.wikipedia.org/wiki/USB#Types_of_USB_connector">USB mini-b</a> connector (J2).</p>
<p>Choosing a ferrite bead is a common hangup. Its purpose is to filter small power fluctuations, all the current for the circuit will go through it. We can guestimate that the Bus Pirate&#8217;s worst case current consumption is 525ma (3 power supplies @ 150ma, the FTDI chip @ 25ma, 2 LEDs @ 50ma max). Use a ferrite bead rated for at least 1000ma to be safe. We used <a href="http://www.mouser.com/Search/ProductDetail.aspx?R=BLM21PG331SN1Dvirtualkey64800000virtualkey81-BLM21P331SG">this one</a>, which is rated for 1500ma and costs 10 cents.</p>
<p>An FTDI <a href="http://www.ftdichip.com/Products/FT232BM.htm">FT232BL</a> USB-&gt;serial chip (IC2) handles the USB connection. You might be familiar with this chip from various <a href="http://hackaday.com/category/arduino-hacks/">Arduino</a> boards. FTDI has <a href="http://www.ftdichip.com/Drivers/VCP.htm">extensive driver support</a> for most platforms, we used the virtual com port drivers.  This is the latest generation chip, and it&#8217;s only available in small SSOP and QFN packages. We had no problem hand-soldering it to a professional PCB, but it&#8217;s not for everyone.</p>
<p>The FT232BL is powered directly from the filtered, unregulated USB supply. C4 is a  decoupling capacitor for the FTDI232BL supply pin. A single LED (LED4/USB) indicates USB status and activity. The FT232BL RXLED pin sinks current, so we powered the LED from the 5volt USB supply through a 1.1K resistor (R3).</p>
<p>While the FT232BL runs at 5volts from the USB supply, its serial IO pins have an independent supply input &#8211; they can operate at another voltage. Since the microcontroller is 3.3volts, we just feed the FT232BL IO pins a 3.3volt supply and eliminate any funky translation circuitry. We used the chip&#8217;s internal 3.3volt regulator to supply the IO pins because it was the easiest trace to route. The IO pins get their own 0.1uF bypass capacitor (C5).</p>
<p><em>Switchable power supplies</em></p>
<p><em><img class="alignnone size-full wp-image-10475" title="vreg-450ii" src="http://hackadaycom.files.wordpress.com/2009/04/vreg-450ii.jpg" alt="vreg-450ii" width="449" height="297" /><br />
</em></p>
<p>The Bus Pirate has on-board 3.3volt and 5volt supplies (VR3, VR4) that can power a test circuit. The  supplies are switchable, so we can reset the circuit from software when something goes wrong. To be extra safe, the supplies are held off until activated in the terminal.</p>
<p>[<a href="http://www.sparkfun.com/commerce/account.php?id=7185">Nathan Seidle</a>] at <a href="http://www.sparkfun.com">SparkFun</a> recommended that we replace the  <a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=sGAEpiMZZMsGz1a6aV8DcPXeWoVS0Fnzr3zi8%252bAr99Q%3d">TPS796xx</a> ($2.50) we used in <a href="http://hackaday.com/2009/01/22/how-to-bus-pirate-v1-improved-universal-serial-interface">The Bus Pirate v1a</a> with a <a href="http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&amp;name=576-1259-1-ND">MIC5205-xxYM5</a> ($0.90). They supply just 150ma maximum current, compared to 800ma from the TPS796xx, but the cost savings and reduced part-count are worth it.</p>
<p>The regulators are fed from the 5volt USB supply. The 5volt regulator drops a few millivolts below optimal because there&#8217;s no headroom, but it&#8217;s within the minimum level specified by  most 5volt parts.</p>
<p>The MIC5205 requires a large output filter capacitor (C22-24, 10uF), but no input capacitor. An optional small-value capacitor on the BP pin can decrease power supply noise, but we left this off because it didn&#8217;t make much difference in practice.</p>
<p>A small voltage on the <em>EN</em> pin enables the supply, we used a 10K pull-down resistor (R18, not shown) to ensure that the supplies stay off while the PIC initializes. LED3/VREG, with current limiting resistor R32, lights when the power supplies are active.</p>
<p><em>On-board pull-up resistors</em></p>
<p><em><img class="alignnone size-full wp-image-10469" title="resis" src="http://hackadaycom.files.wordpress.com/2009/04/resis.jpg" alt="resis" width="450" height="298" /><br />
</em></p>
<p>Bus Pirate V2 has multi-voltage, software controlled pull-up resistors via the <a href="http://www.fairchildsemi.com/ds/CD%2FCD4066BC.pdf">4066</a> (PDF) quad bilateral switch (IC3). When enabled, the 4066 connects the four on-board bus pull-up resistors (R20-23, 10K) to any external signal on the Vpullup pin (0 to 5volts). When disabled, the outputs are high-impedance and have no effect on the bus lines.</p>
<p>The 4066 can&#8217;t switch an input voltage greater than the supply voltage. To give it the widest possible range, we powered it from the USB supply (5volts).</p>
<p>When operated at 5volts, it takes 4volts+ to enable the 4066. The PIC pins have a maximum output of 3.3volts, so we have a problem. We  solve it with a 5volt tolerant PIC pin and a pull-up resistor.  We turn on the 4066 with a pull-up resistor to 5volts (R19, 10K), and then disable it by switching the connected PIC pin to ground.</p>
<p>For a brief instant at power-on, the PIC pin is high-impedance and the 4066 outputs are active because the pull-up resistor holds the control pins at 5volts. This is a concern if the Vpullup input is connected to an external 5volt supply while the bus is connected to a 3.3volt device &#8211; the brief exposure to 5volts might harm the device. If you&#8217;re worried about this, make sure there&#8217;s no active power supply connected to the Vpullup input before powering the Bus Pirate. This isn&#8217;t a concern if you use one of the on-board power supplies for the pull-up voltage because they&#8217;re disabled at startup.</p>
<p><em>Voltage monitoring</em></p>
<p><em><img class="alignnone size-full wp-image-10474" title="cct-adcin" src="http://hackadaycom.files.wordpress.com/2009/04/cct-adcin.jpg" alt="cct-adcin" width="450" height="309" /><br />
</em></p>
<p>Four <a href="http://en.wikipedia.org/wiki/Voltage_divider">voltage dividers</a> (R10-17, 10K), attached to <a href="http://en.wikipedia.org/wiki/Analog-to-digital_converter">analog to digital converters</a>, allow the 3.3volt PIC to safely measure up to 6volts DC.</p>
<p>Two voltage monitors measure the switchable power supply output. One measures the Vpullup input voltage, and another connects to the external voltage measurement probe.</p>
<p><em>Indicator LEDs</em></p>
<p><em><img class="alignnone size-full wp-image-10463" title="front-back2450" src="http://hackadaycom.files.wordpress.com/2009/04/front-back2450.jpg" alt="front-back2450" width="450" height="191" /><br />
</em></p>
<p>Three LEDs indicate power, mode, and voltage regulator status (LED1-3). LED4/USB displays USB activity.</p>
<p>There are pads for resistors R30-32 and LEDs 1-3 on the front and back of the PCB. Only one set should be populated. We put pads on both sides so the board could be mounted with the indicator LEDs abutting the top of an enclosure.</p>
<p><em>V2a vs V2go</em></p>
<p><em><img class="alignnone size-full wp-image-10441" title="bpv2450" src="http://hackadaycom.files.wordpress.com/2009/04/bpv2450.jpg" alt="bpv2450" width="450" height="354" /><br />
</em></p>
<p>Click for large <a href="http://hackadaycom.files.wordpress.com/2009/04/cct1.png">schematic</a> (PNG) and <a href="http://hackadaycom.files.wordpress.com/2009/04/brd.png">layout</a> (PNG) images of the version 2a hardware. The Eagle layout files are available in our <a href="http://code.google.com/p/the-bus-pirate/downloads/list">Google Code SVN</a>.</p>
<p>Bus Pirate V2a is a developer&#8217;s board. In addition to all the features of V2go, it includes a jack (J1) for an external power supply and an additional 5volt regulator (VR1).  A switch (S1) selects between USB power and the external supply.</p>
<p>The FT232BL chip on V2a is powered directly from the USB supply, and is not connected to the external supply. This is useful if you want to disable USB and use the Bus Pirate with a serial port on a PC or PDA.</p>
<p>The V2a 4066 enable pull-up resistor is powered by the switchable 5volt regulator. The 5volt regulator must be enabled for the 4066 to be active. Don&#8217;t forget to install the 4066 pull-up resistor (R19), located on the back of the v2a PCB.</p>
<p><strong>PCB</strong></p>
<p><img class="alignnone size-full wp-image-10047" title="brd25450" src="http://hackadaycom.files.wordpress.com/2009/04/brd25450.png" alt="brd25450" width="437" height="354" /></p>
<p>The PCB is a compact, 2-layer design. We <a href="http://hackaday.com/2009/01/15/how-to-prepare-your-eagle-designs-for-manufacture/">prepared gerbers</a> and had PCBs made by our usual service, <a href="https://www.batchpcb.com/">BatchPCB</a> ($21, shipped to EU), and tried a new service offered by <a href="http://www.seeedstudio.com/wiki/index.php?title=Main_Page">Seeed Studio</a> ($32, shipped worldwide).</p>
<p>Seeed has a PCB service specifically for open source hardware projects. For $32 (including worldwide shipping) we got 5 small PCBs, and Seeed made a few extra to sell in their shop. We liked the idea that there would be extra PCBs available.</p>
<p>You might know Seeed Studio from their cheap, improved <a href="http://www.makershed.com/ProductDetails.asp?ProductCode=MKSEEED2">Seeeduino</a> Arduino clone. They&#8217;re located in Shenzhen, a Chinese electronics manufacturing hot-spot. A bunch of notable bloggers recently <a href="http://www.sparkfun.com/commerce/news.php?id=236">visited the region</a> and wrote about the <a href="http://www.sparkfun.com/commerce/news.php?id=237">huge electronic component markets</a>.</p>
<p><img class="alignnone size-full wp-image-10461" title="seeed-batchpcb4501" src="http://hackadaycom.files.wordpress.com/2009/04/seeed-batchpcb4501.jpg" alt="seeed-batchpcb4501" width="450" height="232" /></p>
<p>The Seed order arrived in 14 days (left), the BatchPCB order arrived in 30 days (right).  Seeed and BatchPCB both make beautiful PCBs. Seeed has a much faster turn-around, and has better minimum trace widths and separation (8mil vs 6mil). BatchPCB has standard green PCBs, Seeed gives you the choice of green, black, or white; red, blue and yellow are $7.50 extra.</p>
<p>We really like the Seeed PCB service, extra Bus Pirate <a href="http://www.seeedstudio.com/depot/the-bus-pirate-v2-go-pcb-p-331.htmlhttp://www.seeedstudio.com/depot/the-bus-pirate-v2-go-pcb-p-331.html">v2go</a> and <a href="http://www.seeedstudio.com/depot/the-bus-pirate-v2-pcb-p-330.html">v2a</a> PCBs from our order are available in the Seeed shop. BatchPCB remains the cheapest prototyping option if you want a single board, closed source work, or don&#8217;t mind the extra wait.</p>
<p><em>Parts list</em></p>
<table border="0">
<tbody>
<tr>
<td><strong>Part</strong></td>
<td><strong>Value (package)</strong></td>
</tr>
<tr>
<td>IC1</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=V/yyTCAHA4D/h5r3CRQDtA==">PIC24J64GA002</a> (SOIC)</td>
</tr>
<tr>
<td>IC2</td>
<td><a href="http://www.sparkfun.com/commerce/product_info.php?products_id=650">FT232RL</a> (SSOP)</td>
</tr>
<tr>
<td>IC3</td>
<td><a href="http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&amp;name=CD4066BCM-ND">CD4066D</a> (SOIC-N)</td>
</tr>
<tr>
<td>VR2,3</td>
<td><a href="http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&amp;name=576-1259-1-ND">MIC5205-3.3YM5 3.3volt regulator</a> (SOT23-5)</td>
</tr>
<tr>
<td>VR4</td>
<td><a href="http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&amp;name=576-1261-1-ND">MIC5205-5.0YM5 5volt regulator</a> (SOT23-5)</td>
</tr>
<tr>
<td>C1-5</td>
<td><a href="https://www.mouser.com/Search/ProductDetail.aspx?R=C0805C104M5RACTUvirtualkey64600000virtualkey80-C0805C104M5R">0.1uF capacitor</a> (0805)</td>
</tr>
<tr>
<td>C20-24</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?R=293D106X96R3A2TE3virtualkey61320000virtualkey74-293D106X96R3A2TE3">10uF tantalum capacitor</a> (SMC-A)</td>
</tr>
<tr>
<td>L1</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?R=BLM21PG331SN1Dvirtualkey64800000virtualkey81-BLM21P331SG">1000ma+ Ferrite bead</a> (0805)</td>
</tr>
<tr>
<td>R1</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=jBethxrBxZb5NLDetw123g==">2000 ohm resistor</a> (0805)</td>
</tr>
<tr>
<td>R3,30</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=DZvKvnD5UYWyFJjgnPvJ4g%3d%3d">1100 ohm resistor</a> (0805)</td>
</tr>
<tr>
<td>R10-23</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=sGAEpiMZZMtlubZbdhIBIADEshVnklemK%252bhrLNEuMe8%3d">10,000 ohm resistor</a> (0805)</td>
</tr>
<tr>
<td>R31,32</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=2BMLUTrrT4P7Xm58YbKmPg==">390 ohm resistor</a> (0805)</td>
</tr>
<tr>
<td>LED1-4</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=7JStj%2fjQ2SElGv%2fp7IzKlg%3d%3d">LED</a> (0805)</td>
</tr>
<tr>
<td>J2</td>
<td><a href="http://www.sparkfun.com/commerce/product_info.php?products_id=587">USB MINI-B</a> (SMD)</td>
</tr>
<tr>
<td>I/O</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?R=9-146278-0virtualkey57100000virtualkey571-9-146278-0">0.1&#8243; pin header</a> (2&#215;05)</td>
</tr>
<tr>
<td>ICSP</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?R=9-146278-0virtualkey57100000virtualkey571-9-146278-0">0.1&#8243; pin header</a> (1&#215;05)</td>
</tr>
<tr>
<td>ST</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?R=9-146278-0virtualkey57100000virtualkey571-9-146278-0">0.1&#8243; pin header</a> (1&#215;03) <em>*unpopulated, optional*</em></td>
</tr>
<tr>
<td><strong><br />
</strong></td>
<td></td>
</tr>
</tbody>
</table>
<table border="0">
<tbody>
<tr>
<td><em><strong>Optional</strong></em></td>
<td><em><strong>Parts for V2a</strong></em></td>
</tr>
<tr>
<td>C6-10</td>
<td><a href="https://www.mouser.com/Search/ProductDetail.aspx?R=C0805C104M5RACTUvirtualkey64600000virtualkey80-C0805C104M5R">0.1uF capacitor</a> (0805)</td>
</tr>
<tr>
<td>J1</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=b2tC%2fwvzm2TxaPjSsb%252bCzQ%3d%3d">2.1mm power jack</a> (SMD)</td>
</tr>
<tr>
<td>LED5,6</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=7JStj%2fjQ2SElGv%2fp7IzKlg%3d%3d">LED</a> (0805)</td>
</tr>
<tr>
<td>R33,34,40</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=DZvKvnD5UYWyFJjgnPvJ4g%3d%3d">1100 ohm resistor</a> (0805)</td>
</tr>
<tr>
<td>S1</td>
<td><a href="http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&amp;name=679-1849-ND">Slide switch, SPDT, rt angle</a></td>
</tr>
<tr>
<td>VR1</td>
<td><a href="https://www.mouser.com/Search/ProductDetail.aspx?R=LD1117S50TRvirtualkey51120000virtualkey511-LD1117S50">LD1117s50 5volt regulator</a> (SOT223)</td>
</tr>
</tbody>
</table>
<p><strong>Firmware</strong></p>
<p>The latest Bus Pirate firmware for all hardware version is always available on our <a href="http://code.google.com/p/the-bus-pirate/">Google Code page</a>. The code is written in C, and is compiled with the <a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1406&amp;dDocName=en534868&amp;redirects=c30">Microchip C30 demonstration compiler</a>.</p>
<p><em>Bootloader</em></p>
<p>The biggest change in the latest firmware is the addition of a <a href="http://en.wikipedia.org/wiki/Boot_loader#Boot_loader">bootloader</a>. Now the firmware can be updated through the USB or serial connection.</p>
<p>A bootloader is small program that sits at the beginning of the PIC program memory. It accepts updated firmware through the USB or serial port and saves it to the chip.</p>
<p><img class="alignnone size-full wp-image-10449" title="bootload-jumper4501" src="http://hackadaycom.files.wordpress.com/2009/04/bootload-jumper4501.jpg" alt="bootload-jumper4501" width="450" height="112" /></p>
<p>The bootloader comes from Microchip application note <a href="http://en.wikipedia.org/wiki/Boot_loader#Boot_loader">AN1157</a>. We modified the bootloader to check for a jumper between the programming clock (PGC) and data (PGD) pins at power-up (update, above left). If there&#8217;s a connection, the bootloader takes over and waits for new code. Without a connection, the bootloader exits and runs the main program.</p>
<p>There&#8217;s a very minor chance of accidentally entering the bootloader with no jumper installed. This won&#8217;t damage the Bus Pirate, but you will need to connect it again.  You can prevent it by moving the jumper over one position,  between the ground pin and the inner programming pin (normal, above right).</p>
<p><em>Upgrading the firmware with the bootloader</em></p>
<p><em><img class="alignnone size-full wp-image-10443" title="pic24fqp" src="http://hackadaycom.files.wordpress.com/2009/04/pic24fqp.png" alt="pic24fqp" width="450" height="141" /><br />
</em></p>
<p>If you&#8217;re using a fresh chip, first program it with the bootloader firmware (vxx-PIC Bootloader.hex) through the ICSP header using a &#8216;real&#8217; programmer like an <a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1406&amp;dDocName=en010046">ICD2</a> or <a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1406&amp;dDocName=en010046">PicKit</a>.</p>
<p>If you&#8217;re upgrading, follow this procedure or refer to the instructions in the firmware download.</p>
<ul>
<li>Disconnect the Bus Pirate from any power supply such as the USB cable.</li>
<li>Place a jumper between the programming data and clock pins of the ICSP header. This will trigger the bootloader mode.</li>
<li>Connect the Bus Pirate to a USB port (or, if applicable, power and serial cable).</li>
<li>Start the MS Windows P24QP.exe programmer utility. You may need to modify the COM port (portindex=) in P24qp.ini to match your system.  Programmer source is available, and the simple bootloader protocol is documented in AN1157 if you want to write an app for a non-Windows system.</li>
<li>Click the connect to device icon (#1). The program will connect to the PIC.</li>
<li>Click the folder icon (#2) and open the firmware update file (vxx-Firmware for BL.hex).</li>
<li> Click the erase device icon (#3) to erase the chip. DO NOT SKIP THIS STEP. Programming may not be successful if you forget to erase the chip.</li>
<li> Click the write device icon (#4) to program the new firmware. Ignore any verify errors between 0&#215;400 and 0xBFF, the bootloader lives in this region and doesn&#8217;t get updated.</li>
<li> Click the green arrow icon (#5) to exit the bootloader and start the program.  Click OK at the warning, we use the jumper to re-enter the bootloader.</li>
<li> Remove the jumper from the programming pins, or move it over one position to connect the inner PGx pin to ground (GND).</li>
<li>***IMPORTANT*** Now restart the Bus Pirate by disconnecting and reconnecting the USB cable (or power cable). Some features won&#8217;t work until after a complete hardware reset.</li>
</ul>
<p><strong>Using it</strong></p>
<p><em>USB device driver<br />
</em></p>
<p>You may need to install an <a href="http://www.ftdichip.com/Drivers/VCP.htm">FTDI virtual serial port driver</a> for your platform.</p>
<p>On Windows, go to the Device Manager to configure the FTDI driver or check the COM port number.</p>
<p><em>Menus and Syntax</em></p>
<p><em><img class="alignnone size-full wp-image-10444" title="term450" src="http://hackadaycom.files.wordpress.com/2009/04/term450.png" alt="term450" width="420" height="195" /><br />
</em></p>
<p>Use a serial terminal to communicate with the Bus Pirate. We like <a href="http://www.ayera.com/teraterm/">Tera Term</a>.</p>
<p>The Bus Pirate works best with the terminal set to 115200bps, 8 databits, no parity, 1stopbit. Disable local echo in the terminal, and use CR for line breaks. Some modes also require Xon/Xoff software flow control.</p>
<p>In the serial terminal, press ? for the help menu. Read more about the Bus Pirate&#8217;s menu and syntax on the <a href="http://www.buspirate.com">Bus Pirate page</a>. There&#8217;s lots of demonstrations in our recent <a href="http://hackaday.com/category/parts/">parts posts</a>.</p>
<p><em>LED indicators</em></p>
<p><em><img class="alignnone size-full wp-image-10476" title="leds-450" src="http://hackadaycom.files.wordpress.com/2009/04/leds-450.jpg" alt="leds-450" width="450" height="81" /><br />
</em></p>
<ul>
<li><strong>PWR</strong> indicates power to the Bus Pirate.</li>
<li><strong>MODE</strong> is off when the I/O pins are in a safe, high-impedance state. MODE is lit when a bus mode is engaged, the pins may be active.</li>
<li><strong>VREG</strong> indicates that the on-board switchable power supplies are active.</li>
<li><strong>UR</strong> is a single USB activity indicator LED. It displays data coming <em>from</em> the PC <em>to</em> the Bus Pirate. You can probably change what this LED displays with the <a href="http://www.ftdichip.com/Resources/Utilities.htm">FTDI configuration utility</a>.</li>
</ul>
<p><em>Connections</em></p>
<p>Pin location diagrams: <a href="http://hackadaycom.files.wordpress.com/2009/01/brd3.png">v2a</a>, <a href="http://hackadaycom.files.wordpress.com/2009/01/brd251.png">v2g0</a>.</p>
<table border="0">
<tbody>
<tr>
<td><strong>Pin name |<br />
</strong></td>
<td><strong>Description (Bus Pirate is the master)</strong></td>
</tr>
<tr>
<td>MOSI</td>
<td>Master data out, slave in (SPI, JTAG), Serial data (1-Wire, I2C, KB), TX* (UART)</td>
</tr>
<tr>
<td>CLK</td>
<td>Clock signal (I2C, SPI, JTAG, KB)</td>
</tr>
<tr>
<td>MISO</td>
<td>Master data in, slave out (SPI, JTAG) RX (UART)</td>
</tr>
<tr>
<td>CS*</td>
<td>Chip select (SPI), TMS (JTAG)</td>
</tr>
<tr>
<td>AUX</td>
<td>Auxiliary IO, frequency probe</td>
</tr>
<tr>
<td>ADC</td>
<td>Voltage measurement probe (max 6volts)</td>
</tr>
<tr>
<td>Vpu</td>
<td>Voltage input for on-board pull-up resistors (0-5volts).</td>
</tr>
<tr>
<td>+3.3v</td>
<td>+3.3volt switchable power supply, max 150ma</td>
</tr>
<tr>
<td>+5.0v</td>
<td>+5volt switchable power supply, max 150ma</td>
</tr>
<tr>
<td>GND</td>
<td>Ground, connect to ground of test circuit</td>
</tr>
</tbody>
</table>
<p>Notes: * TX moved from CS to MOSI in firmware v0g.</p>
<p>The 10 pin I/O block contains the data signals and power supplies that connect to a test circuit. Each pin is labeled on the back of the PCB, refer to the table above for a detailed description.</p>
<p>The pinout on V2 is similar to V1, but we moved the power supply output and Vpullup input  to the cable bundle. We also eliminated the second, unused auxiliary pin.</p>
<p><strong>Conclusion</strong></p>
<p>If you want a complete Bus Pirate or a kit, here&#8217;s a couple options:</p>
<ul>
<li> Seeed Studio is accepting pre-orders for assembled Bus Pirate v2go hardware until the end of Friday, July 3.  An assembled Bus Pirate v2go is $30, including worldwide shipping.</li>
<li>Seeed Studio also has the extra <a href="http://www.seeedstudio.com/depot/the-bus-pirate-v2-go-pcb-p-331.html">v2g0</a> ($5.90) and <a href="http://www.seeedstudio.com/depot/the-bus-pirate-v2-pcb-p-330.html">v2a</a> ($6.50) PCBs from our order.</li>
<li>Fundamental Logic sells a <a href="http://spiffie.org/kits/buspirate/">through-hole kit</a> version of the Bus Pirate V1a ($29.50). <strong>***v1a is serial port only***</strong></li>
</ul>
<p>Thanks to everyone who contributed to this project. The Bus Pirate wouldn&#8217;t be possible without a ton of great feedback from the comments. If you&#8217;d like to get involved, join the <a href="http://code.google.com/p/the-bus-pirate/">Bus Pirate project</a> at Google Code.</p>
<p><strong>Hack a Day review disclosure</strong>: We asked Seeed Studio to make our first order of PCBs for free. Since then, we&#8217;ve made several paid orders.</p>
<p><img class="alignnone size-full wp-image-12042" title="bpv2goiii" src="http://hackadaycom.files.wordpress.com/2009/06/bpv2goiii.jpg" alt="bpv2goiii" width="450" height="330" /></p>
<br />Posted in hardware, how-to, tool hacks  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/10041/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/10041/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/10041/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/10041/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/10041/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/10041/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/10041/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/10041/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/10041/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/10041/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/10041/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/10041/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/10041/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/10041/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=10041&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2009/06/25/how-to-the-bus-pirate-v2-with-usb/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Ian</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/04/buspiratev2goii450.jpg" medium="image">
			<media:title type="html">buspiratev2goii450</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/04/overview450.png" medium="image">
			<media:title type="html">overview450</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/04/cct25450.jpg" medium="image">
			<media:title type="html">cct25450</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/04/pic24f-highlight.jpg" medium="image">
			<media:title type="html">pic24f-highlight</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/04/ftdi-450ii1.jpg" medium="image">
			<media:title type="html">ftdi-450ii1</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/04/vreg-450ii.jpg" medium="image">
			<media:title type="html">vreg-450ii</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/04/resis.jpg" medium="image">
			<media:title type="html">resis</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/04/cct-adcin.jpg" medium="image">
			<media:title type="html">cct-adcin</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/04/front-back2450.jpg" medium="image">
			<media:title type="html">front-back2450</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/04/bpv2450.jpg" medium="image">
			<media:title type="html">bpv2450</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/04/brd25450.png" medium="image">
			<media:title type="html">brd25450</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/04/seeed-batchpcb4501.jpg" medium="image">
			<media:title type="html">seeed-batchpcb4501</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/04/bootload-jumper4501.jpg" medium="image">
			<media:title type="html">bootload-jumper4501</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/04/pic24fqp.png" medium="image">
			<media:title type="html">pic24fqp</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/04/term450.png" medium="image">
			<media:title type="html">term450</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/04/leds-450.jpg" medium="image">
			<media:title type="html">leds-450</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/06/bpv2goiii.jpg" medium="image">
			<media:title type="html">bpv2goiii</media:title>
		</media:content>
	</item>
		<item>
		<title>How-to: Bus Pirate v1, improved universal serial interface</title>
		<link>http://hackaday.com/2009/01/22/how-to-bus-pirate-v1-improved-universal-serial-interface/</link>
		<comments>http://hackaday.com/2009/01/22/how-to-bus-pirate-v1-improved-universal-serial-interface/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 02:43:56 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[hardware]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[tool hacks]]></category>
		<category><![CDATA[bus pirate]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[i2c]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[interface tools]]></category>
		<category><![CDATA[jtag]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[pc at keyboard]]></category>
		<category><![CDATA[scancode]]></category>
		<category><![CDATA[serial]]></category>
		<category><![CDATA[serial port]]></category>
		<category><![CDATA[spi]]></category>
		<category><![CDATA[uart]]></category>
		<category><![CDATA[universal interface]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=7361</guid>
		<description><![CDATA[We use the Bus Pirate to interface a new chip without writing code or designing a PCB. Based on your feedback, and our experience using the original Bus Pirate to demonstrate various parts, we updated the design with new features and cheaper components. There&#8217;s also a firmware update for both Bus Pirate hardware versions, with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=7361&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-8068" title="front450a" src="http://hackadaycom.files.wordpress.com/2009/01/front450a.jpg" alt="front450a" width="450" height="269" /></p>
<p>We use the Bus Pirate to interface a new chip without writing code or designing a PCB. Based on your feedback, and our experience using <a href="http://hackaday.com/2008/11/19/how-to-the-bus-pirate-universal-serial-interface/">the original Bus Pirate</a> to demonstrate various <a href="http://hackaday.com/category/parts/">parts</a>, we updated the design with new features and cheaper components.</p>
<p>There&#8217;s also a firmware update for both Bus Pirate hardware versions, with bug fixes, and a PC AT keyboard decoder. Check out the new <a href="http://hackaday.com/the-bus-pirate-universal-serial-interface/">Hack a Day Bus Pirate page</a>, and browse the Bus Pirate source code in our <a href="http://code.google.com/p/the-bus-pirate/source/browse/">Google code SVN repository</a>.</p>
<p>We cover the design updates and interface a digital to analog converter below.</p>
<p><span id="more-7361"></span></p>
<p><strong>Concept overview</strong></p>
<p><strong><img class="alignnone size-full wp-image-8067" title="overview-diagram1" src="http://hackadaycom.files.wordpress.com/2009/01/overview-diagram1.png" alt="overview-diagram1" width="450" height="212" /><br />
</strong></p>
<p>The Bus Pirate started as a collection of code fragments we used to test new chips without endless compile-program-run development cycles. We released it in a how-to and used it to demonstrate a bunch of serial interface ICs in our <a href="http://hackadaycom.wordpress.com/category/parts/">parts posts</a>. This article introduces an updated design with new features and a bunch of improvements.</p>
<ul>
<li>Surface mount design</li>
<li>Pull-up resistors on all bus lines with external voltage source</li>
<li>Software resettable 3.3volt and 5volt power supplies</li>
<li>Voltage monitoring of all power supplies</li>
<li>An external voltage measurement probe</li>
<li>Cheaper parts</li>
</ul>
<p><img class="alignnone size-full wp-image-7996" title="top" src="http://hackadaycom.files.wordpress.com/2009/01/top.jpg" alt="top" width="450" height="254" /></p>
<p><strong>Hardware</strong></p>
<p><strong><img class="alignnone size-full wp-image-8001" title="cct-450" src="http://hackadaycom.files.wordpress.com/2009/01/cct-450.jpg" alt="cct-450" width="450" height="140" /></strong></p>
<p><a href="http://hackadaycom.files.wordpress.com/2009/01/cct1.png">Click for a full size schematic image</a><strong> </strong>(PNG). The circuit and PCB are designed using the freeware version of <a href="http://www.cadsoft.de/">Cadsoft Eagle</a>. All the files for this project are included in the project archive linked at the end of the article.</p>
<p><em>Microcontroller</em></p>
<p>We used a Microchip <a href="http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en026374">PIC24FJ64GA002</a> 28pin SOIC microcontroller (IC1) in this project. The power pins have 0.1uF bypass capacitors to ground (C1,2). The 2.5volt internal regulator requires a 10uF tantalum capacitor (C20). The chip is programmed through a five pin header (ICSP). A 2K pull-up resistor (R1) is required for the MCLR function on pin 1. Read more about this chip in our <a href="http://hackaday.com/2008/09/18/web-server-on-a-business-card-part-1/">PIC24F introduction</a>.</p>
<p><em>RS-232 transceiver<br />
</em></p>
<p>An inexpensive <a href="http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1068">MAX3232CSE</a> RS232 transceiver (IC2) interfaces the PIC to a PC serial port. This chip replaces the expensive through-hole <a href="http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=MAX3223EEPP%2B-ND">MAX3223EEPP+</a> used in the previous version of the Bus Pirate. The serial interface will work with a USB-&gt;serial adapter.</p>
<p><em>Bus pull-up resistors</em></p>
<p><em><img class="alignnone size-full wp-image-8006" title="cct-pu450" src="http://hackadaycom.files.wordpress.com/2009/01/cct-pu450.png" alt="cct-pu450" width="450" height="137" /><br />
</em></p>
<p>The original Bus Pirate has 3.3volt pull-up resistors on 2 pins, but most of our tests required additional external resistors. The updated design has pull-up resistors (R20-23) on the three main bus signals (data in, data out, clock) and the chip select (CS) pin.</p>
<p>A row of jumpers (SV5) connects each resistor to an external voltage supplied through the Vext terminal (X4). Through-hole resistors are used like jumper-wires to make the PCB easier to etch at home.</p>
<p>We couldn&#8217;t find an elegant way to control an arbitrary voltage pull-up resistor array from a 3.3volt microcontroller. If you have any ideas, please share them in the comments.</p>
<p><em>Power supply</em></p>
<p>VR1 is a 3.3volt supply for the microcontroller and RS232 transceiver. VR2 is a 5volt supply. Both require two 0.1uF bypass capacitors (C3-C6). J1 is a power supply jack for a common <a href="http://en.wikipedia.org/wiki/DC_connector">2.1mm DC barrel plug</a>. 7-10volts DC is probably the ideal power supply range.</p>
<p><img class="alignnone size-full wp-image-8008" title="cct-vr4" src="http://hackadaycom.files.wordpress.com/2009/01/cct-vr4.png" alt="cct-vr4" width="450" height="230" /></p>
<p>The original Bus Pirate had dual power supplies, 3.3volts and 5volts, so most ICs could be interfaced without an additional power supply. A major annoyance was the lack of a power reset for connected chips. If a misconfigured IC needed to be power-cycled, we had to disconnect a wire. We got so tired of this routine that we added a software controlled reset to the updated design.</p>
<p>VR3 (3.3volts) and VR4 (5volts) are TI <a href="http://focus.ti.com/docs/prod/folders/print/tps79650.html">TPS796XX</a> voltage regulators with an enable switch. A high level on pin 1 enables the regulator. A pull-down resistor (R13,R12) ensures that the regulators are off when the PIC isn&#8217;t actively driving the line, such as during power-up initialization. The datasheet specifies a hefty capacitor on the input (C23, C21) and output (C24, C22) pins, we used the same 10uF tantalum we use everywhere. An additional, optional, 0.1uF capacitor (C12,C11) can improve regulation.</p>
<p>The switchable regulators are powered by VR2, a 5volt supply.  We did this because the maximum input for VR3 and VR4 is 6volts, leaving the device with a narrow 5.2-6volt power supply range. VR2 will work well above 10volts, and provides an adequate supply for the other regulators.</p>
<p>VR3 (3.3volts) has plenty of headroom to operate from a 5volt supply. VR4 (5volts) will lose about 0.2volts, but 4.8volts remains well within the acceptable range for most 5volt chips. In practice, and under light loads, we see less than 0.1volts drop-out from VR4.</p>
<p><em>Voltage monitoring</em></p>
<p><em><img class="alignnone size-full wp-image-8003" title="cct-adcin" src="http://hackadaycom.files.wordpress.com/2009/01/cct-adcin.png" alt="cct-adcin" width="373" height="76" /><br />
</em></p>
<p>Voltage monitoring is a new feature we&#8217;re really excited about. Has your project ever mysteriously stopped responding because of an accidental short circuit? The Bus Pirate&#8217;s power supplies are equipped with voltage monitoring that can detect a change in power levels.</p>
<p>Each monitored signal is connected to an <a href="http://en.wikipedia.org/wiki/Analog-to-digital_converter">analog to digital converter</a> (ADC) through a resistor voltage divider. Two 10K resistors (R10,R11 above) divide the input voltage in half, making it possible to measure up to 6.6volts with the 3.3volt PIC microcontroller.</p>
<p>The Bus Pirate has four voltage monitors. The 3.3volt and 5volt power supplies are monitored, as is the external voltage fed to the pull-up resistors. A fourth monitor is connected to pin 9 of the output header to make a voltage probe.</p>
<p><strong>PCB</strong></p>
<p><strong><img class="alignnone size-large wp-image-8134" title="brd450alt" src="http://hackadaycom.files.wordpress.com/2009/01/brd450alt.png?w=450&#038;h=330" alt="brd450alt" width="450" height="330" /><br />
</strong></p>
<p><a href="http://hackadaycom.files.wordpress.com/2009/01/brd.png">Click for a full size placement diagram</a> (PNG). The board is a quasi single-sided design, we etched ours in the lab on a single-sided photo-resist PCB. At the top, near C13, two jumper wires meet at a single via; we soldered one jumper wire to the other on the back of the board.</p>
<p><em>Part list</em></p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>Part</td>
<td>Value</td>
</tr>
<tr>
<td>IC1</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=V/yyTCAHA4D/h5r3CRQDtA==">PIC24FJ64GA002</a> (SOIC)</td>
</tr>
<tr>
<td>IC2</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?R=SN75C3232EDvirtualkey59500000virtualkey595-SN75C3232ED">MAX3232CSE</a> (SOIC-N)</td>
</tr>
<tr>
<td>VR1</td>
<td><a href="https://www.mouser.com/Search/ProductDetail.aspx?R=LD1117S33CTRvirtualkey51120000virtualkey511-LD1117S33C">LD1117S33</a> 3.3volt regulator (SOT223)</td>
</tr>
<tr>
<td>VR2</td>
<td><a href="https://www.mouser.com/Search/ProductDetail.aspx?R=LD1117S50TRvirtualkey51120000virtualkey511-LD1117S50">LD1117s50</a> 5volt regulator (SOT223)</td>
</tr>
<tr>
<td>VR3</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=sGAEpiMZZMsGz1a6aV8DcPXeWoVS0Fnzr3zi8%252bAr99Q%3d">TPS79633</a> 3.3volt regulator (SOT223-6)</td>
</tr>
<tr>
<td>VR4</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?R=TPS79650DCQRvirtualkey59500000virtualkey595-TPS79650DCQR">TPS79650</a> 5volt regulator (SOT223-6)</td>
</tr>
<tr>
<td>C1-13</td>
<td><a href="https://www.mouser.com/Search/ProductDetail.aspx?R=C0805C104M5RACTUvirtualkey64600000virtualkey80-C0805C104M5R">0.1uF capacitor</a> (0805)</td>
</tr>
<tr>
<td>C20-24</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?R=293D106X96R3A2TE3virtualkey61320000virtualkey74-293D106X96R3A2TE3">10uF tantalum capacitor</a> (SMC A)</td>
</tr>
<tr>
<td>R1</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=jBethxrBxZb5NLDetw123g%3d%3d">2000 ohm resistor</a> (0805)</td>
</tr>
<tr>
<td>R2,3</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=2BMLUTrrT4P7Xm58YbKmPg==">390 ohm resistor</a> (0805)</td>
</tr>
<tr>
<td>R4-13</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=sGAEpiMZZMtlubZbdhIBIADEshVnklemK%252bhrLNEuMe8%3d">10000 ohm resistor</a> (0805)</td>
</tr>
<tr>
<td>R20-23</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=8tsW7z%2fc78pkoLNVKn1xoQ%3d%3d">2.2K</a>-<a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=sGAEpiMZZMtMTfExsNintTsTnthYiOMx%2fND7UkWzrMM%3d">10K</a> ohm resistor (through-hole)</td>
</tr>
<tr>
<td>LED1,2</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=7JStj%2fjQ2SElGv%2fp7IzKlg%3d%3d">LED</a> (0805)</td>
</tr>
<tr>
<td>J1</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=8xMK%2bwDsXhcfMNb/YnnwLQ==">2.1mm power jack</a></td>
</tr>
<tr>
<td>X2,X4</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=wjes1ZhMGKfGv3iS94oZ%252bQ%3d%3d">screw clamp (2 terminals)</a> *untested</td>
</tr>
<tr>
<td>X3</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=nAEW9fCjKd%2fyLNwP2ItddQ%3d%3d"></a><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=nAEW9fCjKd%2fyLNwP2ItddQ%3d%3d">db9 female serial port connector</a> *untested</td>
</tr>
<tr>
<td>ICSP</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?R=9-146278-0virtualkey57100000virtualkey571-9-146278-0">0.1&#8243; pin header, straight</a></td>
</tr>
<tr>
<td>SV4</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?R=9-146278-0virtualkey57100000virtualkey571-9-146278-0">0.1&#8243; pin header</a> or shrouded header</td>
</tr>
<tr>
<td>SV5</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?R=9-146278-0virtualkey57100000virtualkey571-9-146278-0">0.1&#8243; pin header, straight</a></td>
</tr>
</tbody>
</table>
<p><strong>Firmware</strong></p>
<p>The firmware is written in C using the free demonstration version of the <a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1406&amp;dDocName=en010065">PIC C30 compiler</a>. Learn all about working with this PIC in our <a href="http://hackaday.com/2008/09/18/web-server-on-a-business-card-part-1/">introduction to the PIC 24F series</a>.</p>
<p>The latest firmware is posted on the <a href="http://hackaday.com/the-bus-pirate-universal-serial-interface/">Hack a Day Bus Pirate page</a>. The latest source is in our <a href="http://code.google.com/p/the-bus-pirate/source/checkout">Google Code SVN repository</a>.</p>
<p><strong>Using it</strong></p>
<p><strong><img class="alignnone size-full wp-image-8004" title="cct-pinout450" src="http://hackadaycom.files.wordpress.com/2009/01/cct-pinout450.png" alt="cct-pinout450" width="450" height="179" /><br />
</strong></p>
<p>The diagram above shows the Bus Pirate pinout.</p>
<p>We made a cable with alligator clips on the end, and added labels to each wire so we don&#8217;t have to refer to this table every time we interface a new chip.</p>
<p>If you know of any cool connectors or cables, please link to them in the comments.</p>
<p><img class="alignnone size-full wp-image-8066" title="ltc2640" src="http://hackadaycom.files.wordpress.com/2009/01/ltc2640.jpg" alt="ltc2640" width="450" height="354" /></p>
<p><em>LTC2640 SPI digital to analog voltage converter</em></p>
<p>The Linear Technology <a href="http://www.linear.com/pc/productDetail.jsp?navId=H0,C1,C1155,C1005,C1156,P85250">LTC2640-LZ8</a> is an 8bit <a href="http://en.wikipedia.org/wiki/Digital-to-analog_converter">digital to analog converter</a> (DAC) programmed over <a href="http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus">SPI</a>. A DAC is essentially a programmable voltage divider. They&#8217;re useful for recreating waveforms, such as audio signals. An 8bit DAC has 255 even intervals between 0 and the reference voltage, the L part we used has an internal 2.5volt reference.</p>
<p>The LTC2640 only comes in a small SOT223-8 package, so we made a breadboard adapter in the profile of a DIP-8 chip.  Our LTC2640 footprint is included in the project archive attached at the end of this article.</p>
<p><img class="alignnone size-large wp-image-8019" title="ltc2640450" src="http://hackadaycom.files.wordpress.com/2009/01/ltc2640450.png?w=450&#038;h=218" alt="ltc2640450" width="450" height="218" /></p>
<p>The schematic above shows our test circuit for the LTC2640. It requires a 2.7-5volt power supply, we used the Bus Pirate&#8217;s 3.3volt supply. C1 is a bypass capacitor between the power pin and ground. Pin 8 is an active-low reset pin, tie it high for normal operation. Pin 7 is the DAC output, connect the Bus Pirate voltage measurement probe (ADC) here.</p>
<table border="0">
<tbody>
<tr>
<td><strong>Bus Pirate</strong></td>
<td><strong>LTC2640 (pin #)</strong></td>
</tr>
<tr>
<td>MOSI</td>
<td>SDI (3)</td>
</tr>
<tr>
<td>CLOCK</td>
<td>SCK (2)</td>
</tr>
<tr>
<td>CS</td>
<td>CS/LD (1)</td>
</tr>
<tr>
<td>ADC</td>
<td>VOUT (7)</td>
</tr>
<tr>
<td>+3.3volts</td>
<td>CLR (8 )</td>
</tr>
<tr>
<td>+3.3volts</td>
<td>VDD (5)</td>
</tr>
<tr>
<td>GND</td>
<td>GND (4)</td>
</tr>
</tbody>
</table>
<p>We connected the Bus Pirate to the LTC2640 as shown in the table. The LTC2640 doesn&#8217;t have a data output pin, this SPI connection remains unused.</p>
<p>The Bus Pirate&#8217;s hardware SPI library and software RAW3WIRE library are compatible with the LTC2640&#8242;s SPI interface. We used the SPI library; if you use the RAW3WIRE library be sure to choose <em>normal pin output</em>.</p>
<blockquote><p>HiZ&gt;m<strong>&lt;&#8211;select mode</strong><br />
1. HiZ<br />
2. 1-WIRE<br />
3. UART<br />
4. I2C<br />
5. SPI<br />
6. JTAG<br />
7. RAW2WIRE<br />
8. RAW3WIRE<br />
9. PC AT KEYBOARD<br />
MODE&gt;5<strong>&lt;&#8211;SPI or RAW3WIRE</strong><br />
900 MODE SET<br />
Set speed:<br />
1. 30KHz<br />
2. 125KHz<br />
3. 250KHz<br />
4. 1MHz<br />
SPEED&gt;1 <strong>&lt;&#8211;test at low speed</strong><br />
&#8230;<br />
102 SPI READY<br />
SPI&gt;</p></blockquote>
<p>Press M for the Bus Pirate mode menu, choose 5 for SPI mode. There are a bunch of configuration options for the SPI module, use the default options for all of them. After SPI mode is ready we need to configure the power supply.</p>
<blockquote><p>SPI&gt;p<strong>&lt;&#8211;power supply setup</strong><br />
W/w toggles 3.3volt supply?<br />
1. NO<br />
2. YES<br />
MODE&gt;2<strong>&lt;&#8211;use 3.3volt supply</strong><br />
W/w toggles 5volt supply?<br />
1. NO<br />
2. YES<br />
MODE&gt;1<strong>&lt;&#8211;don&#8217;t use 5volt supply</strong><br />
9xx SUPPLY CONFIGURED, USE W/w TO TOGGLE<br />
9xx VOLTAGE MONITOR: 5V: 0.0 | 3.3V: 0.0 | VPULLUP: 0.0 |<br />
SPI&gt;</p></blockquote>
<p>p opens the Bus Pirate power supply menu. We use the 3.3volt supply but not the 5volt supply. The voltage monitor verifies that the power supplies are off.</p>
<blockquote><p>SPI&gt;W<strong>&lt;&#8211;capital W (<a href="http://www.w3.org/TR/CSS2/text.html#caps-prop">silly CSS</a>) enables power supply</strong><br />
9xx 3.3VOLT SUPPLY ON<br />
SPI&gt;v<strong>&lt;&#8211;voltage monitor</strong><br />
9xx VOLTAGE MONITOR: 5V: 0.0 | 3.3V: 3.3 | VPULLUP: 0.0 |<br />
SPI&gt;</p></blockquote>
<p>Capital &#8216;W&#8217; enables any power supplies selected in the previous menu, a small &#8216;w&#8217; disables them. V displays the supply voltage monitor, which now shows 3.3volts output from the 3.3volt supply.</p>
<p>Now that configuration is finished, we can send commands to the LTC2640 over the SPI bus. The LTC2640 has a 24bit (3byte) interface protocol. The first byte is a command, followed by two data bytes. The LTC2640 is available in 8,10, and 12bit versions; the 8bit version uses the first byte to set the DAC value, and ignores the second byte.</p>
<blockquote><p>SPI&gt;[0b00110000 255 0]<strong>&lt;&#8211;set DAC to full</strong><br />
110 SPI CS ENABLED<br />
120 SPI WRITE: 0&#215;30<strong>&lt;&#8211;write DAC command</strong><br />
120 SPI WRITE: 0xFF<strong>&lt;&#8211;DAC value</strong><br />
120 SPI WRITE: 0&#215;00<strong>&lt;&#8211;don&#8217;t care</strong><br />
140 CS DISABLED<br />
SPI&gt;</p></blockquote>
<p>Every SPI command begins by enabling the chip select pin ([). The first byte is the command to update the DAC (0b00110000), followed by the value to output (255), and a third byte that's ignored (0). The command ends by disabling chip select (]).</p>
<p>We used an 8bit DAC with 255 even voltage steps, output set to 255 is 100%. We can use the Bus Pirate voltage probe to measure the output.</p>
<blockquote><p>SPI&gt;d<strong>&lt;&#8211;measure voltage</strong><br />
9xx VOLTAGE PROBE: 2.5VOLTS<strong>&lt;&#8211;DAC output</strong><br />
SPI&gt;</p></blockquote>
<p>D triggers a voltage measurement. The DAC output voltage is 100% (255/255) of the internal reference, 2.5volts.</p>
<blockquote><p>SPI&gt;[0b00110000 0 0] d<br />
110 SPI CS ENABLED<br />
120 SPI WRITE: 0&#215;30<strong>&lt;&#8211;write DAC command</strong><br />
120 SPI WRITE: 0&#215;00<strong>&lt;&#8211;DAC value</strong><br />
120 SPI WRITE: 0&#215;00<strong>&lt;&#8211;don&#8217;t care</strong><br />
140 CS DISABLED<br />
9xx VOLTAGE PROBE: 0.0VOLTS<strong>&lt;&#8211;DAC output</strong><br />
SPI&gt;</p></blockquote>
<p>The same command with a DAC value of 0 outputs 0% (0/255) of 2.5volts; 0volts.</p>
<blockquote><p>SPI&gt;[0b00110000 128 0] d<br />
110 SPI CS ENABLED<br />
120 SPI WRITE: 0&#215;30<strong>&lt;&#8211;write DAC command</strong><br />
120 SPI WRITE: 0&#215;80<strong>&lt;&#8211;DAC value</strong><br />
120 SPI WRITE: 0&#215;00<strong>&lt;&#8211;don&#8217;t care</strong><br />
140 CS DISABLED<br />
9xx VOLTAGE PROBE: 1.2VOLTS<strong>&lt;&#8211;DAC output</strong><br />
SPI&gt;</p></blockquote>
<p>A DAC value of 128 is about 50% (128/255) of the reference voltage, 1.2volts.</p>
<blockquote><p>SPI&gt;[0b01000000 0 0] d<br />
110 SPI CS ENABLED<br />
120 SPI WRITE: 0&#215;40<strong>&lt;&#8211;power down command</strong><br />
120 SPI WRITE: 0&#215;00<strong>&lt;&#8211;don&#8217;t care</strong><br />
120 SPI WRITE: 0&#215;00<strong>&lt;&#8211;don&#8217;t care</strong><br />
140 CS DISABLED<br />
9xx VOLTAGE PROBE: 0.0VOLTS<strong>&lt;&#8211;DAC off</strong><br />
SPI&gt;</p></blockquote>
<p>The LTC2640 has a low power mode, triggered by the command 0b01000000 and two bytes that are ignored. After the power down command we can verify that there&#8217;s output from the DAC. Write any DAC value to exit low power mode.</p>
<p><strong>Taking it further</strong></p>
<p>What&#8217;s the next step for the Bus Pirate? We&#8217;ll eventually make a final update to the design that includes USB on a professionally made, double-sided PCB. Power supply indicator LEDs were slated for this version, but didn&#8217;t get included. It would also be handy to have an AT  keyboard connector for debugging without a PC. Check out the roadmap and wishlists on the <a href="http://hackaday.com/the-bus-pirate-universal-serial-interface/">Hack a Day Bus Pirate page</a>.</p>
<p><strong>Download: <a href="http://blog.mahalo.com/hackaday/howto/buspirate.v1a.zip">buspirate.v1a.zip</a></strong></p>
<br />Posted in hardware, how-to, tool hacks  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/7361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/7361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/7361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/7361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/7361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/7361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/7361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/7361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/7361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/7361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/7361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/7361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/7361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/7361/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=7361&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2009/01/22/how-to-bus-pirate-v1-improved-universal-serial-interface/feed/</wfw:commentRss>
		<slash:comments>65</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Ian</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/01/front450a.jpg" medium="image">
			<media:title type="html">front450a</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/01/overview-diagram1.png" medium="image">
			<media:title type="html">overview-diagram1</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/01/top.jpg" medium="image">
			<media:title type="html">top</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/01/cct-450.jpg" medium="image">
			<media:title type="html">cct-450</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/01/cct-pu450.png" medium="image">
			<media:title type="html">cct-pu450</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/01/cct-vr4.png" medium="image">
			<media:title type="html">cct-vr4</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/01/cct-adcin.png" medium="image">
			<media:title type="html">cct-adcin</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/01/brd450alt.png?w=450" medium="image">
			<media:title type="html">brd450alt</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/01/cct-pinout450.png" medium="image">
			<media:title type="html">cct-pinout450</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/01/ltc2640.jpg" medium="image">
			<media:title type="html">ltc2640</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2009/01/ltc2640450.png?w=450" medium="image">
			<media:title type="html">ltc2640450</media:title>
		</media:content>
	</item>
		<item>
		<title>Arduino buyers guide and the Seeeduino</title>
		<link>http://hackaday.com/2008/11/26/arduino-buyers-guide-and-the-seeeduino/</link>
		<comments>http://hackaday.com/2008/11/26/arduino-buyers-guide-and-the-seeeduino/#comments</comments>
		<pubDate>Thu, 27 Nov 2008 02:55:39 +0000</pubDate>
		<dc:creator>Eliot</dc:creator>
				<category><![CDATA[arduino hacks]]></category>
		<category><![CDATA[peripherals hacks]]></category>
		<category><![CDATA[tool hacks]]></category>
		<category><![CDATA[wearable hacks]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[ATmega168]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[duemilanove]]></category>
		<category><![CDATA[freeduino]]></category>
		<category><![CDATA[i2c]]></category>
		<category><![CDATA[icsp]]></category>
		<category><![CDATA[lilypad]]></category>
		<category><![CDATA[make]]></category>
		<category><![CDATA[Sanguino]]></category>
		<category><![CDATA[seeeduino]]></category>
		<category><![CDATA[smd]]></category>
		<category><![CDATA[uart]]></category>

		<guid isPermaLink="false">http://hackadaycom.wordpress.com/?p=6326</guid>
		<description><![CDATA[Make has assembled a buyers guide for the many different types of Arduino devices. The Arduino is an open hardware platform designed to make prototyping easily accessible. The design allows for other people to modify, expand, and improve on the base, and many people have started producing their own versions. The guide features a lot [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=6326&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-6327" title="seeeduino" src="http://hackadaycom.files.wordpress.com/2008/11/seeeduino.jpg" alt="seeeduino" width="450" height="339" /></p>
<p>Make has <a title="Arduino Gift Guide!" href="http://blog.makezine.com/archive/2008/11/aduino_gift_guide.html">assembled a buyers guide</a> for the many different types of Arduino devices. The <a title="Arduino - HomePage" href="http://arduino.cc/">Arduino</a> is an open hardware platform designed to make prototyping easily accessible. The design allows for other people to modify, expand, and improve on the base, and many people have started producing their own versions. The guide features a lot of the hardware we&#8217;ve covered in the past like the <a title="Turn signal jacket how-to  - Hack a Day" href="http://hackaday.com/2008/06/22/turn-signal-jacket-how-to/">LilyPad</a>, <a title="SparkFun Arduino Pro  - Hack a Day" href="http://hackaday.com/2008/08/25/sparkfun-arduino-pro/">Arduino Pro</a>, <a title="Sanguino ATmega644P board  - Hack a Day" href="http://hackaday.com/2008/10/05/sanguino-atmega644p-board/">Sanguino</a>, <a title="Arduino Duemilanove  - Hack a Day" href="http://hackaday.com/2008/10/19/arduino-duemilanove/">Duemilanove</a>, <a title="Official Arduino ethernet shield  - Hack a Day" href="http://hackaday.com/2008/11/06/official-arduino-ethernet-shield/">Ethernet Shield</a>, and <a title="Binary clock using a Freeduino SB 2.1  - Hack a Day" href="http://hackaday.com/2008/06/06/how-to-binary-clock-using-a-freeduino-sb-21/">Freeduino</a>.</p>
<p>Out of the pack, the <a title="Seeeduino fully Assembled - Arduino compatible" href="http://www.nkcelectronics.com/seeeduino-fully-assembled--arduino-compatible.html">Seeeduino</a> (pictured above) definitely caught our eye. It&#8217;s a low profile SMD design much like the Arduino Pro. They&#8217;ve taken advantage of the space saved by the SMD ATmega168 by adding more useful headers. In addition to the ICSP, you get the pins in UART order and an I2C header. Vcc is switch selectable for 3.3 or 5volts. The reset switch has been moved to the edge plus two additional ADC pins. Our favorite feature is the new spacing on the digital pins. Arduino digital pin headers have an inexplicable 160mil gap between the banks. The Seeeduino has the standard row for shield compatibility, but has an additional row spaced at standard 100mil spacing for use with protoboard. At $23.99, it&#8217;s competitively priced too.</p>
<br />Posted in arduino hacks, peripherals hacks, tool hacks, wearable hacks  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/6326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/6326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/6326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/6326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/6326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/6326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/6326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/6326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/6326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/6326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/6326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/6326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/6326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/6326/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=6326&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2008/11/26/arduino-buyers-guide-and-the-seeeduino/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">RobotSkirts</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/11/seeeduino.jpg" medium="image">
			<media:title type="html">seeeduino</media:title>
		</media:content>
	</item>
		<item>
		<title>How-to: The Bus Pirate, universal serial interface</title>
		<link>http://hackaday.com/2008/11/19/how-to-the-bus-pirate-universal-serial-interface/</link>
		<comments>http://hackaday.com/2008/11/19/how-to-the-bus-pirate-universal-serial-interface/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 22:17:57 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[hardware]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[tool hacks]]></category>
		<category><![CDATA[bus]]></category>
		<category><![CDATA[bus pirate]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[debugging tools]]></category>
		<category><![CDATA[eeprom reader]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[hacking tools]]></category>
		<category><![CDATA[i2c]]></category>
		<category><![CDATA[ic interface]]></category>
		<category><![CDATA[serial port]]></category>
		<category><![CDATA[spi]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[uart]]></category>

		<guid isPermaLink="false">http://hackadaycom.wordpress.com/?p=5882</guid>
		<description><![CDATA[UPDATE: New firmware with JTAG and more We&#8217;re always excited to get a new chip or SIM card to interface, but our enthusiasm is often dampened by the prototyping process. Interfacing any chip usually means breadboarding a circuit, writing code, and hauling out the programmer; maybe even a prototyping PCB. A few years ago we [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=5882&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-5904" title="i2ceeprom" src="http://hackadaycom.files.wordpress.com/2008/11/i2ceeprom.jpg" alt="i2ceeprom" width="450" height="308" /></p>
<p><strong>UPDATE:</strong> <a href="http://hackaday.com/2008/12/01/bus-pirate-firmware-update-v0c-jtag-and-more/">New firmware with JTAG and more</a></p>
<p>We&#8217;re always excited to get a new chip or SIM card to interface, but our enthusiasm is often dampened by the prototyping process. Interfacing any chip usually means breadboarding a circuit, writing code, and hauling out the programmer; maybe even a prototyping PCB.</p>
<p>A few years ago we built the first &#8216;Bus Pirate&#8217;, a universal bus interface that talks to most chips from a PC serial terminal. Several standard serial protocols are supported at 3.3-5volts, including <a href="http://en.wikipedia.org/wiki/I%C2%B2C">I2C</a>, <a href="http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus">SPI</a>, and <a href="http://en.wikipedia.org/wiki/Asynchronous_start-stop">asynchronous serial</a>. Additional &#8216;raw&#8217; 2- and 3- wire libraries can interface almost any proprietary serial protocols. Since this has been such a useful tool for us, we cleaned up the code, documented the design, and released it here with specs, schematic, and source code.</p>
<p><span id="more-5882"></span></p>
<p><strong>Concept Overview</strong></p>
<p><strong><img class="alignnone size-full wp-image-6028" title="overview-diagram-new" src="http://hackadaycom.files.wordpress.com/2008/11/overview-diagram-new.png" alt="overview-diagram-new" width="450" height="161" /><br />
</strong></p>
<p><strong><br />
</strong></p>
<p>The Bus Pirate is a serial terminal bridge to multiple IC interface protocols. We type commands into a serial terminal on the computer. The commands go to the Bus Pirate through the PC serial port. The Bus Pirate talks to a microchip in the proper protocol, and returns the results to the PC.</p>
<p>All pins output 3.3volts, but are 5volt tolerant. On-board 3.3volt and 5volt power supplies are available to power the connected chip. Software configurable I2C <a href="http://en.wikipedia.org/wiki/Pull-up_resistor">pull-up resistors</a> complete the package.</p>
<p><img class="alignnone size-full wp-image-5893" title="terminal-450" src="http://hackadaycom.files.wordpress.com/2008/11/terminal-450.png" alt="terminal-450" width="401" height="251" /></p>
<p>The serial terminal interface works with any system: PC, Mac, Linux, Palm Pilots, WinCE devices, etc; no crapware required. We considered a USB device, but USB isn&#8217;t compatible with the huge number of hand-held devices that have a serial port. We also wanted a 3.3volt device with 5volt tolerant inputs, but most popular through-hole USB microcontollers were 5volt parts (e.g. the <a href="http://www.microchip.com/ParamChartSearch/chart.aspx?branchID=111&amp;mid=10&amp;lang=en&amp;pageId=74">PIC18Fx550</a>).</p>
<p>The Bus Pirate currently &#8216;speaks&#8217; three hardware protocols for high-speed interfacing, and has two software protocol libraries for easy bus manipulation. The theory and specification of each protocol is beyond what we can cover here, but check out some of these tutorials:</p>
<p><em>I2C</em></p>
<p>A slow 2 wire bus. Wikipedia is a great place to start for <a href="http://en.wikipedia.org/wiki/I%C2%B2C">I2C background</a>. <a href="http://www.i2c-bus.org/">I2C-Bus.org</a>, <a href="http://www.robot-electronics.co.uk/htm/using_the_i2c_bus.htm">Robot Electronics</a>, <a href="http://www.esacademy.com/faq/i2c/">Embedded Systems Academy</a>, and <a href="http://www.embedded.com/story/OEG20010718S0073">Embedded.com</a> have decent I2C tutorials.</p>
<p><em>SPI</em></p>
<p>A simple 3 wire bus. Wikipedia has <a href="http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus">background</a>; Embedded.com has a great <a href="http://www.embedded.com/columns/beginerscorner/9900483">tutorial and comparison to I2C</a>.</p>
<p><em>Universal Asynchronous Receiver Transmitter (UART or serial)</em></p>
<p>A clock and timing dependent serial protocol best known for its appearance as the PC serial port protocol. Wikipedia has background on <a href="http://en.wikipedia.org/wiki/Asynchronous_start-stop">asynchronous serial protocols</a>.</p>
<p><em>Raw 2 wire</em></p>
<p>This is a generic 2 wire protocol library, similar to I2C but without an ACK bit. I2C and many proprietary 2 wire protocols can be formed using the bus manipulations available in this mode. Use this library to work with non-I2C 2 wire devices, like <a href="http://www.smartcardsupply.com/Content/Cards/SLE4442.htm">smartcards</a> or <a href="http://www.sensirion.com/en/01_humidity_sensors/02_humidity_sensor_sht11.htm">Sensirion SHT11</a> temperature/humidity sensors.</p>
<p><em>Raw 3 wire</em></p>
<p>This is a generic 3 wire protocol library, similar to SPI but without the constraints of a hardware module. Use this library to work with devices that use non-8bit compatible 3-wire protocols, like the <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=569">Sparkfun Nokia 6100 LCD knock-off</a>. Many 3 wire protocols can be formed using the bus manipulations available in this mode.</p>
<p><strong>Hardware</strong></p>
<p><img class="alignnone size-full wp-image-5897" title="brd-450" src="http://hackadaycom.files.wordpress.com/2008/11/brd-450.png" alt="brd-450" width="451" height="325" /></p>
<p><a href="http://hackadaycom.files.wordpress.com/2008/11/brd.png">Click for a full size PCB placement image</a> (PNG). Screw terminals connect to the power supplies. A row of seven pin headers connect to the IO pins. Despite the label, only 7volts DC is required.</p>
<table style="text-align:left;" border="0">
<tbody>
<tr>
<td>
<div><strong>PIN</strong></div>
</td>
<td>
<div><strong>SPI</strong></div>
</td>
<td>
<div><strong>I2C</strong></div>
</td>
<td>
<div><strong>RS232</strong></div>
</td>
</tr>
<tr>
<td>
<div><strong>B9</strong></div>
</td>
<td>
<div>MOSI</div>
</td>
<td>
<div>SDA</div>
</td>
<td>
<div>-</div>
</td>
</tr>
<tr>
<td>
<div><strong>B8</strong></div>
</td>
<td>
<div>CLK</div>
</td>
<td>
<div>SCL</div>
</td>
<td>
<div>-</div>
</td>
</tr>
<tr>
<td>
<div><strong>B7</strong></div>
</td>
<td>
<div>MISO</div>
</td>
<td>
<div>-</div>
</td>
<td>
<div>RX</div>
</td>
</tr>
<tr>
<td>
<div><strong>B6</strong></div>
</td>
<td>
<div>CS</div>
</td>
<td>
<div>-</div>
</td>
<td>
<div>TX</div>
</td>
</tr>
<tr>
<td>
<div><strong>B5</strong></div>
</td>
<td>
<div>AUX</div>
</td>
<td>
<div>AUX</div>
</td>
<td>
<div>AUX</div>
</td>
</tr>
<tr>
<td>
<div><strong>Ground</strong></div>
</td>
<td>
<div>GND</div>
</td>
<td>
<div>GND</div>
</td>
<td>
<div>GND</div>
</td>
</tr>
</tbody>
</table>
<p>This table shows the pin connections for each bus mode. Raw 2 wire mode uses the same pin configuration as I2C. Raw 3 wire mode uses the same pin configuration as SPI.</p>
<p><img class="alignnone size-full wp-image-5899" title="cct-450" src="http://hackadaycom.files.wordpress.com/2008/11/cct-450.png" alt="cct-450" width="450" height="191" /></p>
<p><a href="http://hackadaycom.files.wordpress.com/2008/11/cct.png">Click for a full size circuit image</a> (PNG). The circuit and PCB are designed using the freeware version of <a href="http://www.cadsoft.de">Cadsoft Eagle</a>. Download the <a href="http://blog.mahalo.com/hackaday/howto/buspirate.v0b.zip">project archive</a> (ZIP).</p>
<p><em>PIC 24FJ64GA002</em></p>
<p>We used a <a href="http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en026374">PIC24FJ64GA002</a> microcontroller in the Bus Pirate; this is the same chip we used in our <a href="http://hackaday.com/2008/09/25/web-server-on-a-business-card-part-2/">mini-server project</a>. It&#8217;s fast enough to do everything we want (16MIPS), and the peripheral pin select feature allows the hardware SPI, UART, and I2C modules to share output pins. Each power pin needs a decoupling capacitor(C12,13), and the MCLR function requires a resistor (R7) between pin 1 and 3.3volts. The PIC has an internal voltage regulator that requires a 10uF tantalum capacitor (C3), though we used a plain electrolytic capacitor without issue. Read about programming and working with this chip in our <a href="http://hackaday.com/2008/09/18/web-server-on-a-business-card-part-1/">PIC24F tutorial</a>. If you don&#8217;t have a PIC debugger, several readers recommend the under-$40 ICD2 clones on eBay.</p>
<p>The PIC runs at 3.3volts, but the digital-only pins are 5volt tolerant for interfacing 5volt logic. Pins 14,15,16,17,18,21, and 22, are digital only, which we determined by looking through the datasheet and eliminating any pins with an analog connection type (table 1-2, pages 11-16). According to the datasheet, I2C pins are also 5volt tolerant. There&#8217;s a bunch of conflicting information on the web, but datasheet page 230, parameter DI28, clearly states that the max input for a 24FJ64GA002 I2C pin without analog circuitry is 5.5volts.</p>
<p>Pins 21 and 22 (RB10/11) can pull-up SDA/SCL through resistors R4 and R5.</p>
<p><em>MAX3223CPP</em></p>
<p>This chip converts 3.3volt serial output to +/-10volt RS232 signals compatible with a PC serial port. The MAX3223CPP is a 3-5volt version of the MAX202, with extra power saving features. MAX RS232 transceivers require four 0.1uF capacitors for a charge pump (C4,5,7,8), and one decoupling capacitor (C17). We used the same capacitors for everything.</p>
<p>We used a MAX3223CPP, which doesn&#8217;t seem to be available anymore. <a href="http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=MAX3223EEPP%2B-ND">MAX3223EEPP+</a> is a pin-compatible newer version, available at Digikey for $7. Ouch! None of the 3223&#8242;s power saving features are used, so a cheaper, simpler 3.3volt RS232 transceiver should be substituted if at all possible.</p>
<p><em>Power supplies</em></p>
<p>Most chips can be powered from the Bus Pirate&#8217;s on-board 3.3volt and 5volt supplies. 5volts is supplied by a common 7805 regulator (VR2) and two decoupling capacitors (C9,10). An LM317 adjustable regulator (VR1) is set to 3.3volts using two resistors (R2,3), and requires two decoupling capacitors (C6,7). The circuit requires a 7-10volt DC supply (J1).</p>
<p><em>Part list</em></p>
<table style="text-align:left;" border="0">
<tbody>
<tr>
<td><strong>Part </strong></td>
<td><strong>Value</strong></td>
</tr>
<tr>
<td>IC1</td>
<td><a href="http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=PIC24FJ64GA002-I/SP-ND">PIC24FJ64GA002-DIP</a></td>
</tr>
<tr>
<td>IC2</td>
<td>MAX3223CPP (try <a href="http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=MAX3223EEPP%2B-ND">MAX3223EEPP+</a>)</td>
</tr>
<tr>
<td>C3</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=M%252b5JCWh%252b1ty3RFguvdcdsg%3d%3d">10uF capacitor</a> (preferably tantalum)</td>
</tr>
<tr>
<td>C4-13,17</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=9AX3phJxokWIpR5WRGtIJw%3d%3d">0.1uF capacitors</a></td>
</tr>
<tr>
<td>R1</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=ULgY8XwKjTmmv2gtdH4CoQ%3d%3d">330 ohm resistor</a></td>
</tr>
<tr>
<td>R2</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=4eNa8160l8VHA9lUHkRdvw%3d%3d">240 ohm resistor</a></td>
</tr>
<tr>
<td>R3</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=X3IDIfI%252bJAVuAq1Yim8fmg%3d%3d">390 ohm resistor</a></td>
</tr>
<tr>
<td>R4,5,7</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=8tsW7z%2fc78pkoLNVKn1xoQ%3d%3d">2K2  ohm resistor</a></td>
</tr>
<tr>
<td>VR1</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=swDD%252bF%252bps7c8uLyY%252b3mJJw%3d%3d">LM317</a></td>
</tr>
<tr>
<td>VR2</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=cnIeywgme7bzmZ37%2fiFT9w%3d%3d">LM7805</a></td>
</tr>
<tr>
<td>X1</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=wjes1ZhMGKfGv3iS94oZ%252bQ%3d%3d">Screw clamp (3 terminals)</a> *untested</td>
</tr>
<tr>
<td>X2</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=nAEW9fCjKd%2fyLNwP2ItddQ%3d%3d">DB9 Female connector (serial port)</a> *untested</td>
</tr>
<tr>
<td>ICSP,SV3</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?R=4-103329-0virtualkey57100000virtualkey571-41033290">.1&#8243; pin header, right angle</a></td>
</tr>
<tr>
<td>J1</td>
<td><a href="http://www.mouser.com/Search/ProductDetail.aspx?qs=8xMK%252bwDsXhcfMNb%2fYnnwLQ%3d%3d">Power jack, 2.1mm pin</a></td>
</tr>
<tr>
<td>LED1</td>
<td>3mm LED (optional)</td>
</tr>
</tbody>
</table>
<p><strong>Firmware</strong></p>
<p>The firmware is written in C using the free demonstration version of the <a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1406&amp;dDocName=en010065">PIC C30 compiler</a>. Learn all about working with this PIC in our <a href="http://hackaday.com/2008/09/18/web-server-on-a-business-card-part-1/">introduction to the PIC 24F series</a>. Download the <a href="http://blog.mahalo.com/hackaday/howto/buspirate.v0b.zip">project archive</a> (ZIP).</p>
<p>main.c &#8211; Handles the user terminal interface.</p>
<p>busPirate.c &#8211; Abstraction routines that convert syntax to actions on the proper bus.</p>
<p>uartIO.c &#8211; IO routines for both hardware UARTs.</p>
<p>m_i2c_1.c &#8211; Software I2C routines by [<a href="http://www.microchipc.com/sourcecode/#i2c">Michael Pearce</a>]. We couldn&#8217;t get the PIC hardware I2C to work, so we used this helpful library. The software doesn&#8217;t take into account the I2C speed setting, and seems to work at about 5KHz.</p>
<p>SPI.c &#8211; Routines that drive the hardware SPI module.</p>
<p>raw2wire.c &#8211; Software 2-wire interface library.</p>
<p>raw3wire.c &#8211; Software 3-wire (SPI) interface library.</p>
<p>User input is held in a 4000 byte buffer until a newline character (enter) is detected. If the first character of the input is a menu option (see below), the menu dialog is shown, otherwise the string is parsed for data to send over the bus (see syntax). The code consists of an embarrassing number of switch statements and spaghetti code.</p>
<p><strong>Terminal interface</strong></p>
<p>Rather than write a junk piece of software to control the device, we gave it a serial command line interface that will work with any ASCII terminal.  The bus pirate responds to commands with three digit result codes and a short message. The codes are designed with PC automation in mind. We&#8217;ve included a table of result codes in the <a href="http://blog.mahalo.com/hackaday/howto/buspirate.v0b.zip">project archive</a> (zip).</p>
<p><em>Menu options</em></p>
<p>Menu options are single character commands that don&#8217;t involve data transfers. Enter the character, followed by &lt;enter&gt;, to access the menu.</p>
<p><strong>?</strong> &#8211; Show a help menu with commands and syntax.</p>
<p><strong>M</strong> &#8211; Set the bus mode (SPI, I2C, UART, raw 2 wire, raw 3 wire). Followed immediately by a prompt for speed, polarity, and output state (mode dependent).</p>
<ul>
<li>Bus speeds: SPI:30, 125, 250, 1000KHz. I2C:100, 400, 1000KHz. UART: 300, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200bps. Raw modes: 1, 10, 50KHz.</li>
<li>Inverse clock setting sets the idle state opposite of normal (normal SPI:idle low; normal UART:idle high): SPI:idle high; UART:idle low.</li>
<li>Some modes have optional high-z output modes for use with pull-up resistors (Low=ground, High=input).</li>
</ul>
<p><strong>L &#8211; </strong>Toggle bit transmit/receive order: most/least significant bit first.</p>
<p><strong>P</strong> &#8211; SDA/SCL pin pull-up resistor toggle (3.3volts). Only valid in I2C and raw 2 wire modes.</p>
<p><strong>O</strong> &#8211; Set number output display format. The terminal can display numbers as decimal, hexadecimal, and binary ASCII values. A fourth format sends the raw, unprocessed byte for reading ASCII formatted text.</p>
<p><em>Syntax</em></p>
<p>A simple syntax is used to communicate with chips over a bus.  Syntax commands have generic functions that generally apply to all bus types.</p>
<p><strong>A/a/@ </strong> &#8211; Toggle auxiliary pin. Capital &#8220;A&#8221; sets AUX high, small &#8220;a&#8221; sets to ground. @ sets aux to input (high impedance mode) and reads the pin value.</p>
<p><strong>[ </strong> - Start data write. SPI/raw 3 wire: chip select enabled. I2C/raw 2 wire: start condition. RS232: open UART, discard received bytes.</p>
<p><strong>{ </strong> - Start data write with reads. Same as [, except: SPI/raw 3 wire: show the read byte for each write. RS232: display data as it arrives asynchronously.</p>
<p><strong>] or }</strong> &#8211; End data write. SPI/raw 3 wire: chip select disabled. I2C/raw 2 wire: stop condition. RS232: close UART.</p>
<p><strong>R/r</strong> &#8211; Read byte. SPI/raw 3 wire: send dummy byte, return read. I2C: read byte with ACK. Raw 2 wire: read 8 bits. RS232: check UART for byte and return, or fail if empty. Use 0r1&#8230;255 for bulk reads up to 255 bytes.</p>
<p><strong>0b</strong> &#8211; Write this binary value. Format is 0b00000000 for a byte, but partial bytes are also fine: 0b1001.</p>
<p><strong>0h or 0x</strong> &#8211; Write this HEX value. Format is 0h01 or 0&#215;01. Partial bytes are fine: 0xA. A-F can be lower-case or capital letters.</p>
<p><strong>0-255</strong> &#8211; Write this decimal value. Any number not preceded by 0x, 0h, or 0b is interpreted as a decimal value.</p>
<p><strong>, or space</strong> -	Value delimiter. Use a coma or space to separate numbers. Any combination is fine, no delimiter is required between non-number values: {0xa6,0, 0 16 5 0b111 0haF}.</p>
<p><em>Direct bus manipulation commands for raw 2 wire mode and raw 3 wire mode.</em><br />
<strong>^</strong> &#8211; Send one clock tick. Use 0^1&#8230;255 for multiple clock ticks.</p>
<p><strong>/ and \</strong> &#8211; Toggle clock level high (/) and low (\). Includes clock delay (100uS).</p>
<p><strong>-/_</strong> &#8211; Toggle data state high (-) and low (_). Includes data setup delay (20uS).</p>
<p><strong>! </strong>- Read one bit with clock.</p>
<p><strong>. </strong>- Read data pin state (no clock).</p>
<p><strong>&amp;</strong> &#8211; Delay 1uS. Use 0&amp;1&#8230;255 for multiple delays.</p>
<p><strong>Using it</strong></p>
<p><strong><img class="alignnone size-full wp-image-5902" title="buspirate-24fv0a" src="http://hackadaycom.files.wordpress.com/2008/11/buspirate-24fv0a.jpg" alt="buspirate-24fv0a" width="450" height="330" /><br />
</strong></p>
<p>Here are two examples that show the Bus Pirate in action. Terminals should be set to ASCII mode with local echo, we used the Windows serial terminal. The PC-side serial connection is 115200bps, 8N1. The Bus Pirate should respond to any single line feed type (0x0a, 0x0d), or both (Windows style).</p>
<p><em><a name="EEPROM">.</a>I2C/SPI &#8211; Flash 24LC1025 EEPROM</em></p>
<p><a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=80">Microchip&#8217;s EEPROMS</a> are popular permanent-storage memory chips, the <a href="http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en024636">24LC1025</a> has 128Kbytes of storage with an I2C interface.  We can test this chip without bread-boarding a big circuit or writing code.</p>
<p><img class="alignnone size-full wp-image-5904" title="i2ceeprom" src="http://hackadaycom.files.wordpress.com/2008/11/i2ceeprom.jpg" alt="i2ceeprom" width="450" height="308" /></p>
<p>The picture shows an 24LC1025 connected to the Bus Pirate. The EEPROM works from 2.7 to 5volts, so we used the 3.3volt supply from the Bus Pirate to power the circuit. The on-board SDA/SCL pull-up resistors hold the I2C bus high, and eliminate the need for external resistors. A single 0.1uF capacitor decouples the EEPROM from the power supply.</p>
<p><span style="text-decoration:underline;">Setup I2C mode</span></p>
<p>First, we setup the Bus Pirate for I2C mode and enable the pull-up resistors. Since the Bus Pirate currently uses a software I2C library, the speed setting doesn&#8217;t really have an effect.</p>
<blockquote><p>SPI&gt;m  <strong>&lt;&#8211;enter m for mode select</strong><br />
1. SPI<br />
2. I2C<br />
3. UART<br />
4. RAW 2 WIRE<br />
5. RAW 3 WIRE<br />
MODE&gt;2  <strong>&lt;&#8211;enter 2 for I2C</strong><br />
900 MODE SET<br />
Set speed:<br />
1. 100KHz (Standard)<br />
2. 400KHz (Fast Mode)<br />
3. 1MHz (High Speed)<br />
SPEED&gt;1 <strong>&lt;&#8211;speed doesn&#8217;t really do anything&#8230;</strong><br />
901 SPEED SET<br />
202 I2C READY, P/p FOR PULLUPS<br />
I2C&gt;P   <strong>&lt;&#8211;enable the I2C pull-up resistors</strong><br />
205 I2C PULLUP ON<br />
I2C&gt;</p></blockquote>
<p><span style="text-decoration:underline;">Write to EEPROM (I2C)</span></p>
<p>All I2C operations begin with a start condition { or [, and end with a stop condition } or ]. A write begins by addressing the device (1 byte) and looking for an acknowledgment bit (ACK). If the EEPROM responds, we can send the data location to write (2 bytes) and data payload (n bytes). The Bus Pirate automatically checks for an ACK at the end of each write, and ACKs each read.</p>
<p>The 24LC1025 base address is 1010xxy, where xx is determined by the state of pins 2 and 3, and y is read (1) or write (0) mode. We tied pins 2 and 3 high, making the full write address <strong>1010110</strong>.  We&#8217;ll start writing to the device at the first data location (<em>0 0</em>), and write one to thirteen using a mix of data input formats (<span style="text-decoration:underline;">1&#8230;13</span>).</p>
<blockquote><p>I2C&gt;{<strong>0b10100110 </strong><em>0 0 </em><span style="text-decoration:underline;">1 2 3 4 5 6 7 8 9 10 0xb 0xc 13</span>} <strong>&lt;&#8211;I2C command </strong><br />
210 I2C START CONDITION <strong>&lt;&#8211;bus start</strong><br />
220 I2C WRITE: 0xA6 GOT ACK: YES <strong>&lt;&#8211;address sent and ACK received</strong><br />
220 I2C WRITE: 0&#215;00 GOT ACK: YES <strong>&lt;&#8211;write address</strong><br />
220 I2C WRITE: 0&#215;00 GOT ACK: YES <strong>&lt;&#8211;write address</strong><br />
220 I2C WRITE: 0&#215;01 GOT ACK: YES <strong>&lt;&#8211;data</strong><br />
&#8230;<br />
220 I2C WRITE: 0x0D GOT ACK: YES<br />
240 I2C STOP CONDITION<br />
I2C&gt;</p></blockquote>
<p><span style="text-decoration:underline;">Read from EEPROM (I2C)</span></p>
<p>Reading the 24LC1025 takes two steps. First, a write command with no data sets the address pointer. Second, a read command outputs data starting at the location set in step 1.</p>
<p>The first command is a write command, we use the hexadecimal equivalent of the write address (0b10100110 = 0xa6) to save a bit of typing. The address pointer is set to the location where we wrote our data (0 0).</p>
<blockquote><p>I2C&gt;{0xa6 0 0} <strong>&lt;&#8211;set write pointer command</strong><br />
210 I2C START CONDITION<br />
220 I2C WRITE: 0xA6 GOT ACK: YES<br />
220 I2C WRITE: 0&#215;00 GOT ACK: YES<br />
220 I2C WRITE: 0&#215;00 GOT ACK: YES<br />
240 I2C STOP CONDITION</p></blockquote>
<p>With the pointer set, we can start reading data. The read address is the device address, with the last bit set to 1 ( 0b10100111 or 0xa7). We used thirteen r commands to read the data, but we could have used the shorthand version: 0r13.</p>
<blockquote><p>I2C&gt;{0b10100111 rrrrrrrrrrrrr}<strong> &lt;&#8211;read command</strong><br />
210 I2C START CONDITION<br />
220 I2C WRITE: 0xA7 GOT ACK: YES <strong>&lt;&#8211;chip ACKed the read address</strong><br />
230 I2C READ: 0&#215;01 <strong>&lt;&#8211;data byte 1</strong><br />
230 I2C READ: 0&#215;02 <strong>&lt;&#8211;data byte 2</strong><br />
&#8230;<br />
230 I2C READ: 0x0D <strong>&lt;&#8211;data byte 13</strong><br />
240 I2C STOP CONDITION<br />
I2C&gt;</p></blockquote>
<p>We know the operation was a success because the output matches the data we wrote earlier.</p>
<p><em>UART &#8211; EM406 SurfIII GPS</em></p>
<p><img class="alignnone size-full wp-image-5905" title="gps" src="http://hackadaycom.files.wordpress.com/2008/11/gps.jpg" alt="gps" width="450" height="338" /></p>
<p>The <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=465">EM406</a> is a tiny 5volt GPS module that tracks up to 20 satellites. By default, it outputs NMEA formatted data from a serial port at 4800bps, 8N1. The output format is standard serial, but at 2.8volts it&#8217;s incompatible with PC serial ports. The Bus Pirate can interface this GPS without the need for a separate RS232 transceiver or 5volt power supply.</p>
<p><span style="text-decoration:underline;">Setup the UART</span></p>
<p>First, we setup the Bus Pirate UART to receive serial data at 4800bps.</p>
<blockquote><p>I2C&gt;m <strong>&lt;&#8211;setup mode</strong><br />
1. SPI<br />
2. I2C<br />
3. UART<br />
4. RAW 2 WIRE<br />
5. RAW 3 WIRE<br />
MODE&gt;3 <strong>&lt;&#8211;UART</strong><br />
900 MODE SET<br />
Set speed:<br />
(bps)<br />
1. 300<br />
2. 1200<br />
3. 2400<br />
4. 4800<br />
&#8230;<br />
9. 115200<br />
SPEED&gt;4  <strong>&lt;&#8211;4800bps</strong><br />
901 SPEED SET<br />
302 UART READY<br />
UART&gt;</p></blockquote>
<p><span style="text-decoration:underline;">Enable UART and data reads</span></p>
<p>An important thing to remember about UARTs is that the data arrives asynchronously. Unlike SPI and I2C, where data transfer is controlled by the master, serial data can arrive at the UART at any time. The GPS is a great example of this because it spits out location data continuously, without user intervention.</p>
<p>We developed two read modes to cope with asynchronous data .  { echos all incoming data as it arrives.  New data will displace and garble data entry, but all input is still accepted normally.  [ opens the UART in a send only mode that discards incoming bytes. } or ] closes the UART, regardless of the mode.</p>
<blockquote><p>UART&gt;{ <strong>&lt;&#8211;open UART with async reads</strong><br />
310 UART OPEN, } TO CLOSE<br />
330 UART READ: 0&#215;80 <strong>&lt;&#8211;GPS data</strong><br />
330 UART READ: 0&#215;78</p></blockquote>
<p><span style="text-decoration:underline;">Write to the UART</span></p>
<p>Type in values to send out the UART. Even if the input is broken up by incoming data, it will be processed on &lt;enter&gt;.  We sent <em>0&#215;40</em> as an example, but this has no particular meaning to the GPS module.</p>
<blockquote><p>330 UART READ: 0&#215;80 <em>0&#215;40</em><strong>&lt;&#8211;random byte to write</strong><br />
320 UART WRITE: 0&#215;40 <strong>&lt;&#8211;byte written</strong></p></blockquote>
<p><span style="text-decoration:underline;">Close the UART</span></p>
<p>&#8220;}&#8221; followed by &lt;enter&gt; closes the UART.</p>
<blockquote><p>330 UART READ: 0&#215;78<br />
303 UART READ: 0&#215;60 <em>} </em><strong>&lt;&#8211;close UART command</strong><br />
330 UART READ: 0xE6<br />
340 UART CLOSED<br />
UART&gt;</p></blockquote>
<p>Don&#8217;t think you can use this GPS data to track us, we don&#8217;t actually get satellite reception down here in mom&#8217;s basement.</p>
<p><strong>Taking it further</strong></p>
<p>The Bus Pirate is an important development tool in our lab. We keep updating it as we use it, and we&#8217;ll release new firmware as we add protocols and features. Expect to see the Bus Pirate in future articles.</p>
<p>These improvements are at the top of our list. Do you have any suggestions?</p>
<ul>
<li>New protocols: One Wire, CAN, ???</li>
<li>Controls for polarity and other settings</li>
<li>Adjustable instruction delay</li>
<li>Get hardware I2C module working.</li>
<li>Enable protocol speed settings.</li>
<li>Cheaper, easier to get RS232 transceiver</li>
</ul>
<p>The <a href="http://blog.mahalo.com/hackaday/howto/buspirate.v0b.zip">project archive</a> (ZIP) has everything you need to build your own Bus Pirate.</p>
<br />Posted in hardware, how-to, tool hacks  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/5882/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/5882/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/5882/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/5882/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/5882/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/5882/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/5882/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/5882/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/5882/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/5882/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/5882/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/5882/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/5882/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/5882/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=5882&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2008/11/19/how-to-the-bus-pirate-universal-serial-interface/feed/</wfw:commentRss>
		<slash:comments>54</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Ian</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/11/i2ceeprom.jpg" medium="image">
			<media:title type="html">i2ceeprom</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/11/overview-diagram-new.png" medium="image">
			<media:title type="html">overview-diagram-new</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/11/terminal-450.png" medium="image">
			<media:title type="html">terminal-450</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/11/brd-450.png" medium="image">
			<media:title type="html">brd-450</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/11/cct-450.png" medium="image">
			<media:title type="html">cct-450</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/11/buspirate-24fv0a.jpg" medium="image">
			<media:title type="html">buspirate-24fv0a</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/11/i2ceeprom.jpg" medium="image">
			<media:title type="html">i2ceeprom</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/11/gps.jpg" medium="image">
			<media:title type="html">gps</media:title>
		</media:content>
	</item>
	</channel>
</rss>
