• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
  • slider image 488
  • slider image 491
:::


Browsing this Thread:   1 Anonymous Users






Re: 程式碼一問,使用C30 Compiler為何編譯過不了?
#6
版主
版主


查看用戶資訊
我要讀取是A/D值也可以使用PSV??

沒有必要吧! 一般 PSV 會使用在讀取 Flash 的 Table 值或 EEPROM 的值,AD 轉換後的結果是存在暫存器(RAM)裡,這樣就直接讀取就可以了,不用動到 PSV 的方式。

發表於: 2009/1/19 14:18
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 程式碼一問,使用C30 Compiler為何編譯過不了?
#5
新會員
新會員


查看用戶資訊
感謝版主的指教,因為我要讀取是A/D值也可以使用PSV??

發表於: 2009/1/19 11:16
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 程式碼一問,使用C30 Compiler為何編譯過不了?
#4
版主
版主


查看用戶資訊
”無法正確地讀到固定位址的常數””

一般在 16-bit 的應用,讀取 Table 的話使用 PSV 的映射方式會比較簡單也比較好用,讀取的速度也加倍。你可以不用知道 Table 放在哪裡你只要知道 Table 的名稱就好了。 
const char _EEDATA(1sine_table[ ] =     {128,152,176,198,217,233,245,252,255,252 
        
,245,233,217,198,176,152,128,102,78,56,37,21
           
,9,2,0,2,9,21,37,56,78,102};
CORCONbits.PSV 1;      // 起用 PSV 功能
PSVPAG__builtin_psvpage (sine_table);    // 設定 PSVPAG = 0xFF
while(1)
    {
        if (
Index 31Index=0;    
        
Sine_temp[I] = (sine_table[Index]); //讀取 EEPROM
        
Index ++;
        if (
I>255) while (1);        // 讀取完畢 ?
        
++;
    }


詳細 Table REad/Write & PSV 的應用參考 dsPIC30F Peripheral 的教育訓練裡的 EEPROM 章節。

http://www.microchip.com.tw/modules/w ... glefile.php?cid=4&lid=229

發表於: 2009/1/14 11:07
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 程式碼一問,使用C30 Compiler為何編譯過不了?
#3
新會員
新會員


查看用戶資訊
Linker 錯誤,我最後檢查一下,把程式碼以下宣告:
const unsigned int PB_Cal_Data[1024] __attribute__((aligned(1024), fillupper(0x00), space(prog), section(".cal_data"), address(0x0800)));

改為以下的宣告,compile就過了
const unsigned int PB_Cal_Data[1024] __attribute__((aligned(1024), fillupper(0x00), space(prog)));

只是程式宣告改成這樣的話,我就無法正確地讀到固定位址的常數?還有,就是在p24FJ64GA006.h檔裡也找不到這樣的宣告?

發表於: 2009/1/13 13:52
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 程式碼一問,使用C30 Compiler為何編譯過不了?
#2
版主
版主


查看用戶資訊
Linker 錯誤,會不會變數及程式碼太大了,將編譯過的程式檢查一細 Code Size 及 RAM的使用量。

發表於: 2009/1/7 15:41
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


程式碼一問,使用C30 Compiler為何編譯過不了?
#1
新會員
新會員


查看用戶資訊
請教各位,以下是我的程式碼編譯後出現的錯誤訊息,可是一直編譯不過??
不曉得為什麼?
錯誤訊息為:
----------------------------------------------------------------------
Release build of project `D:\prog\product\410\en_stepless\en.mcp' started.
Wed Jan 07 10:58:27 2009
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Deleted file "D:\prog\product\410\en_stepless\main.o".
Clean: Deleted file "D:\prog\product\410\en_stepless\sub_adc.o".
Clean: Deleted file "D:\prog\product\410\en_stepless\sub_dipsw.o".
Clean: Deleted file "D:\prog\product\410\en_stepless\sub_cc1020.o".
Clean: Deleted file "D:\prog\product\410\en_stepless\sub_RTSP.o".
Clean: Deleted file "D:\prog\product\410\en_stepless\sub_led.o".
Clean: Deleted file "D:\prog\product\410\en_stepless\sub_ichip.o".
Clean: Deleted file "D:\prog\product\410\en_stepless\en.mcs".
Clean: Done.
Executing: "C:\Program Files\Microchip\MPLAB C30\bin\pic30-gcc.exe" -mcpu=24FJ64GA006 -x c -c "main.c" -o"main.o" -I"C:\Program Files\Microchip\MPLAB C30\support\h" -I"C:\Program Files\Microchip\MPLAB C30\support\inc" -g -Wall
main.c: In function '_SPI1Interrupt':
main.c:712: warning: PSV model not specified for '_SPI1Interrupt';
assuming 'auto_psv' this may affect latency
main.c: In function '_T1Interrupt':
main.c:737: warning: PSV model not specified for '_T1Interrupt';
assuming 'auto_psv' this may affect latency
Executing: "C:\Program Files\Microchip\MPLAB C30\bin\pic30-gcc.exe" -mcpu=24FJ64GA006 -x c -c "sub_adc.c" -o"sub_adc.o" -I"C:\Program Files\Microchip\MPLAB C30\support\h" -I"C:\Program Files\Microchip\MPLAB C30\support\inc" -g -Wall
In file included from sub_adc.c:19:
sub_RTSP.h:14: warning: 'fillupper' attribute directive ignored
sub_adc.c: In function 'Read_PB':
sub_adc.c:51: warning: assignment discards qualifiers from pointer target type
Executing: "C:\Program Files\Microchip\MPLAB C30\bin\pic30-gcc.exe" -mcpu=24FJ64GA006 -x c -c "sub_dipsw.c" -o"sub_dipsw.o" -I"C:\Program Files\Microchip\MPLAB C30\support\h" -I"C:\Program Files\Microchip\MPLAB C30\support\inc" -g -Wall
Executing: "C:\Program Files\Microchip\MPLAB C30\bin\pic30-gcc.exe" -mcpu=24FJ64GA006 -x c -c "sub_cc1020.c" -o"sub_cc1020.o" -I"C:\Program Files\Microchip\MPLAB C30\support\h" -I"C:\Program Files\Microchip\MPLAB C30\support\inc" -g -Wall
Executing: "C:\Program Files\Microchip\MPLAB C30\bin\pic30-gcc.exe" -mcpu=24FJ64GA006 -x c -c "sub_RTSP.c" -o"sub_RTSP.o" -I"C:\Program Files\Microchip\MPLAB C30\support\h" -I"C:\Program Files\Microchip\MPLAB C30\support\inc" -g -Wall
Executing: "C:\Program Files\Microchip\MPLAB C30\bin\pic30-gcc.exe" -mcpu=24FJ64GA006 -x c -c "sub_led.c" -o"sub_led.o" -I"C:\Program Files\Microchip\MPLAB C30\support\h" -I"C:\Program Files\Microchip\MPLAB C30\support\inc" -g -Wall
Executing: "C:\Program Files\Microchip\MPLAB C30\bin\pic30-gcc.exe" -mcpu=24FJ64GA006 -x c -c "sub_ichip.c" -o"sub_ichip.o" -I"C:\Program Files\Microchip\MPLAB C30\support\h" -I"C:\Program Files\Microchip\MPLAB C30\support\inc" -g -Wall
Executing: "C:\Program Files\Microchip\MPLAB C30\bin\pic30-gcc.exe" -mcpu=24FJ64GA006 "main.o" "sub_adc.o" "sub_dipsw.o" "sub_cc1020.o" "sub_RTSP.o" "sub_led.o" "sub_ichip.o" "C:\Program Files\Microchip\MPLAB C30\lib\libpPIC24Fxxx-coff.a" -o"en.cof" -Wl,-L"C:\Program Files\Microchip\MPLAB C30\lib",-L"C:\Program Files\Microchip\MPLAB C30\support\h",-L"C:\Program Files\Microchip\MPLAB C30\support\h\peripheral_24F",-L"C:\Program Files\Microchip\MPLAB C30\support\h\peripheral_30F_24H_33F",--script="C:\Program Files\Microchip\MPLAB C30\support\gld\p24FJ64GA006.gld",--defsym=__MPLAB_BUILD=1,-Map="en.map",--report-mem
Link Error: Could not allocate section .cal_data at 0x800
Link Error: Could not allocate program memory
Link step failed.
----------------------------------------------------------------------
Release build of project `D:\prog\product\410\en_stepless\en.mcp' failed.
Wed Jan 07 10:58:33 2009
----------------------------------------------------------------------
BUILD FAILED

但是我將主程式裡有呼叫引用到sub_adc.h & sub_adc.c 的函數和變數拿掉之後,再編譯就過了??附加檔案是我這個project的 ask.mcp檔內容.
謝謝各位相助

發表於: 2009/1/7 11:27
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... ]

教育訓練中心

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