Bus Pirate firmware update v0g
posted Jun 25th 2009 10:30am by Ianfiled under: hardware, news, tool hacks

Firmware v0g for all Bus Pirate revisions is now available. Updates in this release include a bootloader, frequency generator/pulse-width modulator, SPI bus sniffer, MIDI library, configuration reports, improved user interface, and bug fixes. v0g is also the first firmware to fully support the v2 hardware branch.
We’re really proud of this release as it brings a much more consistent structure to the internal operation of the Bus Pirate. It lays the foundation for future CAN, LIN, and OBDII libraries, and it supports localization and translations. Install and upgrade instructions are included with the firmware. Report bugs on the project issue tracker.
We document the new features after the break.
Bootloader
Firmware v0g includes a bootloader. After the bootloader is installed, firmware updates can be done over the serial or USB connection, instead of using a proper ICSP programmer. Install and update instructions are included in the firmware archive.
Frequency generator/pulse-width modulator
1-WIRE>g <–frequency generator/PWM setup command
1KHz-4,000KHz frequency generator/PWM (beta)
FREQUENCY in KHz (50) >50 <–enter frequency in KHz
PRESCALE:8 <–calculated prescaler
PR2:39 <–calculated PR2 value
DUTY CYCLE in % (50) >50 <–enter percent duty cycle
PWM ACTIVE
1-WIRE>f <–frequency measurement command
PWM ACTIVE: DISABLE PWM <–not available when PWM is active
1-WIRE>g <–g again to disable PWM
PWM DISABLED
1-WIRE>
A 1Hz-4MHz frequency generator/pulse-width modulator function is available on the auxiliary pin using menu option ‘g’. This feature is still in development, but v0g has the essential functionality. The frequency generator and frequency measurement features can not be used at the same time. We also squashed a small bug in the frequency measurement code for hardware v1+.
SPI bus sniffer
SPI>(1) <–sniffer macro
Sniff when:
1. CS low
2. CS high
3. All traffic
(1) >3 <–when to sniff bus
SPI BUS SNIFFER, PRESS ANY KEY TO EXIT
0×10(0×00) 0xC6(0×00) <–displays data as MOSI(MISO)
SPI>
The PIC24F’s SPI slave mode made it easy to add an SPI bus sniffer. It works fine on slow or intermittent data transmissions, but it needs additional output buffering for better performance at high speeds. For the best performance, change the Bus Pirate display mode to ‘raw output’.
MIDI library
MIDI, a popular interface for musical instruments, is simply a 33.2K baud/8/N/1 UART. The MIDI library has the same functions as the asynchronous serial port library, with the settings fixed for MIDI communications. MIDI devices require an isolated transceiver, we’re working on one but need a MIDI connector footprint and part number.
Bus Pirate status report
RAW3WIRE>i <– status report command
Hack a Day Bus Pirate v2g0http://www.buspirate.com
Firmware v0g
*———-*
POWER SUPPLIES ON
VOLTAGE MONITOR: 5V: 5.0 | 3.3V: 3.3 | VPULLUP: 5.0 |
AUX: DEFAULT SETTING (AUX PIN)
High-Z outputs (H=input, L=GND)
PULLUP RESISTORS OFF
MSB SET: MOST SIG BIT FIRST
*———-*
RAW3WIRE>
A new in-terminal status report lists the features available in the active protocol library, and the current settings.
User prompts with defaults
HiZ>m
1. HiZ
2. 1-WIRE
3. UART
4. I2C
5. SPI
6. JTAG
7. RAW2WIRE
8. RAW3WIRE
9. PC KEYBOARD
10. MIDI
(1) > <–press enter for default option (1/HiZ)
MODE SET
HiZ>
The user prompt has been updated to accept multiple-digit values. Enter without any input selects the default value shown in parentheses before the prompt. All user input is now handled by this single user prompt function.
User value input format
SPI>r:0×02 <–repeat in hex format
BULK READ 0×02 BYTES:
0×00 0×00
SPI>(0b0) <–macro command in binary format
0.Macro menu
1.SPI bus sniffer
SPI>
All user prompts now support input values in binary, hexadecimal, or decimal. Previously, menu and macro prompts only supported decimal formatted input.
Localization, translations
A lot of the text used in the program has been moved to a translation file, which is defined in base.h.
If you make a translation, please share it with us. We’ll host the translation in SVN and compile a localized firmware for anyone that might be interested.
Test the v0h beta
If you like to live on the edge, try the v0h nightlies. These features are already implemented in v0h nightlies:
- I2C sniffer,
- HD44780 character LCD test library.
- Keyboard library I/O timeout.
- Improved syntax parser.
- Software reset command.
Check the issue tracker for future features, or to make feature requests.








How about an update on the hardware side of things?