Using the Trinkets



  • Lets figure out how we can use these little gems and what we can do with them.

    I picked up one of the Trinket boards today and tried to program it. First thing I needed to do was to add udev rules and also add the configuration for the board to the arduino ide. This part was very well documented on hackaday.

    Following that I could program the trinket once, using the arduino ide without error. However, as soon as I try to program it again

    avrdude: error: usbtiny_transmit: error sending control message: Protocol error
    

    And the new program does not upload. I have not figured out why this is, but I found this workaround:

    • unplug the trinket, and plug it back again
    • reset the program using the onboard button (gently hold the button for a brief moment)
    • compile and upload your new program

    I am using 64bit Ubuntu 14.04

    @Chris did you try programming the trinket? I am curious how yours went


  • Linux

    Aras, good timing on setting this thread up …

    Here is what I figured out about the trinket I picked up this afternoon:

    • I started by soldering the header pins on the two long sides of the board. This took about 10-15 minutes. I used a breadboard to hold the headers and board together wile soldering and this worked … except that I did not pay attention to the alignment of the headers and it could be more square … it is a little finicky putting the trinket back into the bread board if I take it out. Definitely pay attention to alignment before you solder.
    • I did not solder the small header as I do not have an FTDI cable … do not know if anybody does as this will help for debugging?
      I spent way more time getting the board and the Arduino IDE talking … I eventually downloaded the custom Adafruit-Arduino IDE available on the Adafruit website and this worked. I did have to change the Programmer setting to USBTinyISP and just before uploading code to the board I have to press the reset button on the trinket and then hold down the shift key while pressing the upload button in the IDE. It is finicky but it does work … I was having the same problem described by Aras until I came across this solution.
    • I’ve tested the board with the basic blink example and I have added a button to the modified blink example … it all works.

    Pretty impressive capabilities for such a tiny little board!


  • Linux

    Forgot to add … I did this on a Mac.



  • @amanda has a box full of electronic parts that she will bring tomorrow, that we can borrow for the workshop. I think I saw a bunch of FTDI cables in there

    @Chris what does holding down the shift do in the IDE?


  • Linux

    @arasbm, what holding the shift key down does …

    It looks like the bootloader on the trinket is time sensitive … when I push down the reset key with the USB connected it will blink red for a bit then it stops … from the reading I’ve done when it is blinking red it is ready to receive a new sketch.

    Holding down the shift key seems to ‘hold’ the boot loader in a ‘receive’ state for a longer (indefinite?) period of time … allowing the IDE the time it requires to upload the sketch.

    This is all a bit of a guess on my part, but it makes sense.


Log in to reply