Using Bus Pirate with Arduino IDE

4 05 2011

Yesterday, a friend from Tokyo HackerSpace said that he bought an DIY Arduino kit. The problem is that the ATmega168P does not come with the required bootloader. Just the same day I bought two FreakDuino boards and tried to use them to flash the bootloader with no luck. FreakDuino boards had no problem as I tested the same approach using other Arduino type boards available at the hackerspace.

This morning an idea popped up in my mind to use the Bus Pirate with avrdude. I managed to program but something was off because I was not able to connect to the bootloader. I can use Bus Pirate with avrdude directly as it’s firmware can interact with avrdude. “How about embedding it into Arduino IDE?” was the question in my mind now.

While messing around the directory of Arduino IDE, I found some text files and answer to my question lies in one of them: programmers.txt

Just add these three lines to it and you are good to go (note: you might need root privileges for Linux) Bus Pirate





7 responses

10 05 2011
Using Bus Pirate with Arduino IDE « adafruit industries blog

[…] Via Tayken’s Blog […]

10 05 2011

I have a few questions. How do you connect the bus pirate to the arduino to program it? Are you using the stock bus pirate firmware? Or do you need to install an alternate firmware to make the Bus Pirate in to make STK500 v2 AVR programmer clone? And lastly are there any setting that need to be configured on the bus pirate before it can be used as an AVR programmer?

11 05 2011

All this information is actually at Bus Pirate Documents, under AVR programming. You can access the page from here:
So, if I answer your questions:
– For connections, please check “Bus Pirate AVR programming connections” table on the link I gave above.
– I’m using stock BP firmware as avrdude has Bus Pirate support after version 5.8, there was a problem with BP firmware but all is fixed in firmware 5.10+
– avrdude uses the binary access mode, that is the computer program tells BP to change pin states etc by sending some messages to it, so no settings are needed, just plug the cables and select “w\ The Bus Pirate” option for the programmer as the programmer that you’ll use for flashing the Arduino bootloader.

I hope this clears any questions you have in mind. But if you still have some, don’t hesitate. You can even contact me by the contact form if you want to ask in private.

8 03 2014
Scott Lunsford

Hey. I am leaving for Tokyo early in the morning from the USA. I am coming there for work and desperately need some stuff and can’t seem to get google to locate any of it there for me. this page and that one thing from the Maker fair were about all I could find. anyway. I need a “bus pirate”, “goodfet42”, and the rest is pretty standard. I know they have to exists in Tokyo. I think I am just having an issue because I can’t read, type, or anything in Japanese. I will be more than happy to pay you for your assistance. This whole trip there is kind of relying on me being able to get some info off of a bus and an eeprom.. I work for IBM and will be there doing some penetration testing on some zigbee stuff. Seriously. Your my only hope at this point. Scott Lunsford

2 01 2013

Got the buspirate to show up as programmer, so that’s good, yet it fails:

Detecting BusPirate …
BusPirate: using BINARY mode
avrdude: initialization failed. rc=-2
Double check connections and try again. or use -F to override
this check.

The stupid thing is, using avrdude -c buspirate -P /dev/ttyUSB0 -p t85 -v (in this particular case) works just fine from a console. Any pointers as to what could cause this?

2 01 2013

I guess I somehow messed up something. I write my program’s hexfile manually using avrdude, and that worked and verified fine. But I guess something is wrong now. Maybe the fuses. I’ll see if I can figure out what 😉

10 01 2013

Hey there, sorry for the late reply. I am guessing that you are trying to program an Attiny85 w/Arduino IDEusing the Bus Pirate as a programmer. From what I’ve read you have to load a “bootlader” which is actually just setting the fuse bits. That error is usually displayed when the clock speed on the fuse bits and the crystal do not match.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: