Jump to content
Sign in to follow this  
ner

Get The Timing Based On Time

Recommended Posts

hallo...

how do i measure the eact timing on my code using boostc?

even it have speed tester, but it dont show in time base....

and how do i measure my the time of my desired code?

Share this post


Link to post
Share on other sites

You can see the .asm translation of your code.

The base time is clock.

One instruction cycle consists of four oscillator period.

Every instruction needs 1 or 2 cycles for execution (you can see how much in the PIC data sheet).

Count assembler instructions of your desired code, and you can calculate the exact time the instructions need to execute.

It's a bit difficult method, but if you need precision is the best.

Cridarco

Share this post


Link to post
Share on other sites
hallo...

how do i measure the eact timing on my code using boostc?

even it have speed tester, but it dont show in time base....

and how do i measure my the time of my desired code?

Hmm. Well if it's exact timing you require I recommend downloading whatever you want to time directly to your chip and test it via that. Before what you want to time you could output a '1' to a port and after it's finished output a '0'. If you monitor how long the port has been high for you know how long it has taken that bit of code to execute.

If exact timing isn't critical ... there's a timer plugin, right? I haven't used it but I believe it can be used to time specific parts of your code, but it's not completely accurate. http://www.sourceboost.com/Products/Source...ml#Stop%20Watch should do the trick if you have that plugin.

Share this post


Link to post
Share on other sites

set breakpoints in the debugger at the beginning and end of the code you want to evaluate.

in the debugger you can see the amount of ticks. so when you let it run from breakpoint to breakpoint you are able to see how manny ticks it took. If I don't oversee something here ( :P ) this should be a working method to determine the exact time it takes to run that peace of code.....

Share this post


Link to post
Share on other sites
set breakpoints in the debugger at the beginning and end of the code you want to evaluate.

in the debugger you can see the amount of ticks. so when you let it run from breakpoint to breakpoint you are able to see how manny ticks it took. If I don't oversee something here ( :P ) this should be a working method to determine the exact time it takes to run that peace of code.....

 

halo..

how much time for one tick?

tahnks

Share this post


Link to post
Share on other sites
set breakpoints in the debugger at the beginning and end of the code you want to evaluate.

in the debugger you can see the amount of ticks. so when you let it run from breakpoint to breakpoint you are able to see how manny ticks it took. If I don't oversee something here ( :P ) this should be a working method to determine the exact time it takes to run that peace of code.....

 

A tick appears to be an oscillator cycle. If you step through a 1 cycle instruction it will increment the tick count by 4. A 4MHz xtal will give 1us instruction cycle time.

 

The tick count will change to values in 'kilo' after a while i.e. 10k etc. which cannot be reset to zero.

 

If you install BoostC within MPLab (Microchip IDE) you can use its watchdog feature measure in real time.

 

Cheers

 

Reynard

Share this post


Link to post
Share on other sites
set breakpoints in the debugger at the beginning and end of the code you want to evaluate.

in the debugger you can see the amount of ticks. so when you let it run from breakpoint to breakpoint you are able to see how manny ticks it took. If I don't oversee something here ( :P ) this should be a working method to determine the exact time it takes to run that peace of code.....

 

A tick appears to be an oscillator cycle. If you step through a 1 cycle instruction it will increment the tick count by 4. A 4MHz xtal will give 1us instruction cycle time.

 

The tick count will change to values in 'kilo' after a while i.e. 10k etc. which cannot be reset to zero.

 

If you install BoostC within MPLab (Microchip IDE) you can use its watchdog feature measure in real time.

 

Cheers

 

Reynard

 

Doh! Did I say watchdog feature ? read that as "Stopwatch feature to measure in real time."

 

Reynard

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...