Using the USB Bootloader

About the bootloader

A bootloader is a tiny piece of software residing on the microcontroller that that helps load your own code into the remaining space.

One of the challenges with the Pro Trinket is that we wanted to have a built-in USB bootloader, but the ATmega328 doesn't have built-in USB hardware!

So instead, Frank (our awesome engineer with mad USB chops) created a USB bootloader that combines the elegance of V-USB with the well-supported and tested nature of the USBtinyISP. This bootloader looks just like a USBtinyISP - and since it uses the unique Adafruit VID/PID we own and that we added to avrdude so long ago, it works with only very minimal configuraton tweaks. No need to recompile anything, whew!

Then, since we had a little space left in the bootloader area of the chip, we added Optiboot support. You can use either the USB connector or an FTDI cable so that it acts just like an Arduino Uno for programming, for max flexibility.

The Pro Trinket is smart enough to auto-detect which bootloader you are trying to use. If you plug the USB port in, it will enumerate as a USBtinyISP for USB bootloader. If you plug in FTDI and use the Arduino Uno programming procedure it will use that technique

Please note: you cannot use the Adafruit USB VID/PID for your own non-Trinket products or projects. Purchase a USB VID for yourself at http://www.usb.org/developers/vendor/

Pro Trinket USB Drivers for Windows


The cool thing about the bootloader on the Pro Trinket is it just looks like a classic USBtinyISP AVR programmer. This makes it easy to use with AVRdude or Arduino IDE with only minor configuration changes. Before you start, you may need to install the USBtinyISP USB drivers

Drivers are only required for Windows, if you are using a Mac or Linux, drivers are not required!

Check this page for how to install the driver

Don't forget to plug in the Pro Trinket via a known-good USB cable to start the process. You should see the green power LED lit and the red bootloading LED pulse indicating that the Trinket is ready to start bootloading. If you've programmed the Pro Trinket since getting it, you can always get it back to the bootloader state by pressing the small onboard reset button

Special Notes on using Pro Trinket with Linux

Pro Trinket is not supported on Linux operating system at this time - try Mac OS or Windows! However, you can try the following - it does work for some computers
Linux is fairly picky about who can poke and prod at the USB port. You can always run avrdude or Arduino IDE as root, which will make sure you have the proper permissions. If you want to be super-cool you can add a udev rule which will let any user (who is not root) connect to the USBtiny driver. That way you don't have to be root all the time!

Check http://learn.adafruit.com/usbtinyisp/avrdude#for-linux for what to add to your udev file.

How to start the USB bootloader

Before you try to upload code to the Pro Trinket using the USB bootloader it must be in the Bootloader Mode. That means its listening for a sketch or program to be sent to it

When the Pro Trinket is in bootloader mode, the red LED will be pulsing. Once the red LED stops pulsing, you must press the reset button to re-enter bootloader mode

The Pro Trinket must be connected to a computer via a USB cable to enter bootloader mode. You can enter the bootloader mode by pressing the little button on the board with your fingernail. The bootloader will 'time out' after 10 seconds, so to re-enter the bootloader mode just re-press the button!

Don't press-and-hold the reset button, be sure to press-and-release!

See the video below for what it looks like to plug it in, have the LED pulse in bootloader mode, time out and then press reset to restart the bootloader

Last updated on 2016-03-14 at 06.13.54 PM Published on 2014-08-20 at 05.12.17 PM