SOLUTION: Macs with USB 3 and USBtinyISP

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
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: SOLUTION: Macs with USB 3 and USBtinyISP

Post by adafruit_support_rick »

See the first item in the USBTinyISP 'Help' page.
JesterVineo wrote: I'm pretty sure I plugged the 6-pin cable in backwards once. Could that have fried something?
There's power and ground on the 6-pin header, but I don't see how you could smoke anything by installing the cable backwards.

User avatar
jestervineo
 
Posts: 6
Joined: Mon Sep 17, 2012 7:36 pm

Re: SOLUTION: Macs with USB 3 and USBtinyISP

Post by jestervineo »

Well, I figured it out (mostly). It turns out I was dealing with two problems.

The bigger one was that I misread the assembly instructions and instead of installing jumpers for R4 and R7, I just left them unpopulated. Duh! I found that pretty quickly when I stared poking around with a 'scope. After I installed the jumpers, the USBtinyISP worked just fine on a machine with USB 2 ports. Problem #1 solved.

Problem #2 is getting this thing to work on my mac with USB 3 ports. I tried a bunch of cables and an old USB hub, but no luck. So if anyone reads this and has any recommendations for specific cables that will work, please let me know.

Thanks!

User avatar
jestervineo
 
Posts: 6
Joined: Mon Sep 17, 2012 7:36 pm

Re: SOLUTION: Macs with USB 3 and USBtinyISP

Post by jestervineo »

One more post, and then I think I will have beat this thing to death.

I finally got it working with my Mac without a hub. I found a few more USB cables, and one of them did the trick. It doesn't have any markings on it, so I can't tell others what to order.

I would like to emphasize Driverblock's comment about rebooting your Mac. The cable that finally worked, didn't work at first. However, after rebooting my Mac, it worked fine, and it has worked fine all weekend. So, if you're having trouble with USB cables, I'd strongly recommend rebooting your Mac before trying each one.

User avatar
markmoran
 
Posts: 24
Joined: Fri Mar 02, 2012 6:47 am

Re: SOLUTION: Macs with USB 3 and USBtinyISP

Post by markmoran »

Is there any new insight or information about why the new Macs don't consistently work with the USBtinyISP? I had a 2010 MacBook Pro that seemed to work reliably with my USBtinyISP. Over the summer I upgraded to a MacBook Pro with Retina display, and now it seems to fail 4 out of every 5 times I run avrdude, with the basic rc=-1 error.

I'm trying to upload a simple "Hello World" program to an ATtiny13 running at 128KHz. It generally works fine the first time, then I make changes to the code and try to upload the new version and I get the failure below. I try unplugging and replugging the USB cable, moving it to the computer's other USB3 port, etc, but the only thing that seems to work is waiting a few minutes. And sometimes that doesn't work either. Since I'm running at 128KHz, I've also tried using slower speeds, as high as -B 250, but that doesn't seem to work any more reliably than -B 32.

I've tried with two different USB cables and both work equally often. Today I bought a USB 2.0 hub hoping that would fix the problem, but same thing - it worked the very first time (thrilling!), but then failed when I tried again a minute later. In all cases, the USBtiny provides power to the ATtiny and the ATtiny keeps running its program correctly. As usual with a Mac, the green LED on the USBtiny is initially off but turns on the first time I run AVRdude after plugging it in.

I'm running OS X 10.8.2 on an 2.6 GHz Intel Core i7 with 16 GB 1600 MHz DDR3 ram. (I didn't realize until re-reading this thread that the USB hub was suppose to be powered, the one I found is bus-powered, so maybe that's a possible fix? But why is any of this necessary?)

Are USB 3 ports much more finicky about working with USB 1 devices? Do I need to find an old USB 1 hub that plugs into an outlet? Or just keep rebooting my Mac and trying different USB cables? And should I be looking for new or old USB cables? Is there a possible update to the USBtiny firmware?

Thanks for any advice or tips!
-Mark

avrdude -c usbtiny -p attiny13 -B 32 -U flash:w:main.hex:i
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude done. Thank you.
make: *** [flash] Error 1

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

Re: SOLUTION: Macs with USB 3 and USBtinyISP

Post by adafruit_support_rick »

