打印

为啥编译不对

[复制链接]
4449|3
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
chuandaoxy|  楼主 | 2011-9-26 08:51 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
从网上下了段代码,应该没错,可是就是变不过去

显示

Debug build of project `D:\project6\12f683\pic18f252\252.mcp' started.
Language tool versions: mpasmwin.exe v5.35, mcc18.exe v3.35
Preprocessor symbol `__DEBUG' is defined.
Mon Sep 26 09:05:01 2011
----------------------------------------------------------------------
Make: The target "D:\project6\12f683\pic18f252\252.o" is up to date.
Couldn't locate build tool.  Check tool locations.
----------------------------------------------------------------------
Debug build of project `D:\project6\12f683\pic18f252\252.mcp' failed.
Language tool versions: mpasmwin.exe v5.35, mcc18.exe v3.35
Preprocessor symbol `__DEBUG' is defined.
Mon Sep 26 09:05:02 2011
----------------------------------------------------------------------
BUILD FAILED


错在哪? code如下

#include <p18F252.h>
#pragma config OSC = XT, OSCS = OFF, PWRT = ON, BOR = OFF, WDT = OFF, STVR = ON, LVP = OFF, DEBUG = OFF
//----------------------------------------------------------------------------
void main (void);
void InterruptHandlerHigh (void);
union
{
  struct
  {
    unsigned Timeout:1;         //flag to indicate a TMR0 timeout
    unsigned None:7;
  } Bit;
  unsigned char Byte;
} Flags;
//----------------------------------------------------------------------------
// Main routine
void main () {
Flags.Byte = 0;
INTCON = 0x28;     //disable global and enable TMR0 interrupt and RB
INTCON2 = 0x85;     //TMR0 high priority
RCONbits.IPEN = 1;    //enable priority levels
TMR0H = 0;      //clear timer and set TMR0H
TMR0L = 0;      //clear timer low byte and also updates high byte from TMR0H
T0CON = 0x88;     //set up timer0 - no prescaler
INTCONbits.GIEH = 1;   //enable interrupts
TRISB = 0x7E;     //PORTB bits 0 and 7 are output, the rest are input
TRISC = 0;      //PORTC bits are output
PORTC = 0;
   while (1) {
  if (Flags.Bit.Timeout == 1) {                                  //timeout?
   Flags.Bit.Timeout = 0;           //clear timeout indicor
   LATBbits.LATB7 = LATBbits.LATB0; //copy LED state from RB0 to RB7
  }
}
}
//----------------------------------------------------------------------------
// High priority interrupt vector
#pragma code InterruptVectorHigh = 0x08
void
InterruptVectorHigh (void)
{
  _asm
    goto InterruptHandlerHigh //jump to interrupt routine
  _endasm
}
//----------------------------------------------------------------------------
// High priority interrupt routine
#pragma code
#pragma interrupt InterruptHandlerHigh
void InterruptHandlerHigh () {
if (INTCONbits.RBIF) {
  PORTC = PORTB;
  INTCONbits.RBIF = 0;
}
if (INTCONbits.TMR0IF) {    //check for TMR0 overflow
  INTCONbits.TMR0IF = 0;    //clear interrupt flag
  Flags.Bit.Timeout = 1;    //indicate timeout
  LATBbits.LATB0 = !LATBbits.LATB0; //toggle LED on RB0
    }
}
//----------------------------------------------------------------------------
沙发
asspeed| | 2011-9-26 10:03 | 只看该作者
工具相关执行文件定位错误,你一定是没有按照默认路径安装C18编译器,或者错误选择了编译器工具的位置信息,你需要重新指定路径。

使用特权

评论回复
板凳
e掾木| | 2011-9-26 12:31 | 只看该作者
Couldn't locate build tool.  Check tool locations.

使用特权

评论回复
地板
skygrow| | 2011-9-26 14:20 | 只看该作者
MPLAB IDE-->project-->select language toolsuit 检查各个路径

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

843

主题

1029

帖子

4

粉丝