编译结果: 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(FOSC_INTOSC & WDTE_OFF & PWRTE_OFF & MCLRE_OFF & CP_OFF & CPD_OFF & BOREN_ON & CLKOUTEN_OFF & IESO_OFF & FCMEN_OFF);
__CONFIG(WRT_OFF & PLLEN_ON & STVREN_OFF & BORV_HI & LVP_OFF);
如果是9.83以下BORV_HI写成BOR_25
我都是直接写十六进制的,试试高版本的编译器。
-----------------------------------------------------------------------
__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);
我都是直接写十六进制的,试试高版本的编译器。
-----------------------------------------------------------------------
哦 你是说直接用0xXXXX代替这些宏定义啊
__CONFIG(0x3FFC&0x3FF7&0x3FFF&0x3FEF&0x3FBF&0x3F7F&0x3FFF&0x3FFF&0x3BFF&0x3FFF);
这样OK了
#if defined(_16C923) || defined(_16C924) ||
defined(_16C925) || defined(_16C926)
#include <pic169xx.h>
一周热门 更多>