#include<16f877a.h>
#use delay(clock=16m)
#fuses hs,nowdt,nobrownout,nolvp,put,noprotect
#INT_TIMER2
void tmr2()
{
output_toggle(pin_d1);
}
// (1/clock)*4*t2*periyot+1
// (1/16000000)*4*16*26
void main()
{
setup_timer_2(T2_DIV_BY_16,28,1);
enable_interrupts(INT_TIMER2);
enable_interrupts(global);
while(true)
{
output_toggle(pin_d0);
delay_ms(1000);
}
}
Hiç yorum yok:
Yorum Gönder
Her yorum bilgidir. Araştırmaya devam...