Wednesday, December 18, 2013

AVRISP mkII & Arduino 1.0.5

It has been nearly two years since I wrote out the instructions to getting the mkII to work with the Arduio IDE.  After putting a new SSD into my computer, I had to do it over and things are very different but much easier.

So, here's the update:

There are plenty of reasons why you would want to use your AVRISP programmer to upload sketches to the Arduino board if you own one. In fact, it might be worth spending the $35.
  • No bootloader delay when booting.
  • Can use the serial port for something else without having to disconnect it to upload.
  • Faster.
  • Don't have to worry about which bootloader (OPTIBOOT?) and version (today v4.4) to install.
  • Can use all of the flash space on the ATmega.




Step 1: Install Arduino 1.0.5 for Windows

Visit: http://arduino.cc/
On 12/18/2013 it was located here: http://arduino.googlecode.com/files/arduino-1.0.5-windows.exe

Step 2: Install libusb-win32 from SourceForge

  1. Visit: http://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/ On 12/18/2013 the latest release was: http://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/1.2.6.0/libusb-win32-bin-1.2.6.0.zip/download
  2. Unzip somewhere.
  3. Run \libusb-win32-bin-1.2.6.0\bin\inf-wizard.exe
  4. Select AVRISP mkII
  5. And follow the instructions to create the INF and install the driver.

It should be installed correctly:

Step 3: There is no step 3, you are done.

There isn't a text file to edit or any other modifications necessary. To upload using the mkII, simply select Upload Using Programmer from the GUI:


And, you can burn the bootloader too:

So, it is as simple as that!

9 comments:

  1. I have tried this on three different computers under windows 7 64bit pro and windows 8 64bit pro, but every time, when I try to upload using the programmer or burn a bootloader, I get the following error:


    avrdude: stk500v2_command(): command failed
    avrdude: stk500v2_program_enable(): bad AVRISPmkII connection status: Unknown status 0x00
    avrdude: initialization failed, rc=-1
    Double check connections and try again, or use -F to override
    this check.

    I have tried boards of my own design which have worked in the past, as well as a brand new arduino uno and nano, plus some third party nano clone. In all cases I get the same error, yet both lights on the AVRISP Mkii are green. If I flip the connector around, one light flashes orange, and if the target board is not powered or the connector is unplugged, the light turns red, as I'd expect.

    ReplyDelete
    Replies
    1. Does your device manager details window show the same as the screenshot does in my post?

      http://4.bp.blogspot.com/-6KyL9CRgUXk/UrJ8OS_uagI/AAAAAAABZTU/N4ggo2R_3sc/s1600/2013-12-18+20_36_20-Computer+Management.png

      Delete
    2. This comment has been removed by the author.

      Delete
    3. Maybe run through step 2 again and be sure to download it directly from http://sourceforge.net/.

      I did this with a FRESH install of Win7. I know there can be issues with the MKII if you install AVRStudio first with that driver. I doubt that's the case with your setup since you see it correctly in devivce manager. Well, except for the signature.

      It is possible your MKII is bad? 3 different computers and 3 different arduinos... Maybe a bad usb cable?

      Delete
    4. Hm, I went through step 2 with the link you gave in the instructions, same as before, but the result is the same. I still get the error after restarting with driver signature enforcement disabled too. I've tried a second USB cable, though I've been able to successfully program the arduino uno with both cables.

      It could be possible that the ISP is bad, There are two more at work I can try. The libusb testlibusb-win.exe under AMD64 seems to be in order, though.

      Delete
    5. Haha, yeah, it was just a dead ISP. Thanks a million.

      Delete
  2. Just followed the instruction and it worked straight away. I can progam my ATTiny25 now that could no longer be programmed with mySmartUSB light programmer. I think the AVRISP mkII is better with respect to device power target detection. I noticed that with Atmel Studio.
    Thank you very much for this instruction.

    ReplyDelete
  3. Hmm I checked with Atmel Studio 6.1 if it successfully could connect to mkII, before I followed this instruction to make Arduino 1.0.5. work with the AVRISP mkII. Afterwards Studio could not connect to the mkII anymore. Is it either Studio or Arduino that can work with the AVRISP mkII not both with single configuration?

    ReplyDelete
    Replies
    1. Yes, that's my understanding. Studio and Arduino need two different drivers. And, when you plug in the MKII, windows can only install one driver for that one device. :)

      Delete