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


Browsing this Thread:   1 Anonymous Users




« 1 (2)


Re: MPLINK 副程式如何設定如何使用 ?
#8
高級會員
高級會員


查看用戶資訊
1.在*.C檔後面案enter還是不行
2.它一直說 F_Dealy 重複定義 ... 難道課本範例也會錯 XD

發表於: 2008/8/19 9:27
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: MPLINK 副程式如何設定如何使用 ?
#7
資深會員
資深會員


查看用戶資訊
你試試看:
在每一*.C檔的最後再按一次enter
例:
void main(void)
{
} //按enter
應該就可以了.

發表於: 2008/8/18 15:16
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: MPLINK 副程式如何設定如何使用 ?
#6
資深會員
資深會員


查看用戶資訊
看看F_Dealy這一symbol是否重覆定義.

發表於: 2008/8/18 14:43
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: MPLINK 副程式如何設定如何使用 ?
#5
高級會員
高級會員


查看用戶資訊
嗯 ~ 試了半天副程式還是串不起來,我MPLAB從7升到8了還是不行 ? 課本上的設定我也是做了勒 ? 沒有理由按表抄課還會被電腦八掉勒 ><" 這到底是什麼原因勒 ?

MPLINK 4.00, Linker
Copyright (c) 2005 Microchip Technology Inc.
Error - symbol 'F_Delay' has multiple definitions.
Errors : 1

Link step failed.
----------------------------------------------------------------------
Debug build of project `C:\Documents and Settings\Chen Yang Li\My Documents\add\add.mcp' failed.
Preprocessor symbol `__DEBUG' is defined.
Target debug platform is `__MPLAB_DEBUGGER_ICD2=1'.
Debug platform options are: `__ICD2RAM=1'.
Mon Aug 18 14:32:13 2008
----------------------------------------------------------------------
BUILD FAILED

發表於: 2008/8/18 14:36
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: MPLINK 副程式如何設定如何使用 ?
#4
資深會員
資深會員


查看用戶資訊
*1.就我的程式而言我這邊是沒有問題的.
----------------------------------------------------------------------
Release build of project `D:\Test\MCU\PIC\MPLAB_C18\example1\example1.mcp' started.
Mon Aug 18 13:05:12 2008
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Deleted file "D:\Test\MCU\PIC\MPLAB_C18\example1\example1.o".
Clean: Deleted file "D:\Test\MCU\PIC\MPLAB_C18\example1\example1.cof".
Clean: Deleted file "D:\Test\MCU\PIC\MPLAB_C18\example1\example1.hex".
Clean: Deleted file "D:\Test\MCU\PIC\MPLAB_C18\example1\example1.cod".
Clean: Deleted file "D:\Test\MCU\PIC\MPLAB_C18\example1\example1.lst".
Clean: Deleted file "D:\Test\MCU\PIC\MPLAB_C18\example1\example1.map".
Clean: Deleted file "D:\Test\MCU\PIC\MPLAB_C18\example1\example1.mcs".
Clean: Done.
Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8622 /i"C:\mcc18\h" "example1.c" -fo="example1.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
Executing: "C:\mcc18\bin\mplink.exe" /l"C:\mcc18\lib" /k"C:\mcc18\lkr" "C:\mcc18\lkr\18f8622.lkr" "example1.o" /u_CRUNTIME /z__MPLAB_BUILD=1 /m"example1.map" /o"example1.cof"
MPLINK 4.20, Linker
Copyright (c) 2008 Microchip Technology Inc.
Errors : 0

MP2COD 4.20, COFF to COD File Converter
Copyright (c) 2008 Microchip Technology Inc.
Errors : 0

MP2HEX 4.20, COFF to HEX File Converter
Copyright (c) 2008 Microchip Technology Inc.
Errors : 0

Loaded D:\Test\MCU\PIC\MPLAB_C18\example1\example1.cof.
----------------------------------------------------------------------
Release build of project `D:\Test\MCU\PIC\MPLAB_C18\example1\example1.mcp' succeeded.
Mon Aug 18 13:05:14 2008
----------------------------------------------------------------------
BUILD SUCCEEDED

