Site içi Arama

Ara

CCS C ve 16F628 ile yapılan karaşimşek devrsesi

Samet Yüzügüllü - 02.02.2013
CCS C ve 16F628 ile yapılan karaşimşek devrsesi



Ekler: ccs-c-krasimsek.zip

Devrenin CCS C kodları:

#include <16F628A.h>

#FUSES NOWDT //No Watch Dog Timer
#FUSES HS //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD)
#FUSES NOPUT //No Power Up Timer
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOMCLR //Master Clear pin used for I/O
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOCPD //No EE protection

#use delay(clock=4000000)
#use fast_io(b)
int8 sayi=0;



void main()
{

setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_ccp1(CCP_OFF);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
sayi=1;
set_tris_b(0);
output_b(0);

while(1){
output_b(sayi);
sayi=sayi<<1;
delay_ms(100);

output_b(sayi);
sayi=sayi<<1;
delay_ms(100);

output_b(sayi);
sayi=sayi<<1;
delay_ms(100);

output_b(sayi);
sayi=sayi<<1;
delay_ms(100);

output_b(sayi);
sayi=sayi<<1;
delay_ms(100);

output_b(sayi);
sayi=sayi<<1;
delay_ms(100);

output_b(sayi);
sayi=sayi<<1;
delay_ms(100);

output_b(sayi);
sayi=sayi>>1;
delay_ms(100);

output_b(sayi);
sayi=sayi>>1;
delay_ms(100);

output_b(sayi);
sayi=sayi>>1;
delay_ms(100);

output_b(sayi);
sayi=sayi>>1;
delay_ms(100);

output_b(sayi);
sayi=sayi>>1;
delay_ms(100);

output_b(sayi);
sayi=sayi>>1;
delay_ms(100);

output_b(sayi);
sayi=sayi>>1;
delay_ms(100);
}

}




E-posta: samet_esk_26@hotmail.com
İçerik Yan Blok
Konular
Tasarım: Teknimer Teknoloji
Yukarı