编译结果: Error[000] E:511_testmain.c 17 : ) expected
Error[000] E:511_testmain.c 17 : ; expected
Halting build on first failure as requested.
BUILD FAILED: Fri Dec 16 10:00:25 2011
找到对应的程序 : __CONFIG(INTIO&WDTDIS&MCLREN&PWRTEN&CP&CPD&FCMEN&DEBUGDIS&IESODIS&BOREN);
我吧这个注释掉就可以了: //__CONFIG(INTIO&WDTDIS&MCLREN&PWRTEN&CP&CPD&FCMEN&DEBUGDIS&IESODIS&BOREN);
但是 ,这个在pic.h头文件里面有定义啊,为什么不能用呢?
pic.h 文件里的: #define __CONFIG(x) asm(" psect config,class=CONFIG,delta=2");
asm(" dw "___mkstr(x))
补充一下 ,用的MPLAB7.4 + PICC8.05
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
我都是直接写十六进制的,试试高版本的编译器。
-----------------------------------------------------------------------
__CONFIG(INTIO&WDTDIS&MCLREN&PWRTEN&CP&CPD&FCMEN&DEBUGDIS&IESODIS&BOREN);
请问这一段用16进制怎么写啊?
我现在用MPLAB v8.8编译这个问题没有了,但是又出现了很多新的问题。。。
HI-TECH C Compiler for PIC10/12/16 MCUs (Lite Mode) V9.83
Copyright (C) 2011 Microchip Technology Inc.
(1273) Omniscient Code Generation not available in Lite mode (warning)
Error [800] test.as; 45. undefined symbol "BOREN"
Error [800] test.as; 45. undefined symbol "IESODIS"
Error [800] test.as; 45. undefined symbol "DEBUGDIS"
Error [800] test.as; 45. undefined symbol "FCMEN"
Error [800] test.as; 45. undefined symbol "CPD"
Error [800] test.as; 45. undefined symbol "CP"
Error [800] test.as; 45. undefined symbol "PWRTEN"
Error [800] test.as; 45. undefined symbol "MCLREN"
Error [800] test.as; 45. undefined symbol "WDTDIS"
Error [800] test.as; 45. undefined symbol "INTIO"
pic16f914的单片机
pic16f91x.h文件里面都有定义 ,为什么会提示为定义呢
// Configuration Mask Definitions
#define CONFIG_ADDR 0x2007
// Oscillator
#define EXTCLK 0x3FFF // External RC Clockout
#define EXTIO 0x3FFE // External RC No Clock
#define INTCLK 0x3FFD // Internal RC Clockout
#define INTIO 0x3FFC // Internal RC No Clock
#define EC 0x3FFB // EC
#define HS 0x3FFA // HS
#define XT 0x3FF9 // XT
#define LP 0x3FF8 // LP
// Watchdog Timer
#define WDTEN 0x3FFF // On
#define WDTDIS 0x3FF7 // Disabled / SWDTEN control
// Power Up Timer
#define PWRTDIS 0x3FFF // Off
#define PWRTEN 0x3FEF // On
// Master Clear Enable
#define MCLREN 0x3FFF // MCLR function is enabled
#define MCLRDIS 0x3FDF // MCLR functions as IO
// Code Protect
#define UNPROTECT 0x3FFF // Code is not protected
#define CP 0x3FBF // Code is protected
// Data EE Read Protect
#define UNPROTECT 0x3FFF // Do not read protect EEPROM data
#define CPD 0x3F7F // Read protect EEPROM data
// Brown Out Detect
#define BORDIS 0x3CFF // BOD and SBOREN disabled
#define SWBOREN 0x3DFF // SBOREN controls BOR function (Software control)
#define BORXSLP 0x3EFF // BOD enabled in run, disabled in sleep, SBOREN disabled
#define BOREN 0x3FFF // BOD Enabled, SBOREN Disabled
// Internal External Switch Over Mode
#define IESOEN 0x3FFF // Enabled
#define IESODIS 0x3BFF // Disabled
// Monitor Clock Fail-safe
#define FCMEN 0x3FFF // Enabled
#define FCMDIS 0x37FF // Disabled
// In-Circuit Debugger Mode
#define DEBUGEN 0x2FFF // Enable ICD2 debugging
#define DEBUGDIS 0x3FFF // Disable ICD2 debugging
哦 这些警告还是这条语句的问题: __CONFIG(INTIO&WDTDIS&MCLREN&PWRTEN&CP&CPD&FCMEN&DEBUGDIS&IESODIS&BOREN);
一周热门 更多>