Arduino and the USBTinyISP

I’ve been monkeying around with different ways of uploading the sketches and bootloaders to ATmega chips and one of those ways is with the USBTinyISP which I picked up for about $10 on eBay. Even though once my bootloader was installed I never really needed to use the ISP programmer on my Arduino again I did find it was useful for programming chips when I had it bread-boarded out. To do that, I had to make a few tweaks to my config files, which were the following on my various computers:

Linux: /usr/share/arduino/hardware/arduino/boards.txt
Windows 7: C:\Program Files (x86)\Arduino\hardware\arduino\boards.txt
Windows XP: C:\Program Files\Arduino-0022\hardware\arduino\boards.txt

With my favourite text editor I openned them up and appended the following lines:

##############################################################

atmega168bb.name=ATmega168 on a breadboard (8 MHz internal clock)

atmega168bb.upload.protocol=stk500
atmega168bb.upload.maximum_size=14336
atmega168bb.upload.speed=57600

atmega168bb.bootloader.low_fuses=0xE2
atmega168bb.bootloader.high_fuses=0xD9
atmega168bb.bootloader.extended_fuses=0x07
atmega168bb.bootloader.path=arduino:atmega
atmega168bb.bootloader.file=ATmegaBOOT_168_pro_8MHz.hex
atmega168bb.bootloader.unlock_bits=0x3F
atmega168bb.bootloader.lock_bits=0x0F

atmega168bb.build.mcu=atmega168
atmega168bb.build.f_cpu=8000000L
atmega168bb.build.core=arduino:arduino 

##############################################################

atmega328bb.name=ATmega328 on a breadboard (8 MHz internal clock)

atmega328bb.upload.protocol=stk500
atmega328bb.upload.maximum_size=32720
atmega328bb.upload.speed=57600

atmega328bb.bootloader.low_fuses=0xE2
atmega328bb.bootloader.high_fuses=0xDA
atmega328bb.bootloader.extended_fuses=0x05
atmega328bb.bootloader.path=arduino:atmega
atmega328bb.bootloader.file=ATmegaBOOT_168_atmega328_pro_8MHz.hex
atmega328bb.bootloader.unlock_bits=0x3F
atmega328bb.bootloader.lock_bits=0x0F

atmega328bb.build.mcu=atmega328p
atmega328bb.build.f_cpu=8000000L
atmega328bb.build.core=arduino:arduino 

##############################################################

usbtiny168.name=[usbtinyisp]ATmega168

usbtiny168.upload.using=usbtinyisp
usbtiny168.upload.maximum_size=14336

usbtiny168.build.mcu=atmega168
usbtiny168.build.f_cpu=8000000L
usbtiny168.build.core=arduino

##############################################################

usbtiny328.name=[usbtinyisp]ATmega328

usbtiny328.upload.using=usbtinyisp
usbtiny328.upload.maximum_size=32768

usbtiny328.build.mcu=atmega328p
usbtiny328.build.f_cpu=16000000L
usbtiny328.build.core=arduino

After that, I saved the file and restarted the Arduino software. Now I had four new menu items available. Go to Tools -> Board and you will find your new options. The two prefixed with USBTinyISP will not upload a sketch over the USB to Serial connection but rather it will require the 6 pin ISP header and will wipe out your bootloader. Of course, you can always rebootload your ATmega with your ISP programmer so that shouldn’t be an issue. The benefit to doing it this way is that it’s a little bit faster to upload and it takes up less memory on the chip so there’s no wasted space and less of a boot time when the micro powers up.


Tags: , , ,

  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

One Response to “Arduino and the USBTinyISP”

  1. Harald says:

    Hi,
    I just read your stuff about flashing the ATmega328 with the USBTiny.
    That’s what I want to do. However I am not successful with it. I cannot get a sketch to the ATMega which is breadboarded just with the ISB contacts, nothing else. It get’s the + 5 Volts from the USBTiny.
    The setup I have is Linux with the Arduino 1.0.5 and USBTinyISP v3.0. Within the boards.txt I use your [usbtinyisp]ATmega328 coding.

    I get the following error:
    arduino-1.0.5/hardware/arduino/cores/arduino/Arduino.h:213:26: error: pins_arduino.h: No such file or directory

    Do you have any ideas where this error is coming from ?
    Thanks for your help in advance.
    Regards
    Harald

Leave a Reply