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




Current Project / Post can also be found using:

  • how to create 100 Hz with timer for pic ccs
  • timer0 using ccs
  • ccs pic timer0
  • ccs pic16f877a timer0 delay

Leave a Comment

*
= 5 + 7

Read previous post:
ESP8266 touchscreen WiFi light controller and clock
ESP8266 touchscreen WiFi light controller and clock

A couple of months ago I picked up cheap WiFi-controlled LED bulbs (one among dozens of very similar devices), after seeing them at a...

Close
Scroll to top