7 Mayıs 2021 Cuma

CCP kesme (interrupts) ccs compiler

 CCP kesme (interrupts) ccs compiler örnek uygulama

#include<16f877a.h>

#fuses hs,nowdt,nodebug

#use delay(clock=20m)


int i=0;


#int_ccp1

void yukari_ccp1()

{

i=2*i+1;

output_b(i);

}


#int_ccp2

void asagi_ccp2()

{

i=i-1-i/2;

output_b(i);

}


void main()

{

set_tris_b(0x00);

set_tris_a(0x03);


output_b(0x00);


setup_ccp1(ccp_capture_fe);

setup_ccp2(ccp_capture_fe);

enable_interrupts(global);

enable_interrupts(int_ccp1);

enable_interrupts(int_ccp2);

while(true)

{

}

}



Hiç yorum yok:

Yorum Gönder

Her yorum bilgidir. Araştırmaya devam...