We don't actually know what the problem is. There have been similar reports from Windows users, so it may not be a Mac-specific issue.

Are you powering your ATtiny through the USBTiny? If so, can you power the target independently instead?

User avatar
markmoran
 
Posts: 24
Joined: Fri Mar 02, 2012 6:47 am

Re: SOLUTION: Macs with USB 3 and USBtinyISP

Post by markmoran »

I've tried it both powering from an external source (and removing the USBtiny jumper) and also powering it from the computer (connecting the jumper and removing the external power), but neither seem to work now. I also tried three more USB cables (for a total of five) and so far haven't gotten any of them working. Per an earlier post, I reboot the Mac between trying each cable, and the first I run avrdude I get:

avrdude: Error: Could not find USBtiny device (0x1781/0xc9f)

I get this until I unplug and plug the cable from the computer, and then from then on I get:

avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

Before I was getting it to work just by waiting long enough and trying it again but now I'm not getting anything. Urgh.

Is there another AVR programmer you can recommend that works more consistently with the Mac? I had fun building the USBtiny, but this is too frustrating.

Thanks for any advice.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: SOLUTION: Macs with USB 3 and USBtinyISP

Post by adafruit »

can you try going thru a hub of some sort?

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

Re: SOLUTION: Macs with USB 3 and USBtinyISP

Post by adafruit_support_rick »

OP says he tried a USB2.0 bus-powered hub with no joy.

User avatar
markmoran
 
Posts: 24
Joined: Fri Mar 02, 2012 6:47 am

Re: SOLUTION: Macs with USB 3 and USBtinyISP

Post by markmoran »

Yes, I tried with a USB 2.0 hub and it didn't seem to make a difference. I tried it with two different cables in both USB ports (there's one on each side of the new Retina MacBooks). Uploading a small program to an ATtiny13 worked sporadically, just like it did without the hub. I returned the hub to Target, which had cost $15 and I had only purchased to see if it helped with my USBtiny. (How often do people still need USB hubs now that so many peripherals are wireless?)

After my post last night, I did get AVRdude to successfully upload the program again, although without moving any cables or changing anything. So it seemed to be back to working sporadically. Do you think a USB 1.1 hub might work better? Am I better off never powering the chip from the USB? I'm guessing another USB-based programmer like the AVR ISP mkII might have the same issues? I'd consider getting a Dragon so that I can do HVSP and debugging, although I think I'd need a Windows machine to take advantage of the debugging anyway. I'm not sure what a good alternative is since Macs haven't had serial or parallel ports in more than a decade.

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

Re: SOLUTION: Macs with USB 3 and USBtinyISP

Post by adafruit_support_rick »

Well, I'm currently working on an embedded project using AtmelStudio 6, and I can tell you what works for me.
I've got a 27" iMac, I'm running Win XP in Parallels, I've got an Atmel JTAGICE3, and my target is an ATmega32U4.
I can tell you that this arrangement works flawlessly. It's by far the easiest setup for embedded programming and debugging I've ever used.
According to Atmel Studio, the JTAGICE3 supports the ATtiny13.
Yes, the iMac is USB 2.0. You probably want to check avrfreaks to see if anybody has had USB 3.0 troubles with Atmel programmers.

Alternately, you can try setting up an arduino as an ISP programmer. There are lots of tutorials out there, and there have been a few threads on the subject here in the adafruit forums. Here are a few places to start.
http://arduino.cc/en/Tutorial/ArduinoISP
http://www.ladyada.net/library/arduino/arduinoisp.html
http://ladyada.net/library/tools/standaloneisp.html

User avatar
markmoran
 
Posts: 24
Joined: Fri Mar 02, 2012 6:47 am

Re: SOLUTION: Macs with USB 3 and USBtinyISP

Post by markmoran »

Thanks for the notes about your setup. I wasn't familiar with JTAGICE, but for $99 it looks like a great programmer and debugger. I assume the only advantage of the Dragon over JTAGICE is the high voltage option for disabling reset fuse? I'm guessing I can use it with avrdude under Mac, and then if I want to get the debugging capability I can run AtmelStudio under Fusion (which I have but was hoping to avoid starting up Windows XP). This is all just hobby stuff for me, so I'll also look at the Arduino option too. I had read a tutorial about using an Arduino as a programmer (and even a high voltage fuse resetter), but I thought the ArduinoISP sketch was geared only toward loading Arduino sketches onto ATtinys. (That is, I want to program ATtinys without the overhead of the Arduino timers and other libraries.)

