<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://crancho.com/w/index.php?action=history&amp;feed=atom&amp;title=BusPirate</id>
	<title>BusPirate - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://crancho.com/w/index.php?action=history&amp;feed=atom&amp;title=BusPirate"/>
	<link rel="alternate" type="text/html" href="https://crancho.com/w/index.php?title=BusPirate&amp;action=history"/>
	<updated>2026-05-02T04:28:01Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.2</generator>
	<entry>
		<id>https://crancho.com/w/index.php?title=BusPirate&amp;diff=1081&amp;oldid=prev</id>
		<title>Ohayden: /* BusPirate Pin Map */</title>
		<link rel="alternate" type="text/html" href="https://crancho.com/w/index.php?title=BusPirate&amp;diff=1081&amp;oldid=prev"/>
		<updated>2010-04-12T14:23:13Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;BusPirate Pin Map&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Bus Pirate v3=&lt;br /&gt;
== Upgrade Bootloader from v2.X to v4.X ==&lt;br /&gt;
*This requires the &amp;quot;pyserial&amp;quot; package and I used 2.5RC2 from pyserial.sourceforge.net&lt;br /&gt;
*With the Bus Pirate unplugged, on the ICSP header jumper the PGD and PGC pins together and plug the Bus Pirate in to the lappie with the USB cable&lt;br /&gt;
*We have to use the older python script with the v2.X bootloader&lt;br /&gt;
  python P24qp.py -a ./BPv3-v2blupdaterVa3-v4.1.hex -s /dev/ttyUSB0 -v&lt;br /&gt;
