Bus Pirate preorder 2: new bootloader, no firmware


We’ve got another update on Hack a Day’s Bus Pirate v2go preorder 2 firmware. It would be nice if Hack a Day wrote a short post too, since this was their fundraiser.

Seeed made sure everyone got the latest bootloader version (v2) because you have to program that through the ICSP header with a real programmer. They didn’t upload a firmware, so you have to get the latest firmware and upload it using the normal Bus Pirate USB update procedure (Linux/OSX).  Since there’s no existing firmware on the PIC, the bootloader starts automatically. You don’t need a jumper between the PGC and PGD pins. You can tell the v2 bootloader is active if the MODE LED lights immediately after power-on.

The good news is that you got an upgrade to bootloader v2, but you have to update to the latest firmware yourself. Preorder 2 would otherwise have shipped with v0g firmware, you’d probably want to update it to the latest firmware anyways. If you have any questions, or need help bootloading your firmware, please give us a shout in the Bus Pirate forum.

Future Bus Pirate orders WILL ship with both the bootloader and the most recent firmware. Read a bit more about the situation below.

Continue readingBus Pirate preorder 2: new bootloader, no firmware”

Bus Pirate preorder 2 unboxing


***UPDATE*** If your preorder 2 Bus Pirate doesn’t work, try bootloading the latest firmware. We’ve had one report that a preorder 2 v2go shipped with the latest bootloader but no firmware. The bonus is you get the latest bootloader (v2), but you have to add the latest firmware yourself. More info as we figure out what’s going on.

We’ve gotten reports of Bus Pirate v2gos from Hack a Day’s long-delayed preorder 2 starting to arrive. Feel free to share your unboxing experience here, or in the forum.

Don’t forget to upgrade to the latest firmware, it’s got a ton of bug fixes. If you need help with the Bus Pirate, check out the Bus Pirate manual and the Bus Pirate forum for help. We’ve got a few accessories for the Bus Pirate, like a 3-EEPROM explorer board and LCD library adapter.

Artwork by Aaron, Creative Commons Attribution 3.0.

Compile the Bus Pirate firmware


This is an old version, see the latest version on the documentation wiki.

You don’t need a Microchip programmer to develop firmware for the Bus Pirate. You can use Microchip’s free development tools and upload code through the USB bootloader. It’s a mini PIC 24F development board!

First, download and install Microchip’s IDE called MPLAB, and the free demonstration C30 compiler. Next, download a Bus Pirate source code archive, or get the latest development version from SVN with a program like TortoiseSVN.

Open the Bus Pirate project in MPLAB.

Uncomment the correct Bus Pirate hardware version and language in base.h. Compile the project. You may need to modify the compiler location when prompted, but MPLAB is getting better about making these changes automatically.

The compiled firmware must be exported in order to work with the bootloader. In MPLAB, go to File->Export… Make sure that the Program Memory and Configuration Bits boxes are checked. Make sure INHX32 (Intel 32bit HEX) is selected on the File Format tab. Click OK to export the firmware.

Bootload the firmware following your normal upgrade process (Linux, OSX).

After the break, learn how to use TortoiseSVN to check out the Bus Pirate source on Windows.

Continue reading “Compile the Bus Pirate firmware”

Scan for I2C read and write addresses


See the latest version in the documentation wiki.

You can find the I2C address for most I2C-compatible chips in the datasheet. But what if you’re working with an unknown chip, a dated chip with no datasheet, or you’re just too lazy to look it up?

The Bus Pirate has a built-in address scanner that checks every possible I2C address for a response. This brute force method is a fast and easy way to see if any chips are responding, and to uncover undocumented access addresses.

i2c-scan-thumbI2C chips respond to a 7bit address, so up to 128 devices can share the same two communication wires. An additional bit of the address determines if the operation is a write to the chip (0), or a read from the chip (1).

We connected the Bus Pirate to the 3EEPROM explorer board. The 7bit base address for the 24LC/AA I2C EEPROM is 101 0000 (0x50 in HEX). It answers at the write address 1010 0000 (0xA0) and the read address 1010 0001 (0xA1).

I2C>(1)<<<I2C search macro
Searching 7bit I2C address space.
Found devices at:
0xA0(0x50 W) 0xA1(0x50 R)

Macro 1 in the I2C library runs the address scanner. The scanner displays the raw addresses the chip acknowledged (0xA0, 0xA1), and the 7bit address equivalent (ox50) with write or read bit indicators (W/R). Datasheets usually list the 7bit address, but the 8bit value is more recognizable on a logic analyzer, snooper, debugger, etc.

Free PCB Sunday: Bus Pirate v2a


We go through a lot of prototype PCBs, and end up with lots of extras that we’ll never use. Every Sunday we give away a few professionally-made PCBs from one of our past or future projects, or a related prototype.

This week we’re giving away two Bus Pirate v2a PCBs, PCB by Seeed Studio. The Bus Pirate v2a was really handy for developing the Bus Pirate v2 series, but the Bus Pirate v2go is really the final revision of the v2 design. The nicest feature of v2a is the power switch, which allows developers to reset the Bus Pirate without messing with the USB cable.

