Re: 請問使用ram的巨大矩陣的使用方法?
|
||||
---|---|---|---|---|
新會員
|
我的問題解決了,在linker script的STACK SIZE=0x100
RAM=gpr1<=改成“1”就可以了,雖然不太知道為什麼,但是 改過就可以compile了。 程式修改如下: linker script: ACCESSBANK NAME=accessram START=0x0 END=0x7F DATABANK NAME=gpr0 START=0x80 END=0xFF DATABANK NAME=gpr1 START=0x100 END=0x1FF DATABANK NAME=hugestuff START=0x200 END=0x3FF ROTECTED DATABANK NAME=gpr4 START=0x400 END=0x4FF DATABANK NAME=gpr5 START=0x500 END=0x5FF ACCESSBANK NAME=accesssfr START=0xF80 END=0xFFF SECTION NAME=HugeObj RAM=hugestuff STACK SIZE=0x100 RAM=gpr1 SECTION NAME=HugeObj RAM=hugestuff ps: 希望有高手能出c18 compiler的書,這樣使用者就能方更地使 用c18了,不需要東翻西翻地找問題的解答。
發表於: 2005/4/6 12:21
|
|||
|
請問使用ram的巨大矩陣的使用方法?
|
||||
---|---|---|---|---|
新會員
|
我將w401的“記憶體管理 資料陣列的擴展- 範例”compile,發
現array超過256byte後就compile不過,請問要如何使用 mcc18 的巨大矩陣。 請高手幫幫忙!! compile過的程式: #pragma udata HugeObj //select HugeObj section static unsigned char ***Array1[256]***; //define array #pragma udata //return to default udata section unsigned char *Ptr1; //define array pointer (16-bits) void main(void) { unsigned int Count; //define counter variable Ptr1 = Array1; //initialize pointer for (Count=0x00; Count<0x200; Count++) { Ptr1[Count]=0xFF; //set array element to 0xFF }} compile不過的程式: #pragma udata HugeObj //select HugeObj section static unsigned char ***Array1[512]***; //define array #pragma udata //return to default udata section unsigned char *Ptr1; //define array pointer (16-bits) void main(void) { unsigned int Count; //define counter variable Ptr1 = Array1; //initialize pointer for (Count=0x00; Count<0x200; Count++) { Ptr1[Count]=0xFF; //set array element to 0xFF }} 錯誤訊息: MPLINK 3.92, Linker Copyright (c) 2005 Microchip Technology Inc. Error - section 'HugeObj' can not fit the section. Section 'HugeObj' length=0x00000200 Errors : 1 PS: 我有試著把pic“f452.lkr”的“linker script”改成和投影片的內容相同,但是還是不行compile不過。 linker script: ACCESSBANK NAME=accessram START=0x0 END=0x7F DATABANK NAME=gpr0 START=0x80 END=0xFF DATABANK NAME=gpr1 START=0x100 END=0x1FF //DATABANK NAME=gpr2 START=0x200 END=0x2FF //DATABANK NAME=gpr3 START=0x300 END=0x3FF DATABANK NAME=gpr4 START=0x400 END=0x4FF DATABANK NAME=gpr5 START=0x500 END=0x5FF ACCESSBANK NAME=accesssfr START=0xF80 END=0xFFF DATABANK NAME=hugestuff START=0x200 END=0x3FF PROTECTED SECTION NAME=HugeObj RAM=hugestuff
發表於: 2005/4/6 10:10
|
|||
|