我是个PIC初学者,今天写了个简单的程序,建了3个变量,但观察变量,发现并没有建立,如下程序
#include <pic.h>
#define uchar unsigned char
__CONFIG (HS & PROTECT & PWRTEN & BOREN & WDTDIS);
void main(void)
{
uchar i=1,j=2,k=3;
i++;
j++;
k++;
while(1);
}
并且在单步仿真的时候,指针是直接到while(1);的,为何?
但如果我把k++;改为k=i+j;,那么i和j就能建立了。
还有,首次编译的时候,会出现Warning [111] F:PICCPRO9.65includepic.h; 286.20 redefining preprocessor macro "EEADRL",这是什么?
请各位指点一下。谢谢
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
Build E:PIC_projectsc_test est for device 16F877A
Using driver D:Program FilesHI-TECH SoftwarePICCPRO9.65inpicc.exe
Make: The target "E:PIC_projectsc_test est.p1" is out of date.
Executing: "D:Program FilesHI-TECH SoftwarePICCPRO9.65inpicc.exe" --pass1 E:PIC_projectsc_test est.c -q --chip=16F877A -P --runtime=default --opt=default -D__DEBUG=1 -g --asmlist "--errformat=Error [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
Executing: "D:Program FilesHI-TECH SoftwarePICCPRO9.65inpicc.exe" -otest.cof -mtest.map --summary=default --output=default test.p1 --chip=16F877A -P --runtime=default --opt=default -D__DEBUG=1 -g --asmlist "--errformat=Error [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
HI-TECH C PRO for the PIC10/12/16 MCU family (Lite) V9.65PL1
Copyright (C) 1984-2009 HI-TECH SOFTWARE
(1273) Omniscient Code Generation not available in Lite mode (warning)
Memory Summary:
Program space used 1Ah ( 26) of 2000h words ( 0.3%)
Data space used 4h ( 4) of 170h bytes ( 1.1%)
EEPROM space used 0h ( 0) of 100h bytes ( 0.0%)
Configuration bits used 1h ( 1) of 1h word (100.0%)
ID Location space used 0h ( 0) of 4h bytes ( 0.0%)
Running this compiler in PRO mode, with Omniscient Code Generation enabled,
produces code which is typically 52% smaller than in Lite mode.
The HI-TECH C PRO compiler output for this code could be 13 words smaller.
See http://microchip.htsoft.com/portal/pic_pro for more information.
Loaded E:PIC_projectsc_test est.cof.
********** Build successful! **********
并没有你所说的警告信息。
而且可以创建变量……见下图:
(原文件名:picc.jpg)
一周热门 更多>