问题描述
好吧..我一直在网上搜索很多地方..但是我找不到解决问题的方法.上一次我使用AVRISP2时,它运行良好.现在,当我尝试在uC上编写程序时,收到以下消息:
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?
我已经检查了引脚,更新了ISP的固件(blinkdemo可用).
I already checked the pins, I updated the firmware of the ISP (blinkdemo works).
谢谢您的提示.
推荐答案
我和我的一些朋友花了很多时间,但经过数小时的搜索,尝试和调试",我们才得以解决问题.我希望这可以帮助遇到相同问题的其他人解决.
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.
问题在于,ISP(在我的情况下为USB-Prog 3.3)与仅以1MHz速度运行的Atmega8通话速度太快.因此,有两种可能的解决方案:
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:
- 降低ISP的速度
- 加快Atmega8的速度
我在某处发红了声言,即ISP不得超过底层微控制器速度的1/4.
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:
它将Atmega8设置为8MHz,并赋予它64ms的频率来旋转该频率.
avrdude -p atmega8 -P usb -c avrispv2 -U lfuse:w:0xe4:m -U hfuse:w:0xd9:m -B 22
这是avrdude联机帮助页的摘录:
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.
此外,我想推荐Android版 AVR保险丝计算器-对于微控制器程序员来说,它似乎是一个非常有用的工具.
Additionally I want to recommend AVR Fuse Calculator for Android - it seems to be a very useful tool for microcontroller-programmers.
这篇关于AVRISPmkII连接状态:未知状态0x00的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!