Re: 請問關於Configuration Bits的設定
|
||||
---|---|---|---|---|
高級會員
|
前幾天上完W401課程後這個問題已經解決了:
在MPLAB IDE介面中的HELP->Topics->PIC18 Config Setting中,只要選擇你使用的IC型號,裡面會詳細記載它所能設定的Configuration Bits項目及選項,接著只要在程式中以指令#pragma config編寫,就會包含在hex檔中了。 在不同點腦上燒錄這個hex檔時,只要先開啟Configure->Configuration Bits,把Configuration Bits set in code.這個選項打勾,燒錄時就會以hex檔內的設定為準。 一些小地方提供大家做參考
發表於: 2010/2/8 12:19
|
|||
|
Re: 請問關於Configuration Bits的設定
|
||||
---|---|---|---|---|
資深會員
|
試試 MPLAB 的 File->export 功能。
發表於: 2010/2/2 16:39
|
|||
|
Re: 請問關於Configuration Bits的設定
|
||||
---|---|---|---|---|
高級會員
|
找到相關資料了,Microchip有提供一份文件PIC18 Configuration Settings Addendum,裡面有各個PIC18 IC可以設定的Configuration Bits列表,只要在程式中利用假指令#pragma config應該就能達到上述的功能了。
不過PIC18 Configuration Settings Addendum文件中沒有我使用的IC(PIC18F65J50),我在CPU DIV的地方有點疑問: PIC18F65J50的文件中圖示CPU system clock divide分為1、2、3、6 因為PIC18 Configuration Settings Addendum沒有PIC18F65J50這個IC,所以我參考別顆IC的CPUDIV選項,能除頻選項卻是2、3、4、6 請問這樣子要怎麼辦?
發表於: 2010/2/2 15:51
|
|||
|
請問關於Configuration Bits的設定
|
||||
---|---|---|---|---|
高級會員
|
我最近使用C18完成了一個程式,並將HEX檔傳給朋友請他幫忙驗證,結果發現他將HEX檔寫入至手邊的IC後,執行起來速度慢了一倍。
經過一段時間的查驗,我發現是因為我們兩個在MPLAB IDE的Configuration Bits選項不同的關係,我在設計、編寫時,開啟HS+PLL及CPU DIV 2,而他收到HEX檔後在他的電腦上進行燒錄時,卻採用了沒有開啟PLL及CPU DIV的預設設定,後來我請他把Configuration Bits選項設定的與我相同,他的執行速度就正常了。 經過這次事件我發現了HEX檔並不包含這些設定,這些設定是在"燒錄時"才會被寫入IC中。 請問除了每次燒錄前與他確認Configuration Bits的設定以外,有沒有更簡便的方法,可以將Configuration Bits的內容直接包含在HEX檔中呢?
發表於: 2010/2/2 14:49
|
|||
|