MPLAB Stopwatch?

Thread Starter

Ben_C

Joined Oct 19, 2010
65
Anybody got any ideas how to get the total execution time of all iterations of the loop using MPLAB SIM and Stopwatch?
Excluding the final NOP and the instructions that initialize the values of X & Y

Info: 10MHz using PIC18F4520.

The answer is:

716.4μs


Just wondering how you would get this value.. I've tried a lot of ways in MPLAB but I'm getting different times from the Stopwatch :confused:

Rich (BB code):
      radix decimal 
x     equ 10 
y     equ 11 
      CLRF x 
      CLRF y 
loop 
      INCF x 
      INCF x 
      MOVF x,w 
      ADDWF x 
      INCF y 
      BNC loop 
      NOP 
      end
 
Last edited:

Thread Starter

Ben_C

Joined Oct 19, 2010
65
I got it, set a breakpoint at NOP then step through the x & y to find the time then minus this to give the total loop time.. but surely theres an easier way than stepping through x & y ??
 

Markd77

Joined Sep 7, 2009
2,806
If you press the run button, it should stop at the breakpoint. Assuming MPLAB 8, there is a button on the stopwatch to zero it.
 
Top