Capture ccs compiler, CCP_CAPTURE_fe yükselen kenar CCP_CAPTURE_re düşen kenar
CCP_CAPTURE_DIV_4 4 yükselen kenar CCP_CAPTURE_DIV_16 yükselen kenar olarakta kullanabiliriz.
#include <12f683.h>
#fuses hs,nomclr,nobrownout,noput
#use delay( clock=4m )
//#use rs232(baud=9600,parity=N,xmit=PIN_A0,rcv=PIN_A1,bits=8,stop=1)
int16 i=0;
int sonuc;
#INT_CCP1
void yakala1_kesmesi ()
{
i++;
output_high(pin_a0);
delay_ms(1000);
output_low(pin_a0);
delay_ms(500);
}
void main()
{
set_tris_a(0x00);
output_a(0x00);
enable_interrupts(INT_CCP1);
//SETUP_CCP1(CCP_CAPTURE_RE);
SETUP_CCP1(CCP_CAPTURE_fe);
enable_interrupts(GLOBAL);
while(TRUE)
{
//! printf("\f %lu ",i);
//delay_ms(100);
}
}
Hiç yorum yok:
Yorum Gönder
Her yorum bilgidir. Araştırmaya devam...