ABSTRACT

The mid-range PICs contain facilities and devices for controlling and manipulating time lapses in a program; these are usually in the form of timing and counting operations. The basic timer facility on the 16F84 PIC is known as the Timer0 module, as the free-running timer, as the timer/counter, or simply as TMR0. Timer0 is an internal 8-bit register that increments automatically with every PIC instruction cycle until the count overflows the timer capacity, which takes place when the timer count goes from 0xff to 0x00. The Timer0 module can be visualized as a register that increments with every instruction cycle at one-fourth the clock rate, that is, as a timer. PIC applications sometimes read the timer register directly. Alternatively, Timer0 can be set up to generate an interrupt at every transition from 0xff to 0x00, that is, every time the counter overflows.