Motorola SC140 User Manual

Page of 28
Setting Up the Stopwatch Timer Within the Debugger
11
Figure 6.   Event Counter Settings
4.2   
Stopping the Stopwatch Timer
Stopping the stopwatch timer is achieved by halting execution of the application at a breakpoint. Set up the 
breakpoint at the point in the application at which timing should stop to achieve the desired affect.
After the breakpoint is in place, the debugger can be instructed to run the application.
When execution of the application reaches the breakpoint, the value of the stopwatch timer counters can be 
retrieved by opening the EOnCE > EOnCE Configurator > Counter dialog box. Figure 7 on page -12 
shows an example of an event counter dialog box after the debugger halt at the breakpoint. Because the 
countdown counter is initialized to maximum value (0xffffffff), the difference between maximum value 
and the value in the “Event Counter Value” column yields the real SC140 clock counts. To convert the 
values of the real SC140 clock counts to absolute time use the computation described in Section 3.4, 
“Converting Cycles to Actual Time,” on page -6.
After the debugger stops at the breakpoint, the counter, which is setup in sleep mode and is enabled by the 
events at the first instruction of the measured code, is now in enabled mode and continues to count (see 
“Enabled after Event on” column in Figure 7 on page -12). However, continued counting is irrelevant 
because the SC140 clock count has been achieved.