Need help using AVR ISP MKii with Duemilanove

Guys, Attempting to put bootloader into 328P on a Duemilanove with AVR ISP MKii and IDE 1.0. Board is powered from USB connector.

Getting this back when I try. What am I missing? Thanks

C:\Arduino-1.0\hardware/tools/avr/bin/avrdude -CC:\Arduino-1.0\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -cstk500v2 -Pusb -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m

avrdude: Version 5.11, compiled on Sep 2 2011 at 19:38:36 Copyright (c) 2000-2005 Brian Dean, Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "C:\Arduino-1.0\hardware/tools/avr/etc/avrdude.conf"

Using Port : usb Using Programmer : stk500v2 avrdude: usbdev_open(): did not find any USB device "usb"

I had previously use AVR studio 5.1 to attempt to put a bootloader in:


AVR Studio reads this:

BODLEVEL - Disabled SPIEN - checked BOOTSZ - 2048W_3800 CKDIV8 - checked SUT_CKSEL - INTRCOSC_8MHZ_6CK_14CK_65MS

Fuses: FF D9 62

Lock bits - all show NO LOCK Lock bit register: 0xFF

Does AVR Studio have the port in use? Are you saying you can read the chip with AVR Studio?

You could give my bootloader-programming sketch a workout:

That will help iron out any bugs. :)

“Does AVR Studio have the port in use? Are you saying you can read the chip with AVR Studio?”

Yes, I got all the info I posted from AVR Studio.

Not sure what you mean by “port in use”.

I was using the MKii so as not to have 2 Arduino’s set up.
I don’t think I actually have any working '328 chips at the moment, need to get one programmed before I can do anything.
Whole tube of blank parts on hand!

CrossRoads: Not sure what you mean by "port in use".

The first stuff you posted looks like you either ran avrdude from the command line, or from within the IDE.

If you also have AVR Studio running it may "own" the USB port to the chip.

Yes, I tried burning from the IDE as well.

I did not have the IDE and AVR Studio both running when I tried. Only 1 at a time.

AVR Studio recognizes it did you say? Can't you upload the bootloader through that?

I can get a bootloader installed, just doesn’t seem to work.
Flashes 3 times quick on reset, so I’m thinking maybe the clock selection isn’t quite right.

With these fuses:

Erasing chip …
Writing bootloader …
Committing page starting at 0x7E00
Committing page starting at 0x7E80
Committing page starting at 0x7F00
Committing page starting at 0x7F80
Verifying …
No errors found.
Writing fuses …
LFuse = 0xFF
HFuse = 0xDE
EFuse = 0xFD
Lock byte = 0xCF

Results in:

BOOTSZ = 256W_3F00

EXTENDED = 0xFD (valid)
HIGH = 0xDE (modified)
LOW = 0xFF (valid)

High of DC changes BOOTSZ to 512W. Tried other sizes also.

I am just stumped as to why I can’t get serial download to work after the bootloader seems to have successfully loaded onto a stock Duemilanove.
There are 55 clock choices. Best I seem to get is 3 quick flashes after the bootloader is in.

The Optiboot is 512 bytes (0x7E00 to 0x8000) - that is, 256 words. I gather you have the 328 version of the Duemilanove. Does it have the 16 MHz crystal?

The fuses look right. I've been using my uploader on a number of boards (I don't have Duemilanove) without any issues.

Is there something wrong with the USB interface?

Hmm, let me try changing cables, see if that helps.

No, that didn't help. I see it resetting a bunch of times. Both Tx and Rx flash a few times, never gets into that steady dual flashing tho. Both cables do the same.

What board do you have selected in the IDE?

After I used the uploading sketch to put Optiboot on this board here:

I had to select “Arduino Uno” in the IDE, and then I could upload a sketch (with a FTDI cable).

I've been using Duemilanove. Will try Uno...

Dang, that worked! Thanks Nick :)!!

Yep the poor thing thinks it's a Uno now. It's had a personality change. :)

It works tho, that’s what I needed.
Wonder why the IDE cares whether its downloading to an Uno vs a Deumilanove? Functionally, I don’t care.

Here’s a pic of the setup, unpowered. Got a couple of 3mm blue LEDs, things are way too bright with 120 ohm resistors, need to change those.

Now to write some code to receive bytes from the serial interface, update a 12x8 array, and multiplex some LEDs.
Well, as soon as the resistors arrive to be installed, and the array gets gets wired up …


Wonder why the IDE cares whether its downloading to an Uno vs a Deumilanove? Functionally, I don't care.

Simple, the boards.txt file shows the definitions for both the Deum and Uno boards and clearly shows they talk at different baudrates, so the IDE is selecting the wrong baudrate to attempt a upload if you select a Deum board with a target that has a Uno bootloader installed and visa versa of course.


Thanks for that Lefty. Just a couple too many pieces to keep track of it seems. I guess I need to make a list of all the bits that need to be in sync.