AVRISPmkII connection status: Unknown status 0x00
Asked Answered
W

3

8

Well.. I've been searching on the web in many corners.. but I could not find a solution to my problem. Last time I used my AVRISP2 it worked fine. Now I get the following message when I try to write my program on the uC:

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 found many posts on the internet but there weren't any solutions. Does anyone know what the problem might could be?

I already checked the pins, I updated the firmware of the ISP (blinkdemo works).

Thank you for any hints..

Woolson answered 9/3, 2013 at 16:46 Comment(2)
Are you sure the baudrate is correct?Cordie
The problem isn't that I can't reach the Atmel I actually want to program.. the problem is the Atmel on the ISP. It is possible to write the firmware onto the chip but avrdude doesn't get any response from it when he wants to program my actual controller..Woolson
W
8

It took some friends of mine and me a lot of time but after hours of searching, trying and "debugging" we were able to fix the problem. I hope this helps other people who got the same problem to solve it.

The problem was that the ISP, in my case the USB-Prog 3.3, was talking too fast to my Atmega8 which was only running at 1MHz speed. So there are two possible solutions:

  • slow down the speed of the ISP
  • speed up the speed of the Atmega8

I red somewhere, that the ISP must not be faster than 1/4 of the speed of the underlaying microcontroller.

The following lines saved my day:

It sets the Atmega8 to 8MHz and gives it 64ms to spin up that frequency.

avrdude -p atmega8 -P usb -c avrispv2 -U lfuse:w:0xe4:m -U hfuse:w:0xd9:m -B 22

Here is an excerpt of the avrdude manpage:

`-B BITCLOCK'
        Specify the bit clock period for the JTAG interface or the ISP
        clock (JTAG ICE only).  The value is a floating-point number in
        microseconds.  The default value of the JTAG ICE results in about
        1 microsecond bit clock period, suitable for target MCUs running
        at 4 MHz clock and above.  Unlike certain parameters in the
        STK500, the JTAG ICE resets all its parameters to default values
        when the programming software signs off from the ICE, so for MCUs
        running at lower clock speeds, this parameter must be specified on
        the command-line.

Additionally I want to recommend AVR Fuse Calculator for Android - it seems to be a very useful tool for microcontroller-programmers.

Woolson answered 10/3, 2013 at 0:48 Comment(4)
I am going to do that but I have to wait for 2 days until I can mark my own answer as resolved..Woolson
I went into the same problem avrdude -p atmega1284p -P usb -c avrisp2 -U lfuse:w:0x62:m -U hfuse:w:0xd9:m -B 12 this awnswer did not resolve the issue any pointers?Slaw
I'm afraid that I am not able to help you since I didn't find the time to get deeper into this. If you are sure that your ISP and your AVR are communicating at the correct speed then the error might be somewhere else.Woolson
Thanks, BITCLOCK is giving me errors on some boards too.Thereinafter
A
1

Another (common?) problem might be a missing crystal when trying to flash directly on a breadboard. I forgot this twice already and also got this error message. So apart from connecting the ISP pins, also make sure to connect a crystal plus capacitors to XTAL1 and XTAL2 pins of the ATmega if it's configured to use an external oscillator (see the ATmega's datasheet).

Australopithecus answered 21/12, 2017 at 10:52 Comment(0)
P
0

First of all I would recommend you to check the microcontroller itself. I've got the same error message and I found that my Atmega has been damaged. Swapping for the new one fixed the problem.

Penoyer answered 18/8, 2015 at 12:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.