Programming attiny85 with AVRISP mkII and Arduino IDE

Hello all,

I'd like to program an attiny85, but I've had a large number of problems making it happen so far :frowning:

I recently bought one of Sparkfun's USB tiny programmers, but have found that it doesn't work on my newish macbook because it's incompatible with USB3.0 ports. So, that was attempt #1.

I've borrowed an AVRISP mkII and I'm trying to use that to program the attiny directly. I've breadboarded the attiny85, and used jumper cables to connect pins on the ISP Header to the Attiny using these images as a guide:


I selected "AVRISP mkII" as the programmer in the Arduino IDE, and tried to load the Blink Example sketch. I received the error:

avrdude: stk500v2_command(): command failed
avrdude: stk500v2_program_enable(): bad AVRISPmkII connection status: MOSI fail, RST fail, SCK fail, Target not detected
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

I'm not really sure what this means, and I can't find any obvious resources online that are using both the Arduino IDE and the AVRISP mkII. Does anyone have advice for how to get these two things working?

thanks!

Make sure you have power, MKii does not power the device.

Make you have MKii driver installed. Check your IDE folders for avrisp2.cat, that's the folder.

Oh, thanks! I gave the attiny +5V and GND at the appropriate pins, but I'm still getting errors. Thankfully, they're different!

avrdude: verification error, first mismatch at byte 0x0000
         0x26 != 0xff
avrdude: verification error; content mismatch

The MKii is nice and will do the job.

I am cheap and do not do many tiny projects, this always worked without failure:

Ray

What do you use a MKII for if you have lots of arduinos of different types ?
Is that something I might need ? (if so , for what ?)

What do you use a MKII for if you have lots of arduinos of different types ?
Is that something I might need ? (if so , for what ?)

CrossRoads was suggesting the MKii as I do not use one but he will probably chime in; however, a short answer:
If you are using Atmel Studio to program your Arduinos (typically with one of the "free" plugins that support Arduino), then the MKii is simply a perfect match for that environment... Atmel Studio and Atmel designed programmer... it will simply work on every chip that it supports.

So, your money for the MKii is kind of an insurance policy to avoid having to deal with the daily issues others have with the flood of other devices that call themselves programmers.

I'm very confident that the mkII will do the job, once I get it configured properly :slight_smile:

Does anyone know what would cause a content mismatch error?

avrdude: verification error, first mismatch at byte 0x0000
         0x26 != 0xff
avrdude: verification error; content mismatch

asymptoticdesign:
I'm very confident that the mkII will do the job, once I get it configured properly :slight_smile:

Does anyone know what would cause a content mismatch error?

avrdude: verification error, first mismatch at byte 0x0000

0x26 != 0xff
avrdude: verification error; content mismatch

Usually it means you have something else connected to chip pins 5,6,7 while you're trying to upload a program.

Hmm. I've re-checked the pins, but the pins are attached to MISO, MOSI, and SCK, so it seems like that should be correct.

I got it working, but I'm not entirely sure what the issue was. I tried burning the bootloader and everything started working, but I think that I should've been able to use the AVRISP without the bootloader...

'Burn bootloader' is not actually burning a bootloader. As far as I know, there is no bottloader for Attiny, it just erases the chip and sets the fuses to the selected speed.

asymptoticdesign:
I got it working, but I'm not entirely sure what the issue was. I tried burning the bootloader and everything started working

Burn bootloader sets the fuses and clock speed.

asymptoticdesign:
I think that I should've been able to use the AVRISP without the bootloader...

I think so, too.

OTOH I know that burning is more reliable at lower clock speeds. Maybe you lowered the clock speed when you did that.