AVRISP mk2 clone can program Arduino Uno, but not stand-alone ATMega328P

avrispshort-circuit

I have an AVRISP mk2 knock-off that I can't get to work.

Scenario 1: AVRISP mk2 clone vs. Arduino Uno: works

If I take an Arduino Uno, and plug the 6-pin ICSP cable of the AVRISP onto it, one of two things happen, both as expected:

  • The cable is plugged in in the correct orientation, and I can use avrdude to query fuse status and upload .hex files

  • The cable is plugged in reversed, and an orange light in the AVRISP starts flashing

Scenario 2: AVRminiProg vs. ATMega328P on breadboard: works

Moving on, I have put an ATMega328P on a breadboard, connecting power/ground, and using jumper wires to connect the Reset and MOSI/MISO/SCLK pins to a 6-pin ISCP cable. I then take an AVRminiProg, plug in the other end of the ISCP cable, and hook up power/ground (unlike the AVRISP, the AVRminiProg supplies 5V on its own to the system under programming). I can measure the 5V on the breadboard, the ATMega328P works as expected, and I can use avrdude to query fuses / upload programs.

Scenario 3: AVRISP mk2 clone vs same breadboard: doesn't work

The above two steps were just diagnostic; my actual goal is to use the AVRISP to program the ATMega328P on a breadboard, so I can supply my own voltage (my aim is to use 3.3V). So I take the same ISCP cable as in scenario 2, but plug it into the AVRISP instead of the AVRminiProg. I also attach 3.3V (from an Arduino Uno since that's already on the desk) to the breadboard.

However, the orange LED in the AVRISP immediately starts flashing, as if the cable orientation was wrong; even though the same orientation worked just fine for the AVRminiProg. If I try to swap just power and ground, it still doesn't work, but I get the voltage between them to drop to almost nothing.

In my desperation, I've actually ended up downloading the PCB design of the Uno to track the ICSP pins to make sure I am wiring stuff correctly. However, it seems if I just connect power and ground, and nothing else, and both the same way as they are in the Arduino Uno, to the AVRisp mk2, I already get the orange blinking. Yet connecting the same AVRisp mk2 to the ICSP pins on the Uno itself, it works as expected.

What am I doing wrong?

Best Answer

I had a similar experience before wherein I was using the AVRISP MK2 for a project. I was programming an Atmega32 with it and had shorted it by mistake. So initially, I tried burning a small code on the Arduino Uno with it and it worked quite well. But with the AVR it still wasn't working. So I borrowed a USBasp from a friend and tried burning the code on the AVR and it worked perfectly fine. So I wrote a mail to Atmel describing the problem and they had replied that there could be a chance that since the arduino IDE uses avrdude to burn the bootloader, it maybe using a different driver for the ISP. Anyways they suggested that the AVRISP MK2 may be malfunctioning and asked me to replace it.