Shop OBEX P1 Docs P2 Docs Learn Events
Program exicution Speed — Parallax Forums

Program exicution Speed

markistuffmarkistuff Posts: 20
edited 2007-07-03 20:52 in General Discussion
Hi Everyone,
ive got a quick question,· is thier a simple way·to determine how fast a sx.b program will run at a given mhz?
im trying to build a·cheep·and simple·oscilloscope·i want to read an adc chip then do some calcualtions and then send the serial data out to a computer.· now if i can figure·out how long it will take to complate each loop then it would help me in·determing the·right porportions·for the graph·on the computer.
THanks·

Comments

  • JonnyMacJonnyMac Posts: 8,945
    edited 2007-06-30 15:18
    You can determine exactly how fast the program will run; imply open the SRC file generated by the compiler and count the assembly cycles. Simple: yes. Easy: probably not.
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2007-07-01 12:15
    You might also consider, running your code with SXSim which would count the cycles for you, and would also give you the execution time, provided you have specified the correct clock frequency. But be warned, SXSim executes code much slower than a real SX. Therefore, it may take you a while to have it run through a certain program loop.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
  • markistuffmarkistuff Posts: 20
    edited 2007-07-01 19:42
    Thanks guys for the sugestions, ill give 'em a try.

    Mark
  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2007-07-03 20:52
    If you already have access to an oscilloscope or, even better, a logic analyzer you can set a spare output pin high when you enter the loop and low when you exit the loop. This may not be as accurate as the above methods but it can quickly give you a ballpark figure.

    - Sparks
Sign In or Register to comment.