• slider image 514
  • slider image 516
  • slider image 517
  • slider image 518
  • slider image 519
:::


Browsing this Thread:   2 Anonymous Users






Re: 關於C18 Compiler問題
#2
版主
版主


查看用戶資訊
陣列超過一個 BANK 時,C18 並不會自動換到下一個 Bank。必須以手動的方式修改 LKR 檔將BANK從256Bytes加大。

請參考 W401 C18 Workshop 教材第四章後面的說明,怎樣修改 LKR 檔來符合超過 256B 的陣列。

發表於: 2007/7/25 15:34
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


關於C18 Compiler問題
#1
初級會員
初級會員


查看用戶資訊
我想請問,C18在全域變數分配的問題...
我的設定如下:

#include <p18f6722.h>

unsigned char RData_0[256];
unsigned char RData_1[256];

void main(void)
{}
錯誤訊息:
Error - section '.udata_t_Main.o' can not fit the section. Section '.udata_t_Main.o' length=0x00000101
Errors : 1


若我指定給予RAM位置後,程式即正常,如下:

#include <p18f6722.h>

unsigned char RData_0[256];
#pragma udata gpr2=0x200
unsigned char RData_1[256];

void main(void)
{}

我的問題是,當變數超過一個BANK時,C18不會幫使用自動分配記憶空間嗎?需全完使用者手動指定嗎?

我有試過將 gp1~gp3 合併使用
DATABANK NAME=gpr1 START=0x100 END=0x3ff
//DATABANK NAME=gpr2 START=0x200 END=0x2FF
//DATABANK NAME=gpr3 START=0x300 END=0x3FF
執行後,c18 compiler 在run完gpr1的變數後,直接執行gpr3,並沒有切bank,以致於程式錯誤....

有方法可以解決嗎?我想讓系統白動分配記憶體。

發表於: 2007/7/23 14:08
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------