Learn   /   Peripheral Tutorials   /   PIC16F877A

Timer 0 mode timer For CSS Compiler

Timer 0 mode timer For CSS Compiler: circuit, code and details for this PIC microcontroller project.

Tags: #css#timer
Published

At a glance

CategoryPeripheral Tutorials
PIC modelPIC16F877A
IncludesCode
Reading time~1 min

 

C source
// 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);
   }
}
Beginner Tutorials · PIC16F877A

PIC16F877 Driving LCD in 4-Bit Mode using PIC16F877 with Proteus Simulation

Introduction This microcontroller project shows how a PIC16F877 can drive an LCD display using 4-bit mode inside a Proteus simulation.The project demonstrates...

Programmers & ICSP · PIC16F877A

EPE PIC/LCD Demo using PIC16F877 with Proteus Simulation

IntroductionThe EPE PIC/LCD Demo is a classic microcontroller project that demonstrates how a PIC16F877 can fully control a PG12864F graphical LCD.Designed as...

Motors & Robotics · PIC16F877A

Efficient Sun-Following Robot: A Solar Tracker with Microcontroller Control

Abstract The impending global challenge of dwindling non-renewable fuel resources underscores the urgency of transitioning towards renewable energy alternatives like solar power....

Peripheral Tutorials · PIC18F4550

PICDEM FS USB Mass Storage Device using PIC18F4550 with Proteus Simulation

Introduction This microcontroller project demonstrates how to simulate a USB Mass Storage Device (MSD) using the PIC18F4550 in a Proteus simulation environment....

Peripheral Tutorials

Hands-On Digital I/O Lab with PIC18F46K22 Microcontroller

PIC18F46K22 Microcontroller Digital I/O specifically explores the design of simple combinational circuits using the digital I/O capabilities of the PIC18F46K22 microcontroller. Moving...

Peripheral Tutorials

Design for manufacturing and assembly: DFA&DFM

Product developers understand the challenges involved in creating a market-ready product. Even experienced designers often go through multiple prototype iterations before reaching...

Ibrar Ayyub

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...