yewuyi 发表于 2013-2-21 14:21
1、检查项目文件有无中文路径
2、检查代码、EEPROM等空间是否CONFIG设置了加密
3、检查BOD是否关闭
谢谢叶工指点。
1.测试的跑马灯工程那个文件夹是存放在了硬盘根目录的,没有中文路径,这个有注意。
2.MCC18编译器配置位代码如下:
// CONFIG1H
#pragma config OSC = HS //晶振:HS模式
#pragma config FCMEN = OFF
#pragma config IESO = OFF
// CONFIG2L
#pragma config PWRT = OFF
#pragma config BOREN = OFF //低电压检测:关
#pragma config BORV = 3
// CONFIG2H
#pragma config WDT = OFF //看门狗:关
#pragma config WDTPS = 32768
// CONFIG3H
#pragma config PBADEN = ON
#pragma config LPT1OSC = OFF
#pragma config MCLRE = ON
// CONFIG4L
#pragma config STVREN = ON
#pragma config LVP = OFF //S-S ICSP:关
#pragma config BBSIZ = 1024
#pragma config XINST = OFF
//各种保护:关
// CONFIG5L
#pragma config CP0 = OFF
#pragma config CP1 = OFF
#pragma config CP2 = OFF
#pragma config CP3 = OFF
// CONFIG5H
#pragma config CPB = OFF
#pragma config CPD = OFF
// CONFIG6L
#pragma config WRT0 = OFF
#pragma config WRT1 = OFF
#pragma config WRT2 = OFF
#pragma config WRT3 = OFF
// CONFIG6H
#pragma config WRTC = OFF
#pragma config WRTB = OFF
#pragma config WRTD = OFF
// CONFIG7L
#pragma config EBTR0 = OFF
#pragma config EBTR1 = OFF
#pragma config EBTR2 = OFF
#pragma config EBTR3 = OFF
// CONFIG7H
#pragma config EBTRB = OFF
注释的几个是我特别注意了的,IDE一般只提示看门狗和在线烧写这两个必须是关,而且在4580的工程里我只写了
#pragma config OSC = HS;
#pragma config WDT = OFF;
#pragma config LVP = OFF;
调试运行是正常的。
今天用的环境是我自己电脑重装的 32位 Win 7 + MPLAB IDE v8.89 + PICC 18 v9.80,问题依旧...
|