<?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; projects</title>
	<atom:link href="http://hackaday.com/tag/projects/feed/" rel="self" type="application/rss+xml" />
	<link>http://hackaday.com</link>
	<description>Fresh hacks every day</description>
	<lastBuildDate>Sun, 12 Feb 2012 06:24:26 +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; projects</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>Cornell final project list</title>
		<link>http://hackaday.com/2010/05/08/cornell-final-project-list/</link>
		<comments>http://hackaday.com/2010/05/08/cornell-final-project-list/#comments</comments>
		<pubDate>Sat, 08 May 2010 13:29:07 +0000</pubDate>
		<dc:creator>Jakob Griffith</dc:creator>
				<category><![CDATA[misc hacks]]></category>
		<category><![CDATA[Atmel]]></category>
		<category><![CDATA[cornell]]></category>
		<category><![CDATA[finals]]></category>
		<category><![CDATA[mega644]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[university]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=23888</guid>
		<description><![CDATA[Looking for an interesting project to do using an Atmel Mega644? Students at Cornell University have got you covered. They were required to choose, design, and build a project using the microcontroller; and this year is quite promising with video object tracking, the always popular theremins, helicopters, Potentiostats, even Pavlovian conditioned mosquitoes, and more. Of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=23888&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-23889" title="Arnt you glad I'm not lazy and just featured each project each day for the next year?" src="http://hackadaycom.files.wordpress.com/2010/05/pcb_close_large.jpg" alt="" width="470" height="315" /></p>
<p>Looking for an interesting project to do using an Atmel Mega644? <a href="http://instruct1.cit.cornell.edu/courses/ee476/FinalProjects/">Students at Cornell University</a> have got you covered. They were required to choose, design, and build a project using the microcontroller; and this year is quite promising with <a href="http://instruct1.cit.cornell.edu/courses/ee476/FinalProjects/s2010/aip23_kaf42/aip23_kaf42/index.html">video object tracking</a>, the always popular <a href="http://instruct1.cit.cornell.edu/courses/ee476/FinalProjects/s2010/dl346_swj4/dl346_swj4/4760_Final.htm">theremins</a>, <a href="http://instruct1.cit.cornell.edu/courses/ee476/FinalProjects/s2010/jk483_ksd28_zkd2/jk483_ksd28_zkd2/index.html">helicopters</a>, <a href="http://instruct1.cit.cornell.edu/courses/ee476/FinalProjects/s2010/esf59_akh75/esf59_akh75/index.html">Potentiostats</a>, even <a href="http://instruct1.cit.cornell.edu/courses/ee476/FinalProjects/s2010/der34_jhp35_ksm38/der34_jhp35_ksm38/index.html">Pavlovian conditioned mosquitoes</a>, and more.</p>
<p>Of course all the previous years are included as well, making over 350 projects total.</p>
<p>[Thanks Bruce Land]</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/23888/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/23888/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/23888/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/23888/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/23888/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/23888/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/23888/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/23888/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/23888/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/23888/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/23888/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/23888/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/23888/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/23888/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=23888&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2010/05/08/cornell-final-project-list/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Jakob Griffith</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2010/05/pcb_close_large.jpg" medium="image">
			<media:title type="html">Arnt you glad I&#039;m not lazy and just featured each project each day for the next year?</media:title>
		</media:content>
	</item>
		<item>
		<title>Bus Pirate firmware update (v.0c), JTAG and more</title>
		<link>http://hackaday.com/2008/12/01/bus-pirate-firmware-update-v0c-jtag-and-more/</link>
		<comments>http://hackaday.com/2008/12/01/bus-pirate-firmware-update-v0c-jtag-and-more/#comments</comments>
		<pubDate>Mon, 01 Dec 2008 20:37:35 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[classic hacks]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[tool hacks]]></category>
		<category><![CDATA[bench tools]]></category>
		<category><![CDATA[bus]]></category>
		<category><![CDATA[bus pirate]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[i2c]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[jtag]]></category>
		<category><![CDATA[projects]]></category>

		<guid isPermaLink="false">http://hackadaycom.wordpress.com/?p=6457</guid>
		<description><![CDATA[Download: buspirate.v0c.zip A few weeks ago we wrote about our Bus Pirate universal serial interface tool. We used the recent holiday to add some new features, like a JTAG programmer, macros, frequency measurement, and more. A major code reorganization makes everything easier to read and update. Check out the a demonstration of the new features [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=6457&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-6496" title="stat" src="http://hackadaycom.files.wordpress.com/2008/12/stat.jpg" alt="stat" width="450" height="323" /></p>
<p><strong>Download:</strong> <a href="http://blog.mahalo.com/hackaday/howto/buspirate.v0c.zip">buspirate.v0c.zip</a></p>
<p>A few weeks ago we wrote about our <a href="http://hackaday.com/2008/11/19/how-to-the-bus-pirate-universal-serial-interface/">Bus Pirate universal serial interface tool</a>. We used the recent holiday to add some new features, like a JTAG programmer, macros, frequency measurement, and more. A major code reorganization makes everything easier to read and update.</p>
<p>Check out the a demonstration of the new features below. We&#8217;re compiling a roadmap and wish list, so share your ideas in the comments. You can also see how we used the Bus Pirate to <a href="http://hackaday.com/2008/11/25/how-to-read-a-fedex-kinkos-smart-card-sle4442/">read a smart card</a> and <a href="http://hackaday.com/2008/11/28/parts-133mhz-162khz-programmable-oscillator-ds1077/">test-drive an I2C crystal oscillator</a>.</p>
<p><span id="more-6457"></span><strong>New protocols<br />
</strong></p>
<blockquote><p>I2C&gt;m <strong>&lt;&#8211;setup mode</strong><br />
1. HiZ <strong>&lt;&#8211; high impedance pins (safe mode)</strong><br />
2. 1-WIRE <strong>&lt;&#8211; not ready for this release</strong><br />
3. UART<br />
4. I2C<br />
5. SPI<br />
6. JTAG <strong>&lt;&#8211; interface and programmer</strong><br />
7. RAW2WIRE<br />
8. RAW3WIRE<br />
MODE&gt;1<br />
900 MODE SET<br />
HiZ&gt;</p></blockquote>
<p>This firmware release lists three new protocols.</p>
<p>Hi-Z makes all pins <a href="http://en.wikipedia.org/wiki/High_impedance">high impedance</a>/input, a safe state that won&#8217;t damage an attached circuit. To be safe, the Bus Pirate now starts in this mode.</p>
<p>1-Wire is listed, but we couldn&#8217;t include it in this release because we still don&#8217;t have any parts to test with our library. This is just a placeholder for now, but it will be added as soon as we get a 1-Wire part to test.</p>
<p>We wrote a simplified JTAG interface that includes a XSVF player for programming JTAG device chains.</p>
<p>**We included a hardware I2C library, but according to the device errata <a href="http://forum.microchip.com/tm.aspx?m=271183&amp;mpage=1">there&#8217;s a bug in the 24FJ64GA002 rev3 I2C module</a>. This will work with a different chip (e.g. a 28pin dsPIC33).</p>
<p><em>Connection table</em></p>
<table border="0">
<tbody>
<tr>
<td>
<div><strong>PIN</strong></div>
</td>
<td><strong>1-Wire</strong></td>
<td>
<div><strong>I2C*</strong></div>
</td>
<td>
<div><strong>SPI</strong>**</div>
</td>
<td>
<div><strong>RS232</strong></div>
</td>
<td><strong>JTAG</strong></td>
</tr>
<tr>
<td>
<div><strong>B9</strong></div>
</td>
<td>SDA</td>
<td>
<div>SDA</div>
</td>
<td>
<div>MOSI</div>
</td>
<td>
<div>-</div>
</td>
<td>TDI</td>
</tr>
<tr>
<td>
<div><strong>B8</strong></div>
</td>
<td>-</td>
<td>
<div>SCL</div>
</td>
<td>
<div>CLK</div>
</td>
<td>
<div>-</div>
</td>
<td>TCK</td>
</tr>
<tr>
<td>
<div><strong>B7</strong></div>
</td>
<td>-</td>
<td>
<div>-</div>
</td>
<td>
<div>MISO</div>
</td>
<td>
<div>RX</div>
</td>
<td>TDO</td>
</tr>
<tr>
<td>
<div><strong>B6</strong></div>
</td>
<td>-</td>
<td>
<div>-</div>
</td>
<td>
<div>CS</div>
</td>
<td>
<div>TX</div>
</td>
<td>TMS</td>
</tr>
<tr>
<td>
<div><strong>B5</strong></div>
</td>
<td>AUX</td>
<td>
<div>AUX</div>
</td>
<td>
<div>AUX</div>
</td>
<td>
<div>AUX</div>
</td>
<td>AUX</td>
</tr>
<tr>
<td>
<div><strong>Ground</strong></div>
</td>
<td>GND</td>
<td>
<div>GND</div>
</td>
<td>
<div>GND</div>
</td>
<td>
<div>GND</div>
</td>
<td>GND</td>
</tr>
</tbody>
</table>
<p>*also raw 2 wire. **also raw 3 wire.</p>
<p>The new modes connect to the Bus Pirate as outlined in the table.</p>
<p><strong>New features and settings</strong></p>
<p><em>Frequency measurement</em></p>
<blockquote><p>HiZ&gt;F <strong>&lt;&#8211; do a frequency count</strong><br />
9xx FREQ COUNT ON AUX: 22199552Hz (22MHz)<br />
HiZ&gt;</p></blockquote>
<p>As seen in the <a href="http://hackaday.com/2008/11/28/parts-133mhz-162khz-programmable-oscillator-ds1077/">DS1077 demonstration</a>, we added a frequency counter to the Bus Pirate&#8217;s AUX pin.  &#8216;F&#8217; measures frequency, maximum of about 50MHz.</p>
<p><em>Assign axillary control</em></p>
<blockquote><p>HiZ&gt;c <strong>&lt;&#8211; menu c</strong><br />
AUX PIN<br />
1. AUX (DEFAULT)<br />
2. CS/TMS<br />
MODE&gt;1 <strong>&lt;&#8211; set AUX control mode</strong><br />
9xx AUX: DEFAULT SETTING (AUX PIN)<br />
HiZ&gt;</p></blockquote>
<p>Sometimes we need to control the chip select (CS) /JTAG state machine (TMS) pins manually. &#8216;c&#8217; toggles the pin control between the axillary pin and the chip select pin.</p>
<p><em>Set terminal speed</em></p>
<blockquote><p>HiZ&gt;b <strong>&lt;&#8211; menu b</strong><br />
Set serial port speed: (bps)<br />
1. 300<br />
&#8230;<br />
9. 115200<br />
SPEED&gt;9 <strong>&lt;&#8211; set speed</strong><br />
Adjust your terminal and press space to continue<br />
HiZ&gt;</p></blockquote>
<p>&#8216;b&#8217; adjusts the PC-side serial port speed.</p>
<p><strong>Macros</strong></p>
<p>A new syntax addition, &#8216;(#)&#8217;, triggers protocol dependent macros.</p>
<blockquote><p>JTAG&gt;(0) <strong>&lt;&#8211;macro 0</strong><br />
0.Macro menu<br />
1.Reset chain<br />
2.Probe chain<br />
3.XSVF player<br />
JTAG&gt;</p></blockquote>
<p>In any mode, use the macro (0) to display a menu of available macros.</p>
<p><em>I2C address search </em></p>
<blockquote><p>I2C&gt;(1) <strong>&lt;&#8211;scan I2C addresses macro</strong><br />
xxx Searching 7bit I2C address space.<br />
Found devices at:<br />
0xB0 0xB1 <strong>&lt;&#8211;DS1077 responds to write and read address</strong><br />
I2C&gt;</p></blockquote>
<p>The I2C library includes a macro to automatically search the I2C address range for devices. Helpful when you work with an unknown chip.</p>
<p><em>Raw2wire smart card ISO 7813-3 ATR</em></p>
<blockquote><p>RAW2WIRE&gt;(1)<strong>&lt;&#8211;ATR and decode macro</strong><br />
ISO 7813-3 ATR<br />
950 AUX LOW<br />
951 AUX HIGH<br />
4xx RAW2WIRE 0&#215;01 CLOCK TICKS<br />
950 AUX LOW<br />
ISO 7813-3 reply: 0xA2 0&#215;13 0&#215;10 0&#215;91<strong>&lt;&#8211;ATR bytes</strong><br />
Protocol: 2 wire <strong>&lt;&#8211;decoded ATR data</strong><br />
Read type: to end<strong>&lt;&#8211;</strong><br />
Data units: 256 <strong>&lt;&#8211;</strong><br />
Data unit length: 8 bits <strong>&lt;&#8211;</strong><br />
RAW2WIRE&gt;</p></blockquote>
<p>Macro 1 resets and identifies a smart card. For more about the ISO7813-3 ATR, see how we <a href="http://hackaday.com/2008/11/25/how-to-read-a-fedex-kinkos-smart-card-sle4442/">used the Bus Pirate to read a smart card</a>.</p>
<p><strong>JTAG</strong></p>
<p><a href="http://www.fpga4fun.com/JTAG.html">JTAG</a> is a debugging and programming interface for all kinds of electronics. The raw hardware interface can be accessed with the Bus Pirate&#8217;s raw 3 wire library, but we added a few features to make it much easier.</p>
<p><strong><img class="alignnone size-full wp-image-6468" title="jtagstate" src="http://hackadaycom.files.wordpress.com/2008/12/jtagstate.png" alt="jtagstate" width="450" height="312" /></strong></p>
<p>JTAG has different modes where data entry does different things. Modes are navigated with the JTAG TMS signal; there are a <a href="http://www.fpga4fun.com/JTAG2.html">bunch of JTAG modes</a>, called states.The Bus Pirate&#8217;s JTAG library is just the raw 3 wire library, enhanced to help with JTAG state changes.</p>
<p>We only implemented the JTAG states we need to get data in and out of a JTAG device chain: reset, idle, data register, and instruction register. Macro (1) issues a JTAG chain reset, and initializes the chain to the idle state. { puts the JTAG chain in data register mode. [ puts the chain in instruction register mode. ] or } return the chain to the idle state. The Bus Pirate has an internal state machine tracker that is smart enough to manage the chain without explicitly returning the chain to idle; in other words, you don&#8217;t have to close your tags. The state machine tracker reports every state change to help debug problems.</p>
<blockquote><p>JTAG&gt;[0xfe {rrrr} <strong>&lt;-- same as [0xfe]{rrrr}</strong><br />
xxx JTAGSM: ALREADY IDLE<br />
xxx JTAGSM: IDLE-&gt;Instruction Register (DELAYED ONE BIT FOR TMS)<br />
610 JTAG READY TO WRITE IR <strong>&lt;&#8211; JTAG chain instruction register</strong><br />
620 JTAG WRITE: 0xFE <strong>&lt;&#8211; request ID</strong><br />
xxx JTAGSM: (WROTE DELAYED BIT) IR-&gt;IDLE<strong> &lt;&#8211;back to IDLE</strong><br />
xxx JTAGSM: IDLE-&gt;Data Register <strong>&lt;&#8211;IDLE to data register</strong><br />
611 JTAG READY TO READ/WRITE DR<br />
630 JTAG READ: 0&#215;93 <strong>&lt;&#8211;device ID</strong><br />
630 JTAG READ: 0&#215;40<br />
630 JTAG READ: 0&#215;60<br />
630 JTAG READ: 0&#215;59<br />
xxx JTAGSM: DR-&gt;IDLE <strong>&lt;&#8211;back to idle</strong><br />
640 JTAG IDLE<br />
JTAG&gt;</p></blockquote>
<p>Here is a short interaction with a <a href="http://www.xilinx.com/products/xc9500xl/index.htm">Xilinx XC9572 CPLD</a>. We go to the instruction register ( [ ), and send the device ID request command (0xfe). Then, we go the the data register( { ), read four bytes (rrrr, or r:4 shorthand), and return to idle ( } ).</p>
<p><em>What are delayed bit writes?</em></p>
<p>JTAG requires that the last data bit written to the instruction register be entered at the same time as the state change. Since the Bus Pirate has no way of predicting when we'll actually change states, it delays the last bit of each byte write until one of three things happens:</p>
<ul>
<li>Exit the instruction register with a }, ], or { command</li>
<li>Write another byte value</li>
<li>A read command</li>
</ul>
<p>Pending bits are not cleared by bitwise operations (like ! or ^). Do these before writing your last byte, or change the code. We haven&#8217;t implemented pending writes to the data register, but it&#8217;s probably needed. You might need to implement this if you&#8217;re writing the data register, rather just reading, like we did.</p>
<p><em>JTAG Macros</em></p>
<blockquote><p>JTAG&gt;(1) <strong>&lt;&#8211;macro 1</strong><br />
xxx JTAGSM: RESET<br />
xxx JTAGSM: RESET-&gt;IDLE<br />
JTAG&gt;</p></blockquote>
<p>JTAG macro (1) resets the JTAG chain and then advances it to the idle state.</p>
<blockquote><p>JTAG&gt;(2) <strong>&lt;&#8211;macro 2</strong><br />
xxx JTAG INIT CHAIN<br />
xxx JTAGSM: RESET<br />
xxx JTAGSM: RESET-&gt;IDLE<br />
xxx JTAGSM: IDLE-&gt;Instruction Register (DELAYED ONE BIT FOR TMS)<br />
xxx JTAGSM: IR-&gt;IDLE<br />
xxx JTAGSM: IDLE-&gt;Data Register<br />
xxx JTAGSM: DR-&gt;IDLE<br />
xxx JTAGSM: RESET<br />
xxx JTAGSM: RESET-&gt;IDLE<br />
xxx JTAGSM: IDLE-&gt;Data Register<br />
xxx JTAG CHAIN REPORT: <strong>&lt;&#8211;start of report</strong><br />
0&#215;01 DEVICE(S)<br />
#0&#215;01 : 0&#215;93 0&#215;40 0&#215;60 0&#215;59 <strong>&lt;&#8211;device IDs</strong><br />
xxx JTAGSM: DR-&gt;IDLE<br />
JTAG&gt;</p></blockquote>
<p>Macro (2) resets the chain, counts the devices, and reports all the device IDs.</p>
<p><img class="alignnone size-full wp-image-6470" title="xsfv" src="http://hackadaycom.files.wordpress.com/2008/12/xsfv.png" alt="xsfv" width="450" height="350" /></p>
<blockquote><p>JTAG&gt;(3) <strong>&lt;&#8211;macro 3</strong><br />
6xx JTAG XSVF PLAYER<br />
xxx XON/XOFF FLOW CONTROL REQUIRED <strong>&lt;&#8211;required!</strong><br />
xxx PRESS z TO CONTINUE <strong>&lt;&#8211; press z</strong><br />
xxx BEGIN XSVF UPLOAD <strong>&lt;&#8211; upload the file</strong><br />
6&#215;0 XSVF OK <strong>&lt;&#8211; result or error</strong><br />
YOUR PC DRIBBLED MAX 0&#215;05 BYTES AFTER XOFF (THAT&#8217;S OK)<br />
6xx PRESS z 5 TIMES TO CONTINUE <strong>&lt;&#8211; continue</strong><br />
JTAG&gt;</p></blockquote>
<p>Macro 3 is an XSVF player/programmer using code from Xilinx. XSVF is byte format <a href="http://www.asset-intertech.com/support/svf.html">SVF</a>, <a href="http://www.xilinx.com/support/documentation/application_notes/xapp058.pdf">as described by Xilinx</a> (pdf). XSVF files can be compiled for any chain with the correct <a href="http://www.xilinx.com/products/design_resources/config_sol/isp_standards_specs.htm">generic JTAG definition files</a>, even non-Xilinx devices. We successfully used the <em>binary</em> transfer features in <a href="http://www.hw-group.com/products/hercules/index_en.html">Hercules</a> and <a href="http://www.ayera.com/teraterm/">Tera Term</a> to send XSVF files to the programmer.</p>
<p>JTAG sometimes pauses longer than it takes the PC to transfer a byte of data, so we implemented <a href="http://en.wikipedia.org/wiki/XON">XON/XOFF software flow control</a> for the XSVF player. Your terminal must be in XON/XOFF flow control mode before you upload the XSVF file, or the programmer will fail. Even with software flow control, a modern PC has already send several bytes through the layers of operating system before it receives the flow control signals. We deal with this by catching these bytes before moving on, this is reported as the maximum number of bytes &#8220;dribbled&#8221;.</p>
<p>If there&#8217;s an error in the upload, the PC will probably continue to spit bytes at the Bus Pirate. To keep error messages visible, and prevent garbage in the terminal, the XSVF player waits for five lower case z&#8217;s before it returns to the prompt. We chose this sequence because it will never occur in an XSVF file.</p>
<p>*Note that the XSVF player does not respect the JTAG Hi-Z pin setting. Went it does, it fails. Be careful mixing voltages without a buffer.</p>
<p><strong>Better code structure</strong></p>
<p>The biggest difference between the version 0b and 0c firmware is a massive improvement in code structure. The Bus Pirate existed in many incarnations before we packaged it for the initial article. v.0c harmonizes the code libraries and makes it easier to add new protocols.</p>
<p><em>How to add a custom protocol</em></p>
<p>The Bus Pirate code handles the user interface, and passes two variables to the active protocol library. The first variable is a command, such as CMD_READ, CMD_READBULK, or CMD_WRITE. The entire command set is defined in base.h. The second variable is an optional value. A simple CMD_READ command passes no value, a bulk read command passes the number of bytes to read, a write command passes the value to write to the bus, etc. At minimum, a custom protocol needs a function to receive these variables and translate them to bus actions.</p>
<p>We used three different techniques to link commands to bus actions. Simple code can go directly in a giant switch statement, like SPI.c. External libraries use an single linking function, like I2C.c, and m_i2c_1.c. More complicated protocols use the switch statement to call functions included in the library (raw2wire.c, raw3wire.c, jtag.c UART.c). Helpful functions for terminal IO are included in base.h/c.</p>
<p>Due to massive code improvements, it&#8217;s now only mildly confusing to register a new protocol with the Bus Pirate:</p>
<p><em>base.h</em> &#8211; Create a definition for the protocol. The last entry is currently &#8220;#define RAW3WIRE 7&#8243;, so the next entry could be &#8220;#define MYCUSTOMWIRE 8&#8243;.</p>
<p><strong>busPirate.c</strong> &#8211; Include a header file with that gives access to the processing function.  Add a menu entry in the <em>char* mode[]  =</em> variable list. The menu entry <em>must</em> be in the same position on the list as the number assigned in the base.h define. If MYCUSTOMWIRE is number 8, it must be the eight entry in the mode variable. Finally, add an additional switch to the bpProcess() function that calls the custom library processing routine when the mode is set to &#8220;MYCUSTOMWIRE&#8221;.</p>
<p><strong>Taking it further: a Hack a Day wish list</strong></p>
<p>We compiled the feedback we&#8217;ve gotten into three wish lists: protocols, features, and macros.</p>
<p><em>Protocols</em></p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/1-Wire">1-Wire</a>, with enumeration (*ready as soon as we have parts to test it)</li>
<li><a href="http://www.elmelectronics.com/obdic.html">OBD-II</a> (thanks [<a href="http://hackaday.com/2008/11/19/how-to-the-bus-pirate-universal-serial-interface/#comment-51551">Shadyman</a>])</li>
<li><a href="http://en.wikipedia.org/wiki/Controller-area_network">CAN</a></li>
<li><a href="http://www.ucapps.de/">MIDI</a> (<a href="http://en.wikipedia.org/wiki/General_MIDI">Wikipedia</a>)</li>
<li><a href="http://en.wikipedia.org/wiki/DMX512-A">DMX512-A</a></li>
<li><a href="http://en.wikipedia.org/wiki/Irda">IRDA</a>, <a href="http://hackaday.com/2008/10/30/how-to-usb-remote-control-receiver/">RC5x</a>, etc.</li>
</ul>
<p>Some protocols will require an external transceiver.</p>
<p><em>Features</em></p>
<ul>
<li>Pulse-width modulator, frequency generator</li>
<li>&#8220;Wait until interrupt&#8221; command</li>
<li>Convert frequency measurement to input capture peripheral</li>
<li>Allow frequency measurement on any pin</li>
<li>Show a report of the current configuration settings and pin states.</li>
<li>Integer repeat values for bulk read, clock ticks, delays, etc.</li>
<li>A CRC generator</li>
</ul>
<p><em>Macros</em></p>
<ul>
<li>Transparent UART bridge</li>
<li>SD card initialization, meta data extract, and dump</li>
<li>EEPROM program/dump (I2C/SPI)</li>
<li>Nokia 6100 LCD initialization, control</li>
<li>NMEA GPS data decoder</li>
</ul>
<p>Do you have anything to add to the list?</p>
<p>Firmware download: <a href="http://blog.mahalo.com/hackaday/howto/buspirate.v0c.zip">buspirate.v0c.zip</a></p>
<br />Posted in classic hacks, hardware, news, tool hacks  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/6457/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/6457/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/6457/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/6457/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/6457/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/6457/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/6457/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/6457/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/6457/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/6457/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/6457/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/6457/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/6457/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/6457/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=6457&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2008/12/01/bus-pirate-firmware-update-v0c-jtag-and-more/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/2008/12/stat.jpg" medium="image">
			<media:title type="html">stat</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/12/jtagstate.png" medium="image">
			<media:title type="html">jtagstate</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/12/xsfv.png" medium="image">
			<media:title type="html">xsfv</media:title>
		</media:content>
	</item>
		<item>
		<title>Use junk to measure your caps and coils</title>
		<link>http://hackaday.com/2008/07/07/use-junk-to-measure-your-caps-and-coils/</link>
		<comments>http://hackaday.com/2008/07/07/use-junk-to-measure-your-caps-and-coils/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 14:51:00 +0000</pubDate>
		<dc:creator>Will O'Brien</dc:creator>
				<category><![CDATA[classic hacks]]></category>
		<category><![CDATA[misc hacks]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[parts]]></category>
		<category><![CDATA[projects]]></category>

		<guid isPermaLink="false">http://hackaday.iheartcashews.com:8181/2008/07/07/use-junk-to-measure-your-caps-and-coils/</guid>
		<description><![CDATA[[Cliff] sent in [N5ESE]&#8216;s junk box project page. Most of the projects are amateur radio specific, but one that caught my eye was his capacitance checker. If you&#8217;ve ever been looking through a pile of small, unlabeled caps, you know the value of a capacitance meter. This one is fairly simple and uses the AC [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=2206&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img width="400" vspace="4" hspace="4" height="325" border="0" src="http://hackadaycom.files.wordpress.com/2008/07/capacitance-check.jpg?w=400&#038;h=325"  alt="" /><br />[Cliff] sent in [N5ESE]&#8216;s <a href="http://www.io.com/~n5fc/gizmo.htm">junk box project page</a>. Most of the projects are amateur radio specific, but one that caught my eye was his <a href="http://www.io.com/~n5fc/capac_ckr.htm">capacitance checker</a><a href="http://www.io.com/~n5fc/l-meter.htm" />. If you&#8217;ve ever been looking through a pile of small, unlabeled caps, you know the value of a capacitance meter. This one is fairly simple and uses the AC setting of your multimeter to indicate the capacitance of the unknown component.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/hackadaycom.wordpress.com/2206/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/hackadaycom.wordpress.com/2206/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/2206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/2206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/2206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/2206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/2206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/2206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/2206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/2206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/2206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/2206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/2206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/2206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/2206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/2206/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=2206&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2008/07/07/use-junk-to-measure-your-caps-and-coils/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Will O&#039;Brien</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/07/capacitance-check.jpg" medium="image" />
	</item>
		<item>
		<title>FPGA projects roundup</title>
		<link>http://hackaday.com/2008/05/22/fpga-projects-roundup/</link>
		<comments>http://hackaday.com/2008/05/22/fpga-projects-roundup/#comments</comments>
		<pubDate>Thu, 22 May 2008 10:30:00 +0000</pubDate>
		<dc:creator>Will O'Brien</dc:creator>
				<category><![CDATA[misc hacks]]></category>
		<category><![CDATA[defcon]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[fpga]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[roundup]]></category>

		<guid isPermaLink="false">http://hackaday.iheartcashews.com:8181/2008/05/22/fpga-projects-roundup/</guid>
		<description><![CDATA[FPGA&#8217;s have become especially useful to the hacker community of late. Once upon a time, these lovely pieces of dedicated hardware were fabled to only be within reach of deep pocketed graphics card producers working to up their shader and vertex counts. Today they&#8217;re often found in the bowels of high end network gear. As [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=1856&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img width="400" vspace="4" hspace="4" height="199" border="0" src="http://hackadaycom.files.wordpress.com/2008/05/fpga-roundup.jpg?w=400&#038;h=199" alt="" /><br />FPGA&#8217;s have become especially useful to the hacker community of late. Once upon a time, these lovely pieces of dedicated hardware were fabled to only be within reach of deep pocketed graphics card producers working to up their shader and vertex counts. Today they&#8217;re often found in the bowels of high end network gear. As reprogrammable arrays of logic gates, FPGAs represent a happy middle ground between general purpose CPUs and dedicated silicon. After the break, we&#8217;ll recount some of the more interesting FPGA projects we&#8217;ve seen, like the <a href="http://www.hackaday.com/2008/05/21/open-graphics-card-available-for-preorder/">open source graphics card</a> we featured yesterday.</p>
<p><span id="more-1856"></span></p>
<p><img width="400" vspace="4" hspace="4" height="277" border="0" src="http://hackadaycom.files.wordpress.com/2008/05/e-16card.jpg?w=400&#038;h=277" alt="" /><br />Some of our favorite FPGA work has been done by [h1kari]. We made it to a few of his <a href="http://www.hackaday.com/2008/02/15/shmoocon-2008-intercepting-gsm-traffic/">con talks</a> and his group has released <a href="http://openciphers.sourceforge.net/oc/">several projects</a> that use FPGAs to crack various encryption schemes. Lately he&#8217;s been presenting on <a href="http://www.hackaday.com/2008/02/15/shmoocon-2008-intercepting-gsm-traffic/">cracking the A5 encryption</a> used by GSM cellphone networks. They use fairly high end cards like the <a href="http://www.picocomputing.com/products/cards/e16.php">Pico E-16</a>, but the code could certainly be adapted for use with lower end hardware.</p>
<p><img width="400" vspace="4" hspace="4" height="194" border="0" src="http://hackadaycom.files.wordpress.com/2008/05/nsaathome.jpg?w=400&#038;h=194" alt="" /><br />[Sklylark] doesn&#8217;t have his web interface up yet (but you can ask him nicely via irc) to allow open usage of his <a href="http://www.hackaday.com/2007/08/31/nsa-home-diy-shared-fpga-cracker/">NSA@home project</a>. He re-purposed some HDTV FPGA based encoding boards into a dedicated key cracking system for SHA-1.</p>
<p><img width="400" vspace="4" hspace="4" height="199" border="0" alt="" id="img1" src="http://hackadaycom.files.wordpress.com/2008/05/fpga-roundup.jpg?w=400&#038;h=199" /><br />Nothing says high end like completely emulating really old hardware. The minimig (short for mini Amiga) that <a href="http://cellphones.hackaday.com/2006/01/14/amiga-in-an-fpga/">we featured</a> so long ago has evolved into a production quality board and the <a href="http://www.amiga.org/modules/news/article.php?storyid=7386">full source</a> has been released. Pics of the evolution can be found <a href="http://www.amiga.org/modules/myalbum/viewcat.php?uid=12811">here</a>.</p>
<p>If you&#8217;re interested in getting started with FPGA projects, don&#8217;t forget to peruse [John Kent]&#8216;s <a href="http://members.optushome.com.au/jekent/FPGA.htm">collection of documentation</a>. The closest thing we seen to an entry level project is this <a href="http://www.hackaday.com/2007/09/27/usb-2-0-fpga-based-24-channel-logic-analyzer/">24 channel logic analyzer</a> based on a ~$150 FPGA kit.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/hackadaycom.wordpress.com/1856/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/hackadaycom.wordpress.com/1856/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/1856/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/1856/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/1856/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/1856/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/1856/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/1856/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/1856/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/1856/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/1856/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/1856/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/1856/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/1856/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/1856/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/1856/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=1856&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2008/05/22/fpga-projects-roundup/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Will O&#039;Brien</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/fpga-roundup.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/e-16card.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/nsaathome.jpg" medium="image" />

		<media:content url="http://hackadaycom.files.wordpress.com/2008/05/fpga-roundup.jpg" medium="image" />
	</item>
	</channel>
</rss>
