Make your own minimalist AVR ISP

Giving a programmer is a great way to get people started in microcontrollers so If you want a cheap simple AVR programmer this might just be what you’re looking for. It combines the V-USB firmware, USBtiny software, a few resistors, and some zener diodes. An interesting trick using this programmer is if your trying to program another 8 pin ATtiny you can use some tape to isolate the USB data pins and then piggyback the target ATtiny on the programmer.

Unfortunately in order to flash the ATtiny for your programmer you need a working programmer so it’s somewhat of a catch-22.  Make sure your careful when setting the fuse bits because it will use the reset pin making it hard to reprogram without additional programming hardware. AVRs in general are a great way to start using microcontrollers so if your interested give out tutorials a go. You’ll find some tips to get started in addition to information about using an Arduino, or a DAPA cable to flash the firmware to this chip.

Comments

  1. bogdan says:

    It’s nice, it’s simple…
    But for a little more you can build a similar one with tiny2313 that doesn’t give up the reset pin.
    (And i think that the tiny 2313 si cheaper than the ’85 too).

  2. TS says:

    Chris. Please learn the difference between your and you’re.
    Thanks

  3. Robot says:

    It seems that HaD has some amount of investment in the Amtel AVR platform. Is this simply due to the Arduino platform being based on AVR? Or am I missing something about the AVR that makes it stand out among the crowd of C programmable microcontrollers?

    Thanks,
    Robot

    • Caleb Kraft says:

      @Robot,
      Generally we tend to write about what the authors know. The AVR is popular here for sure, but it doesn’t have anything to do with the Arduino. If we had a PIC person on the staff, you’d see tutorials on that as well.

  4. Grammar police says:

    It’s “you’re”

  5. Robot says:

    @Caleb Ah, thank you. I was wondering if I was wasting my time on other products. . . engineering paranoia I guess! Thanks for all of the great posts.

  6. jbremnant says:

    Nice, great job simpleavr!
    I think he has the write up also on his blog.

    http://www.simpleavr.com/avr/vusbtiny

  7. Rob T. says:

    There are a number of options for programming an AVR without the chicken and egg problem of needing a programmer to program the AVR in your programmer. It depends on what hardware you have around. My favorite option is the Bus Pirate, it’s a useful swiss army knife type tool that programs AVRs with AVRdude.

    Other options:
    – An arduino, (See ArduinoISP sketch).
    – FTDI Bitbang, if you have any TTL level FTDI USB serial adapters around.
    – Bit bang serial or paraller port, DASA or DAPA programming cables.

  8. Chris says:

    @Robot

    I can’t speak for HaD, but the usual preference for the 8-bit AVRs is the open source toolchain. Windows people are generally not going to be influenced by IP issues.

    My 2 cents.

  9. Daid says:

    I used DAPA to bootstap my ATMega8 into an USB programmer. From that I’ve bootstrapped multiple other USB programmers for other people.

    But that’s not the hack here. The brilliant part here is the piggybacking. I’ve been thinking about doing this, but then the other way around, piggyback your programmer on the chip you want to program, then you can program any chip in circuit, without special ISP headers.

  10. Rob T. says:

    @Robot, just my option but there are several things that I think contribute to the recent popularity of the AVR. They don’t apply to everyone, but they were factors for me:

    – Open source, multi-platform tools, see the avr-gcc tool chain. Note: this is changing as Microchip is working on cross platform tools.

    – AVRs generally can be programmed with in-circuit voltages. High voltage is usually only needed when the configuration (fuse) bytes get mis-set, preventing further programming of the chip.

    – Natural progression from Arduino to “bare” AVRs.

    – Simpler / more limited part selection. 8 bit avr projects tend to use a small number of AVRs, the ATmega328/168, the ATTiny2313/4313 and the ATTiny85/45. I usually have one from each of the three pin lying around.

    – The same programmer, avrdude, works with most of the chips and most of the available programmers.

    Just my opinions, not trying to start a war.

  11. ColinB says:

    Microchip has not had open-source-friendly compilers. AVR has tons of open source support, it has Arduino which brings in lots of new users (and this is IMHO a Good Thing even if they don’t get deep in the MCU details at first with the Arduino language/environment). AVR seems to me cleaner to program in C and C++ although it still requires more non-standard things than ARM Cortex-M3 (e.g., accessing constant data in flash memory).

    Lately, I think AVR is great for really low power, simple apps requiring 2 KB or less of SRAM, running on batteries, etc., but ARM Cortex-M3/Cortex-M0 completely dominates the area of greater than 4 KB SRAM or requiring higher performance. Compare an NXP LPC1700 ARM Cortex-M3 with a comparable AVR:

    Atmel ATmega640-16AU (AVR ATmega):
    64 KiB flash / 8 KiB SRAM / 16 MHz / 8-bit CPU / $11.80 (@1u, Mouser)

    NXP LPC1752FBD80,551 (ARM Cortex-M3):
    64 KiB flash / 16 KiB SRAM / 100 MHz / 32-bit CPU / $7.10 (@1u, Mouser)

  12. Robot says:

    @Rob, Colin, et al.

    Thanks, I will keep your points in mind. I can see the advantage of having a wide user base that is open source minded.

    – Robot

  13. simpleavr says:

    @Robot
    i think it’s really the availability of open source tools and the fact that AVRs are more easily accessible that makes them popular. lately i do more w/ TI’s msp430s, with the G series value line available (LaunchPad, etc) and more mature linux toolchain, i am sure we will see more projects on the ti platform.

  14. sneakypoo says:

    I’m not an expert so feel free to correct me here. In response to Rob T from a Microchip perspective:
    1. Can’t add anything here
    2. PICs can also be programmed in circuit and unlike AVRs you can’t really “brick” them (they don’t need high voltage to fix configurations mess ups)
    3. Doesn’t apply
    4. Some may find that a good thing, others like myself prefer the massive amounts of option Microchip offers. Nothing stops you from using just a handful of chips that you like but you also have to option to get very specific chips for your application.
    5. Not sure what the function of avrdude is but as far as programmers go the PICKit 2 (or 3) is dirt cheap and handles the majority of PICs out there.

    In general though, pick the platform that you feel comfortable with. They all do basically the same thing, some are better at some things, others are better at other things. Don’t get caught up in the “fan war” and keep an open mind.

  15. sneakypoo says:

    Please disregard the multitude of spelling/word errors in my previous post… that’s what I get for being lazy and not reading through my own text before posting.

    HaD, give us the ability to edit, please!

  16. Gdogg says:

    +1 for ninth grade grammar.

  17. r_d says:

    @sneakypoo:
    “PICs can also be programmed in circuit and unlike AVRs you can’t really “brick” them”
    Although HaD might have you believe that AVR fuse bits go awry if you so much as look at them funny, it’s a pretty uncommon problem if you can read a data sheet.
    “Not sure what the function of avrdude is but as far as programmers go the PICKit 2 (or 3) is dirt cheap and handles the majority of PICs out there.”
    AVRDude is actually some front-end software for a bunch of programmers. “Front-end” might not be the best choice of words, as it can do some pretty low-level stuff like parallel-port bit-banging, but I think you get the gist of it. It’s a command-line tool that interfaces with programming hardware. It’s effectively a single de-facto standard for AVR programming software.
    The issue here isn’t necessarily price, but availability and convenience. Yeah, you might be able to pick up some commercial PIC programming hardware for cheap, but an AVR can be programmed with a parallel cable and three resistors, and more sophisticated DIY plans are available (USBTinyISP, etc.) that are both well-tested and well-supported. I’m not big on trusting manufacturers for support, and commercial programming hardware is a liability as far as I’m concerned.

    But that’s really just my opinion as a hobbyist and free software goon.

  18. Frank says:

    “if your trying to program”
    “Make sure your careful”
    “so if your interested”

    Christ! That’s 3 fails in quick succession. Please check this site out –

    http://www.youryoure.com/

  19. therian says:

    @r_d
    you can just as well program most PICs with three resistors, but it inconvenient so microchip offer probably the cheapest in price and richest in features programmer/debugger on the marked. And belive me microchip have great support they know engineers have no time on BS like this

  20. fdawg4l says:

    @Frank

    I was cringing at every instance. Thank you for beating me to the punch.

  21. kernelcode says:

    @The AVR vs PIC crowd:
    Bravo on the flame-free discussion! I use AVRs because I could get a USBasp programmer for £10, whereas the PICkit2/3 (I forget which) was nearer £40. Though saying that, I have since used a PICkit 3 at uni and must admit the breakpoints/debugging capability of MPLAB(? is that what it’s called?) and a PICkit was pretty useful.
    The thing that clinched it for me was avr-gcc (etc), seemed like there was much more available for AVR + linux than PIC + linux.

  22. simpleavr says:

    @kernelcode
    that’s how i got into avr’s (at90s1200 back then) w/ a diy parallel port programmer, it’s very affordable to begin exploring.
    you might now consider the ti msp430, decent msp430-gcc tool-chain, mspdebug (avr-dude equivalent) and a $4.30 launchpad usb programmer w/ debugging support, plus two 16bit MCUs.
    hack-a-day has good tutorials on it.

  23. Spork says:

    I do EE at work regularly and we work with PICs/AVRs/Arduinos/ARMs and sometimes just good old transistor logic. It’s really all about picking what fits your needs the best… or if you’re a hobbyist (like I had been for years prior to this job) it’s all about making what you have work for everything.

  24. Daid says:

    About the AVR ‘bricking’ and needing high voltage programming. It’s impossible to disable the low voltage ISP with only low voltage ISP. So you cannot brick them like that!

    Straight from the ATMega32 datascheet, page 257, Note 1: “The SPIEN Fuse is not accessible in SPI Serial Programming mode.”
    The ATTiny45 might be an exception on this, but in general you cannot ISP brick your AVRs.

    You can enable an external crystal and don’t have one on your board, that ‘bricks’ them, but by adding a crystal on your programmer that’s easily solved.

  25. bogdan says:

    You can brick them if you make the reset pin a generai IO. This way you cannot program them via ISP, even though ISP is enabled.
    But i keep a general rule not to disable the reset. I’ll neved know when i’ll need an extra micro for a project and have to ‘steal’ from an old one.

  26. smoker_dave says:

    You can brick the AVR if you set the fuse setting to external but do not have an external oscillator! Even so, if you have a sig gen knocking about you can still get it back online.

    I have actually used both PIC and AVR for hobby and professional use. I like both. The Atmel rep came the other week and gave me a load of free goodies (including AVR dragon) which is always a bonus!

    I will say however that there are people in industry who I have heard saying AVR are not as robust as the PIC. This was in terms of passing EMC requirements for products placed in an industrial market.

    In terms of functionality, ease of use etc they are almost identical.

  27. Fallen says:

    It’s a shame there isn’t more PIC articles, I kinda like the little buggers.
    The PICkit2 is dirt cheap too, and makes programming a breeze.

  28. kernelcode says:

    @simpleavr
    Yeah saw that when it was first released – almost jumped on it straight away but the lack of linux support (initially) kinda scuppered me. Plus the fact I’m in the UK. Anyhow, it’s probably worth me having another look!

  29. Lizardboy says:

    Well the number one reason for avr over pic for me is Bascom I write most simple programs in it and would switch chips to use it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 96,376 other followers