Timer 0 mode timer For CSS Compiler

 

// Generator frequency 100 Hz   with Timer0 For Pic16f877     //  
//#include "D:\MICRO_PICC_Group\timer\timer_0\timer_0_100hz.h"
#include <16F877.h>
#device adc=8
#FUSES NOWDT,XT                    //No Watch Dog Timer
#use delay(clock=4000000)

int1 time;
#int_RTCC
void  RTCC_isr(void) 
{
  output_toggle(pin_b0);
/*  
 time =!time;
   if(time==1){
      output_high(pin_b0);
   }
   if(time==0){
      output_low(pin_b0);
   }*/
   set_timer0(236);
}

void main()
{
   setup_adc_ports(NO_ANALOGS);
   setup_adc(ADC_OFF);
   setup_psp(PSP_DISABLED);
   setup_spi(SPI_SS_DISABLED);
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_256);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
   enable_interrupts(INT_RTCC);
   enable_interrupts(GLOBAL);
   set_timer0(236);   
   set_tris_b(0x00);
   time =0;
   while (TRUE){
      output_high(pin_b5);
      delay_ms(5);
      output_low(pin_b5);
      delay_ms(5);
   }
}

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