*2.或是Demo版本的差別嗎!

*3.可能須其他先進的幫忙了.

發表於: 2008/8/18 13:12
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: MPLINK 副程式如何設定如何使用 ?
#3
高級會員
高級會員


查看用戶資訊
我拿你的編譯完會出現語法錯誤耶
錯誤如下:
MPLAB C18 v3.00 (demo) Copyright 1999-2005 Microchip Technology Inc. Days remaining until demo becomes feature limited: 46 C:\Documents and Settings\Chen Yang Li\My Documents\add2\ext_c.c:6:Error: syntax error Halting build on first failure as requested. BUILD FAILED: Mon Aug 18 12:20:25 2008

我把你的程式也拆成兩部份各存成C
檔名分別為delay 和你打的 ext_c
一樣都 Add Source 底下,然後匯入LKR 都設定好以後 build
還是不行 ~ 應該是軟體設定上不知道哪裡有問題才對
我程式已經都貼出去了就是第一篇

發表於: 2008/8/18 12:27
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: MPLINK 副程式如何設定如何使用 ?
#2
資深會員
資深會員


查看用戶資訊
*1.example.c
#include <P18F8622.h>
#include "ext_c.c"
int counter;
void main (void)
{
int i,j;
counter = 1;
TRISB = 0; /* configure PORTB for output */
while (counter <= 15)
{
PORTB = counter; /* display value of 'counter'
on the LEDs */
counter++;
}
i=5000;
j=50;
counter=i/j;
ext(counter);
}

*2.ext_c.c
#include <P18F8622.h>
void ext (int i);
void ext (int i)
{
if(i==0) PORTB=0;
}

*3.程式隨便寫的,沒有問題,看跟你的有何不同?

*4.或將你的程式丟出,我幫你Compile.

發表於: 2008/8/18 12:04
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


MPLINK 副程式如何設定如何使用 ?
#1
高級會員
高級會員


查看用戶資訊
主題:MPLINK如何設定使用
課本:宏友 ~ PIC18Fxx2微控制器原理與實作 (使用組合與言語C語言)
書號:H0210
實驗章節:5.7發展大規模的程式 5-42 頁
問題:程式寫到最後的龐大肯定是有副程式來組合完成的,於是就開始
照著課本範例實做看看,可是我build以後出現如下問題
***************************************************
MPLINK 4.00, Linker Copyright (c) 2005 Microchip Technology Inc. Error - symbol 'F_Delay' has multiple definitions. Errors : 1 BUILD FAILED: Mon Aug 18 10:30:08 2008
***************************************************
請問這是我設定上有什麼錯誤嗎 ? 我只是單純的照著課本把範例程式打
開,建立好專案,按下build就這樣而已~還需要設定什麼嗎 ?
1. Project > New 建立專案
2. Sorce File 將C檔案載入
3. 匯入LKR檔
4. 設定好Project Build Options
5. Configure 處理器也設定好了也改成HS
***************************************************
操作完畢以後沒有辦法Build耶 ? 他的程式碼如下:
( 第一段程式 )
***************************************************
#include <p18f452.h>
#include "delay.c"

#define LEFT 0
#define RIGHT 1

void F_Initial ( void );

void main (void)
{
int I_Direction=LEFT;
F_Initial();
while ( 1 )
{
F_Delay ( 5000 );
switch ( I_Direction )
{
case LEFT:
PORTD <<= 1;
if ( PORTD == 128 )
I_Direction = RIGHT;
break;
case RIGHT:
PORTD >>= 1;
if ( PORTD == 1 )
I_Direction = LEFT;
break;
default:
break;
}
}
}

void F_Initial ()
{
TRISD = 0;
PORTD = 1;
}
***************************************************
( 第二段程式,要被呼叫的副程式 )
#include <p18f452.h>

void F_Delay ( int );

void F_Delay ( int I_Delay_value )
{
int I_Delay_counter;
for ( I_Delay_counter=0 ; I_Delay_counter <= I_Delay_value ; I_Delay_counter++ );
}
請問各位先進,哪裡有錯呢 ?

發表於: 2008/8/18 10:41
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... ]

教育訓練中心

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