AVR programmer modelled after the MkII – uses LUFA

Here’s a new option for building your own AVR programmer. It’s called the MkII Slim and the diminutive size makes it live up to its name. The design is rather spartan, using just three chips; a voltage regulator, a MAX3002 level converter, and an Atmel AT90USB162 as the main microcontroller. This chip has a built-in USB module, foregoing the need for a separate FTDI chip.

The firmware is built on the Lightweight USB Framework for AVRs (LUFA). This is a USB stack implementation originally called MyUSB that was developed by [Dean Camera]. Regular lurkers over at the AVRfreaks forums will recognize [Dean’s] name, or his handle [abcminiuser] as a source for many of the high quality AVR tutorials found there. But we digress.

The programmer offers all the features you’d want in an In-System Programmer. It can easily be reflashed with future updates thanks to the bootloader running on the chip. There’s jumper-selectable power options, and it can program targets running at 3.3V or 5v. The full development package including code and artwork is available for download at the site linked above. For your convenience we’ve embedded the schematic after the break.

20 thoughts on “AVR programmer modelled after the MkII – uses LUFA

    1. Two notable differences:

      1) The USBtinyISP implements its USB interface by bit-banging i/o pins on a non-USB AVR. This is generally reputed to work, but could theoretically be unreliable under certain conditions. The AT90USB162 in the MkII Slim has a real hardware USB interface.

      2) The USBtinyISP is a product that you can buy in kit form. If you want a MkII Slim, it looks like you’ll need to build it yourself!

      For your second question, the MKii Slim is a clone of Atmel’s AVRISP mkII programmer:


      As noted, it is compatible with AVR Studio.

  1. Off topic, but sorta related,

    For those looking for a cheap and easy programmer that works well with AVR Studio, I swear by this guy for all my needs. Cheaper then adafruit’s usbtinyisp, smaller and no assembly required. I buy enough to just embed them into my projects and connect USB whenever I want to upload a new flash.

    But this post is a cool choice for build-your-own.

      1. Thanks for the linkage. I really like the SLO-scope functionality designed into the device, and especially the fact the maker has made all of the source code publicly available. I tallied about $12-15 for the programmer outlined in this article, but $20 for a slightly-better, ready-made product really ain’t bad!

  2. Great project, but on the other hand, the original is only 34$ with a nice enclosure, and no stress about SMD soldering.

    Not sure it’s so interesting.

    I used to like this kind of projects but I finally prefer to trust my tools and focus on my developments

    1. Unfortunately not, because Atmel’s DebugWire protocol is proprietary and undisclosed. And while the Dragon is only $50, you get what you pay for: combined with avrdude and avarice it’s unreliable and irritating to develop with – single stepping alone can take 3 seconds per instruction. I usually have to unplug and re-plug my Dragon more than 10 times a day when developing for AVR, just to reboot it :-(

      If you want real debugging, use an ARM Cortex-M0/M3 – ARM publishes all the debugging specifications and both SWD hardware interfaces and software debuggers are widely available.

      As for this build, including ISP, PDI /and/ TPI is excellent! It wasn’t that long ago that I had to bit-bang TPI myself to program an (unsupported) ‘tiny10 chip.

  3. If you want to debug, you need a JTAG capable device. Save your pennies and get a JTAGICEmkii-CN from MCUZone in China (I have one and it’s under US$100 delivered and nifty as hell) or a cheaper AVR-JTAG-USB from Olimex – either will work well in AVRStudio4. Programmers like this are simply for reading or writing the flash memory and EEPROM. That’s great if you’re into large production of Atmel based boards or need to do in-field reprogramming but of dubious value to the solo hacker and developer.

  4. No, rather save your pennies and begin using the MSP430. The “Launchpad” is only $4,30, INCLUSIVE WORKING in-system debugging with breakpoints and everything you dream for :-)

    The TI tools are quite good (though there is a code size limit for the free edition of around 16KB, and it is not available for linux).

    In Linux you can use “mspdebug” and “mspgcc”, though they are still in development and not 100% stable (but they are getting better every day)

  5. Great
    I have good background in FPGA ,but i’m new to avr. so i decide to create my own programmer. i want to build the best programmer. I think your case is super great.
    but my question: why there is no code for micro controllers?how you program it? could you explain it?

      1. Hey, you need to download the full latest LUFA package and unpack it. When that’s done, you need to set up all the dependencies than are needed to compile the LUFA projects. When that’s done, you need to enter the LUFA/Projects/AVRISPmkII directory and “make” the project, if the make is successful and no errors show up, you need to flash the .hex on the chip and you’re done :)

        Also notice that when you’re on Windows 8.1 like me, and you want to use this AVRISP mkII clone with AtmelStudio 6 then you need to “update driver” in device manager, and then point it to the Program Files/Atmel/Atmel USB/ folder and select “let me pick from a list, then select Jungo and next, then you select the driver from the list and click “Have disk” and point it to “Program Files/Atmel/Atmel USB/usb64/” and select the .inf file there, it will prompt you, but then you agree and say yes and there you go :)

          1. It seems that in the documentation, that the AT90USB162 is a “weaker” MCU and has reduced functionality in the programmer.

            If this limited functionality is connected to my problem, I haven’t found out yet.

          2. Hey, I now got to also test programming an ATxmega128A4U. I switched to 3V3 mode and connected to the PDI connector, and in Atmel Studio 6 tried to read signature, but cannot. Also cannot read signature of ATxmega32A4.

            Any ideas ?

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