AN2039-Adding a Timer
Using MPLAB® Code Configurator (MCC) to add Timer1 function to an application
With the project opened in MPLAB X, from the main menu, select Tools > Microchip Embedded > MPLAB Code Configurator.
After MCC opens, from the Device Resources menu, select Timer1 to bring it into the Project Resources window:
Click on TMR1 to edit and enter values to configure TMR1:
To configure the TMR1 for a 1-millisecond (mS) interrupt using the 16 MHz internal clock, edit the Time Period to 1.0 mS, check the Enable Timer Interrupt box, and edit the Callback Function Rate to 1.
Click the Generate Code button for MCC to create code for TMR1.
Using the MCC, this method can be used to initialize and create functions for the Analog-to-Digital Converter (ADC), Pulse Width Modulation (PWM), GPIO, Flash Memory, and I²C.