0

Issues with uploading trinket program
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Issues with uploading trinket program

by mdikov on Sun Mar 24, 2019 12:39 pm

I have been having some issues uploading my program to a trinket 3v, connected to one of my projects. I already have a program uploaded to it before I connected the buttons, which works fine if I just power it up. So clearly the unit is not damaged. However when I try to connect to the computer with the USB I get the error "Cannot find USBTiny device."

I use USBTinyISP programmer and board Adafruit Trinket (ATiny 85 @ 8MHz)

I am using a powered USB hub to connect the trinket to the computer (Windows 10 Surface tablet). When I use this setup on a different trinket that has not been connected to anything I can see the clean bright red blinking of the bootloader and I can upload the program.

In my connected trinket however the red light seems more like flickering after reset not as much as blinking (https://youtu.be/_-xUfRKADjs). Since I have four neopixel jewels I thought there's not enough power so I powered the tine through the BAT with another USB connection, which is also how I run the device unattached to a PC.

Find attached the pin connections. On #1 I have the neopixel jewels; #3 and #4 are the buttons which are directly connecting to ground (no extra resistors); BAT for USB power, Ground.

I am trying to figure out if I did not connect the trinket correctly, I am not powering it correctly, or if the boot loader has been damaged and in that case I wonder what needs to happen.
Attachments
IMG_4416.jpg
IMG_4416.jpg (578.82 KiB) Viewed 203 times
Last edited by mdikov on Fri Jun 14, 2019 11:41 am, edited 1 time in total.

mdikov
 
Posts: 12
Joined: Thu Oct 06, 2016 3:25 pm

Re: Issues with uploading trinked program

by adafruit_support_mike on Sun Apr 07, 2019 4:23 am

The Trinket bootloader uses pins 3 and 4 to emulate a USB connection when you upload firmware. If you have anything else connected to them, there's a good chance the upload will fail.

adafruit_support_mike
 
Posts: 57861
Joined: Thu Feb 11, 2010 2:51 pm

Re: Issues with uploading trinked program

by mdikov on Sun Jun 09, 2019 10:45 pm

Yes, That was the issue.

What are my options if I want to use 3 & 4 for my switch?

- disconnect 3 & 4 while uploading then connect at runtime
- use other ports, I only see #2 as an option
- use trinket pro which has more ports

Thank you!

mdikov
 
Posts: 12
Joined: Thu Oct 06, 2016 3:25 pm

Re: Issues with uploading trinked program

by adafruit_support_mike on Mon Jun 10, 2019 1:15 am

mdikov wrote:- disconnect 3 & 4 while uploading then connect at runtime

If you want to stick with the ATtiny85 Trinket, that's your best option.

The USB emulation is a hack that sidesteps needing to write firmware with an in-circuit programmer, and you have to cooperate with it to make it work.

In general, we're steering people toward the Trinket M0 because it's easier to use.

adafruit_support_mike
 
Posts: 57861
Joined: Thu Feb 11, 2010 2:51 pm

Re: Issues with uploading trinked program

by mdikov on Mon Jun 10, 2019 1:57 am

Do I understand correctly that the Trinket MO doesn’t use pins 3 and 4 for usb communication?

mdikov
 
Posts: 12
Joined: Thu Oct 06, 2016 3:25 pm

Re: Issues with uploading trinked program

by XRAD on Mon Jun 10, 2019 10:03 am

3 + 4 are used for USB (on the trinket 3 + 5v, not the M0), so anything on 3 + 4 that interferes with USB data transfer will have to be disconnected temporarily or moved to another pin

If it just a non-closed button and an otherwise not an active connection, 3 and 4 should be OK. Did you try pressing the boot button to get a blinking red led before uploading? Also, if you press the boot button, and then go beyond a 10 sec window while compiling, you will have to reset the boot button to upload.

I had some trinkets w/ 3 + 4 wired that I could upload to, and some that I had to disconnect 3 + 4 (2 wire plug used), depending on what was connected....

Here is good link to review:
https://learn.adafruit.com/assets/26080


trinket_3v_microusb.jpg
trinket_3v_microusb.jpg (357.75 KiB) Viewed 83 times
Last edited by XRAD on Wed Jun 12, 2019 6:59 pm, edited 1 time in total.

XRAD
 
Posts: 441
Joined: Sat Nov 19, 2016 3:28 pm

Re: Issues with uploading trinked program

by adafruit_support_mike on Tue Jun 11, 2019 12:46 am

mdikov wrote:Do I understand correctly that the Trinket MO doesn’t use pins 3 and 4 for usb communication?

That's correct. The Trinket M0 uses a SAMD21 microcontroller that handles USB internally. It doesn't need the USB emulation hack, and it has more GPIO pins than the ATiny85.

The Trinket M0's USB connection is indpendent of any GPIO pins broken out to the edge of the board.

adafruit_support_mike
 
Posts: 57861
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.