Hi everyone!
When running low on flash space you usualy have two options: use another processor (for example ATmega328 or ATmega1280), or don’t use the bootloader, which takes about 2KB (and when having only 16KB space on ATmeag168, that’s a lot!). So I started using ICSP to program my Arduino.
At first I built parallel programmer, but it was a bit harder to use. I couldn’t use it on my laptop as it doesn’t have parallel port and you have to get an external power supply. But for a while it was enough, as I only used it to burn bootloader on my chips. Then I found USBtinyISP. It’s realy easy to use, it’s supported in Arduino enviroment (you can directly use it to burn bootloader via Tools-Burn Bootloader), and most of all: it’s cheap! You can get it from eBuy for about 11€ (I bought it, even though I haven’t bought a factory assembled Arduino), it works on all platforms (I’ve tested windows and OSX but should work on linux too).
But there’s a catch. It’s meant to be used only to burn bootloader, so you have to edit one file, if you want to use it for programming. And here’s how to do it:
You must close your Arduino application (if you are running it)!
Windows:
navigate to your Arduino folder (where you installed it) and go to Hardware->arduino and open boards.txt
Mac (OSX):
go to Applications, find Arduino.app and right-click it. Select Show package contents and then Contents->Resources->Java->hardware->arduino and open boards.txt
this is the file, where arduino boards’ definitions are stored. So we add a new one, that we will choose when programming via ICSP. Paste this into boards.txt save and close it.
##############################################################
diecimila2.name=Arduino Diecimila/USBTinyISP
diecimila2.upload.protocol=stk500
diecimila2.upload.maximum_size=16000
diecimila2.upload.speed=19200
diecimila2.upload.using=usbtinyisp
diecimila2.build.mcu=atmega168
diecimila2.build.f_cpu=16000000L
diecimila2.build.core=arduino
##############################################################
When you will start your arduino application you will notice there’s a new board available under Tools->Boards named “Arduino Diecimila/USBTinyISP”. So when you are in need of more space, just use USBtinyISP to program it.
P.S.: don’t forget, you erased the bootloader! So serial programming will not work until you put bootloader back! You do this like this: select your original board and go to Tools->Burn bootloader->USBtinyISP