Thanks again and please let me know if anyone figures out why USB3 or newer machines don't play as nicely with the USBtinyISP. I'd be happy to assemble a new programmer if there is a revised chip or firmware that solves this. And I'm also adding a JTAGICE to my Christmas list. :)

User avatar
drumminhands
 
Posts: 36
Joined: Tue Jul 23, 2013 10:02 am

Re: SOLUTION: Macs with USB 3 and USBtinyISP

Post by drumminhands »

FYI, I just had the same problem on an older Mac Book Pro (Late 2011, running Yosemite) that has two USB ports uploading to a Pro Trinket. Received this message:

Code: Select all

avrdude: error: usbtiny_send: usb_control_msg(DeviceRequestTO): pipe is stalled (expected 128, got -104)
Used multiple USB cables, no fix. Used a 6 port USB hub in-between the same cable and the Mac, works just fine.

User avatar
ggleason
 
Posts: 1
Joined: Thu Aug 27, 2015 9:59 pm

Re: SOLUTION: Macs with USB 3 and USBtinyISP

Post by ggleason »

Could be different issues for different cases, but mostly this seems to be an issue of some cables not being good enough for some USB chips. I had this problem and didn't have any better cables around. The solution was to use a hub between, but even the first hub I tried did not work. It was the newer hub that didn't work, so that also supports the new chipsets need better cables theory.

User avatar
enhering
 
Posts: 13
Joined: Tue Jun 05, 2012 5:03 pm

Re: SOLUTION: Macs with USB 3 and USBtinyISP

Post by enhering »

Hi. I have a USBtinyISP, an Atmel ICE and a mid 2010 MacBookPro (MBP from now on).

I use the USBtinyISP to program my own ATmega328 boards, described here:
https://hackaday.io/project/11724-yauvc ... controller

I power up those boards from a switching power supply, regulated at 3.3V. The USBtiny jumper is removed to do so.

I find issues with the MBP every time I connect the boards to the USBtiny when it is connected to the MBP. Same issues happen if the board is connected to the USBtiny and I connect the USBtiny to the MBP USB. In both cases the USBtiny is not recognized by the MBP. To fix them I have to disconnect everything and reconnect, keeping only the power supply ground connected to the bundle.

I'm going to say this again: Only power supply ground *must* be connected to the board->USBtiny when these are connected to the MBP. Than the red led from USBtiny turns on and USBtiny is recognized. That is an issue.

It is obviously a ground problem. My MBP uses a 2 pin adapter to connect to the wall. I ordered a 3 pin adapter that grounds the MBP, and while it does not arrive, I managed to ground the Apple power adapter myself. But the problem persists.

I have a second monitor connected to the MBP and sometimes, when I plug in the USBtiny the second monitor looses the image and gets blank. Nothing else happens. No smoke, no burning.

Now comes the news. Yesterday the USBtiny stopped working. All I get is an initialization failure, cannot read device signature (0,0,0) from avrdude. I switched to the Atmel ICE and could program the boards.

I tried many solutions, rechecked the flat cable connections end got no results. I even remelted all the USBtiny solders without success.

I read somewhere that 99% of the time the problems with USBtiny are wiring ones. I believe, by changing the programmer, that I do not have wiring problems. That is why I'd like to ask you what happens on 1% of the time? Should I substitute one of the ICs?
IMG_2744.JPG
IMG_2744.JPG (115.8 KiB) Viewed 2638 times
IMG_2745.JPG
IMG_2745.JPG (127.03 KiB) Viewed 2638 times
IMG_2747.JPG
IMG_2747.JPG (156.29 KiB) Viewed 2638 times

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

Re: SOLUTION: Macs with USB 3 and USBtinyISP

Post by adafruit_support_rick »

USB 3 has caused some problems. Please try connecting through a USB2.0 hub.

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

Return to “USBtinyISP”