标题: MPLAB X IDE的编译器HI更换为XC8后程序烧录后没反应(编译通过)用HI可以 [打印本页] 作者: 时间的力量 时间: 2020-7-17 19:29 标题: MPLAB X IDE的编译器HI更换为XC8后程序烧录后没反应(编译通过)用HI可以 大家好,我最近用MPLAB X IDE,开始我用这个键工程,选择的编译器是HI的,程序烧录进去运行OK的,然后我吧编译器更改为XC8,配置也用IDE 生成的,其余代码一模一样,编译OK,但下载后就没反应,不知道是怎么回事,希望有好心人帮忙解决下,谢谢。以下是代码:有前面有两句中文注释是更改编译器后要改的,后面的代码是一模一样的,应该需要怀疑什么。
/*
* File: main.c
* Author: 时间
*
* Created on 2020年6月26日, 下午6:57
*/
// PIC12F675 Configuration Bit Settings
// 'C' source line config statements
// CONFIG
//#pragma config MCLRE = OFF
//以下9句是XC8编译器使用的
#include <xc.h> //
#pragma config FOSC = HS // Oscillator Selection bits (RC oscillator)
#pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT enabled)
#pragma config PWRTE = OFF // Power-up Timer Enable bit (PWRT disabled)
#pragma config BOREN = ON // Brown-out Reset Enable bit (BOR enabled)
#pragma config LVP = ON // Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit (RB3/PGM pin has PGM function; low-voltage programming enabled)
#pragma config CPD = OFF // Data EEPROM Memory Code Protection bit (Data EEPROM code protection off)
#pragma config WRT = OFF // Flash Program Memory Write Enable bits (Write protection off; all program memory may be written to by EECON control)
#pragma config CP = OFF // Flash Program Memory Code Protection bit (Code protection off)
破解过了,这是编译结果清除已成功 (总时间: 2s)
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'G:/TEST/TEST.X'
make -f nbproject/Makefile-default.mk dist/default/production/TEST.X.production.hex
make[2]: Entering directory 'G:/TEST/TEST.X'
"C:\Program Files (x86)\Microchip\xc8\v1.45\bin\xc8.exe" --pass1 --chip=16F877A -Q -G --double=24 --float=24 --opt=+asm,+asmfile,+speed,-space,-debug,-local --addrqual=ignore --mode=pro -P -N255 --strict --warn=-3 --asmlist -DXPRJ_default=default --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,+osccal,+oscval:0x3400,-resetbits,-download,-stackcall,+clib --output=+mcof,-elf:multilocs --stack=compiled:auto:auto "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s" -obuild/default/production/main.p1 main.c
:: warning: (913) "--strict" option can cause compiler errors in some standard header files
"C:\Program Files (x86)\Microchip\xc8\v1.45\bin\xc8.exe" --chip=16F877A -G -mdist/default/production/TEST.X.production.map --double=24 --float=24 --opt=+asm,+asmfile,+speed,-space,-debug,-local --addrqual=ignore --mode=pro -P -N255 --strict --warn=-3 --asmlist -DXPRJ_default=default --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,+osccal,+oscval:0x3400,-resetbits,-download,-stackcall,+clib --output=+mcof,-elf:multilocs --stack=compiled:auto:auto "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s" --memorysummary dist/default/production/memoryfile.xml -odist/default/production/TEST.X.production.cof build/default/production/main.p1
Microchip MPLAB XC8 C Compiler (PRO Mode) V1.41
Build date: Jan 24 2017
Part Support Version: 1.45
Copyright (C) 2017 Microchip Technology Inc.
:: warning: (913) "--strict" option can cause compiler errors in some standard header files
main.c:66: warning: (751) arithmetic overflow in constant expression
main.c:63: warning: (520) function "_delay" is never called
Memory Summary:
Program space used Dh ( 13) of 2000h words ( 0.2%)
Data space used 2h ( 2) of 170h bytes ( 0.5%)
EEPROM space used 0h ( 0) of 100h bytes ( 0.0%)
Data stack space used 0h ( 0) of 60h bytes ( 0.0%)
Configuration bits used 1h ( 1) of 1h word (100.0%)
ID Location space used 0h ( 0) of 4h bytes ( 0.0%)