Find your Bus Pirate's PIC revision


See the latest version in the documentation wiki.

The latest Bus Pirate v2go nightly firmware build reports the device ID, revision, and configuration bits in the terminal.

Hack a Day Bus Pirate v2go
Firmware v2.1-nightly
DEVID:0x0447 <<< PIC 24F64GA002
REVID:0x3042 (B4) <<<0x3042 = Revision 4
CFG1:0xF9DF <<< config word one
CFG2:0x3F7F <<<config word two

Use the information menu (i) to report the settings. PIC revisions: A3/A4=0x3003, B4=0x3042, B5=0x3043.

Bus Pirate: Firmware upgrades on Linux, OSX


STOP!!! You probably need the v2 to v4 upgrade guide instead!!!

See the latest version in the documentation wiki.

Bus Pirate firmware updates can be done from Linux or OSX using the Python PIC24F programmer developed by broeggle and JoseJX. The programmer works on all operating systems that support Python and pySerial: Linux, OSX, and Windows, too. Thanks for a great script!

Our step-by-step guide to the Python PIC24F programmer continues after the break.

Continue reading “Bus Pirate: Firmware upgrades on Linux, OSX”

Bus Pirate: v3 update


***We’ll start a preorder ($30 assembled, shipped worldwide) if there are a few firm commitments, sign up for notification in the forum.***

This rendering shows the nearly-complete Bus Pirate v3 PCB. Our initial preview of the new hardware generated some really good comments.

  • We decided to swap the PGC and PGD pins of the ICSP header as suggested by numerous readers. The pins will now align with a PICKIT2 programmer.
  • The power traces and vias have been expanded to handle the maximum possible loads.
  • SSOP PIC, eliminated a few parts, centered USB jack, rotated CD4066 IC to accommodate a shrouded or right angle pin header.
  • The PGC/PGD swap means this hardware will require a new bootloader and firmware. For this reason we’re going to increment the hardware to v3 instead of v2.5.
  • Added power-on self-test to firmware for hardware v3. Future hardware will probably require a jumper between PGD and ground for normal operation.
  • We decided against mounting holes. We couldn’t locate a standard separation for the hole pattern, so the holes would only fit one specific case.
  • Removed alternate resistor placement pads from bottom of PCB. Back LEDs now use the same resistors as the front side LEDs.

Bus Pirate: Linux/Pyton programmer for PIC 24FJ


There’s been a lot of progress on a Linux/Python programmer for the Bus Pirate’s PIC 24FJ bootloader. The programmer is based on AN851, AN1157, some existing code, and COM dumps. You can track the development in the forum and in the project SVN.

Continue reading “Bus Pirate: Linux/Pyton programmer for PIC 24FJ”

Bus Pirate: v3 power-on self-test


Seeed Studio tested the bootloader and terminal of each Bus Pirate prior to shipping. This is a good test, but Seeed requested that we design a more thorough test program for future orders.

We implemented a self-test menu option in firmware version 2 that tests most of the hardware and functions on the Bus Pirate PCB. It’s still a slow way to test 1000 units, so we came up with a power-on self-test for v3 hardware that can be semi-automated.

The manufacturer’s power-on self-test (POST) is activated by connecting the inner programming pin (which will be PGD on v3 hardware) to +3.3volts (the power pin). This creates a PGD/PGC mismatch that exits the bootloader, and then the main firmware runs the POST if the pin is high.

The POST is a silent version of the self-test available from the Bus Pirate terminal (menu ‘~’). If the test is successful, the MODE LED lights. This could be confused with the v2 ‘bootloader ready LED’, but you can see the VREG LED blink during POST. When the test is complete, any data sent to the Bus Pirate over the USB connection is echoed back, which tests the FTDI chip and the PIC UART. If there were errors, the number of errors is added to the value returned. The easiest test is to enter ASCII 0 and the number of errors will be returned.

The POST is a little dangerous because there’s a chance of accidentally entering the POST mode and harming an attached circuit. v3 will probably ship with a jumper between the inner programming pin and ground, just to guard against accidental POSTs. The v3 article will include a table of ICSP jumper settings with corresponding modes, like ‘normal’, ‘bootloader’, and ‘POST’.

Free prototype PCB Sunday


We go through a lot of prototype PCBs, and end up with lots of extras that we’ll never use. This week we’re going to start a regular, weekly PCB giveaway. Every Sunday we’re going to give away a few professionally-made PCBs from one of our past or future projects, or a related prototype.

This week we’ll send a Bus Pirate v2a PCB to two readers, 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. If you don’t get a free one, Seeed Studio still has some v2a PCBs for sale.

Request your PCB in the comments, be sure to use a real e-mail address so we can contact you for shipping info. Some rules after the break.

Continue reading “Free prototype PCB Sunday”

Confessions of a prototyper: Bus Pirate v1.5


The Bus Pirate V2a and V2go weren’t the only design candidates for the Bus Pirate v2 series. Here’s a rendering of the Bus Pirate ‘v1.5’, a design that never saw the light of day. This Bus Pirate was meant to be completely portable. It has an LCD to display the terminal, and a keyboard jack to work with a roll-up rubber keyboard.

Here’s some of the differences between this version and the final v2 series.

  1. This design didn’t include software controlled pull-up resistors. It uses the jumper concept from v1a with SMD resistors.
  2. V1.5 included a Nokia LCD knock off, like the one SparkFun sells for $15. The LCD backlight needs 7volts, so the large SOT223 regulator behind the power supply is a LM317 set to 7volts. The LM317 also supplies the other regulators with 7volts, which is better than the 5V supply to 5volt regulators on the v2a and v2go.
  3. The six hole pattern seen on both sides of the PCB is for the PC keyboard connector. PC keyboards operate at 5volts, so this feature took two of only seven 5volt tolerant pins on the PIC24FJ64.

When we decided to manufacture the Bus Pirate, this design was too complicated and expensive. The code to run the LCD terminal and read the keyboard was big and made it hard to add new protocols. The knock-off Nokia LCDs are really inconsistent too, even different batches from SparkFun require different drivers. We minimized the design first to the v2a, then to the v2go.

In the end, we’re really pleased with the v2go. In retrospect, however, there were a few changes that would have make the whole process smoother. These have been integrated into the updated Bus Pirate v3, which is an even cleaner design that should be easier to manufacture in quantity.

Prototype: Bus Pirate 3EEPROM explorer board


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

Now you’ve got one of Hack a Day’s Bus Pirates, what do you do with it? Learn about 1-wire, I2C, and SPI EEPROMs with the 3EEPROM explorer board (we pronounce it THREE-PROM, emphasis on the EE).

EEPROM is a type of memory chip that stores data without a continuous power supply. It’s useful for permanent data storage in small logger circuits, or holding custom pages in a mini web server. EEPROMs come in lots of sizes and protocols.

The 3EEPROM has three common EEPROM chips: the DS2431 (1-Wire), 24AA- (I2C), and 25AA- (SPI). All three were previously demonstrated on Hack a Day, but each demo uses a different version of the Bus Pirate hardware and firmware, its difficult for a beginner to follow using a Bus Pirate v2go.

Continue reading for an updated, step by step guide to using the DS2431, 24AA-, and 25AA- EEPROMs with the Bus Pirate v2go. We’ve also got the full session logs as text files so you won’t miss a single detail.

We can have 3EEPROM explorer board PCBs or kits produced at Seeed Studio. PCBs are about $10, kits are about $15, shipped worldwide. We need to organize a group purchase of 10 PCBs or 20 kits to get started. If you’re interested in a Bus Pirate, version 3 is coming.

Continue reading “Prototype: Bus Pirate 3EEPROM explorer board”

Bus Pirate v3: Beating the shortage



UPDATE II: PCB stuffed and tested.

UPDATE I:***We’ll start a preorder ($30 assembled, shipped worldwide) if there are a few firm commitments, sign to be notified and check the forum.***

The next version of the Bus Pirate universal serial interface is about a week away from prototyping. Why a new version so soon, when Hack a Day’s second preorder won’t ship for another 20 days?

The chip availability problem has a lot to do with it. We modified the v2go board to use the SSOP version of the PIC24FJ64GA002, which seems to be more widely available.

We normally work with SOIC chips whenever possible. It’s an easy surface mount size for the timid solderer, and it’s an easy size to prototype on homemade PCBs. The SSOP PIC makes sense here, though, because FTDI only makes the 232RL USB chip used on the Bus Pirate in SSOP and QFN packages, we’re using professional PCBs, and the vast majority of these are being made in a factory.

Changes to Bus Pirate V3:

  • Changed to SSOP PIC24FJ64GA002-I/SS
  • Removed unnecessary pull-down resistor R18. Verified in datasheet that VR3 & VR4 are off when enable pin is open.
  • Moved and rotated the CD4066 (IC3) for cleaner routing and (maybe) sufficient clearance to fit a shrouded header.
  • Thicker power traces, bigger power vias.
  • PCB is thinner and slightly longer, USB jack centered, R19 aligned with other resistors.
  • Moved USB LED to top.
  • Switched ADC and 3.3V pins.
  • Will be programmed with V2+ firmware. Includes a power-on self-test mode triggered by starting with the PGC pin jumpered to +3.3volts. Quality control will be faster and more thorough.
  • Code name is v3, may end up being versioned to v2.5 if the firmware is 100% compatible with v2go.

Look for the new PCB in the SVN soon.

Make your change requests in the comments.

Bus Pirate: Self-test guide


See the latest version on the documentation wiki.

In the past few days Hack a Day’s Bus Pirate preorders have started to arrive all over the world. Broken units have been extremely rare, there’s only been one manufacturing defect and one broken FTDI chip reported so far. Seeed Studio tested the bootloader and terminal of each Bus Pirate, but problems can always occur in transit.

Firmware v2.0 has a self-test routine that will help determine if your Bus Pirate v2go has a defect. Upgrade to the latest Bus Pirate firmware before attempting the self-test. Bus Pirate v3 will come with a power-on self-test mode.

Detailed self-test instructions and analysis follow the break.

Continue reading “Bus Pirate: Self-test guide”

Bus Pirate: Practical guide to pull-up resistors


See the latest version in the documentation wiki.

There’s often some confusion about how the Bus Pirate’s on-board pull-up resistors work. It doesn’t help that the implementation changes drastically from one hardware revision to the next, a lot of the original device tutorials are difficult to follow if you have a Bus Pirate v2go.

The figure outlines the basic parts of the Bus Pirate v2go on-board pull-up resistors. A pull-up (or pull-down) voltage supplied through the Vpullup (Vpu) pin is fed into a  CD4066 analog switch (IC3). The 4066 distributes the pull-up voltage to four 10K resistors (R20-23) that connect to the MOSI, CLOCK, MISO, and CS bus pins.

Continue reading our practical guide to the Bus Pirate v2go’s pull-up resistors after the break.

Continue reading “Bus Pirate: Practical guide to pull-up resistors”

Bus Pirate: Firmware v2.0 released


Firmware v2.0 for all Bus Pirate hardware versions is available from the project’s Google Code page. Version 2 is a major upgrade recommended for all users. Follow our illustrated firmware upgrade guide. The default update speed is a paltry 9600bps, but you might be able to increase it.

Version 2.0 follows the v0g release. V0g is installed on the Bus Pirate v2gos in Hack a Day’s preorders (1&2). We highlight new features after the break, you might find help with issues in the forum.

Continue reading “Bus Pirate: Firmware v2.0 released”

Bus Pirate: High-speed firmware updates


See the latest version in the documentation wiki.

Quality control tests on the Bus Pirate preorder 1 flagged about 50 out of 400 units as defective. The terminal interface worked fine, but the bootloader wouldn’t connect.

The solution was to decrease the speed of the quick programmer utility to the Microchip recommended default, 9600bps. Unfortunately, it takes nearly 3.5minutes to update the firmware at 9600bps.

Most PICs, perhaps all, will work at higher speeds. Right click on the quick programmer speed setting for an options menu. Try connecting at different speeds until you find the highest reliable speed that works with your chip.

Read on for a detailed post-game analysis of the error, where it came from, the issues we faced, and the solution we ultimately chose.

Continue readingBus Pirate: High-speed firmware updates”

Bus Pirate: Firmware upgrades


See the latest version in the documentation wiki.

The Bus Pirate has a bootloader that accepts software updates over the USB connection and writes them to the memory of the PIC 24FJ64GA002 microcontroller. Without a bootloader, we’d have update the firmware through the ICSP header using a ‘real’ programmer like an ICD2 or PICKIT2.

This guide explains how to update the Bus Pirate firmware using the bootloader and the Windows quick programmer utility.

Continue reading “Bus Pirate: Firmware upgrades”

Bus Pirate 101


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

In this introductory tutorial we cover the basics of the Bus Pirate universal serial interface. First, we identify the different parts of the Bus Pirate and explain their function. Next, we cover driver installation and terminal configuration. Finally, we explain the user interface and demonstrate some basic terminal menu commands. There’s links to everything you need to start hacking with the Bus Pirate.

Continue reading “Bus Pirate 101”