Bus Pirate v3, and all previous Bus Pirates, are based on a chip with 64K of program space. Last year we stuffed so many features into the firmware that we used all the space. It was time for new hardware based on a new chip.
We didn’t want to run out of space again soon, so we used a PIC 24FJ256GB106 with 256K of space. More room was the main goal, but we can pull off some other fun things with the resources on the bigger chip:
- Integrated, on-board USB (faster)
- Data storage EEPROM to hold settings
- Pull-up voltage selections: 3.3volt, 5volt, or external supply
- 2 extra I/O pins
- Multipurpose button
- Bus Pirate v4 vs v3 comparison
Bus Pirate v4 is new and shiny, but it will lag behind the trusty v3 for a while. If you want proven goodness we still recommend the v3, it is actively developed and will be manufactured for the foreseeable future. v4 will continue to improve, and we’ll let you know when we think it is the go-to hardware.
Keep reading below for more about the new hardware.
You can get a Bus Pirate v4 for $40, including worldwide shipping.
Small sensors and other microchips talk many different protocols (1-Wire, I2C, UART, SPI, etc) through different numbers of wires. The Bus Pirate is a simple way to talk to many of them from a computer. Commands typed into a computer are sent to the chip, any reply is displayed on the computer screen.
The Bus Pirate speeds up development when you’re working with a new chip. It’s a known-working (usually) reference implementation of a protocol, and you can use it to learn a new chip before writing any code. It also has a ton of other stuff we need all the time like power supplies, voltage and frequency measurement, pull-up resistors, and more. The code is all public domain, so you can reuse it in your own project without restrictions.
We hacked the Bus Pirate together as we worked on different projects. Each feature was added because it solves a real-world problem. Hundreds of contributors have made the Bus Pirate one of the best known open source hacking tools. Thank you to everyone who contributed to the development of Bus Pirate v4.
Click here for a full size schematic image. Schematic and PCB were designed with the freeware version of Cadsoft Eagle, download the latest project files from our Google Code project page or look for a release package.
Bus Pirate v4 uses a beefy PIC24FJ256GB106 microcontoller (IC1). It has 4 times more storage space, and twice the memory of chip used in Bus Pirate version 3. On-chip USB speeds up the data connection considerably, and gives optional USB On-the-Go capability.
A 3.3volt regulator (VR1) powers the PIC from the 5volt USB supply, it needs a 1uF capacitor (C12) to stabilize the voltage output. All the PIC power supply pins (VDD) are decoupled by 0.1uF capacitors (C2,C4,C9). The PIC has an internal 2.5volt regulator that powers the core, it needs a 10uF capacitor (C15) on the VCORE pin.
The PIC runs at 32MHz/16MIPS. A clock is supplied by an external 12MHz quartz crystal (X1) and two 18pF capacitors (C7 and C8). The core gets 32MHz by multiplying the external clock to 96MHz, then dividing it by three.
Code is loaded into the PIC chip through the ICSP programing header. as well a reset button. 2K resistor R7 holds the MCLR pin high so the PIC operates normally. The RESET button momentarily pulls MCLR low to reset the PIC.
Version 4 uses a PIC uC with an on-board hardware USB module, instead of the dedicated FTDI USB-to-serial chip we used in previous versions. On-board USB means the Bus Pirate can interface with a computer at a much faster rate.
The board was designed for USB On-the-Go capability – it can be used as a USB OTG development board. You will need to solder the external supply header (JP1) and the rectifier diode (D3).
The Bus Pirate connects to devices through a 12 pin IO header.
v4 has two new pins (AUX1, AUX2), both are extra generic IO pins. They will eventually be accessible from all modes, and may have frequency generation/counting, secondary serial interface, logic analyzer, and other features.
Switchable power supplies
The Bus Pirate can power small circuits at 3.3volts and 5volts. VR2 supplies 3.3volts, VR3 is a 5v supply. Both use 1uf capacitors (C11, C13) to stabilize their outputs.
Both power supplies are enabled by a microcontroller pin. When the Bus Pirate starts they are off – any attached circuit is safely powered-down. Use the ‘W’ command in the Bus Pirate terminal to turn on the supplies. The VREG LED will light.
Several common electronics interfaces need a resistor between each pin and the power supply. These pull-up resistors create the high/1 signal on a high-impedance bus. Pull-up resistors are also a common way to interface electronics at different voltages.
The Bus Pirate has pull-up resistors on the four main data pins. They can be enabled in software with the ‘P’ command. MISO, CLOCK, and CS have 10K pull-ups through a resistor array (RN1). MOSI has a 2K resistor (R10) to support certain bus-powered 1-Wire devices. Power to the pullups is controlled through a 4066 quad analog switch (IC2).
Switchable pull-up voltage
New in v4 you can select between three pull-up voltage sources from software. Power for the pull-up resistors can come from the 3.3volt supply, 5volt supply, or an external source. The pull-up source is set in the user terminal with the ‘e’ command. This is a new feature, version 3 only uses an external pull-up supply.
Two PNP transistors (Q1,Q2) toggle the voltage source between the on-board regulators. R13 and R14 hold the transistor base high so current can flow, a PIC pin holds it low to keep them off. Diodes D1 and D2 keep current from flowing back through the transistor.
The USB voltage, on-board power supplies, pull-up voltage, and ADC probe are all monitored through a voltage divider. Two 10K resistors (RN2, RN3) allow the 3.3volt PIC to measure up to 6volts safely. For extra protection, the Bus Pirate monitors the voltage regulators and can disable them if a short circuit is detected.
There are 4 LED on-board the Bus Pirate v4, each has a 1K1 current-limiting resistor (R3, R4, R5, R6). The PWR LED is connected to the MCU power supply. The VREG LED is connected to the 3.3V switchable power supply. USB and MODE are driven by the MCU.
New in version 4 is an on-board 24xx64 8Kbyte data storage EEPROM (IC3). It will be used to store various settings and preferences. The EEPROM’s I2C interface can be accessed by the Bus Pirate’s I2C mode – first time users can get familiar with the Bus Pirate without any added components.
Two 2K pull-up resistors (R8, R9) are connected to the I2C lines. The chip is powered at 3.3volts and gets a 0.1uF decoupling capacitor (C6) on the power supply pin.
New in Bus Pirate V4 are two buttons. NORMAL starts the Bus Pirate without loading any settings saved in the EEPROM – useful if something when wrong. RESET simply resets the PIC.
Click for a full size schematic image. Schematic and PCB were designed with the freeware version of Cadsoft Eagle, download the latest project files from our Google Code project page or look for a release package.
Bus Pirate v4 is fairly straight-forward to solder. Start with the PIC, power supply, EEPROM, and 4066, then move to the passives. Finish with the through-hole headers.
If you want to test the PIC before moving further, solder IC1, USB, VR1, C12, L1, C15, R7, and the ICSP header. Now you should be able to power the board over USB and connect to the PIC with a PIC programmer.
Taking it further
Extra space and more I/O pins on version 4 clear the way for new and improved features. Here’s some ideas for the future:
- Integrate all the current accessory firmwares into a single firmware (XSVF player, STK500v2 AVR programmer, extra modes)
- Store BASIC scripts in EEPROM
- Support more LCDs and OLEDs (also graphic LCDs with font support)
- Enable extra pins for JTAG, other modes
- CAN bus support, other new protocols
- Your ideas too!
We’ll post the most recent firmware updates on our blog. You can also join the discussion in the forum.
Bus Pirate v4 is available now, but v3 is still your best bet.
You can get one for $40, including worldwide shipping.
Your purchases at Seeed Studio keep the open source project coming, we sincerely appreciate your support!