MPLAB IDE写P18点灯测试
时间:10-02
整理:3721RD
点击:
求大神指导用MPLAB IDE8.89的MPLAB C18 (mcc18.exe)写一段LED闪烁测试,但是每次编译时都出现如下提示,请问该如何解决。而且每次都提示要不要再开一个软件测试,然后需要点击否,最后出现failed to load E:\PIC\test\test.cof的小窗口。这样的话就不能够用PICKit2来仿真,烧录了(PS. 用范例的HEX文件可以烧录)
Debug build of project `E:\BEAM-pj\project\PIC18\code\test3\test3.mcp' started.
Preprocessor symbol `__DEBUG' is defined.
Wed Jul 29 10:02:24 2015
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean Warning: File "E:\BEAM-pj\project\PIC18\code\test3\test3.o" doesn't exist.
Clean Warning: File "E:\BEAM-pj\project\PIC18\code\test3\test3.cof" doesn't exist.
Clean Warning: File "E:\BEAM-pj\project\PIC18\code\test3\test3.hex" doesn't exist.
Clean Warning: File "E:\BEAM-pj\project\PIC18\code\test3\test3.map" doesn't exist.
Clean: Done.
Executing: "D:\MPLAB IDE\MPLAB IDE\Core\MPLAB.exe" -p=18F87J11 "test3.c" -fo="test3.o" -D__DEBUG --extended -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
Executing: "D:\MPLAB IDE\MPLAB IDE\Core\MPLAB.exe" "test3.o" /m"E:\BEAM-pj\project\PIC18\code\test3\test3.map" /w /aINHX8M /o"E:\BEAM-pj\project\PIC18\code\test3\test3.cof"
----------------------------------------------------------------------
Debug build of project `E:\BEAM-pj\project\PIC18\code\test3\test3.mcp' succeeded.
Preprocessor symbol `__DEBUG' is defined.
Wed Jul 29 10:02:29 2015
----------------------------------------------------------------------
BUILD SUCCEEDED
程序如下:
#include "p18f87j11.h"
void delay(int i)
{
while(i--);
}
void initial()
{
TRISD = 0x00;
}
void main()
{
initial();
while(1)
{
PORTD = 0x00;
delay(2000);
PORTD = 0xff;
delay(2000);
}
}
如果使用MPLAB SIM编译则出现以下提示:
Debug build of project `E:\BEAM-pj\project\PIC18\code\test3\test3.mcp' started.
Preprocessor symbol `__DEBUG' is defined.
Wed Jul 29 10:20:12 2015
----------------------------------------------------------------------
Make: The target "E:\BEAM-pj\project\PIC18\code\test3\test3.o" is out of date.
Executing: "D:\MPLAB IDE\MPLAB IDE\Core\MPLAB.exe" -p=18F87J11 "test3.c" -fo="test3.o" -D__DEBUG --extended -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
Make: The target "E:\BEAM-pj\project\PIC18\code\test3\test3.cof" is out of date.
Executing: "D:\MPLAB IDE\MPLAB IDE\Core\MPLAB.exe" /k"D:\MPLAB IDE\MPASM Suite\LKR" "D:\MPLAB IDE\MPASM Suite\LKR\18f87j11_g.lkr" "test3.o" /m"E:\BEAM-pj\project\PIC18\code\test3\test3.map" /w /aINHX8M /o"E:\BEAM-pj\project\PIC18\code\test3\test3.cof
----------------------------------------------------------------------
Debug build of project `E:\BEAM-pj\project\PIC18\code\test3\test3.mcp' succeeded.
Preprocessor symbol `__DEBUG' is defined.
Wed Jul 29 10:20:18 2015
----------------------------------------------------------------------
BUILD SUCCEEDED
Debug build of project `E:\BEAM-pj\project\PIC18\code\test3\test3.mcp' started.
Preprocessor symbol `__DEBUG' is defined.
Wed Jul 29 10:02:24 2015
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean Warning: File "E:\BEAM-pj\project\PIC18\code\test3\test3.o" doesn't exist.
Clean Warning: File "E:\BEAM-pj\project\PIC18\code\test3\test3.cof" doesn't exist.
Clean Warning: File "E:\BEAM-pj\project\PIC18\code\test3\test3.hex" doesn't exist.
Clean Warning: File "E:\BEAM-pj\project\PIC18\code\test3\test3.map" doesn't exist.
Clean: Done.
Executing: "D:\MPLAB IDE\MPLAB IDE\Core\MPLAB.exe" -p=18F87J11 "test3.c" -fo="test3.o" -D__DEBUG --extended -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
Executing: "D:\MPLAB IDE\MPLAB IDE\Core\MPLAB.exe" "test3.o" /m"E:\BEAM-pj\project\PIC18\code\test3\test3.map" /w /aINHX8M /o"E:\BEAM-pj\project\PIC18\code\test3\test3.cof"
----------------------------------------------------------------------
Debug build of project `E:\BEAM-pj\project\PIC18\code\test3\test3.mcp' succeeded.
Preprocessor symbol `__DEBUG' is defined.
Wed Jul 29 10:02:29 2015
----------------------------------------------------------------------
BUILD SUCCEEDED
程序如下:
#include "p18f87j11.h"
void delay(int i)
{
while(i--);
}
void initial()
{
TRISD = 0x00;
}
void main()
{
initial();
while(1)
{
PORTD = 0x00;
delay(2000);
PORTD = 0xff;
delay(2000);
}
}
如果使用MPLAB SIM编译则出现以下提示:
Debug build of project `E:\BEAM-pj\project\PIC18\code\test3\test3.mcp' started.
Preprocessor symbol `__DEBUG' is defined.
Wed Jul 29 10:20:12 2015
----------------------------------------------------------------------
Make: The target "E:\BEAM-pj\project\PIC18\code\test3\test3.o" is out of date.
Executing: "D:\MPLAB IDE\MPLAB IDE\Core\MPLAB.exe" -p=18F87J11 "test3.c" -fo="test3.o" -D__DEBUG --extended -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
Make: The target "E:\BEAM-pj\project\PIC18\code\test3\test3.cof" is out of date.
Executing: "D:\MPLAB IDE\MPLAB IDE\Core\MPLAB.exe" /k"D:\MPLAB IDE\MPASM Suite\LKR" "D:\MPLAB IDE\MPASM Suite\LKR\18f87j11_g.lkr" "test3.o" /m"E:\BEAM-pj\project\PIC18\code\test3\test3.map" /w /aINHX8M /o"E:\BEAM-pj\project\PIC18\code\test3\test3.cof
----------------------------------------------------------------------
Debug build of project `E:\BEAM-pj\project\PIC18\code\test3\test3.mcp' succeeded.
Preprocessor symbol `__DEBUG' is defined.
Wed Jul 29 10:20:18 2015
----------------------------------------------------------------------
BUILD SUCCEEDED
不了解,表示没遇到这种问题。
编译信息没有错误呀,PORTD是不是有其他的默认用途?