measure the xtal


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Jun 2006
    Location
    Greece
    Posts
    302


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    To measure something, anything, you have to have an accurate timebase. To measure the internal clock of the PIC, using that same internal clock as your timebase as you've shown in your brief example, doesn't work.
    Do you have an o'scope?
    Yes i have.
    Or how to measure a xtal on RA4;
    I want to measure the frequency of a oscillator with xtal or from a signal connecting to RA4
    Last edited by savnik; - 7th June 2007 at 16:13.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by savnik View Post
    Yes i have.
    Or how to measure a xtal on RA4;
    I want to measure the frequency of a xtal or from a signal connecting to RA4
    So you want to make a frequency counter then...not measure the internal frequency of your PIC...

  3. #3
    Join Date
    Jun 2006
    Location
    Greece
    Posts
    302


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    So you want to make a frequency counter then...not measure the internal frequency of your PIC...
    Yes.I want to measure the frequency of a oscillator with xtal or from a signal.

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by savnik View Post
    Yes.I want to measure the frequency of a oscillator with xtal or from a signal.
    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.

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Thumbs up Simple ...

    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 " !!!
    *****************************************

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    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
    Won't the output from RCTime be a logarithmic response, in other highly non-linear? You'd probably have to do some serious math to get accurate results.

  7. #7
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    Won't the output from RCTime be a logarithmic response, in other highly non-linear? You'd probably have to do some serious math to get accurate results.
    Hi, Skimask

    you Just forgot The XTal range won't be from zero to infinite ... 1 to 20 ... may be.

    But, as always, I'm not so sure of what our friend intends to do ...

    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 " !!!
    *****************************************

Similar Threads

  1. 16F877A with 20MHz XTAL not working?
    By ustredna in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 19th August 2011, 15:04
  2. Xtal speed vs PIC power
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 4th January 2010, 19:55
  3. Using CCP1 and CCP2 to measure instant fuel consumption
    By srspinho in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 20th September 2008, 15:50
  4. How can I measure Duty cycle ?
    By MaxiBoost in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 28th December 2006, 15:02
  5. using internal xtal
    By jojokatada in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 3rd April 2005, 16:25

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts