Attiny85 USB

Hello again,

I very successfully completed the V-USB project using Arduino outputting keystrokes to my computer. But as the atmega328 isn't exactly small, I was hoping to run V-USB on the attiny85. I know this is possible and I've searched google and this forum but I havent found detailed instructions.

I would like to use the Arduino IDE. I saw the V-USB easylogger project and the code for that isn't arduino :~

Any help pointing me in the right direction will be appreciated. Thanks

Check out the Digispark (Digispark USB Development Board - Digistump). It's pretty much what you describe. You can either buy a built one, or since it's open source, base your own design on it.

Good luck!

Digispark is pretty awesome. I just got one. It's 1 square inch of Arduino goodness with built in USB! :slight_smile:

It is a little "different" however. Be sure to read the wiki on it (link to it on page given above). Because of the small size and limited pins, USB, etc...not all libraries work as expected. I believe it also doesn't have but-in, easy to use serial communication. It can do it, but might take a little extra trickiness to make it work how you want. But, for the price...I say buy one & give it a try. It's so tiny!

That looks almost perfect. Could I burn the special bootloader on my attiny85 and run it on a breadboard with USB?

And what would be the steps to burn the bootloader?

Thanks guys

Could I burn the special bootloader on my attiny85 and run it on a breadboard with USB?

I've never done this but I can't think of any reason why not, as long as you follow his schematic for the USB connection etc.

And what would be the steps to burn the bootloader?

This page

http://digistump.com/wiki/digispark/tutorials/connecting#bootloader

says they're using version 1.02 of this bootloader

and you can either compile it yourself or download micronucleus-1.02.hex from

Once you have the hex file you can burn it to the attiny with your Arduino as an ISP, like this guy did:

http://forum.arduino.cc/index.php?topic=81824.0

or just Google something like "arduino isp attiny hex upload" for other examples.

Just an FYI —

When using the 'micronucleus' to program ATTiny (at least with the Digispark Arduino IDE) you should not plug into USB until after clicking to send sketch to Arduino. It then gives you like 60 seconds to plug it in.
Also, since the USB programming pins are shared as other input/output/PWM pins.... make sure your circuit won't interfere with programming signal. Just be aware what's connected to them. I usually just disconnect everything from the board until after I load my sketch onto it to be safe.

Thanks for all the help guys! I got the hex file uploaded (on my own! That made me happy :)) but thanks for the complete directions they may be useful to others reading this.

I got the blink sketch uploaded and that worked, but when I keep trying to upload it fails with a "USB not recognized/malfunctioned" message in windows. Any suggestions?

phillips:
Thanks for all the help guys! I got the hex file uploaded (on my own! That made me happy :)) but thanks for the complete directions they may be useful to others reading this.

I got the blink sketch uploaded and that worked, but when I keep trying to upload it fails with a "USB not recognized/malfunctioned" message in windows. Any suggestions?

What is connected to which pins on ATTiny?

I'm following the schematic on the digispark website https://s3.amazonaws.com/digistump-resources/files/97a1bb28_DigisparkSchematic.pdf

I didnt know which pin is USB D+ and D- though. I'm also not using an exact 1k5 resistor (instead 4 resistors that add to about 1k5). It has worked about 1/4 the time but I don't know what I'm doing different that makes it work.

Ok. So no other circuitry of your own added? No LEDs? Etc?

Looks like pins 2 & 3 are USB data pins.

I just noticed you mentioned running Windows. Seems to have "issues" sometimes. This thread may help...?

I got it to work through a USB hub! Kinda weird but as long as its working I'm happy.

Thanks for all the help 1ChicagoDave and magagna.

I have the same problem you have, after wasted lots of time i continue without connect my Attiny85 through USB, using Arduino IDE, any Suggestion?, idea?, comment?

Escrich:
I have the same problem you have, after wasted lots of time i continue without connect my Attiny85 through USB, using Arduino IDE, any Suggestion?, idea?, comment?

OP solved his problem with USB hub. Where is your problem?

Hi Smajdalf, first of all, thanks for your fast answer, after that, looking at your answer:

"OP solved his problem with USB hub. Where is your problem?"

I don't know what you mean when you write "OP", my actual problem it´s because i want to have an USB adapter on an Attiny85, i'm trying to use a small board like the one in the picture, or like the attached schema, i'm readig how to do it with Atmel Studio, but I'm still no ready to use Atmel Studio, at this moment i have not enough knowledge to use it, that´s because i want to do it using Arduino IDE.

You can use Arduino IDE. But first you need to upload bootloader to the ATTiny (and set fuses). Try to follow links in reply #4. Then you may need to install drivers for Digispark into the IDE.

In the attached image you can see the cards I can see from Digispark on my Arduino IDE, really i don't know which one to choose, if any

Digispark cards.jpg

Well, I was advanced something, at this momment I can upload an sketch on the attiny85 using the Arduino IDE though the USB connector, choosing Digispark boards at Arduino IDE, now my questions are:

Is this all what we can do with this USB connector?

Could i make an sketch sending information from attiny to the computer using this USB connector?

Thanks for all your answers

Look at Digispark wiki. There is thing called DigiCDC (they also have examples in IDE) and it emulates Serial communication just like "normal" Arduino. But you need drivers for it. For me it works flawlessly on Windows XP and Vista but I did not manage to get it to work on my new Windows 10 computer. I don't know if it is Windows or hardware problem, maybe a hub would help (I don't have one). It somehow violates USB standarts and if your system is not forgiving it won't work.
There are also other ways that are said to work (using HID protocol) but I did not have time to play with it.