OSX and USBtinyISP native programming via Arduino app

USB AVR Programmer and SPI interface. Adafruit's USBtinyISP.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
deadprojx
 
Posts: 1
Joined: Tue May 22, 2012 11:42 pm

OSX and USBtinyISP native programming via Arduino app

Post by deadprojx »

I finally decided to build my own version of the arduino app tonight to see if i could get the usbtiny working natively within the application. Seems easy enough.... the problem is that the usbtiny doesn't have a port per se on a mac, and the arduino applicaiton really wants one. So i figured a simple if mac and usbtiny then ignore the -P parameter on the avrdude command, which is basically what i do from a shell to get it to work.

So, download git and install.... git the arduino repository.

edit AvrdudeUploader.java down /Arduino/app/src/processing/app/debug

add if to first part here:

// -- added if for mac and usbtiny - bold is new code
if (!Base.isMacOS() && !protocol.equals("usbtiny")) {
commandDownloader.add("-P" + (Base.isWindows() ? "\\\\.\\" : "")
+ uploadPort);
}


and second part here:

// added if macos and usbtiny - bold is new
if (!Base.isMacOS() && programmer != "USBtinyISP") {
if ("usb".equals(programmerPreferences.get("communication"))) {
params.add("-Pusb");
} else if ("serial".equals(programmerPreferences.get("communication"))) {
params.add("-P" + (Base.isWindows() ? "\\\\.\\" : "") + Preferences.get("serial.port"));
if (programmerPreferences.get("speed") != null) {
params.add("-b" + Integer.parseInt(programmerPreferences.get("speed")));
}
}
}


issue ant to build, then go find the boards.txt file down the build path. whichever board you want to program using this new functionality, change the "upload.using" to say usbtiny and save, then launch arduino, select your board and the programmer, upload away.

my boards file i added the following line to support programming the boarduino from the usbtinyisp. note the bold upload.using.
#####
board328p.name=Boarduino
board328p.upload.using=usbtiny
board328p.upload.maximum_size=30720
board328p.upload.speed=57600
board328p.bootloader.low_fuses=0xFF
board328p.bootloader.high_fuses=0xDA
board328p.bootloader.extended_fuses=0x05
board328p.bootloader.path=atmega
board328p.bootloader.file=ATmegaBOOT_168_atmega328.hex
board328p.bootloader.unlock_bits=0x3F
board328p.bootloader.lock_bits=0x0F
board328p.build.mcu=atmega328p
board328p.build.f_cpu=16000000L
board328p.build.core=arduino
board328p.build.variant=standard
#####


now i'm certain there is a better way... but dang it i got tired of always using the shell. if anyone has ideas on how to get better code officially supported in the IDE please feel free to let me know and/or execute on such plan. I'd love to see it work. Maybe Ada has enough pull to convince someone to assist her mac BANNED brethren? :)

i'll record this (and other things) out on deadprojx.com... {{{cough cough shameless plug for my crappy website}}}}

i hope to have data on all of the tweaks i use there shortly...

Locked
Please be positive and constructive with your questions and comments.

Return to “USBtinyISP”