16f877 gecikme sorunu

mignot

Üye
Katılım
22 Kas 2008
Mesajlar
3
Puanları
1
Yaş
39
ayarlamaları asagıda ki gıbı yaptım fakat led 1000ms yanıo ama sonme suresı yanı (delay_ms(gecikme); satırı 1000ms gecıkme saglamıyor cok kısa bı sure sonuk kalıyor.ayrıca islmcı 20mhz yazıo uzernde ama programda 4mhz ayarlayp 4mhz osılator baglıyorm bilginiz olsun...Yardımlarınız için şimdiden teşekkur ederim...



#include <16F877.h>
#device adc=8

#FUSES NOWDT //No Watch Dog Timer
#FUSES XT //Crystal osc <= 4mhz
#FUSES NOPUT //No Power Up Timer
#FUSES NOPROTECT //Code not protected from reading
#FUSES BROWNOUT //Reset when brownout detected
#FUSES LVP //Low Voltage Programming on B3(PIC16) or B5(PIC18)
#FUSES NOCPD //No EE protection
#FUSES NOWRT //Program memory not write protected
#FUSES NODEBUG //No Debug mode for ICD

#use delay(clock=4000000)




#include "C:\yazılım\led yakma sondurme\4mhz.h"
#include <float.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>


void main()
{
int gecikme=1000;
int i;

setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_psp(PSP_DISABLED);
setup_spi(FALSE);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);


output_d(0x00);
delay_ms(1000);


while(1){
if(input(PIN_A0)==1){
for(i=20; i>0; i--){
output_d(0x01);
delay_ms(1000);
output_d(0x00);
delay_ms(gecikme);
}
}
}
}
 
sorun aynı gun halledilmiştir cevaba gerek yok...
 

Forum istatistikleri

Konular
128,217
Mesajlar
915,887
Kullanıcılar
450,000
Son üye
ozproje46

Yeni konular

Geri
Üst