Duplicating chips with USBasp?

So I'm about to make a small production run of a kit project, and I find myself wondering what the best way to go about duplicating the chips will be. So far it has been fairly straightforward if tedious - burn optiboot on to the chip, then use optiboot to load the compiled hex through the Arduino interface through a FTDI cable. It works, but it's no good for shipping a bunch of copies around to friends and family. I have a USBasp available, so I'm suspecting that if I do something like this with the master chip:

avrdude -c usbasp -p m328 -U hfuse:r:hfuse.hex:i
avrdude -c usbasp -p m328 -U lfuse:r:lfuse.hex:i
avrdude -c usbasp -p m328 -U efuse:r:efuse.hex:i
avrdude -c usbasp -p m328 -U flash:r:flash.hex:i

I'll get 4 files that contain the contents of the master. Once I have those files, can I just drop them on a fresh chip with something like:

avrdude -c usbasp -p m328 -U hfuse:w:hfuse.hex
avrdude -c usbasp -p m328 -U lfuse:w:lfuse.hex
avrdude -c usbasp -p m328 -U efuse:w:Efuse.hex
avrdude -c usbasp -p m328 -U flash:w:flash.hex

Or am I missing something simpler? Or is it more complex than that? I'm just starting to step out of the Arduino toolchain, so any assistance would be greatly appreciated!

I don't know about the avrdude commands, but you can skip the bootloading part.
Connect up your AVR ISP and use File:Upload using programmer to load the sketch directly if you are done making changes.

But won't that leave the fuses set to whatever factory default they come in and prevent the bootloader from getting flashed to the chip? Or does part of the ISP upload process set the fuses to what's in boards.txt for the selected chip? My whole experience with ISP so far has been with ArduinoISP and ATtiny85s, this would be my first whack at using it (well, functionally similar anyway) on a 328. I have sufficient flash so the optiboot overhead is negligible, and the possibility of field upgrades using cheap FTDI connectors has a certain appeal.

Eliminating the bootloader makes updating the firmware a bit harder, but it also increases the amount of flash you have for your program, as well as removes the boot delay while the loader waits for escape character, letting it know there's new firmware to load via serial.

I am making a color mixer and fader for RGB LED lighting, and found the boot delay annoying when I powered up the system. Removing the bootloader makes the startup nearly instant.

I use a USB-ASP I got off ebay for a couple of dollars. In reality, it is just an ATMEGA8 running what appears to be a software USB stack and ASP firmware similar to using the arduino as an ISP.

alternatively, you could build your own... I think V-USB and the ISP sketch are pretty much what they are using...

focalist:
Eliminating the bootloader makes updating the firmware a bit harder, but it also increases the amount of flash you have for your program, as well as removes the boot delay while the loader waits for escape character, letting it know there's new firmware to load via serial.

Yeah, and for reasons I'm not entirely certain of, the bootloader that I'm using through the Burn Bootloader command is the (a?) no-wait bootloader that only enters serial programming mode after a reset. It's disconcerting to use my official Arduino that has a delay on powerup now. :slight_smile:

Of course, now that I've re-routed all of my signal lines to the top of the board, I have the entire bottom of the board (more or less) to route an ISP header to. I might just put both headers on the board, but I'd like to keep the no-wait loader I've been using because I ran out of SRAM before I ran out of flash, so the bootloader overhead is in a section of memory I'm not even touching anyway.

focalist:
I am making a color mixer and fader for RGB LED lighting, and found the boot delay annoying when I powered up the system. Removing the bootloader makes the startup nearly instant.

I use a USB-ASP I got off ebay for a couple of dollars. In reality, it is just an ATMEGA8 running what appears to be a software USB stack and ASP firmware similar to using the arduino as an ISP.

That's the one I'm using too - $5 and it programs ATtinys like a champ without making me rip up my Arduino. Still waiting on my ZIF sockets to make it a little less breadboard-y, but it's a lot simpler than fiddling around with ArduinoISP.