Cannot get trinket to accept code [SOLVED]

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
ssstraub
 
Posts: 3
Joined: Sun Jan 18, 2015 4:13 pm

Cannot get trinket to accept code [SOLVED]

Post by ssstraub »

First time 3v Trinket user. I have followed the Adafruit guide for OS X and I cannot get this think to accept the upload of the blink example. I am using the Adafruit Arduino 1.0.5 package and a fresh install of Java for OS X 2014-001 (I did not have Java on my system). I'm on Yosemite 10.10.1.

Is the red LED supposed to pulse infinitely? Mine is doing a smooth pulse for 10-11 seconds, very brief pause, then back to smooth pulse. It does this forever... Isn't the red LED supposed to turn off and stay off after 10 seconds?

Things I have tried:
-Green LED is on
-Allow apps downloaded from anywhere (just left it this way while testing)
-Different USB port
-Different micro USB cable
-Trinket is visible in System Report > USB
-Tools > Board is set to Adafruit Trinket 8 MHz
-Tools > Programmer is set to USBtinyISP
-Replaced "id" and "avrdude.conf" twice each

When I upload the example code it says many of these:

Code: Select all

avrdude: error: usbtiny_receive: usb_control_msg(DeviceRequestTO): no connection to an IOService (expected 4, got -6)
And then this:

Code: Select all

avrdude: verification error, first mismatch at byte 0x0000
         0x20 != 0x00
avrdude: verification error; content mismatch

avrdude: error: usbtiny_transmit: usb_control_msg(DeviceRequestTO): no connection to an IOService
This seems to match the note about NOT replacing avrdude.conf, but I did that again and it does the same thing? Restarted arduino software multiple times as well.
Last edited by ssstraub on Thu Feb 05, 2015 9:43 pm, edited 1 time in total.

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Cannot get trinket to accept code

Post by adafruit_support_mike »

A Trinket comes preprogrammed with a Blink sketch, which gives us a fast way to make sure they're working during the QA tests.

You need to have the Arduino IDE start sending data within the first 10 seconds after pushing the reset button.

User avatar
ssstraub
 
Posts: 3
Joined: Sun Jan 18, 2015 4:13 pm

Re: Cannot get trinket to accept code

Post by ssstraub »

Yes, I am attempting to upload a sketch within 2 seconds of resetting.

Is the preprogrammed Blink sketch 100% identical to the "smooth pulse" that happens in the first 10 seconds after bootup? Because that's what mine is doing. I find this very unlikely as this would leave no way for the user to identify when those first 10 seconds have passed and you need to reset it again.

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Cannot get trinket to accept code

Post by adafruit_support_mike »

No, they're not identical.

The Blink sketch is a straight on/off pulse while the bootloader fades the LED up and down. It can be easy to confuse them at a glance though.

If the bootloader is just cycling without launching the sketch, it may be corrupt. Try reloading it as shown on this page of the tutorial: https://learn.adafruit.com/introducing- ... bootloader

User avatar
ssstraub
 
Posts: 3
Joined: Sun Jan 18, 2015 4:13 pm

Re: Cannot get trinket to accept code

Post by ssstraub »

Well I don't have an Arduino to reprogram it with BUT that FAQ you pointed to had this part which did solve it! It's now working just fine. Thanks for your help.
Hmm I'm still having problems with Arduino/Avrdude - and I definitely did the required updates
One fix that works for some people is to edit avrdude.conf and set the
chip_erase_delay = 900000;
under the ATtiny85 heading to
chip_erase_delay = 400000;
That is, a shorter delay.

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Cannot get trinket to accept code [SOLVED]

Post by adafruit_support_mike »

Glad to hear that worked for you!

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”