Last edited by savnik; - 7th June 2007 at 16:13.
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.
Hi, Savnik
An easy solution is to use an external RC circuit and use ... RCTime ( 16 Bits result ...) !!!
calibrate RCTime ( low drift components !!! ) with a Known Freq XTal ...
With another XTal The Result will be proportionnal to the XTal Freq change ...
That's all, Folks !!!
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks