Instructables


after making a usbtiny isp programmer and using it for 6 months, i was looking at making another one for carrying around. i like the simplicy of the usbtiny isp design but would like to make it even smaller and take less parts. one thing in the original design that i want to change is to eliminate the use of clock crystal. one solution i found is that v-usb drivers supports the 16.5Mhz internal oscillator on attiny25/45/85 devices. so i start out this project to have usbtiny isp employs v-usb for usb communication. the immediate benefits is that it saves space and have less component counts (no more crystals).


usbtiny

description from http://www.xs4all.nl/~dicks/avr/usbtiny/

USBtiny is a software implementation of the USB low-speed protocol for the Atmel ATtiny microcontrollers. Of course, it will also work on the ATmega series. The software is written for an AVR clocked at 12 MHz. At this frequency, each bit on the USB bus takes 8 clock cycles, and with a lot of trickery, it is possible to decode and encode the USB waveforms by software. The USB driver needs approximately 1250 to 1350 bytes of flash space (excluding the optional identification strings), depending on the configuration and compiler version, and 46 bytes RAM (excluding stack space). The C interface consists of 3 to 5 functions, depending on the configuration.


vusb

description from http://www.obdev.at/products/vusb/

V-USB is a software-only implementation of a low-speed USB device for Atmel's AVR microcontrollers, making it possible to build USB hardware with almost any AVR microcontroller, not requiring any additional chip.

video on construction and usage


 
Remove these adsRemove these ads by Signing Up
1-40 of 60Next »
spiess2 years ago
This is really a great little project! I built it on a little stripe of of prototype board and arranged it in such a way that one end of the prototype stripe also serves as a usb plug.

Every thing worked perfectly on the first try - so big congratulations for presenting such a useful project and making things so simple and the instructions so precise!

Thanks!!!
vusbtiny.jpg

that is awesome what you did turning the breadboard into a usb stick

CarlB1 made it!1 month ago

Great Tutorial, I've setup 2 of these on breadboard already, one t45 and one t85. This circuit is just too easy to replicate! I did initially have issues with requiring the use of 'sudo' with avrdude, but this simple rule for udev fixed that.

SUBSYSTEM=="usb", ATTR{idProduct}=="0c9f",ATTRS{idVendor}=="1781", MODE="0660", GROUP="adm"

vusbtinys.jpg
skootles1 month ago

Built one of these and it works great! Do you know if there are any limitations? For example, Adafruit's USBtinyISP kit can't program any AVRs that have over 64k of flash like the Atmega1281/1280/2561/2560. I don't have any of those AVRs on hand to test.

Also, I built one and it takes about 2 minutes to burn the Arduino bootloader to an ATmega328. Do you know what could be done to speed that process up, at all?

dan30088 months ago

Wish there was a way of doing this without needing an avr programmer... Ah well, Teach me for looking for the easy way out

dan3008 dan30088 months ago

Just a thourght, do you know if its possible to get the ATtiny45/85 preprogrammed with vusbtiny?

simpleavr (author)  dan30088 months ago

Not from me. I have not do an AVR for more than one year. On MSP430 now. If you have friends that got a programmer, you can download the hex and have him flash one for you. Or try local avr forums. It might be wiser to get a programmer from ebay. They are about $3 shipped nowadays.

dzervas9 months ago
When I plug it in the USB i get in dmesg:

[257309.496223] usb 4-1.1: new full-speed USB device number 50 using ehci-pci
[257309.562747] usb 4-1.1: device descriptor read/64, error -32
[257309.732580] usb 4-1.1: device descriptor read/64, error -32
[257309.902371] usb 4-1.1: new full-speed USB device number 51 using ehci-pci
[257309.968926] usb 4-1.1: device descriptor read/64, error -32
[257310.138778] usb 4-1.1: device descriptor read/64, error -32
[257310.308634] usb 4-1.1: new full-speed USB device number 52 using ehci-pci
[257310.714804] usb 4-1.1: device not accepting address 52, error -32
[257313.126003] hub 4-1:1.0: connect-debounce failed, port 1 disabled

