Specifications

Chapter 2 - Microcontroller PIC16F84
by one. This provides us with the ability to measure longer timer periods.
After each count up to 255, timer resets its value to zero and starts with a new cycle of counting to
255. During each transition from 255 to zero, T0IF bit in INTCOM register is set. If interrupts are
allowed to occur, this can be taken advantage of in generating interrupts and in processing interrupt
routine. It is up to programmer to reset T0IF bit in interrupt routine, so that new interrupt, or new
overflow could be detected. Beside the internal oscillator clock, timer status can also be increased by
the external clock on RA4/TOCKI pin. Choosing one of these two options is done in OPTION register
through T0CS bit. If this option of external clock was selected, it would be possible to define the edge
of a signal (rising or falling), on which timer would increase its value.
In practice, one of the typical example that is solved via external clock and a timer is counting full
turns of an axis of some production machine, like transformer winder for instance. Let's wind four
metal screws on the axis of a winder. These four screws will represent metal convexity. Let's place
http://www.mikroelektronika.co.yu/english/product/books/PICbook/2_08Poglavlje.htm (2 of 5) [4/2/2003 16:17:58]