External interrupt For CSS Compiler

 

#include <16F877.h> 
#device adc=8
#fuses XT,NOWDT,NOPROTECT,NOLVP    
#use delay(clock=4000000)        

#INT_EXT                                                                 
void EXT_ISR(void){                 
    output_toggle(PIN_B7);        
    delay_us(300);
 }

void Init_MCU(void){
    enable_interrupts(GLOBAL);    
    enable_interrupts(INT_EXT);   
    ext_int_edge(H_TO_L);         
    set_tris_B(0x01);
    output_low(pin_B7);
}

void main(){
    Init_MCU();                   
    while (TRUE) {
        output_toggle(PIN_B6);     
        delay_ms(1000);                     
    }
}

 

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.