#include <16F628A.h>
#fuses HS,NOPROTECT,NOBROWNOUT,NOLVP,NOPUT,NOCPD,WDT
#use delay(clock=20000000)
#define use_portb_lcd TRUE // LCD B portuna bağlı
#include <lcd420.c>
#use fast_io(b)
#use fast_io(a)
int16 i=0;
int k=0;
#int_timer0
void timer0_kesme()
{
i++;
set_timer0(255);
}
#int_timer1
void timer1_kesme()
{
set_timer1(40536);
k++;
if(k==50)
{
lcd_gotoxy(1,1);
lcd_putc("frekans");
lcd_gotoxy(1,2);
printf(lcd_putc,"%ld",i);
i=0;
k=0;}
}
void main()
{
setup_timer_1(T1_INTERNAL | T1_DIV_BY_8);
setup_timer_2(T2_DISABLED,0,1);
enable_interrupts(global);
set_tris_a(0x10);
set_tris_b(0x00);
setup_timer_0(RTCC_EXT_L_TO_H | RTCC_DIV_2);
lcd_init(); // LCD hazırlanıyor
enable_interrupts(int_timer0);
enable_interrupts(int_timer1);
enable_interrupts(global);
set_timer0(255);
set_timer1(40536);
while(1);
}