There is currently a bug in Arduino 1.8.7 which requires you to select a Port before upload but we don't use Ports for Trinket uploads. If you don't have a Serial Port available to select, please use Arduino 1.8.6
Mandatory: Arduino IDE Setup
Just follow the steps in the steps in the Adafruit Arduino IDE setup guide to easily add support for Trinket, Gemma, Pro Trinket & more to the Arduino IDE.
You will need Arduino IDE 1.6 or greater
When you're finished installing the IDE & board manager add on come back to this page to continue the Trinket guide.
Failure to follow this step and you will not see the Trinket in the Arduino Board Manager.
Blink!
After installing the Arduino IDE with support for Adafruit's boards you can load a simple blinking LED example to test uploading to Trinket works as expected. Open the Arduino IDE and replace the sketch code with the following blink code:
/* Blink Turns on an LED on for one second, then off for one second, repeatedly. This example code is in the public domain. To upload to your Gemma or Trinket: 1) Select the proper board from the Tools->Board Menu 2) Select USBtinyISP from the Tools->Programmer 3) Plug in the Gemma/Trinket, make sure you see the green LED lit 4) For windows, install the USBtiny drivers 5) Press the button on the Gemma/Trinket - verify you see the red LED pulse. This means it is ready to receive data 6) Click the upload button above within 10 seconds */ int led = 1; // blink 'digital' pin 1 - AKA the built in red LED // the setup routine runs once when you press reset: void setup() { // initialize the digital pin as an output. pinMode(led, OUTPUT); } // the loop routine runs over and over again forever: void loop() { digitalWrite(led, HIGH); delay(1000); digitalWrite(led, LOW); delay(1000); }
Plug in the Trinket, make sure you see the green LED lit (power good) and the red LED pulsing.
Press the button if the red LED is not pulsing, to get into bootloader mode.
Click the Upload button (or select File->Upload)
Something Went Wrong!
If you get the error message avrdude: Error: Could not find USBtiny device (0x1781/0xc9f)
That means the bootloader wasn't active. Make sure to press the button on the Trinket to activate the bootloader before clicking the Upload button.
If you get a lot of red text, errors and also a warning about Verification Failed
Try again! Make sure you have a good USB cable, try connecting through a hub if you have one.
On Linux if you get the error message "usbtiny_receive: error sending control message: Protocol error (expected 4, got -71)"
These can generally be ignored and should not interfere with the program upload. Unfortunately Linux's USB core is a little flakey communicating with the ATtiny85 processor on the Trinket/Gemma and can cause these errors. If an upload does fail, try it again as it is likely an intermittent issue.
Text editor powered by tinymce.