External interrupt For CSS Compiler

 

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

#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);                     
    }
}

 

About The Author

Ibrar Ayyub

I am an experienced technical writer with a Master's degree in computer science from BZU Multan University. I have written for various industries, mainly home automation, and engineering. I have a clear and simple writing style and am skilled in using infographics and diagrams. I am a great researcher and is able to present information in a well-organized and logical manner.

Follow Us:
LinkedinTwitter