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 holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter