Em dùng mplab x ide và mplab xc8
Sẵn cho em hỏi cách đưa code lên diễn đàn, tìm cách post code trong diễn đàn mà chưa thấy.
Cám ơn mọi người nhiều ạ.
---------------
PHẦN CHƯƠNG TRÌNH
#include<pic16f887.h>
#include<xc.h>
#include<stdio.h>
#include<stdlib.h>
// CONFIG1
#pragma config FOSC = XT // Oscillator Selection bits (XT oscillator: Crystal/resonator on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN)
#pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT disabled and can be enabled by SWDTEN bit of the WDTCON register)
#pragma config PWRTE = OFF // Power-up Timer Enable bit (PWRT disabled)
#pragma config MCLRE = OFF // RE3/MCLR pin function select bit (RE3/MCLR pin function is digital input, MCLR internally tied to VDD)
#pragma config CP = OFF // Code Protection bit (Program memory code protection is disabled)
#pragma config CPD = OFF // Data Code Protection bit (Data memory code protection is disabled)
#pragma config BOREN = OFF // Brown Out Reset Selection bits (BOR disabled)
#pragma config IESO = OFF // Internal External Switchover bit (Internal/External Switchover mode is disabled)
#pragma config FCMEN = OFF // Fail-Safe Clock Monitor Enabled bit (Fail-Safe Clock Monitor is disabled)
#pragma config LVP = OFF // Low Voltage Programming Enable bit (RB3 pin has digital I/O, HV on MCLR must be used for programming)
// CONFIG2
#pragma config BOR4V = BOR21V // Brown-out Reset Selection bit (Brown-out Reset set to 4.0V)
#pragma= OFF config WRT = OFF // Flash Program Memory Self Write Enable bits (Write protection
#define _XTAL_FREQ 4000000
void main (void)
{
void port_init();
void adc_init();
void in_init();
while(1){
__delay_ms(10);
GODONE = 1;
}
}
void port_init(void){
ANSEL = 0xO8;
ANSELH = 0;
TRISA2 = 1;
TRISE = 0;
PORTE = 0xff;
}
void adc_init(){
ADCON0bits.ADCS1 = 0;
ADCON0bits.ADCS0 = 1;
VCFG0 = 0;
VCFG1 = 0;
CHS3 = 0;
CHS2 = 0;
CHS1 = 1;
CHS0 = 0;
ADFM = 1;
ADON = 1;
__delay_ms(1);
}
void in_init(){
GIE = 1;
PEIE = 1;
ADIE = 1;
ADIF = 0;
}
void interrupt IRS(){
int adc_result;
if(PIE && ADIE && ADFE){
if (adc_result> 818)
{
PORTE=0b000; //Turn LEDs ON
}
else if(adc_result> 613)
{
PORTE=0b101;
}
else if(adc_result> 409)
{
PORTE=0b011;
}
else if(adc_result> 204)
{
PORTE=0b110;
}
}
}
--------------------------------------------------------
PHẦN LỖI
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'E:/dien/nhap_project16f/adc_bai1.X'
make -f nbproject/Makefile-default.mk dist/default/production/adc_bai1.X.production.hex
make[2]: Entering directory 'E:/dien/nhap_project16f/adc_bai1.X'
"C:\Program Files (x86)\Microchip\xc8\v1.34\bin\xc8.exe" --pass1 --chip=16F877 -Q -G --double=24 --float=24 --opt=default,+asm,+asmfile,-speed,+space,-debug --addrqual=ignore --mode=free -P -N255 --warn=0 --asmlist --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,+osccal,-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/adc.p1 adc.c
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1157 : warning: (111) redefining preprocessor macro "_ADCON0_GO_nDONE_POSN" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1248)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1158 : warning: (111) redefining preprocessor macro "_ADCON0_GO_nDONE_POSITION" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1249)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1161 : warning: (111) redefining preprocessor macro "_ADCON0_GO_nDONE_MASK" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1252)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1162 : warning: (111) redefining preprocessor macro "_ADCON0_CHS_POSN" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1253)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1163 : warning: (111) redefining preprocessor macro "_ADCON0_CHS_POSITION" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1254)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1164 : warning: (111) redefining preprocessor macro "_ADCON0_CHS_SIZE" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1255)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1165 : warning: (111) redefining preprocessor macro "_ADCON0_CHS_LENGTH" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1256)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1166 : warning: (111) redefining preprocessor macro "_ADCON0_CHS_MASK" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1257)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1172 : warning: (111) redefining preprocessor macro "_ADCON0_GO_POSN" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1263)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1173 : warning: (111) redefining preprocessor macro "_ADCON0_GO_POSITION" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1264)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1176 : warning: (111) redefining preprocessor macro "_ADCON0_GO_MASK" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1267)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1177 : warning: (111) redefining preprocessor macro "_ADCON0_CHS0_POSN" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1268)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1178 : warning: (111) redefining preprocessor macro "_ADCON0_CHS0_POSITION" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1269)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1181 : warning: (111) redefining preprocessor macro "_ADCON0_CHS0_MASK" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1272)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1182 : warning: (111) redefining preprocessor macro "_ADCON0_CHS1_POSN" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1273)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1183 : warning: (111) redefining preprocessor macro "_ADCON0_CHS1_POSITION" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1274)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1186 : warning: (111) redefining preprocessor macro "_ADCON0_CHS1_MASK" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1277)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1187 : warning: (111) redefining preprocessor macro "_ADCON0_CHS2_POSN" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1278)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1188 : warning: (111) redefining preprocessor macro "_ADCON0_CHS2_POSITION" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1279)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1191 : warning: (111) redefining preprocessor macro "_ADCON0_CHS2_MASK" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1282)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1202 : warning: (111) redefining preprocessor macro "_ADCON0_nDONE_POSN" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1298)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1203 : warning: (111) redefining preprocessor macro "_ADCON0_nDONE_POSITION" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1299)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1206 : warning: (111) redefining preprocessor macro "_ADCON0_nDONE_MASK" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1302)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1207 : warning: (111) redefining preprocessor macro "_ADCON0_GO_DONE_POSN" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1303)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1208 : warning: (111) redefining preprocessor macro "_ADCON0_GO_DONE_POSITION" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1304)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1211 : warning: (111) redefining preprocessor macro "_ADCON0_GO_DONE_MASK" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1307)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:2225 : warning: (111) redefining preprocessor macro "CHS0_bit" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 3655)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:2227 : warning: (111) redefining preprocessor macro "CHS1_bit" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 3657)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:2229 : warning: (111) redefining preprocessor macro "CHS2_bit" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 3659)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:2259 : warning: (111) redefining preprocessor macro "GO_bit" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 3709)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:2261 : warning: (111) redefining preprocessor macro "GO_DONE_bit" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 3711)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:2263 : warning: (111) redefining preprocessor macro "GO_nDONE_bit" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 3713)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:2591 : warning: (111) redefining preprocessor macro "nDONE_bit" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 4213)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:2224 : error: (1098) conflicting declarations for variable "CHS0" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:2224 )
(908) exit status = 1
nbproject/Makefile-default.mk:94: recipe for target 'build/default/production/adc.p1' failed
make[2]: Leaving directory 'E:/dien/nhap_project16f/adc_bai1.X'
nbproject/Makefile-default.mk:78: recipe for target '.build-conf' failed
make[1]: Leaving directory 'E:/dien/nhap_project16f/adc_bai1.X'
make[2]: *** [build/default/production/adc.p1] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
BUILD FAILED (exit value 2, total time: 1s)
Sẵn cho em hỏi cách đưa code lên diễn đàn, tìm cách post code trong diễn đàn mà chưa thấy.
Cám ơn mọi người nhiều ạ.
---------------
PHẦN CHƯƠNG TRÌNH
#include<pic16f887.h>
#include<xc.h>
#include<stdio.h>
#include<stdlib.h>
// CONFIG1
#pragma config FOSC = XT // Oscillator Selection bits (XT oscillator: Crystal/resonator on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN)
#pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT disabled and can be enabled by SWDTEN bit of the WDTCON register)
#pragma config PWRTE = OFF // Power-up Timer Enable bit (PWRT disabled)
#pragma config MCLRE = OFF // RE3/MCLR pin function select bit (RE3/MCLR pin function is digital input, MCLR internally tied to VDD)
#pragma config CP = OFF // Code Protection bit (Program memory code protection is disabled)
#pragma config CPD = OFF // Data Code Protection bit (Data memory code protection is disabled)
#pragma config BOREN = OFF // Brown Out Reset Selection bits (BOR disabled)
#pragma config IESO = OFF // Internal External Switchover bit (Internal/External Switchover mode is disabled)
#pragma config FCMEN = OFF // Fail-Safe Clock Monitor Enabled bit (Fail-Safe Clock Monitor is disabled)
#pragma config LVP = OFF // Low Voltage Programming Enable bit (RB3 pin has digital I/O, HV on MCLR must be used for programming)
// CONFIG2
#pragma config BOR4V = BOR21V // Brown-out Reset Selection bit (Brown-out Reset set to 4.0V)
#pragma= OFF config WRT = OFF // Flash Program Memory Self Write Enable bits (Write protection
#define _XTAL_FREQ 4000000
void main (void)
{
void port_init();
void adc_init();
void in_init();
while(1){
__delay_ms(10);
GODONE = 1;
}
}
void port_init(void){
ANSEL = 0xO8;
ANSELH = 0;
TRISA2 = 1;
TRISE = 0;
PORTE = 0xff;
}
void adc_init(){
ADCON0bits.ADCS1 = 0;
ADCON0bits.ADCS0 = 1;
VCFG0 = 0;
VCFG1 = 0;
CHS3 = 0;
CHS2 = 0;
CHS1 = 1;
CHS0 = 0;
ADFM = 1;
ADON = 1;
__delay_ms(1);
}
void in_init(){
GIE = 1;
PEIE = 1;
ADIE = 1;
ADIF = 0;
}
void interrupt IRS(){
int adc_result;
if(PIE && ADIE && ADFE){
if (adc_result> 818)
{
PORTE=0b000; //Turn LEDs ON
}
else if(adc_result> 613)
{
PORTE=0b101;
}
else if(adc_result> 409)
{
PORTE=0b011;
}
else if(adc_result> 204)
{
PORTE=0b110;
}
}
}
--------------------------------------------------------
PHẦN LỖI
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'E:/dien/nhap_project16f/adc_bai1.X'
make -f nbproject/Makefile-default.mk dist/default/production/adc_bai1.X.production.hex
make[2]: Entering directory 'E:/dien/nhap_project16f/adc_bai1.X'
"C:\Program Files (x86)\Microchip\xc8\v1.34\bin\xc8.exe" --pass1 --chip=16F877 -Q -G --double=24 --float=24 --opt=default,+asm,+asmfile,-speed,+space,-debug --addrqual=ignore --mode=free -P -N255 --warn=0 --asmlist --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,+osccal,-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/adc.p1 adc.c
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1157 : warning: (111) redefining preprocessor macro "_ADCON0_GO_nDONE_POSN" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1248)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1158 : warning: (111) redefining preprocessor macro "_ADCON0_GO_nDONE_POSITION" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1249)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1161 : warning: (111) redefining preprocessor macro "_ADCON0_GO_nDONE_MASK" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1252)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1162 : warning: (111) redefining preprocessor macro "_ADCON0_CHS_POSN" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1253)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1163 : warning: (111) redefining preprocessor macro "_ADCON0_CHS_POSITION" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1254)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1164 : warning: (111) redefining preprocessor macro "_ADCON0_CHS_SIZE" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1255)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1165 : warning: (111) redefining preprocessor macro "_ADCON0_CHS_LENGTH" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1256)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1166 : warning: (111) redefining preprocessor macro "_ADCON0_CHS_MASK" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1257)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1172 : warning: (111) redefining preprocessor macro "_ADCON0_GO_POSN" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1263)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1173 : warning: (111) redefining preprocessor macro "_ADCON0_GO_POSITION" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1264)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1176 : warning: (111) redefining preprocessor macro "_ADCON0_GO_MASK" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1267)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1177 : warning: (111) redefining preprocessor macro "_ADCON0_CHS0_POSN" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1268)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1178 : warning: (111) redefining preprocessor macro "_ADCON0_CHS0_POSITION" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1269)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1181 : warning: (111) redefining preprocessor macro "_ADCON0_CHS0_MASK" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1272)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1182 : warning: (111) redefining preprocessor macro "_ADCON0_CHS1_POSN" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1273)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1183 : warning: (111) redefining preprocessor macro "_ADCON0_CHS1_POSITION" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1274)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1186 : warning: (111) redefining preprocessor macro "_ADCON0_CHS1_MASK" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1277)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1187 : warning: (111) redefining preprocessor macro "_ADCON0_CHS2_POSN" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1278)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1188 : warning: (111) redefining preprocessor macro "_ADCON0_CHS2_POSITION" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1279)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1191 : warning: (111) redefining preprocessor macro "_ADCON0_CHS2_MASK" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1282)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1202 : warning: (111) redefining preprocessor macro "_ADCON0_nDONE_POSN" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1298)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1203 : warning: (111) redefining preprocessor macro "_ADCON0_nDONE_POSITION" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1299)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1206 : warning: (111) redefining preprocessor macro "_ADCON0_nDONE_MASK" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1302)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1207 : warning: (111) redefining preprocessor macro "_ADCON0_GO_DONE_POSN" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1303)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1208 : warning: (111) redefining preprocessor macro "_ADCON0_GO_DONE_POSITION" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1304)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:1211 : warning: (111) redefining preprocessor macro "_ADCON0_GO_DONE_MASK" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 1307)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:2225 : warning: (111) redefining preprocessor macro "CHS0_bit" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 3655)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:2227 : warning: (111) redefining preprocessor macro "CHS1_bit" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 3657)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:2229 : warning: (111) redefining preprocessor macro "CHS2_bit" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 3659)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:2259 : warning: (111) redefining preprocessor macro "GO_bit" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 3709)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:2261 : warning: (111) redefining preprocessor macro "GO_DONE_bit" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 3711)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:2263 : warning: (111) redefining preprocessor macro "GO_nDONE_bit" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 3713)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:2591 : warning: (111) redefining preprocessor macro "nDONE_bit" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f887.h: 4213)
C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:2224 : error: (1098) conflicting declarations for variable "CHS0" (C:\Program Files (x86)\Microchip\xc8\v1.34\include\pic16f877.h:2224 )
(908) exit status = 1
nbproject/Makefile-default.mk:94: recipe for target 'build/default/production/adc.p1' failed
make[2]: Leaving directory 'E:/dien/nhap_project16f/adc_bai1.X'
nbproject/Makefile-default.mk:78: recipe for target '.build-conf' failed
make[1]: Leaving directory 'E:/dien/nhap_project16f/adc_bai1.X'
make[2]: *** [build/default/production/adc.p1] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
BUILD FAILED (exit value 2, total time: 1s)
Comment