Sayıcı devrem çalışmıyor

Başlatan taytis, 23 Aralık 2008, 11:12:16

taytis

Arkadaşlar basit bir sayıcı devresi yaptım uzun zamandır pic'lerle uğraşmadığıma paslanmışım. Program mantıkta hata vermiyor proteusta çalışıyor ama pratikte yaptığım bir hatamı var ?

- Lcd'nin data uçları RB portu diğer RS-RW-E uçlarıda RA portuna bağlı.

#if defined(__PCM__)
#include <16F84A.h>


#FUSES NOWDT //No Watch Dog Timer
#FUSES NOPUT //No Power Up Timer
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O



#use delay(clock=6000000,RESTART_WDT)
#include <LCDF628.C>

void main()
{
int32 x;
x = read_EEPROM (10);
set_tris_a (0b11111111); // RA portu giriş //
set_tris_b (0b11111111); // RB portu GİRİŞ //

lcd_init(); // LCd ile haberleş
lcd_gotoxy(1,1);
lcd_putc("xxxxx\n");
lcd_putc("xxxxx");
DELAY_MS(1000);
lcd_putc("\f");
lcd_gotoxy(1,1);
lcd_putc("xxxx:\n");
lcd_putc("xxxxx");
DELAY_MS(1000);
lcd_putc("\f");
lcd_gotoxy(1,1);
lcd_putc("xxxxx:\n");
lcd_putc("xxxxxx");
DELAY_MS(1000);
lcd_putc("\f");
lcd_gotoxy(1,1);
lcd_putc("PRES01 : SAYICI\n");

lcd_gotoxy(7,2);
printf(lcd_putc,"%ld",x);

for(;{
if(!input(PIN_A4)){
x=x+1;output_high(PIN_B4);
lcd_gotoxy(7,2);
printf(lcd_putc,"%ld",x);
write_eeprom(10,x);
while(!input(PIN_A4));
}else {output_low(PIN_B4);}

if(!input(PIN_B7)){X=0;
write_eeprom(10,x);

lcd_putc("\f");
lcd_gotoxy(1,1);
lcd_putc("PRES01:SAYICI\n");
lcd_gotoxy(7,2);
printf(lcd_putc,"%ld",x);

}

}

}


Konuyla ilgili başlık belirtiniz - Analyzer