View Single Post
Old 15-07-2012, 11:28 AM   #1
buivantuyen89th
Đệ tử 3 túi
 
buivantuyen89th's Avatar
 
Tham gia ngày: Jun 2012
Bài gửi: 54
:
xin gỡ lỗi chương trình ccs cho pic

xin chào các cao nhân.mình vừa mới học PIC nên mình có gặp phải lỗi này mà không biết gỡ thế nào. mong các cao nhân chỉ giúp
mình viets 1 đoạn code như sau:
#include <main.h>
#include <16F877A.h>
#include <def_877a.h>
#FUSES NOWDT, HS, NOPUT, NOPROTECT, NODEBUG, NOBROWNOUT, NOLVP, NOCPD, NOWRT
#use delay(clock=20000000)
#byte PORTB=0x06
void main()
{
TRISB = 0x00;
PORTB = 0xFF;
While(1)
{
PORTB = 0;
delay_ms(250);
PORTB = 0xFF;
delay_ms(250);
}
}
nhung khi dịch nó báo lỗi:
***Error23"c:\porgram file\PICC\divices\16F877A.h"line 2(8,9):Can not change device type this far into the code
***Error48"c:\porgram file\PICC\divices\16F877A.h"line 179(2,6):Expecting a(
***Error48"c:\porgram file\PICC\divices\16F877A.h"line 179(21,26):Expecting a(
***Error48"c:\porgram file\PICC\divices\16F877A.h"line 179(0,1):Expecting a declaration
lỗi đầu tiên no chỉ vào: #device PIC16F877A
lỗi thứ 2: #word CCP_1 = getenv("SFR:CCPR1L") (nó chỉ vào tử "Word")
lỗi thứ 3: #word CCP_1 = getenv("SFR:CCPR1L") (nó chỉ vào dấu "=")
lỗi thứ 4: #define CCP_PWM_PLUS_3 0x3c(nó chỉ vào cuối dòng)
cụ thể lỗi trong file sau: http://www.mediafire.com/?22irvozaahu4rbg
mong các bạn chỉ giúp cho mình đang rất vội làm đồ án tốt nghiệp.
Thanks!
buivantuyen89th vẫn chưa có mặt trong diễn đàn   Trả Lời Với Trích Dẫn