Any help appreciated...
simple probably vacuous question, what is SPI and why would I want to program it? Post a link if it's a fairly good explanation. Thanks in advance
simpleavr (author)  keverett4584291 year ago
There are a few ways to program an avr, SPI (serial peripheral interface) is the simplist way as it only require three signals, Clock, MOSI and MISO (master-in, slave-out and vice versa). SPI is easier to implement (most uses bit-bang style) and require fewer HW resources. See linked docutment from amtel for details.
http://www.atmel.ca/Images/doc0943.pdf
necko1 year ago
Need help on swapping PB3 and PB4.
Modified usbconfig.h as below and flash the attiny85.
#define USB_CFG_DMINUS_BIT 3
#define USB_CFG_DPLUS_BIT 4
I monitor reset line.
It stay high for a few seconds and then started pulsing.

I think I have to modified MCUR setting but do not know how.
Can you please help?
Thanks.
I use this udev rule for my actual USBTiny but even though the id is the same it makes me use sudo for the vusbtiny. Any ideas?

ssokolow1 year ago
Could you clarify where the "1k/2k resistors for io lines protection (optional)" go?

Also, what benefit does the  "optional 0.1uf capacitor" bring, and where does it fit in the circuit diagram? I'm feeling really fuzzy today and I'm having trouble working backwards from the photo of the breadboard.
simpleavr (author)  ssokolow1 year ago
io line resistors protects the device when u accidentally connect high-voltage input and output pins. most builds don't use them to make the project footprint smaller.
the 0.1uF capacitor is just a bypass cap to stablise power supply (like any other projects). if u have one, put it it.
there are many successful builds of this project. google vusbtiny and u can find other's experience / modification to make it work.
I haven't tried but I can imagine it might work nicely to solder SMD resistors between two adjacent perfboard holes for compact I/O line resistors (using a heat gun to keep both melted at once) similar to what spless did with all of his resistors in the photo he posted.

As for the I/O line resistors, I got that but I'm not sure where they're supposed to go in the circuit diagram. (That's also my second question about the bypass cap since, lately, I've been jet-lagged and my free time coincides with the time I'm too dozy to make sense of how the breadboard photo maps to the circuit diagram.)
etuardu1 year ago
Thank you for this guide, I succeeded in programming both an AtTiny45 and an Atmega328.
Note that in this last case I had to wire pin4 of J2 to the Atmega328's SCK (that is pin 19), not to the SCL (that was pin 28).
And I was on Windows7 64bit, if anyone cares.
icarus742 years ago
Great tutorial. I am porting this to a protoboard.

Can the 68Ohm resistors be replaced with any other values (47Ohm, 100Ohm...) and the 150K one be replaced by another value say 1K or 2.2K ?
Would avoid burning fossil-fuel to get only those 2 from the store. Rest, I have pretty-much everything.

Also for your USB printer cable hack, can you explain the header connections ? You only seem to have Vcc and D+ connected to the header, and GND, D- isn't clear from the pic, if they are on their own headers or just plain terminated (left floating).
simpleavr (author)  icarus742 years ago
here are my understanding...
. the 68ohms are current limited (to protect the pins), so u should make them as close to 68 as u can. 47ohm definitely works. sometimes even better than 68ohms if u have a long usb cable.
. the 1.5k is a pullup, so anything between 1k to 5k is fine.
. follow the schematic / diagram, there are only 6/7 parts in this, the schematic also make notes of the 4pin header position. if u are talking about the usb cable itself, they can be different colored wires inside, u sould use a multi-meter to sort out which is which. i.e. measure between the contacts on one end against the 4 exposed wires against a usb pin-out diagram.

good luck on your build.

_Ludo3 years ago
Did anybody test it under Win7? I got an error saying that the installation could not be done!?
icarus74 _Ludo2 years ago
As far as I can tell, reading various posts at the Objective-Development site (& forums), very few people seem to have had success in using V-USB under Windows 7. Apparently, some initial / early Win 7 (that too, possibly only on 32-bit mode), installation did work, but people do seem to have issues.

Here's one such thread: http://forums.obdev.at/search.php?fid[]=8&sid=ffe64be8b944f53757abea58c378899a
nis1232 years ago
It is sufficient if i just flash the given HEX file using SinaProg???
simpleavr (author)  nis1232 years ago
never used sinaprog before. if it can accept hex file and works for u in flashing avrs, yes, u can use it as my hex files are no different. u do need to toggle the fuse bit on your target device and u should find out how it's done w/ sinaprog.
8N12 years ago
The usbconfig.h says:
"Please note that D+ must also be connected to interrupt pin INT0!"

Can you tell me what you have done to avoid that?

Thanks for sharing!
simpleavr (author)  8N12 years ago
thanks for your interest.

the default D+ pin is INT0, but it can be changed, for attiny45/85 layout, i used portb.3, we can re-define USB_INTR_VECTOR to be the "pin change" interrupt. and any one of the 6 io pin level change will trigger the interrupt, which includes portb.3.

note that if u are also using some other higher priority interrupts this may fail.

inside usbconfig.h, toward the end of the file, u can see the various options.

#define USB_INTR_VECTOR SIG_PIN_CHANGE

//#define USB_INTR_VECTOR INT0_vect
//#define USB_INTR_VECTOR PCINT9_vect
putyn2 years ago
hey im trying to build a smd version of your tiny avr programmer (will post pictures as soon as i get it finished) and im waiting for the board to arrive anyway my question the programmer uses the 8mhz internal oscillator ?
so i can order this part ATtiny85V-10SU or this ATTINY85-20SH :) ?
simpleavr (author)  putyn2 years ago
@putyn

