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


Browsing this Thread:   1 Anonymous Users






Re: 請問關於dsPIC30f2010使用到ctype.h時出現的問題?
#5
新會員
新會員


查看用戶資訊
我的c30 是v1.10
我曾試著將p30f2010.gld裡面的data範圍從原來的512更改為8196後
data (a!xr) : ORIGIN = 0x800, LENGTH = 8196
在compiler一次你的測試程式,結果是ok的
還有就是project zip如何傳給您
謝謝

這是我的程式,當我不執行
TEMP_REG = tolower((int)TEMP_REG);這行程式時
compiler是ok的,但當加入此行程式後就會出現link error

/******************************
藉由dsPIC30F2010的UART模組,
接收資料並顯示在超級終端機
*******************************/
#include <p30f2010.h>
#include <ctype.h>

#define FCY 10000000
#define MILLISEC FCY/100000

void SYSTEM_initial(void);
void RS232_initial(void);
void DelayNmSec(unsigned int N);
void REG_initial(void);

char TEMP_REG;

int main(void)
{
SYSTEM_initial();

while(1)
{
while(U1STAbits.URXDA)
{
TEMP_REG = (char) U1RXREG;
TEMP_REG = tolower((int)TEMP_REG);
PORTE = TEMP_REG;
U1TXREG = (int)TEMP_REG;
}
}
}
//------------------------------------------------------------
void SYSTEM_initial(void)
{
RS232_initial();
REG_initial();
}
//------------------------------------------------------------
void RS232_initial(void)
{
//U1BRG = ((FCY/16)/BAUD)-1;
U1BRG = 10;
U1MODE = 0x8000;
U1STA = 0x0000;
U1STAbits.UTXEN = 1;
}
//---------------------------------------------------------
void DelayNmSec(unsigned int N)
{
unsigned int i;
while(N--)
{
for(i=0;i<MILLISEC;i++);
}
}
//---------------------------------------------------------
void REG_initial(void)
{
TEMP_REG = 0;
}

發表於: 2004/9/27 18:06
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問關於dsPIC30f2010使用到ctype.h時出現的問題?
#4
版主
版主


查看用戶資訊
查過 Region data is full 的錯誤解釋如下:
The memory region REGION is full, but section secname has been assigned to it.

你說有編譯過我的程式一樣也會有此問題,這就很奇怪了,要不要將你的Project ZIP 候傳給我試試看。
你的 C30 的版本是哪一版?
我的是 v1.20


發表於: 2004/9/27 17:36
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問關於dsPIC30f2010使用到ctype.h時出現的問題?
#3
新會員
新會員


查看用戶資訊
不好意思,在請問一下,當我在compiler你的程式還是會出現error ,而相關include的路徑也有設定,還是有問題,不知道是否我還有其它相關設定忽略了. 謝謝
Executing: "C:\MPLAB C30\pic30_tools\bin\pic30-gcc.exe" -Wl,"C:\pic30demo\dsPIC30F2010\test\test.o",--script="C:\MPLAB C30\pic30_tools\support\gld\p30f2010.gld",-L"C:\pic30_tools\lib",-o"test.cof"

C:\MPLAB C30\pic30_tools\bin\pic30-ld.exe: Link Error: region data is full (test.cof section .data)

C:\MPLAB C30\pic30_tools\bin\pic30-ld.exe: Link Error: region data is full (test.cof section .data)

發表於: 2004/9/27 16:25
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問關於dsPIC30f2010使用到ctype.h時出現的問題?
#2
版主
版主


查看用戶資訊
不會阿! 我寫一段很短的程式測試你的問題,我並沒有你的問題發生,是不是 #include 的路徑沒設到。

請確定"Project" --> "Build Option" --> "Project" 下的設定為:

$AINDIR = c:\pic30_tools\support\inc
$INCDIR = C:\pic30_tools\include;C:\pic30_tools\support\h
$LIBDIR = C:\pic30_tools\lib

我的程式如下:
#define __dsPIC30F2010__
#include "c:\pic30_tools\support\h\p30F2010.h"
#include <ctype.h>

#define LED0 PORTDbits.RD0
#define LED1 PORTDbits.RD1

int main(void)
{
LATD = 0x0000;
LED1=0;
LED0=0;

int ch='3';
if (isdigit(ch)) LED0=1;

ch='#';
if (isdigit(ch)) LED1=1;

while(1); // do for ever

}

發表於: 2004/9/27 16:00
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


請問關於dsPIC30f2010使用到ctype.h時出現的問題?
#1
新會員
新會員


查看用戶資訊
當dsPIC30F2010使用到ctype.h中的函式時,例如:isdigit()或tolower()...等等函式,在compiler時,會出現Link error:region data is full的錯誤訊息,若把這些函式去掉不使用它,程式compiler就沒問題,所以想請問一下,是什麼樣的原因會造成錯誤的產生? 謝謝

發表於: 2004/9/27 15:14
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... ]

教育訓練中心

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