Bootcloner/Bitbang on linux

I'm working on a project for school, and am finding myself in a crunch --

I need to install the arduino bootloader (and some sketches) onto a few atmega168s, but I don't have the time to order a "real" avr programmer. This popular bitbanger is well documented, but it only runs on windows. Has anyone found a way to do it in Linux? This is just confusing, and I'm not 100% sure how exactly it is supposed to be set up. I'm fairly visual, especially with things I don't completely understand. Are there any schematics or pictures of how it should be built? Also, how do you use it once you've loaded the sketch? It appears to use the serial console, but I don't want to make semi-random guesses and hope for the best.

(yes, I've used the search function, but I keep getting 500 errors; it's taken me a few hours just to perform a couple searches -- and having a whiny baby in my arms doesn't help :-[)

Thanks in advance!

I think I'd go for the parallel port programmer, if you've got a computer with a parallel port. Some parallel ports work, some don't (mine didn't), but it is not a tremendous amount of work or expense to try it. There is also a variant that uses a 74xx244 that did work for me. I can dig up a schematic if you can't locate one.

The programmer2 playground article makes a programmer out of your arduino. It looks like it has some additional functions, in addition to a standard stk500 interface. It references arduino 0009, so it appears to be old. I have no experience with it.


Thanks for the reply, kg.

I’ll give the parallel programmer a try.

I’d still like to see if anyone has info on the “Programmer2” so I don’t have to swap chips in and out of my arduino board all the time.

I remember seeing the original post from its creator, and he even built a shield with a zif socket on it…maybe he has schematics somewhere.

<tries searching, again>

This seems to be a Linux app( and others ) which uses one Arduino to program another Arduino as an "stk500 protocol compatible programer(SIC)"

It looks pretty cool and it is now getting bookmarked for later use here.

After reading the README file in the download, Massimo's avr-programmer appears to flash the arduino entirely, so it becomes the stk500.

I would prefer to keep my original arduino intact, if at all possible.

Though, maybe I could just mark the chip as the avr-programmer, and set it aside while using the arduino board normally....

EDIT: I should note that I would prefer NOT modifying the arduino, as it's the only one I have at the moment. Should something happen to it, I would be up the creek without a paddle. :'(

I see your concerns since you only have one Arduino and a bunch of raw ATmega 168 chips. If the upgrading of the Arduino to the stk500 fails, you'd have to purchase a bootloader loaded $6 part to replace it.

Still, considering you'd only have to purchase one $6 part to have a backup, wouldn't that be a good investment for what you'd get?

And if it works as it says it does, you end up programming your own bootloader loaded parts from your $4 raw 168 parts. It still sounds like the way to go.

I will be ordering some parts from Digi-key and will have to get a few raw parts myself. I'll also be ordering a couple more boarduino kits from Adafruit so a test of this avrusb500 stuff is definitely in order. I'll use the 2nd Boarduino as a target instead of breadboarding the ISP pins to a raw part.

Maybe search around for info on how successful people have been with the avrusb500 setup before trying it yourself?

Well, under normal circumstances, you're right -- the $6 backup is a fine investment, and the benefits outweigh the risk. Unfortunately, I'm under a time crunch, in that I need to get a couple working prototypes done within the next week or so -- no time to wait for something to come in the mail (nor the funds to manage faster shipping fees).

I was hoping to figure something out to use over the weekend. I'll probably give the Parallel Cable a shot.

If one of my current Arduino's was not running our espresso machine, I'd give it a go with the 2nd one and see if it works. I don't have an extra ATMega 168 around so while I could reflash one of my Boarduinos, I really couldn't test it completely. Sorry.

The parallel port method seems to be quite common and if you have a parallel port, that should do the trick for ya. Good luck.

If one of my current Arduino's was not running our espresso machine...

Dang. I'm jealous. Not only do you have an espresso machine, but it's controlled via Arduino? That's the life ;)

Well...I came to a sudden revelation. My wife doesn't run Linux, and she's a nice lady who lets me use her laptop if I smile pretty. So I used Kosaka's bitbanger to burn the bootloader onto a new chip.

It's both fun and amazing ;) I've got a blinking arduino next to me now.

I'm still going to try and figure out the Programmer2 (schematics, anywhere?)...but at least I'll be able to do what I need to for this project.

In the long run, though, I'll probably just get an avr programmer from LadyAda - it's a bit more versatile.

This popular bitbanger is well documented, but it only runs on windows. Has anyone found a way to do it in Linux?

FWIW, I'd not seen that comment before and just re-read the linked pages. There seems to be some disagreement whether it works on Linux or not--the fact the code is based on avrdude and the original author mentions Linux suggests it is compatible. But if that's the case I don't know why the additional warning was added.


It's using a modified version of avrdude, serjtag-avrdude, which was only built on windows, and it's homepage is in japanese.

I don't know exactly why, but for whatever reason it's Windows-only.

The readme in the avrdude-serjtag directory in the zip file has instructions and patches on how to build a patched avrdude with linux. I don't have a linux handy at the moment so can't try it myself anytime soon, but if a linux handy person were to give it a go I think that would answer the question. My guess is that the author is referring to the binary when he says "windows only", dunno.

It's using a modified version of avrdude, serjtag-avrdude, which was only built on windows

According to the README file in the .tar.gz archive it can be built on Linux but the included binary is for Windows. Other people on this forum have used it with success--maybe check the threads to see what OS they used.

and it's homepage is in japanese.

Note that Google translate will do a passable job on translation of serjtag-avrdude home page.


I finally got around to making this work in Linux...and the google translation wasn't overly helpful. A few steps were left out...I'm not sure if it was a translation issue, or just oversight on the part of the author.

Anyhow, I've written up my own version of the instructions (based heavily upon everything mentioned above, with proper credit, of course)