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.

There are 10 Comments to "Arduino 1.0.5-r2 for AT90USB1286 and Printrboard"

  • Seb says:

    You just made my day! Thank you very much for this updated Version of Arduino with Printrboard support.

  • Aaron E says:

    On a hunch, I copied the AT90USB1286 directory out of the hardware dir on your release and dropped it into Arduino 1.0.5 and it compiled and uploaded my Marlin firmware (for a Kossel). I was able to connect to the printer and send a command – not quite the results I was looking for, but to leads me to think that we could just drop this hardware dir into Arduino and compile.

  • kareem says:

    I have been happily following your instructions and using versions of your firmware for my 2 printers both using rev D Printrboard (Rev D CDC Bootloader). A few days ago I attempted to upload firmware to the board, I have done this at least 20 times in the past, the upload failed to complete after more than 20 minutes (usually takes just 1 minute).

    Now i am unable to connect to the board in normal mode. I do see the Com port in Windows device manager, but my Repetier cannot connect. When I install the boot jumper (Rev D) and press the reset button my normal printing Com port disappears but the bootloader Com port does not show up in the device manager.

    I had a spare Printrboard and attempted to upload the firmware on it and the same thing happened also. Any suggestions?

    • lincomatic says:

      If you have another computer, try it on that one. It sounds like a driver setup issue.
      Another thing to try would be in Device Manager, do View->Show hidden devices, and look for the bootloader comm port. If you can find it, delete it, and try to re-detect.

      • kareem says:

        Thanks for the help. I have tried on 4 computer so far and have the same issue.

        I deleted the driver from the device manager, and re-installed the driver. However the device manager is shows just 1 com port, regardless of the whether the boot jump is installed or not. Once the boot pins are shorted the reset button has not effect when i push it. Should I get the hardware device and attempt to re-install the bootloader?

  • Shane says:

    Firstly, thanks for your work on arduino 1.0.5 and 022! Wouldn’t have been able to get my printer working without you.

    Next I’d like to address a problem that I had and resolved with the fan. After i flashed my board with the latest version of marlin from github, the fan stopped working.

    What i did was, in arduino, i navigated to pins.h, went to line 1759, under #if MB(TEENSYLU) || MB(PRINTRBOARD) and changed #define FAN_PIN 22 to #define FAN_PIN 16

    Lastly I was wondering if anyone could help. I can’t get sd cards to read. I’ve tried a generic 8gb and sandisk 4gb. I enabled SD card support within arduino configuration.h but this is all i get:

    >>> M20
    SENDING:M20
    Begin file list
    End file list
    >>> M21
    SENDING:M21
    echo:SD init fail

  • FA-MAS says:

    Trying to update my Printrboard to a recent version of Marlin and it’s It won’t complile, says I need a version of Arduino greater than 1.6.something

    Downloaded 1.6.8, installed teensy and copied over your files. Though they seem to have changed the structure in new arduino. Now there’s an avr folder.

    So I put things were I found the “stock” ones and had to modify boards.txt with build.board values, but it still won’t compile. Was wondering if you might take a look at it.

    • lincomatic says:

      Sorry I haven’t played with this stuff in a long time. My Printrboard is working great with the old stuff and I don’t see any need to keep upgrading the firmware every time they change it.
      The file structure and compiler are very different in Arduino 1.6.x and are incompatible. Does it work if you select Teensy as the board type instead of using my files?

Write a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>