We’re giving away two PCBs this week, just ask for one in the comments. Be sure to use a real e-mail in the address field so we can contact you for shipping info. Some rules after the break.

Don’t forget that today is the last day to rant for free Bus Pirate v3 preview PCBs, check out this post.

Continue reading “Free PCB Sunday: Bus Pirate v2a”

Bus Pirate: Fast upgrades on slow chips


See the latest version in the documentation wiki.

The individual PIC chip we used on the Bus Pirate v3 is among those that won’t bootload at 115200bps. Our upgrade recommendation until now has been to bootload firmware at 9600bps, or faster if your PIC will allow.

After working with one of these ‘slow’ chips, we’ve found two methods to connect to the bootloader at full speed:

  1. Connect to the Bus Pirate with the quick programmer utility at 9600bps, then disconnect. Adjust the speed to 115200bps and connect again. This time the slow PIC should respond fine at 115200bps.
  2. We’ve also had success connecting to a slow PIC at 115200bps if we put the bootloader jumper between the PGC and PGD pins while it’s running, and then reset the Bus Pirate from within the terminal with the reset command (#). Disconnect your terminal program and connect with the quick programmer utility at 115200bps. Running correctly at 115200bps before talking to the bootloader seems to nudge slower PICs into the correct timing.

Good luck. If you have a ‘slow’ PIC, please let us know if this helped you upgrade at higher speeds.

Chips: DS1307 I2C real-time clock


This is an old version, see the latest version on the documentation wiki.

The DS1307 is a simple, inexpensive I2C real-time clock, it’s somewhat similar to the PCF8563 that was previously demonstrated with the Bus Pirate.

This chip has some nice features. It has internal capacitors on both oscillator pins, the only required external part is a 32.768kHz time-keeping crystal. It also has a backup battery input so it can keep time during power failures. The battery backup also applies to 56byte of general purpose RAM.

Keep reading for a complete DS1307 demo using the Bus Pirate universal serial interface. If you’re not using a Bus Pirate, that’s OK, you can still follow along and get a better understanding of how to implement this chip in your own application.

Continue reading “Chips: DS1307 I2C real-time clock”

Bus Pirate: Repeat command

See the latest version in the documentation wiki.

RAW3WIRE>r:5<<<read 5 bytes (DEC)
0x00 0x00 0x00 0x00 0x00
RAW3WIRE>r:0x05<<<read 5 bytes (HEX)
0x00 0x00 0x00 0x00 0x00
RAW3WIRE>r:0b101<<<read 5 bytes (BIN)
0x00 0x00 0x00 0x00 0x00

Many Bus Pirate commands can be repeated by adding ‘: ‘ to a command, followed by the number of times to repeat the command. To read five byte, enter r:5, etc. The repeat values can be HEX/DEC/BIN. In the example above we read five bytes each time using a different number format.

RAW3WIRE>0x40:5<<<write 0x40, repeat 5 times
WRITE: 0x40 , 0x05 TIMES
RAW3WIRE>^:5<<<send 5 clock ticks
RAW3WIRE>&:5<<<delay 1uS, repeat 5 times
DELAY 0x05uS

Depending on the bus mode, you can repeat reads, writes, macros, clock ticks, delays, and more. Refer to the Bus Pirate manual for detailed command tables for each mode.

Bus Pirate: 2K pull-up resistor mod

The Bus Pirate v2go shipped with 10K ohm pull-up resistors (R20-23). We modded our Bus Pirate with a 2K pull-up resistor so we don’t need an external resistor to work with 1-Wire devices. Pull-up resistors larger than 2.2K ohms don’t provide enough current for parasitically powered 1-Wire parts. Since we only need the bigger resistor for the 1-Wire protocol, we only replaced the pull-up resistor on the MOSI pin (R23).

Read more about our mod after the break.

Continue reading “Bus Pirate: 2K pull-up resistor mod”

Hack a Day Bus Pirate preorder 2 ships


Fan from Seeed Studio just posted this note in the forum:

Hey guys, This is fan from Seeedstudio. I got a good news for you, Bus pirate preorder 2 was ready and started shipping. You should get your preordered product very soon.

Thanks for the update! When you get your Bus Pirate remember to update the firmware, and check the Bus Pirate manual for all the latest demonstrations and updates. Help is always available in our forum.

Bus Pirate: Number formats


This is an old version, see the latest version on the documentation wiki.

The Bus Pirate terminal interface accepts numbers in three formats: hexadecimal, decimal, and binary. It also displays values in HEX/DEC/BIN and a raw byte format. This short guide explains how to enter number values into the Bus Pirate, and how to adjust the Bus Pirate number display format.

Continue reading “Bus Pirate: Number formats”

Bus Pirate: SLE4442 smart card update


This is an old version, see the latest version on the documentation wiki.

The SLE4442 is a popular smart card with 256bytes of protected EEPROM storage. You can buy blanks to play with for a few dollars, or pick some up at your local copy center. The advantage to buying them is that you’ll know the security code and be able to write to the card.

Hack a Day looked at the SLE4442 using the Bus Pirate, but the article uses v0a hardware and a very early firmware. This is an updated quick guide to reading a SLE4442 with v2go and firmware v2.2+. Refer to the original article for an in depth look at the SLE4442 and its data layout.

Continue readingBus Pirate: SLE4442 smart card update”

Free PCB Sunday: USB RGB color changer


We go through a lot of prototype PCBs, and end up with lots of extras that we’ll never use. Every Sunday we give away a few professionally-made PCBs from one of our past or future projects, or a related prototype.

This is a USB controlled RGB color changing light. Ian did this project at DIY Life, a Weblogs, Inc. site that shut down about a year ago. Someone made some minor modifications to the design and had a bunch of boards produced, we ended up with a pile of the extras. This PCB is as-of-yet untested, you can discuss it in the forum.

We’re giving away two PCBs this week, just ask for one in the comments. Be sure to use a real e-mail in the address field so we can contact you for shipping info. Some rules after the break.

Continue reading “Free PCB Sunday: USB RGB color changer”

Bus Pirate firmware v2.2 roadmap

With Bus Pirate firmware v2.1 out the door, we started thinking about what we wanted to include in v2.2. Here’s our thoughts so far:

  • I2C/SPI EEPROM dump and program macro.
  • I2C hardware slave.
  • I2C sniffer.
  • UART auto baud rate detector.
  • JTAG library integration with bitbang functions, facelift and improvements.
  • Central data struct for syntax variables, keeps a ton of stuff off the stack by not passing commands and repeat values through three or four functions.

Feel free to make requests in the comments, in the forum, or on the SVN tracker.

Continue reading “Bus Pirate firmware v2.2 roadmap”

Fundamental Logic Bus Pirate v1 kit now $20


Fundamental Logic was the first company to offer a Bus Pirate for sale. Their Bus Pirate v1a through-hole kit is currently on sale for $20.  v1a is completely compatible with the latest firmware updates, the main difference between v1a and v2 & v3 is the connection type (serial vs USB) and the pull-up resistors (manual vs software controlled).

If you’re looking for a through-hole Bus Pirate kit, $20 seems like a great deal. Fundamental Logic had good prices on international shipping when we last checked.

Thanks Marc!

Why do you hate the Arduino?


That’s assuming you do. We’ve noticed a general malaise towards the Arduino and/or Arduino projects in comments at tech blogs. Arduino is to Hack a Day as Knex guns are to Instructables.

What’s the deal? Too many newbies with blinken LEDs? $30 is too much for an AVR with a bootloader? Is it the platform or the projects?

We all know the arguments for the Arduino: it’s an easy and open prototyping platform with free tools and great community support. But why do so many geeks detest the Arduino? Why the hate?

We’ll send a free Bus Pirate v3 PCB to the commenter with the best rant for- or against- the Arduino.

Continue reading “Why do you hate the Arduino?”

Bus Pirate firmware v2.1 released


Bus Pirate firmware v2.1 is a major upgrade that fixes a lot of bugs. With Hack a Day’s second Bus Pirate preorder about to ship, we couldn’t wait any longer to release it.

This version has major fixes to the I2C library, hardware I2C support, new speed options, and improved terminal interface. Thanks to a dedicated translator, we’re also able to release the first Spanish and Italian localized firmware for the Bus Pirate. Download the updated firmware from the Google Code page, check out the change log below.

Do you have any requests for the next firmware version?  What hardware version do you use? How often do you update your firmware?

Continue reading “Bus Pirate firmware v2.1 released”

Bus Pirate HEX/DEC/BIN converter


See the latest version in the documentation wiki.

Converting between hexadecimal, decimal, and binary is a pretty constant activity when you work with a new microchip.

HiZ>=<<<HEX/DEC/BIN converter command
CONVERT (1) >0b1010 <<<convert this value
0x0A <<<HEX equivalent
10<<<DEC equivalent
0b00001010<<<BIN equivalent
HiZ>=<<<HEX/DEC/BIN converter command
CONVERT (1) >0xf

The latest Bus Pirate nightly firmware compile (v2.1-RC3+) adds a much-needed base conversion command, available in all modes. Press ‘=’ and enter any byte value to see the HEX/DEC/BIN equivalent.

Continue reading “Bus Pirate HEX/DEC/BIN converter”

Hack a Day Bus Pirate preorder 2 update


Seeed Studio just tweeted an update on Hack a Day’s second Bus Pirate preorder. Looks like they’ll ship in one week:

After long time waiting,we got ICs from Digikey. Now Bus Pirat Preorder 2 just started manufacture,will be ship out within a week.

Check out our Bus Pirate goodies when it arrives.

Thanks Mike! Artwork by Aaron, Creative Commons Attribution 3.0.