View previous topic :: View next topic |
Author |
Message |
Pyrofer
Joined: 13 Sep 2006 Posts: 16
|
Benchmarking |
Posted: Mon Sep 18, 2006 3:01 am |
|
|
What is the easiest way to benchmark a routine in CCS?
Ive been doing lots of optimisations and would like to know how much ive increased the speed, its also usefull to know the absolute time for the routine.
Any suggestions? |
|
|
Will Reeve
Joined: 30 Oct 2003 Posts: 209 Location: Norfolk, England
|
|
Posted: Mon Sep 18, 2006 4:10 am |
|
|
I usually use a spare I/O pin put it high at the start and low at the end and use a scope to measure the pulse width. |
|
|
Ttelmah Guest
|
|
Posted: Mon Sep 18, 2006 4:28 am |
|
|
Or run it in MPLAB simulator, reset the stopwatch at the start of the routine, and have a breakpoint at the end.
Similarly, if you have ICE abilities, most of these can be programmed to output a pulse at a particular point. Doing this is also possible with ICD, but has the disadvantage that there is usually a tiing error introduced by the ICD actually outputting the pulse.
Best Wishes |
|
|
Pyrofer
Joined: 13 Sep 2006 Posts: 16
|
|
Posted: Mon Sep 18, 2006 4:46 am |
|
|
I like the output pin/pulsewidth idea best. Thats a great trick I didnt think of at all! Thanks.
Ill run the routine multiple times to get a larger sample however for accuracy, but thats such a simple idea I dont know why I didnt think of it. |
|
|
|