PDA

View Full Version : Processor Speed Test?



Ramius
- 12th May 2011, 02:48
Anyone ever written something to tell you the actual speed the PIC's processor is really running at?

HenrikOlsson
- 12th May 2011, 07:12
No, not really but depending on what type of accuracy you need it may be as simple as blinking a LED.

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.

rmteo
- 12th May 2011, 16:51
Sounds like the OP wants to do something like this:


cpu_speed = ........ ' compute actual CPU speed
if cpu_speed = 5 then
' do something
else
' do somethingelse
end if

Acetronics2
- 12th May 2011, 18:03
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

mackrackit
- 14th May 2011, 02:31
You might be able to use something like this
http://www.picbasic.co.uk/forum/showthread.php?t=9350