Arduino IDE Setup
Just follow the steps in the steps in the Adafruit Arduino IDE setup guide to easily install a pre-configured Arduino IDE to program Gemma!
When you're finished installing the IDE come back to this page to continue the Gemma guide.
Blink!
After installing the Arduino IDE with support for Adafruit's boards you can load a simple blinking LED example to test uploading to Gemma 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 or Trinket: 1) Select the proper board from the Tools->Board Menu (Arduino Gemma if teal, Adafruit Gemma if black) 2) Select the uploader from the Tools->Programmer ("Arduino Gemma" if teal, "USBtinyISP" if black Gemma) 3) Plug in the Gemma into USB, make sure you see the green LED lit 4) For windows, make sure you install the right Gemma 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); }
If you're using the Adafruit Gemma (with a black PCB board) select the Adafruit Gemma 8MHz board from the Tools->Board menu.
However if you're using the newer Arduino Gemma (with a teal PCB board) select the Arduino Gemma board from the Tools->Boards menu.
Then select Arduino Gemma as the Programmer type
Get Into Bootloader Mode
Plug in the Gemma, 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 Gemma 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
Check that you updated the avrdude.conf file above - if you don't update the description of the Attiny85 in the configure file by replacing it, the IDE wont know to be patient with the Gemma bootloader and will have many upload errors
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.
Page last edited March 08, 2024
Text editor powered by tinymce.