Arduino 1.0.5-r2 for AT90USB1286 and Printrboard

It’s been a few years since I hacked together the copy of Arduino-0022 that’s been floating around the web, which lets you compile and automatically upload Arduino code to an AT90USB1286. This made it a lot easier to develop Arduino code for the AT90USB1286, and in particular to easily modify the Marlin firmware for the Printrboard.

Yesterday, I figured it was high time to add AT90USB1286 support to Arduino 1.0.5-r2. The basic procedure for the modification was to first install Teensyduino, which adds the AT90USB1286 compilation support to Arduino, but only uploads to a Teensy++ 2.0, running PJRC’s proprietary halfkay bootloader. I modified the Teensyduino configuration to also support uploads to targets running the LUFA CDC Bootloader, or via USBtinyISP or USBasp ICSP programmers.

Note that I copy that I modified only runs on Microsoft Windows.
You can download it from github: https://github.com/lincomatic/arduino-1.0.5-r2-at90usb1286
It’s easiest to download it as a zip file: https://github.com/lincomatic/arduino-1.0.5-r2-at90usb1286/archive/master.zip

Once you unzip the archive and launch arduino.exe, you will notice some new entries in the Tools->Board menu:

[USBasp]AT90USB1286
[usbtinyisp]AT90USB1286
[BootloaderCDC]AT90USB1286
[USBasp]Printrboard
[usbtinyisp]Printrboard
[BootloaderCDC]Printrboard

The only difference between the Printrboard and AT90USB1286 entries is that the extraneous USB Type, CPU Speed, and Keyboard Layout submenus are grayed out from the Tools menu.

To load Marlin firmware onto a Printrboard, you will most likely want to use [BootloaderCDC]Printrboard.

Note that unlike my Arduino-0022 hack, the pinMode()/digitalRead()/digitalWrite() functions in version currently only support the pins that are exposed on the Teensy++ 2.0. This is because I haven’t yet had the time to figure out how to add in the remaining AT90USB1286. However, this limitation doesn’t affect Marlin firmware on the Printrboard, because Marlin uses its own fastio functions, rather than using Arduino digital pin numbers and pinMode()/digitalRead()/digitalWrite(). See pinmap.txt for the currently supported Arduino digital pin numbers.

Thanks again to PJRC for Teensyduino. Teensys are a great alternative to Arduino boards.