Recently on this forum there was an inquiry on how to setup an Elapsed Timer using Darrel Taylor's
Instant Interrupts "DT_INT-14.bas" to work at 1ms resolution.

Some time ago I had created just such a project for my own purposes.
I thought it might be worth sharing with the larger audience here.

*** First of all let me start by saying that Darrel gets all of the credit for this project. ***

His development of DT's Instant Interrupts for PBP and his initial Elapsed Timer demo were the basis for my project.
I merely made some minor changes to the Elapsed Timer demo to achieve what I needed.

I have attached a zip file with all of the independent files including DT's Instant Interrupt include files.

The project zip file includes (5) files:
1. NewElapsed_Demo.pbp v1.10 (My Elapsed Timer Demo main program)
2. ElapTimer_Interrupt.pbp v1.0 (My version of DT's Elapsed_INT.bas)
3. DT_INTS-14.bas v1.10 (This file has NOT been modified)
4. ReEnterPBP.bas v3.4 (This file has NOT been modified)
5. README.txt (Some Installation information)

My code files are commented fairly well, especially within the "ElapTimer_Interrupt.pbp" file,
which is based on DT's file, "Elapsed_INT.bas", and where I made my modifications.

The project was created, compiled and tested with PBP v3.0.7.4 and MPASM v8.90.

Other than making changes to support a 1ms Timer1 Interrupt period in the ElapTimer_Interrupt file,
I also incorporated modifications to the same file that were inspired by DT's "Elapsed_INT-18.bas" v1.2 file
which he created an Elapsed Demo project for 18F series PICs.
There were some excellent improvements he made that simplifies the use of the file.
Most notably, the removal of hard-coded TimerConst reload values for OSC frequencies.

The project displays an LCD clock with the following output:
dd-hh:mm:ss.mmm

dd = days
hh = hours
mm = minutes
ss = seconds
mmm = milliseconds

With the LCDOUT execution time being what it is, the milliseconds display will not increment by a single ms; however, the Timer1 interrupt is
firing at 1ms intervals and recording the number of elapsed milliseconds.
Rather, it will increment by a few ms.


In the spirit of Darrel's generosity to all of us here, I hope some may find this project helpful.

ElapsedDemo_1ms.zip