One of the easiest ways I can think of off the top of my head...
Use PBP's COUNT command...
But that's only good up to about 125Khz when the PIC is running at 20Mhz.
So, you could 'pre-divide' (like the various prescaler/postscalers inside the PIC) the incoming signal using a divide-by-x chip, like maybe a 74193 or something similar.
Feed the input signal into the 74193, take the output from the 74193's Qd output, which will be a divide-by-16 output, and will effectively increase PBP's COUNT commands range up to about 2Mhz (with a decrease in resolution of course).
Cascade 2 of the 74193's back-to-back, and you should be able to measure signals up to about 32Mhz (which is the effective limit of the 74LS193), using PBP's COUNT command.
Bookmarks