Processor Speed Test?


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322

    Default Processor Speed Test?

    Anyone ever written something to tell you the actual speed the PIC's processor is really running at?

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,520


    Did you find this post helpful? Yes | No

    Default Re: Processor Speed Test?

    No, not really but depending on what type of accuracy you need it may be as simple as blinking a LED.
    Code:
    DEFINE OSC 4
    TRISB.0 = 0
    Main:
      PortB.0 = 1
      PauseUs 250
      PortB.0 = 0
      PauseUs 250
    Goto Main
    Now put the scope or frequency counter on PortB.0, you should get a 2kHz signal, if you don't the PIC isn't running at 4MHz.

  3. #3
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default Re: Processor Speed Test?

    Sounds like the OP wants to do something like this:

    Code:
    cpu_speed = ........     ' compute actual CPU speed
    if cpu_speed = 5 then
      ' do something
    else
      ' do somethingelse
    end if
    Why pay for overpriced toys when you can have
    professional grade tools for FREE!!!

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Default Re: Processor Speed Test?

    Quote Originally Posted by Ramius View Post
    Anyone ever written something to tell you the actual speed the PIC's processor is really running at?
    an external integrated oscillator feeding Timer1 in capture mode ???

    using mains rectified to get a precise 100 ( or 120 ! ) Hz signal and measure the supposed 10 or 8.33 ms period ??? - "Pulsin" can be used here.

    one could even think to an auto-adjustment through the OSCTUNE register ... if intosc used.

    ...

    if only a rough idea is needed ... some RC external ladder with RC Time function ...

    Alain
    Last edited by Acetronics2; - 12th May 2011 at 17:10.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: Processor Speed Test?

    You might be able to use something like this
    http://www.picbasic.co.uk/forum/showthread.php?t=9350
    Dave
    Always wear safety glasses while programming.

Members who have read this thread : 1

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