SOLUTION: Macs with USB 3 and USBtinyISP
Moderators: adafruit_support_bill, adafruit

Re: SOLUTION: Macs with USB 3 and USBtinyISP

by adafruit_support_rick on Thu Sep 20, 2012 7:34 am

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
adafruit_support_rick
 
Posts: 11637
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: SOLUTION: Macs with USB 3 and USBtinyISP

by JesterVineo on Sun Sep 30, 2012 9:06 am

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!
JesterVineo
 
Posts: 6
Joined: Mon Sep 17, 2012 6:36 pm

Re: SOLUTION: Macs with USB 3 and USBtinyISP

by JesterVineo on Mon Oct 01, 2012 7:47 am

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.
JesterVineo
 
Posts: 6
Joined: Mon Sep 17, 2012 6:36 pm

Re: SOLUTION: Macs with USB 3 and USBtinyISP

by markmoran on Fri Nov 30, 2012 9:54 pm

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
markmoran
 
Posts: 13
Joined: Fri Mar 02, 2012 5:47 am

Re: SOLUTION: Macs with USB 3 and USBtinyISP

by adafruit_support_rick on Sat Dec 01, 2012 12:23 pm

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
adafruit_support_rick
 
Posts: 11637
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: SOLUTION: Macs with USB 3 and USBtinyISP

by markmoran on Wed Dec 05, 2012 3:59 am

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.
markmoran
 
Posts: 13
Joined: Fri Mar 02, 2012 5:47 am

Re: SOLUTION: Macs with USB 3 and USBtinyISP

by adafruit on Wed Dec 05, 2012 9:33 am

can you try going thru a hub of some sort?
User avatar
adafruit
 
Posts: 11670
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Re: SOLUTION: Macs with USB 3 and USBtinyISP

by adafruit_support_rick on Wed Dec 05, 2012 9:39 am

OP says he tried a USB2.0 bus-powered hub with no joy.
User avatar
adafruit_support_rick
 
Posts: 11637
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: SOLUTION: Macs with USB 3 and USBtinyISP

by markmoran on Wed Dec 05, 2012 11:47 am

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.
markmoran
 
Posts: 13
Joined: Fri Mar 02, 2012 5:47 am

Re: SOLUTION: Macs with USB 3 and USBtinyISP

by adafruit_support_rick on Wed Dec 05, 2012 12:26 pm

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
adafruit_support_rick
 
Posts: 11637
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: SOLUTION: Macs with USB 3 and USBtinyISP

by markmoran on Wed Dec 05, 2012 2:10 pm

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. :)
markmoran
 
Posts: 13
Joined: Fri Mar 02, 2012 5:47 am