It was my error to mention dv/dt. Although I would like to measure this also, the frequency is what I am looking for.
Thank you IOANNIS for your suggestions but my thrust right now is to try and do it all with the 16F877A.

The program I have right now runs just fine when it is compiled and programmed under ICD. Using the real time compiler and programmer it doesn't work?????

Any suggestions?