Posts

Showing posts with the label timers

Using Timers in PIC16F877A

Image
Using Timers in PIC16F877A A timer counts pulses of a fixed, known frequency usually the system clock for the processor.Physically, timer is a register whose value is continually increasing to 255, and then it  starts all over again: 0, 1, 2, 3, 4...255....0,1, 2, 3......etc.  This incrementing is done in the background of  everything a microcontroller does. It is up to programmer to think up a way how he  will take advantage of this characteristic for his  needs. One of the ways is increasing some variable on  each timer overflow.  � If we know how much time a timer needs to make one complete round, then multiplying the value of a variable by that time will yield the total amount of elapsed time. PIC16F877A has 3 timer modules, Timer0,Timer1 and Timer2.The device has three readable and writeable hardware timers that can increment automatically each instruction cycle (if no prescaler is used).All timers can...