Using the template code I wrote earlier, I’ve written a demo application that displays the elapsed time to the console window. From the description in the code:
This demonstrates the use of a timer and associated interrupt. In this example we’ll setup a timer to generate an interrupt every millisecond (= 1000Hz rate). In response to this interrupt, the microcontroller will execute a specific piece of code called an interrupt handler (see user_routines_fast.c). This interrupt handler will simply increment the global variables “msClock” and “Clock”. High-level user code can then access these variables to create sophisticated state machines and highly accurate sequencers. We’ll just keep the time.
The code can be found here.
Because I found MPLAB 6.3 so buggy, I updated to 6.4 (found here)](http://www.microchip.com/1010/pline/tools/picmicro/devenv/mplabi/mplab6/index.htm) which isn’t compatible with the 6.3 project file format. Consequently, you’ll need to update to 6.4 or create a new project with the project wizard if you want to re-build the code. Include all files in the .zip except ifi_library.lib. If that’s too much hassle, I’ve also included the .hex file which IFI_Loader can use.