program doğru ama mplab ccs-c hata veriyor

kwister

Üye
Katılım
2 Nis 2012
Mesajlar
51
Puanları
1
aşağıda görmüş olduğunuz programı yazdım. programın amacı start butonuna basıldığında saymaya başlayacak, stop butonuna basıldığında duracak, reset butonuna basıldığı zaman da resetleyecek. programı yazdım ama 9 tane hata veriyor. bu neyden kaynaklanıyor olabilir?

işte program

#include <16f877.h>#fuses XT,NO_WDT
#use delay(clock=4000000)
#define start pin_d0
#define stop pin_d1
#define reset pin_d3
void main()
{
int8 a;
set_tris_c(0xff);
set_tris_d(0x00);
j0: a=0;
j1: output_c(a);
if (input(start)==1)
{
a=1;
goto j1;
}
if (input(stop)==1)
{
a=0;
goto j1;
}
if (input(reset)==1)
{
goto j0;
}
if (a==1)
{
delay_ms(100);
a++;
}
goto j0;
}

buda hatalarım

*** Error 111 "aa.c" Line 2(7,17): Unknown keyword in #FUSES "NO_WDT"
*** Error 128 "aa.c" Line 7(1,8): A #DEVICE required before this line
*** "aa.c" Line 10: Error #12: Undefined identifier -- set_tris_c
*** "aa.c" Line 11: Error #12: Undefined identifier -- set_tris_d
*** "aa.c" Line 13: Error #12: Undefined identifier -- output_c
*** "aa.c" Line 14: Error #12: Undefined identifier -- input
*** "aa.c" Line 19: Error #12: Undefined identifier -- input
*** "aa.c" Line 24: Error #12: Undefined identifier -- input
9 Errors, 0 Warnings.
 
#include <16f877.h> bu header dosya bir şekilde açılamamış veya içi boş. Dosya yerinde mi içi dolu mu bi kontrol et
 
#include <16f877.h>
#fuses XT,NOWDT
#use delay(clock=4000000)
#define start pin_d0
#define stop pin_d1
#define reset pin_d3
void main()
{
int8 a;
set_tris_c(0xff);
set_tris_d(0x00);
j0: a=0;
j1: output_c(a);
if (input(start)==1)
{
a=1;
goto j1;
}
if (input(stop)==1)
{
a=0;
goto j1;
}
if (input(reset)==1)
{
goto j0;
}
if (a==1)
{
delay_ms(100);
a++;
}
goto j0;
}
***********************
programınızdaki NO_WDT deki yazım hatasını düzelttiginizde aşagıdaki hex dosyası oluşuyor.

File Summary:
Filename: C:\Users\sssssssssss\Desktop\a\a_.hex
File Status: Good
Target Chip: PIC16F877
File Type: INHX8 (Intel Hex)
Program Size: 82 Instructions (1%)
Program Range: 0000-0051
Data EE Size: 0 bytes
Checksum: E026
Config Size: 2 bytes
Created: 21-Eyl-13 22:22
Addresses are: Word addresses


Program Memory
000000: 3000 008A 281B 0000 3022 0084 1383 0800
000008: 1903 2818 3001 00F8 01F7 0BF7 280D 0BF8
000010: 280C 304A 00F7 0BF7 2813 2816 0B80 280A
000018: 118A 120A 284F 0803 391F 0083 30FF 00A0
000020: 1683 141F 149F 151F 119F 1383 30FF 0087
000028: 1283 00A0 3000 1683 0088 1283 01A1 3000
000030: 00A0 1683 0187 1283 0821 0087 1683 1408
000038: 1283 1C08 283E 3001 00A1 282F 1683 1488
000040: 1283 1C88 2845 01A1 282F 1683 1588 1283
000048: 1988 282E 0B21 2850 3064 00A2 2804 0AA1
000050: 282E 0063
Configuration Words
002007: 3F71
Program Memory


;PIC16F877
;CRC=3A42 CREATED="21-Eyl-13 22:22"
 

Forum istatistikleri

Konular
128,133
Mesajlar
915,308
Kullanıcılar
449,850
Son üye
umutbaysal9

Yeni konular

Çevrimiçi üyeler

Geri
Üst