Timer0 Example Using MPLAB Code Configurator
The MPLAB Code Configurator (MCC) makes setting up the Timer0 peripheral very easy. The MCC will automatically generate the code to load the proper registers and initialize the proper values to produce the desired Timer0 operation.
The best way to show how this is done is through a simple example. In this example, Timer0 is used as a time base for toggling an I/O pin. A PIC16F1825 will be used with the 4 MHz internal oscillator and the RA2 I/O pin will toggle on every Timer0 overflow. Timer0 will be set to overflow at a 2.5 millisecond rate using a 1:32 prescaler.