A few days ago, we started to upload our program into the atmega2560 chips, but we found that the results are quite diffeerent on periodical running time. By measuring, we found that the system is 16 times slower than our expectation. Later on, we found that the system clock is 1Mhz and we were using the default fuse setting.
However, I mistakenly configured the fuse setting as External Clock (which should be External Crystal Clock). After that, I cannot comminicate with the atmega2560 chips through avrisp2 cables, so that I cannot even reconfigure the fuse setting again.
Fortunately, I found a work around to do this.
http://www.larsen-b.com/Article/260.html
However, I think the program to generate 1MHz clock in previous webpage is not good so that I found the following page to do this.
http://www.bot-thoughts.com/2011/06/generate-clock-signal-with-avr-atmega.html
And my code is listed here,
#include <avr/io.h>
int main(void)
{
TCNT1 = 0;
OCR1A = 8;
TCCR1A |= (1<<COM1A0);
TCCR1B |= (1<<WGM12);
TCCR1B |= (1<<CS10);
DDRB |= _BV(1);
while (1){
// Place your code here
};
return 0;
}
There is also one Chinese forum post about this.
http://www.ourdev.cn/bbs/bbs_content_all.jsp?bbs_sn=3762261

作者遇到Atmega2560芯片在不同运行周期下表现不一致的问题,发现系统时钟频率仅为1MHz,且误配置了外时钟设置导致无法通过AVR ISP电缆通信。通过工作-around方案和找到生成1MHz时钟信号的方法解决了问题。
5586

被折叠的 条评论
为什么被折叠?