use the 20mhz version (attiny85-20??), we need to use a internal oscillator clocked at 16.5Mhz to avoid external crystals.

for more technical details if u need, go to the vusb site for explanations.

good luck w/ your project.
putyn simpleavr2 years ago
ok thanks for your answer will order this ATTINY85-20SH - can you take a look at my schematic and design if i post them ?
simpleavr (author)  putyn2 years ago
not sure, i think this is the most simple programmer already? are u changing anything? If not, build it and if u ran into problem. Post a comment here I am sure either myself or someone can help.

John_Edward3 years ago
Thank you for this guide, I made my tiny programmer with the help of this :)
I made mine to a piece of stripboard, and used an Arduino to program the chip.
I'll link my materials here, so people can see how it would fit to a stripboard.
The board could be made smaller if I used more wires instead of jumpers, but It's small enough for me like this :)

I don't take any responsibility for wrong schematics though, these are made from memory and might not be correct:

http://koti.mbnet.fi/johnedwa/misc/vUSBtiny_stripboard_v1.PNG
http://koti.mbnet.fi/johnedwa/misc/vUSBtiny_stripboard_v1_schematics.PNG
That ATtiny is bigger, my ATtiny45V is smaller than that one in the clip.
Or am i wrong?
vishwaiit3 years ago
What are all the avr micro controllers that can be programmed using this programmer.if any one has the PCB layout,i would be interested.
zgr95 vishwaiit3 years ago
i just finished a pcb layout sent me a message and ill email it to you
Awesome. It's a mashup of two of my favorite projects, and the result is the most minimal USB programmer I've seen yet!
msajib_063 years ago
1.Can i make this with an ATMega32?
2.If so what modifications do i need to make?
simpleavr (author)  msajib_063 years ago
no u cannot swap w/ an atmega easily, this circuit relies on the special 16.5mhz internal oscillator (only available on tiny25/45/85) so that no crystal is needed.
if u have an atmega, u should build the usbasp, it is also very simple to build.
If you've got an Arduino, you can use it as an ISP programmer. That doesn't mean you don't want to build this one - it can be handy to have a dedicated programmer, and use the Arduino for fancier stuff. On the other hand, if you're building one of these, you probably don't have a high-voltage programmer, so you may want to splurge and have a couple extra ATtiny85's around in case anything goes wrong.
simpleavr (author)  bill.stewart3 years ago
100% correct, you will want to also build a HVP, i did bricked a tiny45 building this project. so i build a tiny2313 based "standalone" fuse reader / rescuer. that's an upcoming project awaiting write-ups. it will only do HVSP (serial hi-voltage) and works only with 8pin and 14pin avrs. here's a picture http://www.simpleavr.com/avr/avr_fuse.jpg


IMG_1656.jpg
So when is this one coming out ? :)
simpleavr (author)  hardwarehank3 years ago
http://www.instructables.com/id/AVR-HVSP-Fuse-Resetter/

just finished the fuse resetter instructable, enjoy.
Thanks!
1-40 of 60Next »