*Unplug the Bus Pirate and then remove the jumper from the PGD / PGC pins and plug the Bus Pirate back into the lappie via the USB cable&lt;br /&gt;
*Connect to the Bus Pirate via serial (make sure the Bus Pirate is on the right dev, for me it&amp;#039;s /dev/ttyUSB0):&lt;br /&gt;
  minicom -o&lt;br /&gt;
*Press enter in the terminal and instead of the normal Bus Pirate prompt, you&amp;#039;ll see an installer message asking you to type &amp;quot;Yes&amp;quot; to program the new bootloader&lt;br /&gt;
*Type &amp;quot;Yes&amp;quot; and it will update the bootloader and the output should be similar to the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Erasing 0xA400... done&lt;br /&gt;
Erasing 0xA800... done&lt;br /&gt;
Writing row 0 1 2 3 4 5 6 7 done&lt;br /&gt;
Erasing 0x0000... done&lt;br /&gt;
Writing row 0... done&lt;br /&gt;
&lt;br /&gt;
Success!&lt;br /&gt;
Upload new firmware with the ds30 Loader app to complete the upgrade&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Now your ready to do a firmware update using the newer &amp;quot;pirate-loader_lnx&amp;quot; cli tool -- See &amp;quot;Firmware Updates using Bootloader v4.X&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Firmware Updates using Bootloader v4.X ==&lt;br /&gt;
*With the Bus Pirate unplugged, on the ICSP header jumper the PGD and PGC pins together and plug the Bus Pirate in to the lappie with the USB cable&lt;br /&gt;
*With the latest update tar.gz extracted, cd into the Bus Pirate v3 directory as such:&lt;br /&gt;
  cd BPv3\&amp;amp;v2go/&lt;br /&gt;
*You might need to chmod the cli tool as such:&lt;br /&gt;
  chmod +x ../pirate-loader_lnx&lt;br /&gt;
*Run the firmware update:&lt;br /&gt;
  ../pirate-loader_lnx --dev=/dev/ttyUSB0 --hex=./BPv3-Firmware-v4.2.hex --verbose&lt;br /&gt;
*Once done, unplug the Bus Pirate and then remove the jumper from the PGD / PGC pins and plug the Bus Pirate back into the lappie via the USB cable&lt;br /&gt;
*Connect to the Bus Pirate via serial (make sure the Bus Pirate is on the right dev, for me it&amp;#039;s /dev/ttyUSB0):&lt;br /&gt;
  minicom -o&lt;br /&gt;
*Press enter in the terminal and you&amp;#039;ll see the normal Bus Pirate prompt &amp;quot;HiZ&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== I2c with the Maxim 7312 ==&lt;br /&gt;
* Set output mode:&lt;br /&gt;
  [0x42 0x06 0x00]&lt;br /&gt;
*Set all off on port 1:&lt;br /&gt;
  [0x42 0x02 0x00]&lt;br /&gt;
*Set first pin on for port 1:&lt;br /&gt;
  [0x042 0x02 0x01]&lt;br /&gt;
&lt;br /&gt;
== Bus Pirate to a STK500v2 AVR Clone ==&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FFFFFF;background:#FF0000&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;Not needed?  Apparently avrdude can work directly with the bus pirate...&amp;#039;&amp;#039;&amp;#039;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strike&amp;gt;&lt;br /&gt;
Unfortunately the stock firmware doesn&amp;#039;t include the STK500 protocol and they are saying it&amp;#039;s highly unlikely it ever will.  That just means we&amp;#039;ll need to flash back and forth for now.  Here are the step to making the Bus Pirate a STK500v2 AVR clone.&lt;br /&gt;
*With the Bus Pirate unplugged, on the ICSP header jumper the PGD and PGC pins together and plug the Bus Pirate in to the lappie with the USB cable&lt;br /&gt;
*With the latest update tar.gz extracted, cd into the Bus Pirate v3 directory as such:&lt;br /&gt;
  cd BPv3\&amp;amp;v2go/&lt;br /&gt;
*You might need to chmod the cli tool as such:&lt;br /&gt;
  chmod +x ../pirate-loader_lnx&lt;br /&gt;
*Run the firmware update:&lt;br /&gt;
  ../pirate-loader_lnx --dev=/dev/ttyUSB0 --hex=./BPv3-STK500v2-v0b.hex --verbose&lt;br /&gt;
*Once done, unplug the Bus Pirate and then remove the jumper from the PGD / PGC pins and plug the Bus Pirate back into the lappie via the USB cable&lt;br /&gt;
*Now you should be able to use avrdude or similar&lt;br /&gt;
&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install an AVR Toolchain ==&lt;br /&gt;
=== Prepare ===&lt;br /&gt;
*Install some packages&lt;br /&gt;
  apt-get install bison texinfo gawk flex byacc gcc make libgmp3-dev libmpfr-dev&lt;br /&gt;
=== Binutils ===&lt;br /&gt;
*Official site: http://www.gnu.org/software/binutils/&lt;br /&gt;
*Download the latest binutils from [ftp://ftp.gnu.org/gnu/binutils/ here] and compile:&lt;br /&gt;
*NOTE 1: --disable-nls = Avoids the dependency on gettext (for i18n) being installed on the host. As LC_ALL=POSIX is set, NLS would not be used anyway even if enabled.&lt;br /&gt;
*NOTE 2: --enable-install-libbfd = Binary File Descriptor library: Allows applications to use the same routines to operate on object files whatever the object file format. Basically, it adds ELF, or whatever executable format your toolchain outputs, support to binutils.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
wget ftp://ftp.gnu.org/gnu/binutils/binutils-2.20.1.tar.gz&lt;br /&gt;
tar xvf binutils-2.20.1.tar.gz&lt;br /&gt;
cd binutils-2.20.1&lt;br /&gt;
mkdir obj-avr&lt;br /&gt;
cd obj-avr&lt;br /&gt;
../configure --target=avr --prefix=/usr/local/avr --disable-nls --enable-install-libbfd&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GCC Core ===&lt;br /&gt;
*Official site: http://gcc.gnu.org/&lt;br /&gt;
*Download the latest gcc-core from [ftp://ftp.gnu.org/gnu/gcc/ here] and compile:&lt;br /&gt;
*NOTE 1: --disable-libssp = Stack Smashing Protection library: This isn&amp;#039;t supported by avr-gcc, so we need to disable it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
wget ftp://ftp.gnu.org/gnu/gcc/gcc-4.4.3/gcc-core-4.4.3.tar.gz&lt;br /&gt;
tar xfv gcc-core-4.4.3.tar.gz &lt;br /&gt;
cd gcc-4.4.3&lt;br /&gt;
mkdir obj-avr&lt;br /&gt;
cd obj-avr&lt;br /&gt;
../configure --target=avr --prefix=/usr/local/avr --disable-nls --disable-libssp --enable-languages=c&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== AVR-Libc ===&lt;br /&gt;
*Official site: http://www.nongnu.org/avr-libc/&lt;br /&gt;
*Download the latest avr-libc from [http://nongnu.askapache.com/avr-libc/ here] and compile:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
wget http://nongnu.askapache.com/avr-libc/avr-libc-1.6.8.tar.bz2&lt;br /&gt;
tar xfv avr-libc-1.6.8.tar.bz2&lt;br /&gt;
cd avr-libc-1.6.8&lt;br /&gt;
mkdir obj-avr&lt;br /&gt;
cd obj-avr&lt;br /&gt;
../configure --host=avr --prefix=/usr/local/avr --build=`./config.guess`&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== AVRDude ===&lt;br /&gt;
This is only required only for programming the AVR.&lt;br /&gt;
*Official site: http://www.nongnu.org/avrdude/&lt;br /&gt;
*Download the latest avrdude from [http://nongnu.askapache.com/avrdude/ here] and compile:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /share&lt;br /&gt;
mkdir avrdude&lt;br /&gt;
cd avrdude&lt;br /&gt;
wget http://nongnu.askapache.com/avrdude/avrdude-5.9.tar.gz&lt;br /&gt;
tar xvf avrdude-5.9.tar.gz&lt;br /&gt;
cd avrdude-5.9&lt;br /&gt;
./configure --prefix=/usr/local/avr&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
cp avrdude.conf /etc/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Setup ===&lt;br /&gt;
*Configure avrdude by opening /etc/avrdude.conf and setting &amp;quot;default_serial&amp;quot; to &amp;quot;/dev/ttyUSB0&amp;quot; for the Bus Pirate&lt;br /&gt;
*Add the following to your ~/.bash_profile (ssh) and/or ~/.bashrc (gui terminal) as needed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PATH=$PATH:/usr/local/avr/bin&lt;br /&gt;
export PATH&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Avrdude ==&lt;br /&gt;
*Initial test:&lt;br /&gt;
  avrdude -p m328p -c buspirate&lt;br /&gt;
*Output from the above should look like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Detecting BusPirate...&lt;br /&gt;
**  &lt;br /&gt;
**  Bus Pirate v3&lt;br /&gt;
**  Firmware v4.2 Bootloader v4.1&lt;br /&gt;
**  DEVID:0x0447 REVID:0x3042 (B4)&lt;br /&gt;
**  http://dangerousprototypes.com&lt;br /&gt;
**&lt;br /&gt;
BusPirate: using BINARY mode&lt;br /&gt;
avrdude: AVR device initialized and ready to accept instructions&lt;br /&gt;
&lt;br /&gt;
Reading | ################################################## | 100% 0.10s&lt;br /&gt;
&lt;br /&gt;
avrdude: Device signature = 0x1e950f&lt;br /&gt;
&lt;br /&gt;
avrdude: safemode: Fuses OK&lt;br /&gt;
&lt;br /&gt;
avrdude done.  Thank you.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Programming:&lt;br /&gt;
  avrdude -p m328p -c buspirate -U flash:w:blink_1MHz.hex&lt;br /&gt;
*Output from above:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Detecting BusPirate...&lt;br /&gt;
**  &lt;br /&gt;
**  Bus Pirate v3&lt;br /&gt;
**  Firmware v4.2 Bootloader v4.1&lt;br /&gt;
**  DEVID:0x0447 REVID:0x3042 (B4)&lt;br /&gt;
**  http://dangerousprototypes.com&lt;br /&gt;
**&lt;br /&gt;
BusPirate: using BINARY mode&lt;br /&gt;
avrdude: AVR device initialized and ready to accept instructions&lt;br /&gt;
&lt;br /&gt;
Reading | ################################################## | 100% 0.10s&lt;br /&gt;
&lt;br /&gt;
avrdude: Device signature = 0x1e950f&lt;br /&gt;
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed&lt;br /&gt;
         To disable this feature, specify the -D option.&lt;br /&gt;
avrdude: erasing chip&lt;br /&gt;
avrdude: reading input file &amp;quot;blink_1MHz.hex&amp;quot;&lt;br /&gt;
avrdude: input file blink_1MHz.hex auto detected as Intel Hex&lt;br /&gt;
avrdude: writing flash (300 bytes):&lt;br /&gt;
&lt;br /&gt;
Writing | ################################################## | 100% 9.79s&lt;br /&gt;
&lt;br /&gt;
avrdude: 300 bytes of flash written&lt;br /&gt;
avrdude: verifying flash memory against blink_1MHz.hex:&lt;br /&gt;
avrdude: load data flash data from input file blink_1MHz.hex:&lt;br /&gt;
avrdude: input file blink_1MHz.hex auto detected as Intel Hex&lt;br /&gt;
avrdude: input file blink_1MHz.hex contains 300 bytes&lt;br /&gt;
avrdude: reading on-chip flash data:&lt;br /&gt;
&lt;br /&gt;
Reading | ################################################## | 100% 9.59s&lt;br /&gt;
&lt;br /&gt;
avrdude: verifying ...&lt;br /&gt;
avrdude: 300 bytes of flash verified&lt;br /&gt;
&lt;br /&gt;
avrdude: safemode: Fuses OK&lt;br /&gt;
&lt;br /&gt;
avrdude done.  Thank you.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*To cheat and supply voltage to the chip you&amp;#039;re programming you can draw from the Bus Pirate by using it&amp;#039;s power supply.  Simply connect, set a mode with the &amp;quot;m&amp;quot; command.  Any mode will do, but &amp;quot;2&amp;quot; 1-Wire doesn&amp;#039;t ask any follow up questions.  Once you&amp;#039;re in a mode, then use the &amp;quot;W&amp;quot; to turn on the power supplies and &amp;quot;w&amp;quot; to turn them off.&lt;br /&gt;
== BusPirate Pin Map ==&lt;br /&gt;
[[Image:Buspirate_pin_map.png‎]]&lt;/div&gt;</summary>
		<author><name>Ohayden</name></author>
	</entry>
</feed>