Re: MPLINK 副程式如何設定如何使用 ?
|
||||
---|---|---|---|---|
高級會員
|
1.在*.C檔後面案enter還是不行
2.它一直說 F_Dealy 重複定義 ... 難道課本範例也會錯 XD
發表於: 2008/8/19 9:27
|
|||
|
Re: MPLINK 副程式如何設定如何使用 ?
|
||||
---|---|---|---|---|
資深會員
|
你試試看:
在每一*.C檔的最後再按一次enter 例: void main(void) { } //按enter 應該就可以了.
發表於: 2008/8/18 15:16
|
|||
|
Re: MPLINK 副程式如何設定如何使用 ?
|
||||
---|---|---|---|---|
資深會員
|
看看F_Dealy這一symbol是否重覆定義.
發表於: 2008/8/18 14:43
|
|||
|
Re: MPLINK 副程式如何設定如何使用 ?
|
||||
---|---|---|---|---|
資深會員
|
*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
|
|||
|
Re: MPLINK 副程式如何設定如何使用 ?
|
||||
---|---|---|---|---|
高級會員
|
我拿你的編譯完會出現語法錯誤耶
錯誤如下: 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
|
|||
|
Re: MPLINK 副程式如何設定如何使用 ?
|
||||
---|---|---|---|---|
資深會員
|
*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
|
|||
|
MPLINK 副程式如何設定如何使用 ?
|
||||
---|---|---|---|---|
高級會員
|
主題: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
|
|||
|