Trinket HELP

USB AVR Programmer and SPI interface. Adafruit's USBtinyISP.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
technobly
 
Posts: 118
Joined: Mon Oct 31, 2011 11:06 am

Re: Trinket HELP

Post by technobly »

@johnweythek can you explain exactly what you are doing with the updated .exe? It sounds like you are just unzipping it and running it. You need to backup your old one, and drop the updated one in the C:\arduino-1.0.5\hardware\tools\avr\bin\ directory. Like so:
Image
Then run the commands to program the trinketblink.hex from the command line.

If you are getting this error you have to modify your avrdude.conf file by removing lines 1516 through 1632. I've attached mine if you don't want to do that. It's in a zip file because the forum wouldn't let me upload a .conf file directly...
Image

You'll want to backup your old avrdude.conf like your .exe and copy the .conf file to both of these directories:
C:\arduino-1.0.5\hardware\tools\avr\bin\
C:\arduino-1.0.5\hardware\tools\avr\etc\

This part of the location may be different on your computer:
C:\arduino-1.0.5\
Attachments
avrdude.zip
avrdude.conf zipped up
(24.74 KiB) Downloaded 178 times

User avatar
johnweythek
 
Posts: 33
Joined: Fri Jul 05, 2013 3:22 pm

Re: Trinket HELP

Post by johnweythek »

Thank you for the hand-holding super noob instructions. Seriously, i see and exe, i execute it, other files were replaced and changed though. Seriously thanks, i am dumb at this trinket for some reason.

No more constant bootloader. Tried Uploading blink and got an oarnge message that said

"avrdude: Trinket Bootloader selected"

but no blinking light and no other errors. I can feel it getting closer. Is it working? just not with blink? or is there something else i missed. It's a weird error to tell me it's basically working.


Is the 'trinket friendly' IDE supposed to just work after install? I'm about to fire up an old rig just to see if that'll work instead. Well, old still has windows 7 and i know there were usbtiny problems with that from the start so my hopes aren't exactly up.

Thanks again for the help. You spent a lot of time on that response i can tell. I'm glad there's you and bill and the rest of the supportive community on the forums.

User avatar
technobly
 
Posts: 118
Joined: Mon Oct 31, 2011 11:06 am

Re: Trinket HELP

Post by technobly »

@johnweythek as long as you still have patience to keep working on solving the problem, I'm determined to help you :)

Sounds like you are not using the avrdude.exe from the command line, but rather the ArduinoIDE. You can download the pre-modified ArduinoIDE and it will work for the Trinket (at least it did for me). THE FAST WAY here is what you want: http://learn.adafruit.com/introducing-t ... rduino-ide

I preferred to modify my current IDE because I have other modifications done to it that change the theme and different libraries already installed.

One thing to note is that when you press the reset button on the Trinket, it puts it into bootloader mode for at least 10 seconds. During that time the RED LED will pulse with a fade in/out pattern. The default trinketblink sketch blinks the RED LED on and off at a similar rate, without the fade in/out. I like to modify the delay times to see if it in fact is programming each time.

Here's an obvious change to the default sketch that makes the LED blink on and off faster:

