使用MPLAB IDE v8.9编译c18 选用单片机为pic18f2525
分别采用如上三种编译器 均无法编译 要么无法找到头文件(picc18),要么陷入死循环(mcc)、或者配置字未定义(xc8)
#include<timers.h>
#include<plib.h>
#include<xc.h>
/*Set configuration bits
* -set HS oscillator
* -disable watchdog timer
* -disable low_voltage programming
* -disable brownout reset
* -enable master clear
*/
#pragma config OSC=HS
#pragma config WDT=OFF
#pragma config LVP=OFF
#pragma config BOR=OFF
#pragma config MCLRE=ON
void MyHighInt(void)
void MyLowInt(void)
#pragma interrupt MyHighInt
#pragma code high_vector=0x08
void high_vector(void)
{
_asm GOTO MyHighInt_endasm
}
#pragma interruptlow MyLowInt
#pragma code low_vector=0x18
void low_vector(void)
{
_asm GOTO MyLowInt_endasm
}
|