jxchen 发表于 2015-4-20 19:11:27

AVR EXTERNAL CLOCK 設定問題

使用CVAVR 編譯,程式編譯皆正常,我接外部crystal,但燒錄fuse,依據data sheet use external clock must programmer cksel "0000",為何程式沒有跑起來
依據data sheet 配置外部震盪器,xtal2 pin 他是NC,我就不懂了,我的程式只有單純對 IO PORT 填 0 或 1,能否幫忙看看問題點出在那




#include <mega2560.h>
#include <delay.h>


// Declare your global variables here
                                                         
void main(void)
{

// Crystal Oscillator division factor: 1
#pragma optsize-
CLKPR=0x80;
CLKPR=0x00;
#ifdef _OPTIMIZE_SIZE_
#pragma optsize+
#endif

// Port H initialization
// Func7=In Func6=Out Func5=Out Func4=In Func3=In Func2=In Func1=In Func0=In
// State7=T State6=0 State5=0 State4=T State3=T State2=T State1=T State0=T
PORTH=0x0;
DDRH=0xff;      //data direction register of port h
}
while (1)
       {
       // Place your code here
      
       PORTH=0x00;
       delay_ms(100);
       PORTH=0xff;
       delay_ms(100);
       };
}

sbk100 发表于 2015-4-20 22:46:49

外部晶振多大?JTAG还是ISP下载?

jxchen 发表于 2015-4-20 23:11:23

本帖最后由 jxchen 于 2015-4-20 23:13 编辑

sbk100 发表于 2015-4-20 22:46
外部晶振多大?JTAG还是ISP下载?

是JTAG INTERFACE
我已經稿定了,是我會錯意, 應該是看Data sheet 10.4章節 Low power crystal oscillator
相關fuse設定如附件
页: [1]
查看完整版本: AVR EXTERNAL CLOCK 設定問題