e mới tập học pic thôi
thấy trên mạng có code nháy port B như
#include <htc.h>
__CONFIG(XT & WDTDIS & PWRTEN & MCLREN & UNPROTECT & SWBOREN & IESODIS & FCMDIS & LVPDIS & DEBUGDIS);
__CONFIG(BORV21);
#define _XTAL_FREQ 4000000
void main(void)
{
ANSEL=0;
ANSELH=0;
TRISB=0x00;
PORTB=0xFF;
while(1)
{
PORTB=0x00;
__delay_ms(300);
PORTB=0xFF;
__delay_ms(300);
};
}
mà ko hiểu sao ấn ctrl+F10 mà nó hiện ra lỗi là
Clean: Deleting intermediary and output files.
Clean Warning: File "D:\pic\project\project1\main.p1" doesn't exist.
Clean: Done.
Build D:\pic\project\project1\tapsu1 for device 16F877
Using driver C:\Program Files\HI-TECH Software\PICC\9.83\bin\picc.exe
Executing: "C:\Program Files\HI-TECH Software\PICC\9.83\bin\picc.exe" --pass1 D:\pic\project\project1\main.c -q --chip=16F877 -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"
Error [192] D:\pic\project\project1\main.c; 7.1 undefined identifier "ANSEL"
Error [192] D:\pic\project\project1\main.c; 8.1 undefined identifier "ANSELH"
********** Build failed! **********
mọi người giúp em với ạ.e cảm ơn.hjhi
thấy trên mạng có code nháy port B như
#include <htc.h>
__CONFIG(XT & WDTDIS & PWRTEN & MCLREN & UNPROTECT & SWBOREN & IESODIS & FCMDIS & LVPDIS & DEBUGDIS);
__CONFIG(BORV21);
#define _XTAL_FREQ 4000000
void main(void)
{
ANSEL=0;
ANSELH=0;
TRISB=0x00;
PORTB=0xFF;
while(1)
{
PORTB=0x00;
__delay_ms(300);
PORTB=0xFF;
__delay_ms(300);
};
}
mà ko hiểu sao ấn ctrl+F10 mà nó hiện ra lỗi là
Clean: Deleting intermediary and output files.
Clean Warning: File "D:\pic\project\project1\main.p1" doesn't exist.
Clean: Done.
Build D:\pic\project\project1\tapsu1 for device 16F877
Using driver C:\Program Files\HI-TECH Software\PICC\9.83\bin\picc.exe
Executing: "C:\Program Files\HI-TECH Software\PICC\9.83\bin\picc.exe" --pass1 D:\pic\project\project1\main.c -q --chip=16F877 -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"
Error [192] D:\pic\project\project1\main.c; 7.1 undefined identifier "ANSEL"
Error [192] D:\pic\project\project1\main.c; 8.1 undefined identifier "ANSELH"
********** Build failed! **********
mọi người giúp em với ạ.e cảm ơn.hjhi
Comment