Code: Select all

      /*
  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(300);
    digitalWrite(led, LOW);
    delay(300);
}
    
And one that blinks really slow:

Code: Select all

      /*
  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(2000);
    digitalWrite(led, LOW);
    delay(2000);
}
    
If you kind of alternate between these, you should see it program each time. Don't forget to press the reset button before you hit the upload button.

BTW the "avrdude: TRINKET BOOTLOADER SELECTED" message is not actually an error, and you should see it twice each time you upload a sketch.

Your IDE status bar should say Compiling Sketch, and then Uploading Sketch and then Upload Complete.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Trinket HELP

Post by adafruit_support_rick »

Let's try replacing your Trinket. Please email [email protected] with a link to this thread for a replacement

User avatar
johnweythek
 
Posts: 33
Joined: Fri Jul 05, 2013 3:22 pm

Re: Trinket HELP

Post by johnweythek »

Thanks, i have several trinkets to test so it's not a faulty unit as the same happens on my other 3V one, thanks for the offer though. Good that my error wasn't an error.

I am gonna mess with those timing numbers because my blink code wasnt nearly that short (300) more like 1000.

ITS BLINKING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :shock: :shock: :shock: WOWOWOWOWOWOW! Thank you all so very much. I hope i can do this for someone else on the forum one day. Oh boy, changed blink timings and they changed on the trinket, FINALLY time to put my projects together. This has been a great learning experience for me and hope to do it all right any time i have to in the future. I'll prob be back with more questions but this is a huge step. Thanks again to everyone who chipped in, you have made a tinkerer very, very happy indeed. :D :D :D :D :D :D

User avatar
johnweythek
 
Posts: 33
Joined: Fri Jul 05, 2013 3:22 pm

Re: Trinket HELP

Post by johnweythek »

AWE YEAH!!!!! It's handling everything from the neopixel library! Decided to use the gemma for the goggles since it has the JST connector and i wanted to wear some gear on the outside for nerd pride and all. Trinket's powering my xmas ornament, though, i have to use the USB shielding for ground because the ground pin resets it, i'm guessing that's a 'plugged in' problem and will go away with a battery on it. Thanks again, i'm still riding high on the excitement of new projects!

User avatar
technobly
 
Posts: 118
Joined: Mon Oct 31, 2011 11:06 am

Re: Trinket HELP

Post by technobly »

@johnweythek Awexome! Can't wait to see what you come up with ;-)

BTW, here's my first project with the Trinket: http://www.youtube.com/watch?v=O3Cr7Nu0i1Y

User avatar
technobly
 
Posts: 118
Joined: Mon Oct 31, 2011 11:06 am

Re: Trinket HELP

Post by technobly »

johnweythek wrote:though, i have to use the USB shielding for ground because the ground pin resets it, i'm guessing that's a 'plugged in' problem and will go away with a battery on it.
If you have a sketch programmed already, and plug in power... the Trinket will power up in bootloader mode for 10 seconds and then it will run your code. Maybe this is what you are seeing? You should be able to hook up standard mini USB wall adapter, and connect your neopixel's VCC to the USB pin of the Trinket. If you are going to add a battery then you probably want to follow the adafruit guide here that shows adding a 3.7V Lipo to the BATT pin of the trinket along with your neopixel VCC http://learn.adafruit.com/larson-scanne ... -soldering

User avatar
johnweythek
 
Posts: 33
Joined: Fri Jul 05, 2013 3:22 pm

Re: Trinket HELP

Post by johnweythek »

Nice job there. rings and shields will make for great illumination in translucent objects like that. I'm sticking (mostly) to the adafruit tutorials until i run out of cool stuff. I think i am already tasked with making a light up tacky xmas sweater for my father-in-law. Got a sheet of wearable friendly pixels and some conductive thread on the way, now for the tacky sweater...

The Goggles are def my 1st project though i went for red rather than the provided green for a scarier look (because i started this before halloween, ha) but rainbow swirls are awesome too and The big lipo battery has been going all night and day. I also have a 'nightvision' program which is simply all set to hi white, which honestly gives you vision in the dark, so, the name works. Almost no light bounce back with no lenses or the right placement of black sugru. After i get some strands of neopixels my desk is gonna have some crazy ambient light effects as well (to add to my adalight monitor kit). Even with all that there's no end in sight for my adventures in gadgetry.

I can't thank you guys enough times for all the help so i'll do it again, THANKS!!!

User avatar
technobly
 
Posts: 118
Joined: Mon Oct 31, 2011 11:06 am

Re: Trinket HELP

Post by technobly »

Sounds like you have NeoPixel Fever ;-) Nothing wrong with that... only way to keep it in check is to build lots and lots of NeoPixel projects! Happy Making!!

Mischa77
 
Posts: 3
Joined: Mon Dec 10, 2012 3:50 pm

Re: Trinket HELP

Post by Mischa77 »

Thank you very very much for your first post.
There were no solutions to find, but I had the same problem of not being able to connect.
Pressing the reset button while compiling works for me.
Thanks again

Mischa77
 
Posts: 3
Joined: Mon Dec 10, 2012 3:50 pm

Re: Trinket HELP

Post by Mischa77 »

Sorry, my last post was about this site:
http://codergirljp.blogspot.nl/2014/01/ ... de-in.html
worked very well for my problem. Sorry, if it's a different subject

User avatar
makerspace_aurich
 
Posts: 1
Joined: Tue Aug 25, 2015 8:00 pm

Re: Trinket HELP

Post by makerspace_aurich »

In our makerspace we build 6 POI-Genesis with trinket 5V.
Under XP everything works correct. Under Windows 7 (64bit) we get no error while compiling. But when we tried to load the program into the trinket (the LED fades correct on an off) we get always the error message "avrdude: error: usbtiny_receive: (expected 4, got -5)". We tried to deinstall of the trinket driver and install it again. We tried to install the driver without license. Always It comes the same error. Now we´ve no more idea. It´s always (expected 4, got -5) and not (expected 4, got -71) or samething similair.

Mischa77
 
Posts: 3
Joined: Mon Dec 10, 2012 3:50 pm

Re: Trinket HELP

Post by Mischa77 »

Have you tried resetting it just before the upload ends? Or disconnect every I/O pin while uploading? Not a desired work flow but it worked for me.

User avatar
nekollx
 
Posts: 46
Joined: Thu Dec 04, 2014 1:22 am

Re: Trinket HELP

Post by nekollx »

I installed the arduino IDE, i can verrify my files but when i go to upload it gives a ton of errors seemingly timout based and yet i installed the conf file from the adafruit build
Arduino: 1.6.4 (Windows 7), Board: "Pro Trinket 5V/16MHz (USB)"

Sketch uses 2,836 bytes (9%) of program storage space. Maximum is 28,672 bytes.

Global variables use 42 bytes of dynamic memory.

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x03

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x03

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x03

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x03

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x03

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x03

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x03

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x03

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x03

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x03

Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

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

Return to “USBtinyISP”