打印

求助一个很初级的问题,芯片是PIC16F876A!

[复制链接]
4686|3
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
sb_L|  楼主 | 2009-12-31 09:53 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
用C写了一个程序,环境是MPLAB8.1+PICC9.6(**版)
1、用ICD2带着调试,功能一切正常,
2、把ICD2改成下载模式,把第1步得到的HEX文件下载进去也一切正常。
3、在2的基础上,重新编译产生HEX文件,再用ICD2下载进去,程序就不正常了。有一个每隔6分钟才出现的功能,有时只要一分钟,或者两、三分钟就出来了。还有就是还出现了其它误操作,感觉就像程序有一部份跑飞了似的。
以下是编译输出,把警告打到-9。
Build E:\OTHER_CODE\GSM\gsm for device 16F876A
Using driver C:\Program Files\HI-TECH Software\PICC\std\9.60\bin\picc.exe
Executing: "C:\Program Files\HI-TECH Software\PICC\std\9.60\bin\picc.exe" -q -g --asmlist --chip=16F876A "--errformat=Error   [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s" -P --char=unsigned --warn=-9 -C E:\OTHER_CODE\GSM\gsm.c
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 215.50 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 236.29 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 298.34 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 299.38 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 302.45 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 314.24 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 349.34 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 350.32 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 351.35 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 352.33 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 353.33 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 354.31 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 355.34 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 356.32 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 357.33 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 358.31 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 372.30 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 373.30 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 374.30 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 375.30 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 434.16 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 436.16 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 1090.40 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 1113.56 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 1114.51 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 1133.35 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 1141.40 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 1164.56 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 1165.51 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 1191.32 implicit signed to unsigned conversion
Warning [373] E:\OTHER_CODE\GSM\gsm.c; 1208.24 implicit signed to unsigned conversion
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 150. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 150. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 150. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 183. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 184. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 188. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 189. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 190. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 196. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 200. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 201. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 215. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 215. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 235. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 236. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 236. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 279. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 298. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 299. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 299. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 302. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 302. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 302. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 306. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 307. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 308. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 314. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 315. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 324. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 343. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 367. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 372. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 373. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 373. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 374. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 375. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 375. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 386. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 402. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 423. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 434. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 436. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 1090. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 1100. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 1101. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 1105. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 1106. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 1113. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 1151. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 1152. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 1156. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 1157. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 1164. conversion to shorter data type
Warning [752] E:\OTHER_CODE\GSM\gsm.c; 1165. conversion to shorter data type
Executing: "C:\Program Files\HI-TECH Software\PICC\std\9.60\bin\picc.exe" -q -g --asmlist --chip=16F876A "--errformat=Error   [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s" -P --char=unsigned --warn=-9 -ogsm.cof -mgsm.map gsm.obj
Memory Usage Map:
Program space:
    CODE                 used   BB1h (  2993) of  2000h words   ( 36.5%)
    CONST                used    7Eh (   126) of  2000h words   (  1.5%)
    ENTRY                used     0h (     0) of  2000h words   (  0.0%)
    STRING               used     0h (     0) of  2000h words   (  0.0%)
Data space:
    BANK0                used    43h (    67) of    60h bytes   ( 69.8%)
    BANK1                used    42h (    66) of    50h bytes   ( 82.5%)
    BANK2                used    46h (    70) of    60h bytes   ( 72.9%)
    BANK3                used    17h (    23) of    60h bytes   ( 24.0%)
    COMBANK              used     1h (     1) of    10h bytes   (  6.3%)
EEPROM space:
    EEDATA               used     0h (     0) of   100h bytes   (  0.0%)
Configuration bits:
    CONFIG               used     1h (     1) of     1h word    (100.0%)
ID Location space:
    IDLOC                used     0h (     0) of     4h bytes   (  0.0%)
Summary:
    Program space        used   C2Fh (  3119) of  2000h words   ( 38.1%)
    Data space           used    E3h (   227) of   170h bytes   ( 61.7%)
    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%)
沙发
yewuyi| | 2009-12-31 11:37 | 只看该作者
飞机也没这么飞的。。。

典型的代码有BUG 。。。

你都那么都Warning还玩什么?!

使用特权

评论回复
板凳
backupyan| | 2010-1-5 07:52 | 只看该作者
你真以为warning可以无视吗?
哈哈!你错了!就是warning把你搞死了!

使用特权

评论回复
地板
lileibmw| | 2010-1-5 08:03 | 只看该作者
呵呵,有的warning确实不可小视。

使用特权

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

本版积分规则

15

主题

23

帖子

0

粉丝