7. Time Measurement
How to Use Time Measurement Function
7.1
Setup Time Measurement
Use the example from above and enter debugging mode. Open "Main.c" and use normal display (not mixed
display). Set three breakpoints as shown below:
23: void main(void)
=>(x)24: {
=>(
)25:
=>(
)26:
=>(
)27:
28:
=>(
)29:
=>(
)30:
31:
=>(
)32:
33:
=>(
)34:
35:
=>(
)36:
=>(
)37:
=>(x)38:
=>(x)39:
=>(
)40:
=>(
)41: }
Choose DebugTime Measurement... and click on Clear if there are any time entries not equal to zero. Click on
Close then.
Run the program. The CPU will stop at the beginning of the main function (1
initializes the time measurement counter.
Next, go on with execution. The CPU stops at the call to the wait function.
Now choose DebugTime Measurement... . You will find the following information:
From Initialize: 0h00m00s002ms115us375ns[Time]
From Last Executed: 0h00m000ms001us100ns[Time]
From Initialize: 4350[Cycle]
From Last Executed 35[Cycle]
The number of measurement cycles includes an error of about 20 cycles. In the Real-time mode of Full Trace
mode it has additionally an error of about at most +10000 cycles. For measurement use the Internal Trace mode
or External Trace mode, which has less error.
FR Family MB2198-01 Emulating and Debugging Installation Guide, Doc. No. 002-05223 Rev. *A
InitIrqLevels();
__set_il(7);
__EI();
a = 2;
DDR0 = 0xFF;
while (1)
{
for (b = 0; b < 10; b++)
{
c = b * a;
PDR0 = c;
wait (5000);
}
}
/* allow all levels */
/* globaly enable interrupts */
st
breakpoint). This first stop
Time from Reset to main (1
st
Time to wait (1
breakpoint)
see above
see above
st
breakpoint)
nd
breakpoint to 2
24