If using the PIC as the frequency generator, wouldn't it be simpler to calculate the frequency rather than measure it?