Welcome! Log In Create A New Profile

Advanced

Can't get AVRISP MKII to work -- PLEASE HELP

Posted by Cain 
Can't get AVRISP MKII to work -- PLEASE HELP
April 22, 2011 11:44AM
I'm having a lot of problems getting my AVRISP MKII to function. I'm trying to set the fuses/upload the bootloader to my atmega644P for the generation 7 electronics.

I've connected the programmer, powered up the board, and both lights on the programmer are green.

I typed in
./avrdude -C ./avrdude.conf -c ?
in the arduino hardware/tools directory to find my programmer, but there are two entries for the AVRISP MKII (They are avrisp2 and avrispmkII).

If I decide to use either of them and type in
./avrdude -C ./avrdude.conf -c avrispmkII -p atmega644p -P /dev/ttyACM0 \
    -B 5 -U lfuse:w:0xF7:m -U hfuse:w:0xDC:m -U efuse:w:0xFF:m

I only get this error:
avrdude: ser_open(): can't open device "/dev/ttyacm0": No such file or directory

If I replace /dev/ttyacm0 with usb: (I have no idea if I'm supposed to do this?), it says permission denied. If I add a sudo infront of that, however, I get this error:

avrdude: stk500v2_command(): command failed
avrdude: initialization failed, rc=-1
double check connections and try again, or use -F to override this check


If I add the -F to override that check, I get:

avrdude: stk500v2_command(): command failed
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions

avrdude: Device signature = 0xffffff
avrdude: Yikes! Invalid device signature
avrdude: Expected signature for ATMEGA644P is 1E 96 0A
avrdude: reading input file "0xF7"
avrdude: writing lfuse (1 bytes):
writing | 0% 0.00s ***failed;
writing | 100% 0.06s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xF7:
avrdude: load data from input file 0xF7:
avrdude: input file 0xF7 contains 1 bytes
avrdude: reading on-chip lfuse data:

reading | 100% 0.00s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0xF7 != 0xFF
avrdude: verification error; content mismatch

avrdude: safemode: lfuse changed! was f7, and is now ff
would you like this fuse to be changed back? (Y/N)

I can't understand any of this. It says the fuse was changed, but what it says it changed to was what it was originally, and it says it changed from what I wanted it to change to. I've followed all the instructions on the gen7 wiki.

What am I supposed to do here? Where did I go wrong?
Re: Can't get AVRISP MKII to work -- PLEASE HELP
April 22, 2011 09:49PM
I assume you are using windows?

replace /dev/ttyacm0 with the com port ie: COM4
Re: Can't get AVRISP MKII to work -- PLEASE HELP
April 23, 2011 02:13AM
I've been trying under ubuntu 10.0. Is there a package I'm missing or something?
Re: Can't get AVRISP MKII to work -- PLEASE HELP
April 23, 2011 04:13AM
Quote

avrdude: ser_open(): can't open device "/dev/ttyacm0": No such file or directory

/dev/ttyACM0 and /dev/ttyacm0 are two different names. You probably have the one with upper case letters.

Using -F doesn't help to work around misconfigurations ;-)

I also had cases where the Ubuntu driver was messed up to a point requiring a reboot, one of the programmer LED turns always red on connection attempts, then.

If that still doesn't help, try increasing the -B value. This slows down the communication speed. A slow success is always better than a fast failure smiling smiley


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Can't get AVRISP MKII to work -- PLEASE HELP
April 23, 2011 05:39PM
That was not a direct copy and paste, I typed it with the laptop sitting next to me. I've only ever tried using /dev/ttyACM0, usb, and usb:32 (32 being the last 2 digits of the programmer's serial number).

The -B value doesn't change anything, I've tried 5, 10, 100 and 1000. It all comes up with the same error. I'm thinking of ordering another ATmega644p just to be sure I didn't accidentally kill it somehow.

What I believe happened is, I installed AVRstudio on my windows computer, and found a random guide on the internet on how to use that to upload the bootloader. I did this, the programmer flashed and everything looked good and said it worked. Except I'm almost certain that I didn't change the fuses in AVRstudio before uploading the bootloader.

I'm going to try to use AVRstudio on my windows machine again and see if it works to do anything. Is there any way to upload arduino sketches (The firmware) with avr studio too?

And how would I go about setting the fuses in avr studio? from what I've seen, there's a bunch of check boxes. The wiki has some crazy capital and lowercase letters and numbers, how do I translate the two?
Re: Can't get AVRISP MKII to work -- PLEASE HELP
April 24, 2011 07:03AM
Well, "No such file or directory" is pretty clear: the device file doesn't exist (with that name). You can check that with a simple, plain "ls". If you put in the USB plug, the file appears, if you pull it out, it disappears. No magic.

No idea about AVR Studio. Never used it.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Can't get AVRISP MKII to work -- PLEASE HELP
April 24, 2011 06:32PM
I know that, perhaps I phrased my question wrong. I'm using a USB programmer. Therefore, would I still use "/dev/ttyACM0" or would I type "USB"?

Arg....

This is starting to drive me insane...if I can't get this to work, for whatever reason, how much would you sell an atmega644 with the bootloader/fuses set, ready to have the firmware uploaded? Starting to lose hope in fixing this...
Re: Can't get AVRISP MKII to work -- PLEASE HELP
April 25, 2011 04:22AM
Quote

I'm using a USB programmer. Therefore, would I still use "/dev/ttyACM0" or would I type "USB"?

My programmer is an USB one, too, and the device is /dev/ttyACM0. There's also /dev/ttyACM1, which is usually the USB-to-TTL converter also on that tiny board. Perhaps the numbering is exchanged in your setup?

BTW., I'm using this one: [www.pololu.com]

Quote

how much would you sell an atmega644 with the bootloader/fuses set, ready to have the firmware uploaded?

That's € 7,- for the ATmega plus € 5.- shipping. I can put on some firmware, hope you can solve your situation, though.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Can't get AVRISP MKII to work -- PLEASE HELP
April 25, 2011 11:13AM
Alright, thank you. I can't even get my programmer to work under windows now, even with the atmel drivers it just won't connect under avr studio. I'm going to try for a little while longer, but if it still doesn't work I'm thinking I'll try to return it, and get the one from pololu that you have (So I know it works, at least...).

If i can't get it to work, I'm definitely buying one from you. This is the last obstacle in my way of getting my mendel running smiling smiley
Sorry, only registered users may post in this forum.

Click here to login