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

<channel>
	<title>Bus Pirate &#8211; IoT Expert</title>
	<atom:link href="https://iotexpert.com/tag/bus-pirate/feed/" rel="self" type="application/rss+xml" />
	<link>https://iotexpert.com</link>
	<description>Engineering for the Internet of Things</description>
	<lastBuildDate>Tue, 28 Oct 2014 12:22:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://iotexpert.com/wp-content/uploads/2017/01/cropped-Avatar-32x32.jpg</url>
	<title>Bus Pirate &#8211; IoT Expert</title>
	<link>https://iotexpert.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Bus Pirate V4 (SeeedStudio)</title>
		<link>https://iotexpert.com/bus-pirate-v4-seeedstudio/</link>
					<comments>https://iotexpert.com/bus-pirate-v4-seeedstudio/#respond</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Wed, 29 Oct 2014 10:00:20 +0000</pubDate>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Bus Pirate]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=263</guid>

					<description><![CDATA[In the previous two Bus Pirate posts, I introduced the Bus Pirate and talked about the V3 version from Sparkfun, and I showed how to use the V3 version from Seeedstudio to read and write I2C commands into a Cypress FRAM. Bus Pirate V4 is a complete redesign of the hardware.  It combines the PIC microcontroller [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In the previous two Bus Pirate posts, I introduced the Bus Pirate and talked about the V3 version from Sparkfun, and I showed how to use the V3 version from Seeedstudio to read and write I2C commands into a Cypress FRAM.</p>
<p>Bus Pirate V4 is a complete redesign of the hardware.  It combines the PIC microcontroller and FTDI USB/Serial bridge into a single chip (a <a class="external text" href="http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en531081" target="_blank" rel="nofollow">PIC 24FJ256GB106</a>).  Mr. Lesnet also added 3.3v and 5.0v on board regulated voltages, and an onboard eeprom for extra storage.  You can read more on the Dangerous Prototypes <a href="http://dangerousprototypes.com/docs/Bus_Pirate_v4_design_overview" target="_blank">web page.</a></p>
<p>I also ordered the acrylic case (which is cool) as well as the V4 cable (which sucks compared to the V3 cable because the grabbers don&#8217;t match the cable color and are signals are unlabeled).</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2014/10/front.png"><img fetchpriority="high" decoding="async" class="alignnone wp-image-271 size-large" src="https://iotexpert.com/wp-content/uploads/2014/10/front-1024x768.png" alt="front" width="1024" height="768" srcset="https://iotexpert.com/wp-content/uploads/2014/10/front-1024x768.png 1024w, https://iotexpert.com/wp-content/uploads/2014/10/front-600x450.png 600w, https://iotexpert.com/wp-content/uploads/2014/10/front-300x225.png 300w, https://iotexpert.com/wp-content/uploads/2014/10/front.png 1500w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></p>
<p>On the back of the board you can clearly see the right way to put a silkscreen on a board.  Clear, sensible, legible.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2014/10/back.png"><img decoding="async" class="alignnone wp-image-270 size-large" src="https://iotexpert.com/wp-content/uploads/2014/10/back-1024x768.png" alt="back" width="1024" height="768" srcset="https://iotexpert.com/wp-content/uploads/2014/10/back-1024x768.png 1024w, https://iotexpert.com/wp-content/uploads/2014/10/back-600x450.png 600w, https://iotexpert.com/wp-content/uploads/2014/10/back-300x225.png 300w, https://iotexpert.com/wp-content/uploads/2014/10/back.png 1500w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></p>
<p>The first thing that I did was &#8220;?&#8221; to see what was new on the menu.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2014/10/v4help.png"><img decoding="async" class="alignnone size-full wp-image-277" src="https://iotexpert.com/wp-content/uploads/2014/10/v4help.png" alt="v4help" width="675" height="505" srcset="https://iotexpert.com/wp-content/uploads/2014/10/v4help.png 675w, https://iotexpert.com/wp-content/uploads/2014/10/v4help-600x449.png 600w, https://iotexpert.com/wp-content/uploads/2014/10/v4help-300x224.png 300w" sizes="(max-width: 675px) 100vw, 675px" /></a></p>
<p>The next thing that I tried was putting the BP into I2C mode.  This was similar to V3 with the exception that now there is a hardware driven I2c and it is capable of 1MHz operation.  The other thing that has been added is a programmable onboard power supply.  You can select either 3.3v or 5.0v by using the &#8220;e&#8221; command.  The power supply can be turned on/off using &#8220;w&#8221; (off) and &#8220;W&#8221; (on).</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2014/10/setupi2c.png"><img loading="lazy" decoding="async" class="alignnone wp-image-269 size-large" src="https://iotexpert.com/wp-content/uploads/2014/10/setupi2c-1024x931.png" alt="setupi2c" width="1024" height="931" srcset="https://iotexpert.com/wp-content/uploads/2014/10/setupi2c-1024x931.png 1024w, https://iotexpert.com/wp-content/uploads/2014/10/setupi2c-600x546.png 600w, https://iotexpert.com/wp-content/uploads/2014/10/setupi2c-300x272.png 300w, https://iotexpert.com/wp-content/uploads/2014/10/setupi2c.png 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Here is a screenshot of the schematic for selectable regulated pullup.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2014/10/schematic2.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-268" src="https://iotexpert.com/wp-content/uploads/2014/10/schematic2.png" alt="schematic" width="692" height="859" srcset="https://iotexpert.com/wp-content/uploads/2014/10/schematic2.png 692w, https://iotexpert.com/wp-content/uploads/2014/10/schematic2-600x745.png 600w, https://iotexpert.com/wp-content/uploads/2014/10/schematic2-241x300.png 241w" sizes="auto, (max-width: 692px) 100vw, 692px" /></a></p>
<p>I was interested in trying the Bus Pirate I2C sniffer.  To do this I used the onboard I2C bridge in the &#8220;KitProg&#8221; on the <a href="http://www.cypress.com/?rid=77780" target="_blank">CY8CKIT042</a> and used the Cypress <a href="http://www.cypress.com/?rID=38050" target="_blank">Bridge Control Panel</a> (part of PSoC Programmer) to issue I2C commands to the FRAM on my test setup (which is the same as in the <a title="Bus Pirate V3 (from Sparkfun)" href="https://iotexpert.com/2014/10/23/bus-pirate-v3-from-sparkfun/" target="_blank">previous posts</a>).  In the example below I first issue a &#8220;Write, location 0x00, data 9,8,7,6,5,4,3,2,1&#8221;  In other words fill up the first 9 locations in the FRAM with 9..1.</p>
<p>The second command issues a &#8220;write, location 0x00, Read the next 5 bytes (each &#8220;x&#8221; reads 1 byte)&#8221;.</p>
<p>In the 2nd part of the Bridge Control Panel you can see the actual commands that happened on the bus and the ACKs (&#8220;+&#8221;) and responses from the FRAM.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2014/10/bcp.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-267" src="https://iotexpert.com/wp-content/uploads/2014/10/bcp.png" alt="bcp" width="1335" height="1107" srcset="https://iotexpert.com/wp-content/uploads/2014/10/bcp.png 1335w, https://iotexpert.com/wp-content/uploads/2014/10/bcp-600x498.png 600w, https://iotexpert.com/wp-content/uploads/2014/10/bcp-300x248.png 300w, https://iotexpert.com/wp-content/uploads/2014/10/bcp-1024x849.png 1024w" sizes="auto, (max-width: 1335px) 100vw, 1335px" /></a></p>
<p>In the screenshot below you can see that the sniffer perfectly &#8220;sniffs&#8221; the first command.  That is pretty cool&#8230; and a very useful function.</p>
<p>In the second case, you can see that the BP sniffer can see the write command perfectly and can read the first byte response from the FRAM perfectly, but does not read the other bytes correctly.  Specifically it reads 0x10, 0x1c and 0x30 instead of 0x08, 0x07, and 0x06.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2014/10/sniffer.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-266" src="https://iotexpert.com/wp-content/uploads/2014/10/sniffer.png" alt="sniffer" width="1056" height="665" srcset="https://iotexpert.com/wp-content/uploads/2014/10/sniffer.png 1056w, https://iotexpert.com/wp-content/uploads/2014/10/sniffer-600x378.png 600w, https://iotexpert.com/wp-content/uploads/2014/10/sniffer-300x188.png 300w, https://iotexpert.com/wp-content/uploads/2014/10/sniffer-1024x644.png 1024w" sizes="auto, (max-width: 1056px) 100vw, 1056px" /></a></p>
<p>To debug this problem I plugged in my Tektronix MSO2024B logic analyzer to see if there was some problem with the I2C transactions.  However, you can see from the screenshot below that the scope can read transactions perfectly.  So, what is going on?  I don&#8217;t know.  But, at this point it seems clear that the sniffer is a bit flaky.  At this point that is going to be a problem for another day.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2014/10/scope.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-265" src="https://iotexpert.com/wp-content/uploads/2014/10/scope.png" alt="scope" width="1000" height="489" srcset="https://iotexpert.com/wp-content/uploads/2014/10/scope.png 1000w, https://iotexpert.com/wp-content/uploads/2014/10/scope-600x293.png 600w, https://iotexpert.com/wp-content/uploads/2014/10/scope-300x146.png 300w" sizes="auto, (max-width: 1000px) 100vw, 1000px" /></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/bus-pirate-v4-seeedstudio/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Bus Pirate V3 (SeeedStudio)</title>
		<link>https://iotexpert.com/bus-pirate-v3-seeedstudio/</link>
					<comments>https://iotexpert.com/bus-pirate-v3-seeedstudio/#respond</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Mon, 27 Oct 2014 10:00:21 +0000</pubDate>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Bus Pirate]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=234</guid>

					<description><![CDATA[In the previous post, I introduced Bus Pirate  V3 &#8211; specifically the Sparkfun version.  After digging through things a little bit I decided to order the SeeedStudio V3 Bus Pirate.  This version has exactly the same firmware, pinout etc as the Sparkfun version.  However, there are a few good improvements in the SeeedStudio version. First, [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In the <a title="Bus Pirate V3 (from Sparkfun)" href="https://iotexpert.com/2014/10/23/bus-pirate-v3-from-sparkfun/">previous</a> post, I introduced Bus Pirate  V3 &#8211; specifically the Sparkfun version.  After digging through things a little bit I decided to order the <a href="http://www.seeedstudio.com" target="_blank">SeeedStudio</a> V3 Bus Pirate.  This version has exactly the same firmware, pinout etc as the Sparkfun version.  However, there are a few good improvements in the SeeedStudio version.</p>
<p>First, the silkscreen on the SeeedStudio board is WAY better.  There is no good excuse for having a bad silkscreen on your board.  When you compare the two boards you can easily see the labels that clearly document the pins.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2014/10/sidebyside.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-236" src="https://iotexpert.com/wp-content/uploads/2014/10/sidebyside.png" alt="sidebyside" width="913" height="601" srcset="https://iotexpert.com/wp-content/uploads/2014/10/sidebyside.png 913w, https://iotexpert.com/wp-content/uploads/2014/10/sidebyside-600x395.png 600w, https://iotexpert.com/wp-content/uploads/2014/10/sidebyside-300x197.png 300w" sizes="auto, (max-width: 913px) 100vw, 913px" /></a></p>
<p>Second, the <a href="http://www.seeedstudio.com/depot/Bus-Pirate-v3-probe-cable-with-labels-and-male-pins-p-1827.html?cPath=55_56" target="_blank">cable</a> that you can get from SeeedStudio has beautiful heat shrink labels on the end of the cable.  And, more importantly the colors match the pins on the board.  In the picture the below the SparkFun cable colors are correct because I uncrimped the cable and fixed it as I described in the previous post.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2014/10/side-by-side-top.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-237" src="https://iotexpert.com/wp-content/uploads/2014/10/side-by-side-top.png" alt="side-by-side-top" width="713" height="451" srcset="https://iotexpert.com/wp-content/uploads/2014/10/side-by-side-top.png 713w, https://iotexpert.com/wp-content/uploads/2014/10/side-by-side-top-600x380.png 600w, https://iotexpert.com/wp-content/uploads/2014/10/side-by-side-top-300x189.png 300w" sizes="auto, (max-width: 713px) 100vw, 713px" /></a></p>
<p>And lastly, the SeeedStudio version is compatible with their <a href="http://www.seeedstudio.com/depot/Bus-Pirate-v36-acrylic-case-v1-DP6037-p-1229.html?cPath=55_60" target="_blank">acrylic case </a>which is inexpensive and works well.  It is just two pieces of acrylic that have been laser cut to fit the BP.  Nice.</p>
<p>For my project I have:</p>
<ol>
<li>An <a href="http://www.cypress.com/?mpn=FM24V10-G" target="_blank">FM24V10</a> FRAM from mounted onto a <a href="http://www.cypress.com/?rID=94456" target="_blank">PSoC 4000</a> development kit from Cypress</li>
<li>An <a href="http://www.analog.com/en/mems-sensors/mems-inertial-sensors/adxl345/products/product.html" target="_blank">ADXL345</a> 3-Axis accelerometer mounted on an <a href="https://www.adafruit.com/products/1231" target="_blank">breakout board</a> from Adafruit.</li>
<li>An <a href="http://www.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf" target="_blank">BMP180</a> Barometric pressure and temperature sensor on a <a href="https://www.adafruit.com/products/1603" target="_blank">breakout board</a> from Adafruit</li>
<li>A <a href="https://www.adafruit.com/datasheets/1899_HTU21D.pdf" target="_blank">HDU-21D-F</a> Humidity and temperature sensor on a <a href="https://www.adafruit.com/products/1899" target="_blank">breakout board</a> from Adafruit</li>
</ol>
<p>Here is the schematic:</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2014/10/schematic1.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-246" src="https://iotexpert.com/wp-content/uploads/2014/10/schematic1.png" alt="schematic" width="402" height="486" srcset="https://iotexpert.com/wp-content/uploads/2014/10/schematic1.png 402w, https://iotexpert.com/wp-content/uploads/2014/10/schematic1-248x300.png 248w" sizes="auto, (max-width: 402px) 100vw, 402px" /></a></p>
<p>And, here is a picture of the crazy breadboard.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2014/10/breadboard1.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-247" src="https://iotexpert.com/wp-content/uploads/2014/10/breadboard1.png" alt="breadboard1" width="836" height="601" srcset="https://iotexpert.com/wp-content/uploads/2014/10/breadboard1.png 836w, https://iotexpert.com/wp-content/uploads/2014/10/breadboard1-600x431.png 600w, https://iotexpert.com/wp-content/uploads/2014/10/breadboard1-300x215.png 300w" sizes="auto, (max-width: 836px) 100vw, 836px" /></a></p>
<p>&nbsp;</p>
<p>When you attach a terminal program &#8211; like <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html" target="_blank">Putty</a> &#8211; to the usb serial port of the Bus Pirate, you are given a command prompt (press enter to get the prompt).  The first prompt that you get is &#8220;HiZ&#8221; which indicates that all of the pins of the BP are in high impedance mode.  Then, I issue the &#8220;m&#8221; command which tells the BP that I want to switch the mode.  I select &#8220;4&#8221; to put the BP into I2C mode.  I then select &#8220;4&#8221; to pick 400khz.  Notice that the BP says &#8220;~400kz&#8221; which almost certainly means that the I2C is implemented with bit banging.  Then I turn on the I2C pullup resistors  using the &#8220;P&#8221; (capital P) which are on the BP board.  In order for them to work you need to attach the &#8220;VPU&#8221; pin to either 3.3v or 5.0v.  The last command that I issue is a macro, all the macros are  enclosed in parenthesis.  The macro that I issue is &#8220;(1)&#8221; which searches the I2C address space (addresses 1-127) and makes a list of all of the devices that respond.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2014/10/i2csetup.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-250" src="https://iotexpert.com/wp-content/uploads/2014/10/i2csetup.png" alt="i2csetup" width="675" height="505" srcset="https://iotexpert.com/wp-content/uploads/2014/10/i2csetup.png 675w, https://iotexpert.com/wp-content/uploads/2014/10/i2csetup-600x449.png 600w, https://iotexpert.com/wp-content/uploads/2014/10/i2csetup-300x224.png 300w" sizes="auto, (max-width: 675px) 100vw, 675px" /></a></p>
<p>In my setup there are 4 I2C devices</p>
<div class="table-responsive"><table  style="width:500px; "  class="easy-table easy-table-default " border="1">
<caption>Devices</caption>
<thead>
<tr><th  style="text-align:center" >Device</th>
<th  style="text-align:center" >7-bit address</th>
<th  style="text-align:center" >8-bit read</th>
<th  style="text-align:center" > 8-bit write</th>
</tr>
</thead>
<tbody>
<tr><td  style="text-align:center" >FRAM</td>
<td  style="text-align:center" >0x50</td>
<td  style="text-align:center" >0xA1</td>
<td  style="text-align:center" > 0xA1</td>
</tr>

<tr><td  style="text-align:center" >ADXL345</td>
<td  style="text-align:center" >0x53</td>
<td  style="text-align:center" >0xA7</td>
<td  style="text-align:center" >0xA6</td>
</tr>

<tr><td  style="text-align:center" >BMP180</td>
<td  style="text-align:center" >0x77</td>
<td  style="text-align:center" >0xEF</td>
<td  style="text-align:center" > 0xEE</td>
</tr>

<tr><td  style="text-align:center" >HTU21</td>
<td  style="text-align:center" >0x40</td>
<td  style="text-align:center" >0x81</td>
<td  style="text-align:center" >0x80</td>
</tr>
</tbody></table></div>
<p>In order to write to the FRAM you need to issue:</p>
<ol>
<li>An I2C Start &#8211; in BP that means &#8220;[&#8220;</li>
<li>The 7-bit I2C address of the FRAM (0x50) and the write bit &#8220;0&#8221;.  AKA 0xA0</li>
<li>The two byte address of where you want to start writing data in the FRAM 0x00 and 0x00</li>
<li>The data &#8211; in this case 9,8,7,6,5,4,3,2,1 (which means that locations 0-8 will contain 9..1)</li>
<li>An I2C stop &#8211; in BP that means &#8220;]&#8221;</li>
</ol>
<p>After issuing this sequence &#8220;[0xa0 0 0 9 8 7 6 5 4 3 2 1]&#8221; you can see the commands that are actually issueed on the I2C bus as well as the slave FRAM responding with &#8220;ACK&#8221;.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2014/10/i2c-commands.png"><img loading="lazy" decoding="async" class="alignnone size-large wp-image-252" src="https://iotexpert.com/wp-content/uploads/2014/10/i2c-commands-1024x699.png" alt="i2c-commands" width="1024" height="699" srcset="https://iotexpert.com/wp-content/uploads/2014/10/i2c-commands-1024x699.png 1024w, https://iotexpert.com/wp-content/uploads/2014/10/i2c-commands-600x410.png 600w, https://iotexpert.com/wp-content/uploads/2014/10/i2c-commands-300x204.png 300w, https://iotexpert.com/wp-content/uploads/2014/10/i2c-commands.png 1193w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>The second example which you can see in the above screen shot is to read from the FRAM.  In order to do this you need to issue the following I2C commands</p>
<ol>
<li>An I2C Start &#8211; &#8220;[&#8220;</li>
<li>The 7-bit I2C address of the FRAM (0x50) and the write bit &#8220;0&#8221;.  AKA 0xA0 (left shift the 0x50 and or it with the read 0x00)</li>
<li>The two by address of where you would like to read 0x00 and 0x00</li>
<li>An I2C Stop &#8211; &#8220;]&#8221;</li>
<li>An I2C Start (aka Restart) &#8211; &#8220;[&#8220;</li>
<li>The 7-bit I2C address of the FRAM (0x50) and the read bit &#8220;1&#8221;.  AKA 0xA1 (left shift the 0x50 and or it with the read 0x01)</li>
<li>5 reads</li>
</ol>
<p>After issuing this sequence &#8220;[0xa0 0 0][0xa1 r:5]&#8221; you can see the commands that are actually issued on the I2C bus as well as the slave FRAM responding with the data in the FRAM and the &#8220;ACKs&#8221;.</p>
<p>In the next post I will introduce the V4 Bus Pirate.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/bus-pirate-v3-seeedstudio/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Bus Pirate V3 (from Sparkfun)</title>
		<link>https://iotexpert.com/bus-pirate-v3-from-sparkfun/</link>
					<comments>https://iotexpert.com/bus-pirate-v3-from-sparkfun/#respond</comments>
		
		<dc:creator><![CDATA[Alan Hawse]]></dc:creator>
		<pubDate>Thu, 23 Oct 2014 17:17:23 +0000</pubDate>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Bus Pirate]]></category>
		<guid isPermaLink="false">https://iotexpert.com/?p=220</guid>

					<description><![CDATA[One of the common open source development tools is called the Bus Pirate.  It is a low cost ($35) serial terminal based program that can issue commands to many (and mostly serial) busses including UART, SPI, 1-2-3 wire and I2C.  Bus Pirate was developed by Ian Lesnet of Dangerous Prototypes. I am currently working on a [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>One of the common open source development tools is called the Bus Pirate.  It is a low cost ($35) serial terminal based program that can issue commands to many (and mostly serial) busses including UART, SPI, 1-2-3 wire and I2C.  Bus Pirate was developed by Ian Lesnet of Dangerous Prototypes.</p>
<p>I am currently working on a project for a friend of mine  (more to come on this topic) that will read data from 3 different I2C sensors, record the data into a nonvolatile RAM and simultaneously broadcast it over a BLE Radio.  As such, I had a need to make sure that I understood the way that these sensors behave.</p>
<p>The bus pirate has had 4 major revisions and many subrevisions.  The current &#8220;stable&#8221; version is V3, however, there is a fairly new version V4 which has many improvements and should soon displace V3.</p>
<p>Initially I bought a <a href="http://www.sparkfun.com/products/9544" target="_blank">V3 bus pirate from Sparkfun</a> and the Sparkfun <a href="http://www.sparkfun.com/products/9556" target="_blank">cable</a>,  which I thought would be cool. <a href="https://iotexpert.com/wp-content/uploads/2014/10/sparkfun.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-226" src="https://iotexpert.com/wp-content/uploads/2014/10/sparkfun.png" alt="sparkfun" width="901" height="600" srcset="https://iotexpert.com/wp-content/uploads/2014/10/sparkfun.png 901w, https://iotexpert.com/wp-content/uploads/2014/10/sparkfun-600x400.png 600w, https://iotexpert.com/wp-content/uploads/2014/10/sparkfun-300x199.png 300w" sizes="auto, (max-width: 901px) 100vw, 901px" /></a></p>
<p>I started by plugging the BP into a USB port, where it proceeded to enumerate as something my computer had never seen before.  Great.  I looked  around a bit and figured out that the designer had used a FTDI USB to Serial bridge chip as part of the design.  This chip required a custom driver which I found on FTDIs driver <a href="http://www.ftdichip.com/Drivers/VCP.htm" target="_blank">website</a>.  This requirement was also documented in the <a href="http://dangerousprototypes.com/docs/Bus_Pirate_101_tutorial" target="_blank">Bus Pirate 101 tutorial</a>.  It is kind of too bad that FTDI hasn&#8217;t gotten their driver to be understood by Windows without intervention.  Just one more good reason to use the <a href="http://www.cypress.com/USBSerial/" target="_blank">Cypress USB Serial Chip.</a></p>
<p>After sorting out the driver situation I attached to the Bus Pirate using my favorite terminal program &#8211; <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html" target="_blank">Putty</a>.  You can see (by looking at the Device Manager) that the BP enumerated as COM5 on my computer.</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2014/10/devicemanager.png"><img loading="lazy" decoding="async" class="alignnone wp-image-228 size-medium" src="https://iotexpert.com/wp-content/uploads/2014/10/devicemanager-300x285.png" alt="devicemanager" width="300" height="285" srcset="https://iotexpert.com/wp-content/uploads/2014/10/devicemanager-300x285.png 300w, https://iotexpert.com/wp-content/uploads/2014/10/devicemanager-600x572.png 600w, https://iotexpert.com/wp-content/uploads/2014/10/devicemanager.png 780w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>The first thing that I tried (without having yet looked at the instructions was &#8220;?&#8221; which nicely gave a list of the commands (as you can see in the screenshot below).</p>
<p><a href="https://iotexpert.com/wp-content/uploads/2014/10/screen1.png"><img loading="lazy" decoding="async" class="alignnone size-large wp-image-227" src="https://iotexpert.com/wp-content/uploads/2014/10/screen1-1024x790.png" alt="screen1" width="1024" height="790" srcset="https://iotexpert.com/wp-content/uploads/2014/10/screen1-1024x790.png 1024w, https://iotexpert.com/wp-content/uploads/2014/10/screen1-600x463.png 600w, https://iotexpert.com/wp-content/uploads/2014/10/screen1-300x231.png 300w, https://iotexpert.com/wp-content/uploads/2014/10/screen1.png 1056w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></p>
<p>I then tried &#8220;v&#8221; which shows the states of the 10 pins.  Cool.  My first though was &#8220;which wire on this cable is pin 1?&#8221;  Then I looked at the screen and realized &#8220;wow&#8230; look at that, the wires on the cable are the same color as the labels on the screen&#8221;.  I though that was pretty damn civilized.  I had a variable voltage sitting right next to the kit (just a POT on another devkit that I was working on) so I plugged it into the &#8220;YW&#8221; (aka Yellow) wire.  After pressing v again it happily reported 0.00v (two decimal places even).  Hmmm&#8230; what in the world is going on.   Time for the fluke.  Crazy, the voltage is right, I wonder what isnt working.  I then guessed that the cable was plugged in backwards, but that wasnt it (the cable is keyed).  Then I wondered if there was something wrong with the cable, so I disconnected it and just connected directly to the pin (which is unlabeled on the silkscreen &#8211; that sucks).  I found the pinout on the schematic on <a href="http://dangerousprototypes.com/docs/Bus_Pirate_I/O_Pin_Descriptions" target="_blank">Dangerous Prototypes.</a>  Then I realized, the cable is BACKWARDS from the real pinout.  That really really sucks.</p>
<p>When I looked at the comments on the Sparkfun page there is quite the little discussion about this topic.  Included is a suggestion to un-crimp the cable, flip it over, and recrimp.  I tried this suggestion and it worked out, until I broke part of the plastic holding the cable together.  After getting the voltage source connected to pin 4 I was able to see changes in the value being read correctly by the analog to digital convertor in the BP.  Cool.</p>
<p>The other comment which caught my attention on the Sparkfun page was a request from Ian Lesnet to please buy from the SeeedStudio website.  This motivated me to purchase another V3 and a V4 from SeeedStudio.  I the next post Ill talk more about my experience with SeeedStudio V3 and V4.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://iotexpert.com/bus-pirate-v3-from-sparkfun/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
