2009年7月12日 星期日

BASCOM-AVR 教程(1)

BASCOM-AVR 是我用過許多 AVR Compiler 最適合入門, 最快上手的.
  • 安裝

下載 BASCOM-AVR 免費版

http://www.mcselec.com/index.php?option=com_docman&task=doc_download&gid=139

解壓 再執行安裝.

記住安裝完成反後要重新 BOOT 機 (Restart Windows).

  • 第一次運行

在程式表中選取 :

會看見這樣 (當然要先關掉沒用的 TIPS 方塊)

開一新檔案

輸入這程式
$regfile = "m8def.dat"
Config Portb = Output
Portb = 0
    While Portb <> 128
        Portb = Portb Xor 255
    Wend
End

然後按 Compiler Icon
按 Simulate Icon
開啟 I/O Window
連續按單步執行可看到 PORTB 的變化.
1

沒有留言:

張貼留言

 
Free URL Redirection @ .co.nr